/* ==========================================================================
   RIMCI - home.css
   Startseite: Hero, Karten-Stapel, Beispiel-Leiste.
   Der Stapel arbeitet nur mit position: sticky, ohne Scroll-Listener.
   ========================================================================== */

.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  height: 100vh;
  height: 100svh;
  padding: var(--head) var(--gutter) 24px;
  text-align: center;
}

.hero .h { max-width: 18em; }
.h__line { display: block; }
.hero .lead { max-width: 30rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero__in > * { animation: hero-in 1s var(--ease) both; }
  .hero__in > :nth-child(2) { animation-delay: 0.06s; }
  .hero__in > :nth-child(3) { animation-delay: 0.12s; }
  .hero__in > :nth-child(4) { animation-delay: 0.18s; }
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Der Hero klebt und bleibt für den Beobachter sichtbar. Diese unsichtbare Marke
   scrollt normal mit und sagt der Handy-Leiste, wann der erste Bildschirm vorbei ist. */
.dock-mark { position: absolute; top: 0; left: 0; width: 1px; height: 80vh; pointer-events: none; }

.stack {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 340vh;
  min-height: 340svh;
  pointer-events: none;
}
.stack > * { grid-area: 1 / 1; align-self: start; }

.story {
  position: sticky;
  z-index: 1;
  display: block;
  overflow: hidden;
  top: var(--stick);
  width: var(--w);
  margin-top: var(--from);
  margin-left: var(--x);
  aspect-ratio: 356 / 676;
  border-radius: 16px;
  background: #111;
  color: var(--white);
  font: 400 0.6875rem/1.2 var(--display);
  letter-spacing: 0;
  text-decoration: none;
  pointer-events: auto;
}
.story img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.story--mid { --w: 58vw; --x: 21vw; --from: 72vh; --stick: 11vh; z-index: 1; }
.story--left { --w: 33vw; --x: 8vw; --from: 130vh; --stick: 47vh; z-index: 2; }
.story--right { --w: 30vw; --x: 62vw; --from: 186vh; --stick: 53vh; z-index: 3; }

.story__top,
.story__bottom {
  position: absolute;
  inset-inline: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}
.story__top {
  top: 0;
  padding-block: 12px 8px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
}
.story__top::before {
  content: "";
  position: absolute;
  inset: 5px 8px auto;
  height: 1.5px;
  background: linear-gradient(90deg, #fff 0 32%, transparent 32% 34%, rgba(255, 255, 255, 0.5) 34% 66%, transparent 66% 68%, rgba(255, 255, 255, 0.5) 68%);
}
.story__dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-weight: 700;
}
.story__arrow { width: 16px; height: 16px; margin-left: auto; flex: none; }
.story__bottom {
  bottom: 0;
  padding-block: 8px 10px;
}
.story__tag {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 300px;
  background: rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}
.story--left .story__tag,
.story--right .story__tag { padding: 4px 8px; font-size: 0.6875rem; }
.story--left .story__dot,
.story--right .story__dot { width: 16px; height: 16px; font-size: 0.5625rem; }
.story--left .story__top,
.story--right .story__top { font-size: 0.625rem; gap: 5px; padding-inline: 7px; }
.story--left .story__arrow,
.story--right .story__arrow { display: none; }

.stack__word {
  position: relative;
  z-index: 5;
  margin-top: 236vh;
  padding-inline: var(--gutter);
  color: var(--white);
  font: 700 var(--word)/0.78 var(--display);
  letter-spacing: -0.04em;
  white-space: nowrap;
  mix-blend-mode: difference;
}

@supports (height: 1svh) {
  .story--mid { --from: 72svh; --stick: 11svh; }
  .story--left { --from: 130svh; --stick: 47svh; }
  .story--right { --from: 186svh; --stick: 53svh; }
  .stack__word { margin-top: 236svh; }
}

@media (min-width: 1024px) {
  .stack { min-height: 470vh; min-height: 470svh; }
  .story { border-radius: 20px; font-size: 0.875rem; }
  .story--mid { --w: min(24.7vw, 41vh); --x: calc(50vw - var(--w) / 2); --from: 76vh; --stick: 5vh; }
  .story--left { --w: min(20.3vw, 34vh); --x: 8.2vw; --from: 136vh; --stick: 5vh; }
  .story--right { --w: min(18.5vw, 31vh); --x: 73.3vw; --from: 192vh; --stick: 25vh; }
  .stack__word { margin-top: 294vh; }
  .story__dot { width: 30px; height: 30px; }
  .story__top, .story__bottom { padding-inline: 14px; }
  .story--left .story__tag, .story--right .story__tag { font-size: 0.75rem; padding-inline: 12px; }
  .story--left .story__dot, .story--right .story__dot { width: 24px; height: 24px; font-size: 0.75rem; }
  .story--left .story__top, .story--right .story__top { font-size: 0.75rem; gap: 8px; }
  .story--left .story__arrow, .story--right .story__arrow { display: block; }
}
@supports (height: 1svh) {
  @media (min-width: 1024px) {
    .story--mid { --w: min(24.7vw, 41svh); --from: 76svh; --stick: 5svh; }
    .story--left { --w: min(20.3vw, 34svh); --from: 136svh; --stick: 5svh; }
    .story--right { --w: min(18.5vw, 31svh); --from: 192svh; --stick: 25svh; }
    .stack__word { margin-top: 294svh; }
  }
}

.sec-about { z-index: 2; }
.sec-services { z-index: 3; }
.sec-work { z-index: 4; }
.sec-steps { z-index: 5; }
.sec-faq { z-index: 6; }

.sec-about { position: sticky; top: 0; }

@media (min-width: 1024px) and (min-height: 820px) {
  .sec-services {
    position: sticky;
    top: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    align-content: center;
    padding-block: 72px;
  }
}

/* ---- Beispiel-Leiste ---- */
.sec-work {
  min-height: 0;
  padding-block: clamp(64px, 6vw, 88px);
}
.sec-work .glass__in { max-width: none; width: 100%; }

.work-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 50%;
  max-width: 1034px;
  margin: clamp(36px, 5vw, 72px) auto 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.work-rail::-webkit-scrollbar { display: none; }

.work-item {
  display: block;
  color: var(--white);
  font: 600 0.875rem/1.3 var(--display);
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  scroll-snap-align: start;
}
.work-item img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; }
.work-item span { display: block; padding: 12px 4px 0 0; }
.work-item small { display: block; font: 400 0.75rem/1.4 var(--mono); letter-spacing: 0.02em; }

.work-nav { display: flex; justify-content: center; gap: 14px; margin-top: 22px; }
.work-note { max-width: 34rem; margin: 22px auto 0; text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  .hero, .sec-about, .sec-services { position: relative; top: auto; }
  .hero { height: auto; min-height: 70vh; }
  .stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    min-height: 0;
    padding: 24px var(--gutter) 48px;
  }
  .story { position: relative; top: auto; margin: 0; --x: 0; --from: 0; }
  .stack__word { width: 100%; margin-top: 16px; padding: 0; mix-blend-mode: normal; }
}
