/* ======================================================
   INTRO – DIE BAHN IN ZAHLEN
   ====================================================== */

/* ---------- Variablen & Theme ---------- */

:root {
  --bg: #0e0f12;
  --text: #f4f6f8;

  --pad: clamp(16px, 6vw, 80px);
  --gap: 24px;

  --font: "Inter", system-ui, sans-serif;
}

/* ---------- Base ---------- */

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.theme-dark {
  --bg: #29292e;
  --text: #f4f6f8;
}

body.theme-light {
  --bg: #e7e1d8;
  --text: #111;
}

h1, h2, p, span {
  color: var(--text);
  font-family: var(--font);
}

/* ---------- Story Container ---------- */

.story-container {
  scroll-snap-type: y proximity;
}

/* ---------- Segmente ---------- */

.story-segment {
  min-height: 100vh;
  padding: 0 var(--pad);

  display: grid;
  place-items: stretch;

  background: transparent;
}

/* ---------- Grid-Grundlage ---------- */

.segment-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items: start;
}

/* ======================================================
   SCROLL-REVEAL (Intro-Gedanken)
   ====================================================== */

/* ======================================================
   SCROLLIO – GEDANKENÜBERGANG
   ====================================================== 

   #scrollio-intro {
    scroll-snap-align: none;
    min-height: auto;
    padding: 6vh 0 8vh;
  }
  

  #scrollio-intro .segment-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
  }

  #scrollio-intro .reveal-step {
    grid-column: 3 / 10;   
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 420ms ease, transform 420ms ease;
  
    margin: 14vh 0;
    will-change: opacity, transform;
  }

  #scrollio-intro .reveal-step.is-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  #scrollio-intro .reveal-step.was-in {
    opacity: 0;
    transform: translateY(16px);
  }


#scrollio-intro h1.zwischentext {
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;

  margin: 0;
  max-width: 40ch;
}

#scrollio-intro .reveal-step:first-child {
  margin-top: 20vh;
}

#scrollio-intro .reveal-step:last-child {
  margin-bottom: 10vh;
}

#last-reveal-step h1 {
  font-weight: 600;
}


#scrollio-intro {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#scrollio-intro.chat-complete {
  opacity: 1;
  pointer-events: auto;
}
*/

/* Scrollio-Intro wird eine Bühne */
#scrollio-intro {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

/* Steps liegen übereinander an derselben Stelle */
#scrollio-intro .segment-content{
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

/* Text-Spalte wie vorher */
#scrollio-intro .reveal-step > *{
  grid-column: 3 / 10;
  margin-bottom: 40vh;
}

/* Crossfade-Setup */
#scrollio-intro .reveal-step{
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  grid-template-columns: repeat(12, 1fr);

  opacity: 0;
  pointer-events: none;

  /* Default: rausfaden etwas länger */
  transition: opacity 900ms ease;
}

/* Rein-faden: minimal schneller */
#scrollio-intro .reveal-step.is-in{
  opacity: 1;
  pointer-events: auto;
  transition-duration: 650ms;
}

/* Expliziter "aus" Zustand fürs Crossfade */
#scrollio-intro .reveal-step.is-out{
  opacity: 0;
  pointer-events: none;
  transition-duration: 900ms;
}

/* ======================================================
   HERO
   ====================================================== */

#intro-hero {
  min-height: 90vh;
}

.segment-content-titel {
  width: 100%;
  max-width: calc(1200px + var(--pad) * 2);
  margin: 0 auto;
  padding: 0 var(--pad);

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-content: center;
}

/* Titel */
#intro-hero .page-title {
  grid-column: 1 / 13;
  grid-row: 1 / 2;
  margin: 4vh 0 2vh 0;
  align-self: end;

  font-size: clamp(3rem, 10vw, 15rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.01em;
 /* text-transform: uppercase; */
}

/* Subline */
#intro-hero .page-subtitle {
  grid-column: 1/ 6;
  grid-row: 2 ;
