/* ============================================================
   Scroll-Spacer (Test-Umgebung)
   ============================================================ */
.scroll-spacer {
    width: 100%;
    height: 200vh;
}

/* ============================================================
   Timeline-Section
   ============================================================ */
.timeline-section {
    position: relative;
    width: 100%;
    /* === Fine-Tuning: Gesamtdauer der Sticky-Pin-Phase ===
       Steuert, wie lange der Pin "festhält" bevor die Section loslässt
       und es normal weiterscrollt.
       600vh = 6 Viewports Scrollweg innerhalb der gepinnten Section (Original).
       450vh = deutlich früher fertig.
       350vh = sehr knapp.
       Alle Sub-Animationen (Video-Frames, Cards, Ticks) skalieren proportional mit.
       --- 2026-06-02 (viewport-fix branch): Outer-Höhe an --locked-vh gehängt
       (gesetzt beim Page-Load in js/standard.js). Verhindert kumulative Layout-
       Shifts beim Instagram-In-App-Browser-Toolbar-Toggle (Section-Höhe bleibt
       konstant, nur Inner-Pin atmet via 100dvh). */
    height: 450vh;                                  /* Fallback ohne JS */
    height: calc(var(--locked-vh, 100vh) * 4.5);   /* JS-locked, konstant. Fallback 100vh = identisch zu Original (450vh) */
    background: #000;
}

.timeline-pin {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;          /* Fallback */
    height: 100dvh;         /* Dynamic Viewport — passt sich an In-App-Browser-Toolbars (Instagram etc.) an */
    overflow: hidden;
}

/* ============================================================
   Hintergrund-Bild – schmalerer sichtbarer Streifen in der Mitte,
   oben und unten kräftige schwarze Fade-Bars.
   ============================================================ */
.timeline-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    user-select: none;
    pointer-events: none;
}

/* ============================================================
   Sterne im Hintergrund – nur oberer Bereich, vor dem Video,
   hinter Track-Bild & Overlay (deshalb z-index 1).
   Statische radial-gradients in zwei Layers für Twinkle-Effekt.
   ============================================================ */
