/* =================================================================
   PROJECT DOOMSDAY — Scrollytelling "AMOC-Kollaps" (Oberklasse Phase 3)
   ================================================================= */

/* ---------- Page shell ---------- */
body.story-body {
    background: #070707;
    color: #e8e8e8;
}

.story-wrap {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* ---------- HERO ---------- */
.story-hero {
    position: relative;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a1828 0%, #040608 80%);
}
.story-hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.story-hero-fallback {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 35%, rgba(0,80,140,0.35) 0%, transparent 55%),
        radial-gradient(circle at 70% 65%, rgba(255,107,0,0.18) 0%, transparent 60%),
        #040608;
}
.story-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: clamp(2rem, 6vw, 5rem);
    background: linear-gradient(180deg, rgba(4,6,8,0) 45%, rgba(4,6,8,0.75) 100%);
    pointer-events: none;
}
.story-hero-inner {
    max-width: 900px;
}
.story-hero-kicker {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ff6b00;
    margin-bottom: 1.2rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255,107,0,0.5);
    background: rgba(255,107,0,0.06);
}
.story-hero h1 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 450;
    font-weight: 450;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem;
    color: #f4f4f4;
    text-wrap: balance;
}
.story-hero h1 em {
    font-style: italic;
    color: #ff6b00;
    font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1, "wght" 500;
}
.story-hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.55;
    color: #c8c8c8;
    max-width: 62ch;
    margin: 0;
}
.story-hero-meta {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #888;
    text-transform: uppercase;
}
.story-hero-meta span strong {
    color: #ff6b00;
    font-weight: 700;
    margin-left: 0.35rem;
}

.story-scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: #666;
    text-transform: uppercase;
    animation: pdscrollpulse 2.4s ease-in-out infinite;
}
@keyframes pdscrollpulse {
    0%,100% { opacity: 0.35; transform: translate(-50%, 0); }
    50%     { opacity: 1;    transform: translate(-50%, 6px); }
}

/* ---------- ACTS ---------- */
.story-act {
    position: relative;
    padding: clamp(5rem, 10vh, 8rem) clamp(1rem, 4vw, 3rem);
    max-width: 860px;
    margin: 0 auto;
}
.story-act-label {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.26em;
    color: #ff6b00;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.story-act-label::before {
    content: "";
    width: 48px;
    height: 1px;
    background: #ff6b00;
    display: inline-block;
}
.story-act h2 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 500;
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #f2f2f2;
    margin: 0 0 2rem;
    text-wrap: balance;
}
.story-act h2 em {
    font-style: italic;
    color: #ff6b00;
    font-variation-settings: "opsz" 96, "SOFT" 60, "WONK" 1, "wght" 500;
}
.story-act h3 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 48, "SOFT" 30, "wght" 500;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    line-height: 1.2;
    color: #ededed;
    margin: 3rem 0 1.25rem;
    letter-spacing: -0.015em;
}

.story-act p {
    font-family: 'Inter', sans-serif;
    font-size: 1.075rem;
    line-height: 1.72;
    color: #d4d4d4;
    margin: 0 0 1.4rem;
    max-width: 66ch;
    hanging-punctuation: first last;
}
.story-act p strong {
    color: #f6f6f6;
    font-weight: 600;
}
.story-act p em {
    color: #ff944d;
    font-style: italic;
}

/* Drop cap on first paragraph of each act */
.story-act .lede::first-letter {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 500;
    font-weight: 500;
    font-size: 4.8rem;
    line-height: 0.9;
    float: left;
    padding: 0.35rem 0.8rem 0 0;
    color: #ff6b00;
    letter-spacing: -0.03em;
}

/* Pull-quote */
.story-pullquote {
    margin: 3rem 0;
    padding: 1.5rem 0 1.5rem 1.75rem;
    border-left: 3px solid #ff6b00;
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 72, "SOFT" 50, "wght" 400;
    font-style: italic;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    line-height: 1.35;
    color: #ededed;
    letter-spacing: -0.015em;
    max-width: none;
}
.story-pullquote cite {
    display: block;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: #888;
    font-style: normal;
    text-transform: uppercase;
}