/*  align-self: end; */

  font-size: clamp(1rem, 2.6vw, 5rem);
  font-weight: 400;
  opacity: 1.0;

  margin: 0;
  margin-bottom: 3vh;
  margin-top: 1.5vh;
  max-width: 32ch;
}

/* ======================================================
   HERO BUTTON – ruhig, hochwertig, editoriell
   ====================================================== */

   #intro-hero .my-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    padding: 0.3em 1.2em;
    min-width: 14ch;
  
    border-radius: 999px;
  
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(1rem, 2.6vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.01em;
  
    color: #ffffff;
    text-decoration: none;
  
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
  
    /* Ruhe */
    box-shadow: none;
    transition: none;
  }
  
  /* Kein klassischer Hover – nur minimale Klarheit */
  #intro-hero .my-button:hover {
    background: rgba(255, 255, 255, 0.85);
  }
  
  /* Fokus (Accessibility, aber ruhig) */
  #intro-hero .my-button:focus-visible {
    outline: none;
    border-color: rgba(0, 0, 0, 0.2);
  }

  /* ======================================================
   HERO BUTTON – unten rechts positioniert
   ====================================================== */

#intro-hero .button {
  grid-column: 9 / 13;     /* rechts im 12er Raster */
  align-self: end;         /* unten im Hero */
  justify-self: end;

  margin-bottom: 6vh;      /* Abstand zum unteren Rand */
  margin-right: 6vh;
  margin-top: 1.5vh;
}
/* ======================================================
   FADE-IN (Intersection Observer)
   ====================================================== */

.io-fade {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.io-fade.in {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 800px) {

  #scrollio-intro h1 {
    font-size: 1.1rem;
  }

  #intro-hero .page-title {
    grid-column: 1 / -1;
    font-size: clamp(3rem, 14vw, 6rem);
  }

  #intro-hero .page-subtitle {
    grid-column: 1 / -1;
  }

  #intro-hero .button {
    grid-column: 1 / -1;
  }
}

/* ======================================================
   SCHRANKE – LAYOUT
   ====================================================== */

/* Hero-Sektion: links ohne Padding, rechts normal */
#intro-hero.story-segment {
  padding-left: 0;
  padding-right: var(--pad);
}

/* Schranken-Container */
.hero-barrier {
  grid-column: 1 / -1;
  margin: 32vh 0 10vh 0;

  /* notwendig für saubere Rotation */
  perspective: 1200px;
}

/* ======================================================
   SCHRANKE – SVG (GESCHLOSSEN)
   ====================================================== */

.barrier-svg {
  display: block;
  width: 100%;
  height: auto;

  transform-origin: left center;
  transform: rotateZ(0deg);

  transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ======================================================
   SCHRANKE – OFFEN
   ====================================================== */

#intro-hero.is-opening .barrier-svg {
  transform: rotateZ(-90deg);
}

  /* ======================================================
  Typo animation: type faded wenn schranke aufgeht 
   ====================================================== */

   /* ======================================================
   HERO TYPO – AUSGANGSZUSTAND
   ====================================================== */

#intro-hero .page-title,
#intro-hero .page-subtitle {
  transition:
    opacity 0.8s ease,
    filter 0.8s ease,
    transform 0.8s ease;
}

/* ======================================================
   HERO TYPO – VERSCHWINDEN
   ====================================================== */

   #intro-hero.is-opening .page-title,
   #intro-hero.is-opening .page-subtitle {
     opacity: 0;
     filter: blur(6px);
     transform: translateY(-24px);
   }

   #intro-hero .page-title {
    transition-delay: 0s;
  }
  
  #intro-hero .page-subtitle {
    transition-delay: 0.05s;
  }


  /* button verschwindet später */ 
  #intro-hero .button {
    transition: opacity 0.4s ease;
  }
  
  #intro-hero.is-opening .button {
    opacity: 0;
    transition-delay: 0.4s;
  }