.timeline-stars {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 50%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.timeline-stars::before,
.timeline-stars::after {
    content: '';
    position: absolute;
    inset: 0;
    background-repeat: repeat;
}

/* Wie im Hero-Canvas: viele kleine, gedeckte Sterne ohne Glow.
   Zwei wiederholende Tiles mit Stop-Stops für klare 1–2px Punkte. */
.timeline-stars::before {
    background-image:
        radial-gradient(1px 1px at  14px  18px, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at  42px  72px, rgba(255,255,255,0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at  68px  30px, rgba(255,255,255,0.65) 50%, transparent 51%),
        radial-gradient(1px 1px at  95px 108px, rgba(255,255,255,0.30) 50%, transparent 51%),
        radial-gradient(1px 1px at 124px  46px, rgba(255,255,255,0.50) 50%, transparent 51%),
        radial-gradient(1px 1px at 152px  90px, rgba(255,255,255,0.40) 50%, transparent 51%),
        radial-gradient(1px 1px at 178px  12px, rgba(255,255,255,0.60) 50%, transparent 51%),
        radial-gradient(1px 1px at 206px  66px, rgba(255,255,255,0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 234px 124px, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at 256px  38px, rgba(255,255,255,0.45) 50%, transparent 51%),
        radial-gradient(2px 2px at  28px 138px, rgba(255,255,255,0.7)  50%, transparent 51%),
        radial-gradient(2px 2px at  82px  56px, rgba(255,255,255,0.65) 50%, transparent 51%),
        radial-gradient(2px 2px at 138px 158px, rgba(255,255,255,0.6)  50%, transparent 51%),
        radial-gradient(2px 2px at 192px  84px, rgba(255,255,255,0.7)  50%, transparent 51%),
        radial-gradient(2px 2px at 248px 152px, rgba(255,255,255,0.5)  50%, transparent 51%);
    background-size: 280px 180px;
    background-repeat: repeat;
    animation:
        timeline-stars-twinkle-a 5.6s ease-in-out infinite,
        timeline-stars-drift-a 90s linear infinite;
}

/* Zweite Tile, versetzt + leicht andere Verteilung, damit das Pattern
   nicht regelmäßig wirkt. */
.timeline-stars::after {
    background-position: 80px 40px;
    background-image:
        radial-gradient(1px 1px at  22px  54px, rgba(255,255,255,0.45) 50%, transparent 51%),
        radial-gradient(1px 1px at  58px 122px, rgba(255,255,255,0.40) 50%, transparent 51%),
        radial-gradient(1px 1px at  88px  18px, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at 116px  80px, rgba(255,255,255,0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 144px 142px, rgba(255,255,255,0.50) 50%, transparent 51%),
        radial-gradient(1px 1px at 174px  24px, rgba(255,255,255,0.45) 50%, transparent 51%),
        radial-gradient(1px 1px at 200px  96px, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at 228px 168px, rgba(255,255,255,0.35) 50%, transparent 51%),
        radial-gradient(2px 2px at  46px  92px, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(2px 2px at 106px 162px, rgba(255,255,255,0.5)  50%, transparent 51%),
        radial-gradient(2px 2px at 168px  56px, rgba(255,255,255,0.6)  50%, transparent 51%),
        radial-gradient(2px 2px at 218px 116px, rgba(255,255,255,0.55) 50%, transparent 51%);
    background-size: 250px 200px;
    background-repeat: repeat;
    animation:
        timeline-stars-twinkle-b 7.4s ease-in-out infinite,
        timeline-stars-drift-b 130s linear infinite;
}

@keyframes timeline-stars-twinkle-a {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 1; }
}
@keyframes timeline-stars-twinkle-b {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}
/* Sanfter, endloser Drift — Bewegung wickelt sich nach genau einer Tile-Größe sauber. */
@keyframes timeline-stars-drift-a {
    from { background-position: 0 0; }
    to   { background-position: 280px 180px; }
}
@keyframes timeline-stars-drift-b {
    from { background-position: 80px 40px; }
    to   { background-position: -170px -160px; }
}

.timeline-glow {
    position: absolute;
    left: 50%;
    top: 65%;
    width: 130vw;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 15%, #000 45%, #000 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, transparent 15%, #000 45%, #000 100%);
    /* Umfärben:
       filter: hue-rotate(45deg);   -> grün/türkis
       filter: hue-rotate(-90deg);  -> magenta
       filter: hue-rotate(180deg);  -> orange/gelb */
}

/* Stops in % statt vh: skaliert mit Pin-Höhe (100dvh) — bei Browser-Toolbar-Toggle
   bleibt der untere Fade proportional am Pin-Boden statt absolute vh-Position
   wo der Pin selbst nicht mehr hinreicht. */
.timeline-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(0,0,0,1)   0%,
            rgba(0,0,0,1)  18%,
            rgba(0,0,0,0)  30%,
            rgba(0,0,0,0)  78%,
            rgba(0,0,0,1)  86%,
            rgba(0,0,0,1) 100%
        );
}
@media (max-width: 1200px) {
    .timeline-bg-overlay {
        background:
            linear-gradient(
                180deg,
                rgba(0,0,0,1)   0%,
                rgba(0,0,0,1)  10%,
                rgba(0,0,0,0)  22%,
                rgba(0,0,0,0)  77%,
                rgba(0,0,0,1)  85%,
                rgba(0,0,0,1) 100%
            );
    }
}
@media (max-width: 1200px) and (max-height: 800px) {
    .timeline-bg-overlay {
        background:
            linear-gradient(
                180deg,
                rgba(0,0,0,1)   0%,
                rgba(0,0,0,1)  10%,
                rgba(0,0,0,0)  22%,
                rgba(0,0,0,0)  80%,
                rgba(0,0,0,1)  88%,
                rgba(0,0,0,1) 100%
            );
    }
}
@media (max-width: 1200px) and (max-height: 600px) {
    .timeline-bg-overlay {
        background:
            linear-gradient(
                180deg,
                rgba(0,0,0,1)   0%,
                rgba(0,0,0,1)  10%,
                rgba(0,0,0,0)  22%,
                rgba(0,0,0,0)  85%,
                rgba(0,0,0,1)  93%,
                rgba(0,0,0,1) 100%
            );
    }
}

/* ============================================================
   Section-Headline – sitzt im oberen Fade-Bereich,
   muss ÜBER der bg-overlay (z-index 10) liegen.
   ============================================================ */
.timeline-head {
    position: absolute;
    left: 50%;
    top: 60px;
    width: min(1220px, 92vw);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 11;
    pointer-events: none;
}

.timeline-head-sub {
    margin: 0;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-align: center;
    color: #fff;
}

.timeline-head-title {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-head-title-line {
    display: block;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-align: center;
    color: #fff;
}

.timeline-head-title-line--gradient {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.4) 15.2%,
        #FFFFFF              31.11%,
        #47CCF5              38.4%,
        #47CCF5              63.1%,
        #FFFFFF              69.99%,
        rgba(255,255,255,0.4) 87.8%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
}

@media (max-width: 1400px) {
    .timeline-head-sub       { font-size: 16px; }
    .timeline-head-title-line { font-size: var(--header-tablet); }
}
@media (max-width: 900px) {
    .timeline-head           { top: 32px; gap: 16px; }
}
@media (max-width: 800px) {
    .timeline-head-title       { display: block; text-align: center; }
    .timeline-head-title-line  { display: inline; }
    .timeline-head-title-line + .timeline-head-title-line::before { content: ' '; }
}
@media (max-width: 600px) {
    .timeline-head-title-line { font-size: var(--header-handy); }
}

/* ============================================================
   Stage: enthält Track, Rails, Cards
   ============================================================ */
.timeline-stage {
    transform: translateY(40px);
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ============================================================
   Track-Bild: zentriert, steht still
   ============================================================ */
.timeline-track {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 64%;
    width: auto;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    filter: contrast(1.08) brightness(0.92) saturate(1.15);
    opacity: 0.95;
}
@media (max-width: 1200px) {
    .timeline-track {
        width: 900px;
    }
}
@media (max-width: 600px) {
    .timeline-track {
        width: 500px;
    }
}

/* ============================================================
   Rail-Container: enthält Tick-Wrapper, von JS bestückt
   ============================================================ */
.timeline-rail {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Ein Tick: kleiner Wrapper am Rail-Punkt, der den Strich enthält.
   Wrapper ist 0x0, Position rotiert mit der Rail-Tangente. */
.timeline-tick {
    position: absolute;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    /* TEST 2026-06-02 (timeline-perf): will-change deaktiviert um 780 GPU-Layer
       abzubauen. Original: `will-change: transform, opacity, left, top;` */
    will-change: auto;
}

.timeline-tick-bar {
    position: absolute;
    left: 0;
    top: -1px;                 /* halber Default-Strich */
    height: 2px;
    background: linear-gradient(90deg,
        rgba(180,220,255,0.95) 0%,
        rgba(180,220,255,0.85) 70%,
        rgba(180,220,255,0)  100%);
    border-radius: 2px;
}

.timeline-tick--year .timeline-tick-bar {
    top: -1.5px;
    height: 3px;
    background: rgba(230,245,255,1);
    box-shadow: 0 0 12px rgba(140,210,255,0.55);
}

/* ============================================================
   Jahres-Labels (nur rechte Rail) – stehen frei in der Stage,
   nicht im rotierenden Tick-Container, damit sie lesbar bleiben.
   ============================================================ */
.timeline-year-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.timeline-year-label {
    position: absolute;
    transform: translate(0, -50%);
    font-family: 'helveticaregular', Arial, sans-serif;
    color: rgba(225,240,255,0.95);
    font-size: 13px;
    letter-spacing: 0.18em;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(140,210,255,0.6);
    /* TEST 2026-06-02 (timeline-perf): will-change deaktiviert.
       Original: `will-change: left, top, opacity, font-size;` */
    will-change: auto;
}

.timeline-year-label.is-active {
    color: #fff;
    text-shadow: 0 0 20px rgba(160,220,255,0.9);
}

/* ============================================================
   Story-Cards
   ============================================================ */
.timeline-cards {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.timeline-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 572px;
    max-width: 92vw;
    padding: 0;
    color: #fff;
    border-radius: 8px;
    /* Blur sitzt hier (gleiche Ebene wie der per-JS gesetzte transform),
       damit Geschwister-Karten im Backdrop liegen und tatsächlich
       verschwimmen. Kein Flex-Layout: der Dot wird absolut platziert.
       --- TEST 2026-06-02 (timeline-perf): von blur(18px) auf blur(6px)
       reduziert. Gauss-Blur-Cost skaliert ~quadratisch mit Radius —
       6px ist ca. 1/9 der GPU-Last von 18px bei noch deutlich sichtbarem
       Glass-Effekt. Original-Wert war 18px. */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
    transform-origin: 50% 50%;
    /* TEST 2026-06-02 (timeline-perf): will-change deaktiviert.
       Original: `will-change: transform, opacity, top, left;` */
    will-change: auto;
}

.timeline-card-box {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    padding: 47px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
    background: linear-gradient(314.84deg,
        rgba(255,255,255,0.04) -10.08%,
        rgba(255,255,255,0.0096) 126.86%);
    border-radius: 8px;
}

.timeline-card-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg,
        rgba(255,255,255,0.75) 0%,
        rgba(255,255,255,0.22) 30%,
        rgba(255,255,255,0.08) 70%,
        rgba(255,255,255,0.45) 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.timeline-card-title {
    margin: 0;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #fff;
}

.timeline-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.timeline-card-text {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: rgba(255,255,255,0.7);
}

.timeline-card-text strong {
    color: #fff;
    font-weight: 600;
}

.timeline-card-dot {
    display: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background:
        linear-gradient(314.84deg,
            rgba(255,255,255,0.04) -10.08%,
            rgba(255,255,255,0.0096) 126.86%),
        rgba(255,255,255,0.08);
}

.timeline-card-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(45deg,
        rgba(255,255,255,0.75) 0%,
        rgba(255,255,255,0.22) 30%,
        rgba(255,255,255,0.08) 70%,
        rgba(255,255,255,0.45) 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

@media (max-width: 900px) {
    .timeline-card { width: 468px; }
    .timeline-card-box   { padding: 36px; gap: 21px; }
    .timeline-card-title { font-size: 29px; }
    .timeline-card-text  { font-size: 20px; }

    /* Mobile: Keine GPU-Layer-Promotion mehr für Ticks/Labels/Cards.
       Bei reduzierter Tick-Anzahl (Phase 2 im JS) kostet ein eigener Layer
       pro Element mehr Speicher, als er einspart. */
    .timeline-tick,
    .timeline-year-label,
    .timeline-card {
        will-change: auto;
    }
}
@media (max-width: 700px) {
    .timeline-card-box   { padding: 28px; gap: 16px; }
    .timeline-card-title { font-size: 22px; }
    .timeline-card-text  { font-size: 16px; line-height: 1.5; }
}