/* Citations inline */
.story-cite {
    color: #ff944d;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72em;
    vertical-align: super;
    line-height: 0;
    padding: 0 0.15em;
    text-decoration: none;
}
.story-cite:hover { color: #ff6b00; }

/* ---------- FULL BLEED VIZ SECTION ---------- */
.story-viz {
    margin: 4rem 0;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(180deg, rgba(18,18,18,0.9) 0%, rgba(10,10,10,0.95) 100%);
    border: 1px solid #262626;
    border-radius: 4px;
    position: relative;
}
.story-viz::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 80px; height: 1px;
    background: #ff6b00;
}
.story-viz-kicker {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ff6b00;
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.story-viz-title {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 72, "SOFT" 30, "wght" 500;
    font-weight: 500;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: #f2f2f2;
}
.story-viz-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #999;
    margin: 0 0 1.5rem;
    max-width: 62ch;
}
.story-viz-canvas { width: 100%; min-height: 300px; overflow: visible; }
.story-viz-canvas svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Timeline legend */
.story-viz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #888;
    text-transform: uppercase;
}
.story-viz-legend span::before {
    content: "";
    display: inline-block;
    width: 10px; height: 10px;
    margin-right: 0.5rem;
    vertical-align: middle;
    border-radius: 2px;
}
.story-viz-legend .lg-current::before  { background: #ff6b00; }
.story-viz-legend .lg-proxy::before    { background: #555; }
.story-viz-legend .lg-stable::before   { background: #00b39a; }
.story-viz-legend .lg-unstable::before { border: 1px dashed #ff6b00; background: transparent; }
.story-viz-legend .lg-collapse::before { background: #8a1f1f; }

/* ---------- CHOROPLETH (Act 3) ---------- */
.story-map {
    position: relative;
    margin: 4rem auto 0;
    max-width: 880px;
}
.story-map-inner {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #0d0d0d;
    border: 1px solid #1e1e1e;
    border-radius: 4px;
    overflow: hidden;
}
.story-map-inner svg { width: 100%; height: 100%; display: block; }
.story-map-country {
    stroke: #0a0a0a;
    stroke-width: 0.6;
    transition: filter 0.15s, stroke 0.15s;
    cursor: pointer;
}
.story-map-country:hover {
    stroke: #ff6b00;
    stroke-width: 1.2;
    filter: brightness(1.25);
}
.story-map-label {
    fill: #666;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.04em;
    pointer-events: none;
    text-anchor: middle;
}
.story-map-scale {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #888;
}
.story-map-scale-gradient {
    flex: 1;
    height: 10px;
    background: linear-gradient(90deg, #3a0a0a 0%, #8a1f1f 30%, #d65c2d 60%, #f2c57a 85%, #1e3a52 100%);
    border-radius: 1px;
}

/* ---------- ACT 4: CTA ---------- */
.story-outro {
    background: linear-gradient(180deg, #0a0a0a 0%, #040404 100%);
    padding: 6rem 1.5rem;
    text-align: center;
    border-top: 1px solid #1e1e1e;
    margin-top: 4rem;
}
.story-outro-inner {
    max-width: 700px;
    margin: 0 auto;
}
.story-outro h2 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 500;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.1;
    margin: 0 0 1.25rem;
    color: #f4f4f4;
    text-wrap: balance;
}
.story-outro h2 em {
    color: #ff6b00;
    font-style: italic;
}
.story-outro p {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #bbb;
    margin: 0 auto 2.5rem;
    max-width: 58ch;
}
.story-cta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.story-cta {
    display: block;
    padding: 1.25rem 1rem;
    border: 1px solid #262626;
    background: rgba(255,255,255,0.015);
    color: #ededed;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    border-radius: 3px;
    font-family: 'Inter', sans-serif;
}
.story-cta:hover {
    border-color: #ff6b00;
    background: rgba(255,107,0,0.07);
    transform: translateY(-2px);
}
.story-cta-kick {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    color: #ff6b00;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.story-cta-t {
    display: block;
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 48, "SOFT" 30, "wght" 500;
    font-size: 1.2rem;
    line-height: 1.2;
    color: #f4f4f4;
}

/* ---------- Sources / footnotes ---------- */
.story-sources {
    max-width: 760px;
    margin: 4rem auto 0;
    padding: 2rem 1.5rem;
    border-top: 1px solid #1e1e1e;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #888;
}
.story-sources h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    color: #ff6b00;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 1rem;
}
.story-sources ol { padding-left: 1.2rem; }
.story-sources li { margin-bottom: 0.6rem; }
.story-sources li strong { color: #c8c8c8; font-weight: 600; }

/* ---------- Tooltip (shared with pd-chart) ---------- */
.story-tip {
    position: absolute;
    background: #111;
    border: 1px solid #ff6b00;
    color: #eee;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    border-radius: 2px;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
    white-space: nowrap;
}
.story-tip strong {
    color: #ff6b00;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .story-scroll-hint { animation: none; }
    .story-hero-canvas { display: none; }
    .story-hero-fallback { filter: brightness(1.15); }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .story-act { padding: 4rem 1rem; }
    .story-act p { font-size: 1rem; }
    .story-hero { min-height: 560px; }
    .story-hero-meta { gap: 0.8rem; font-size: 0.68rem; }
    .story-pullquote { margin: 2rem 0; padding-left: 1.25rem; }
    .story-act .lede::first-letter { font-size: 3.6rem; }
}
