/* Preview 9 · Time Series
   The page is one annotated chart: a single series line threads every
   section, drawn by scroll. Sections are data points (observations),
   shaded bands (regimes), an annotation, and a dashed forecast.
   Theme: dark, locked. Accent: chart amber, locked. Radii: 10px, locked. */

:root {
    color-scheme: dark;
    --bg: #0a0b0d;
    --panel: #101216;
    --text: #eef0f2;
    --muted: #9aa3ad;
    --amber: #f2b13d;
    --amber-dim: rgba(242, 177, 61, 0.4);
    --line: rgba(255, 255, 255, 0.08);
    --radius: 10px;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --maxw: 1060px;
}

* { box-sizing: border-box; margin: 0; }

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.65 "Sora", system-ui, sans-serif;
    position: relative;
}

a { color: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:where(a):focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[id] { scroll-margin-top: 2rem; }
h1, h2, h3 { text-wrap: balance; }
.mono { font-family: "JetBrains Mono", monospace; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -3rem; z-index: 30;
    background: var(--amber); color: #1d1503;
    padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none;
    transition: top 150ms var(--ease-out);
}
.skip-link:focus-visible { top: 1rem; }

.gallery-link {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30;
    font-size: 0.8125rem; color: var(--muted); text-decoration: none;
    background: var(--panel); border: 1px solid var(--line);
    padding: 0.4rem 0.8rem; border-radius: 999px;
}
.gallery-link:hover, .gallery-link:focus-visible { color: var(--text); }

/* ---- The series line ---- */
#series {
    position: absolute; top: 0; left: 0; z-index: 0;
    pointer-events: none;
    display: none; /* JS sizes it to the document, then shows it */
}
html.js #series.is-ready { display: block; }
#series-path {
    fill: none; stroke: var(--amber); stroke-width: 2;
    stroke-linejoin: round; stroke-linecap: round;
}
#series-forecast {
    fill: none; stroke: var(--amber-dim); stroke-width: 2;
    stroke-dasharray: 6 8; stroke-linecap: round;
}

/* Scroll-driven draw (Chrome/Edge); falls back to fully drawn line */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: scroll()) {
        #series-path.draw {
            stroke-dasharray: var(--len);
            animation: draw linear both;
            animation-timeline: scroll(root);
        }
        @keyframes draw {
            from { stroke-dashoffset: var(--len); }
            to { stroke-dashoffset: 0; }
        }
    }
}

/* Data-point markers: amber diamonds sitting on the line */
.marker {
    position: absolute; width: 11px; height: 11px;
    background: var(--amber); transform: rotate(45deg);
    box-shadow: 0 0 0 4px var(--bg);
    z-index: 1;
}

/* ---- Nav ---- */
.nav {
    position: relative; z-index: 2;
    max-width: var(--maxw); margin: 0 auto; padding: 1.2rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
}
.nav__mark { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.nav__mark:hover, .nav__mark:focus-visible { color: var(--text); }
.nav nav { display: flex; gap: 1.5rem; }
.nav nav a {
    font-size: 0.9rem; color: var(--muted); text-decoration: none;
    transition: color 140ms var(--ease-out);
}
.nav nav a:hover, .nav nav a:focus-visible { color: var(--amber); }

main { position: relative; z-index: 2; }

/* ---- Hero ---- */
.hero {
    position: relative;
    max-width: var(--maxw); margin: 0 auto;
    padding: 5.5rem 1.5rem 7rem;
}
.hero .marker { left: 4rem; bottom: 2rem; }
.axis-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 1.6rem; }
.hero h1 {
    font-size: clamp(2.8rem, 7vw, 4.8rem);
    font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
}
.hero__tag { margin-top: 1.3rem; color: var(--muted); font-size: 1.06rem; max-width: 36rem; }
.hero__actions { margin-top: 1.9rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
    display: inline-block; text-decoration: none; font-weight: 600;
    font-size: 0.92rem; padding: 0.7rem 1.5rem; border-radius: var(--radius);
    transition: transform 130ms var(--ease-out), background 150ms var(--ease-out),
        border-color 150ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.btn--solid { background: var(--amber); color: #1d1503; }
.btn--line { border: 1px solid var(--line); color: var(--text); }
.btn--lg { padding: 0.9rem 2.2rem; font-size: 1rem; }
@media (hover: hover) and (pointer: fine) {
    .btn--solid:hover { background: #ffc75a; }
    .btn--line:hover { border-color: var(--amber-dim); }
}

/* ---- Section headings ---- */
.sect-h {
    font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em;
    display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 2.2rem;
}
.sect-h__sub {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem; font-weight: 400; color: var(--muted);
}

/* ---- Observations: points alternating around the line ---- */
.obs { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.obs__points { display: flex; flex-direction: column; gap: 3.5rem; }
.point { position: relative; width: min(34rem, 88%); }
.point--left { align-self: flex-start; }
.point--right { align-self: flex-end; }
.point .marker { top: 1.4rem; }
.point--left .marker { right: -2.6rem; }
.point--right .marker { left: -2.6rem; }
.point a {
    display: block; text-decoration: none;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.4rem 1.6rem;
    transition: border-color 170ms var(--ease-out), transform 170ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .point a:hover { border-color: var(--amber-dim); transform: translateY(-2px); }
}
.point a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.point__meta { font-size: 0.75rem; color: var(--amber); margin-bottom: 0.6rem; }
.point h3 { font-size: 1.15rem; font-weight: 600; }
.point__excerpt { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; }
.obs__more { margin-top: 2.5rem; display: flex; gap: 1.6rem; font-size: 0.9rem; }
.obs__more a { color: var(--muted); }
.obs__more a:hover, .obs__more a:focus-visible { color: var(--amber); }

/* ---- Regimes: full-width shaded bands ---- */
.regimes { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.regimes__bands { display: flex; flex-direction: column; }
.band {
    position: relative;
    padding: 2rem 1.6rem 2rem 2.6rem;
    border-left: 1px solid var(--amber-dim);
    background: linear-gradient(90deg, rgba(242, 177, 61, 0.05), transparent 65%);
}
.band + .band { margin-top: 1rem; }
.band .marker { left: -6px; top: 2.5rem; }
.band__head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.band h3 { font-size: 1.2rem; font-weight: 600; }
.band__status { font-size: 0.72rem; color: var(--amber); }
.band__sum { margin-top: 0.6rem; color: var(--muted); font-size: 0.94rem; max-width: 62ch; }
.band__focus { margin-top: 0.8rem; font-size: 0.72rem; color: var(--muted); }

/* ---- Annotation (about) ---- */
.annot {
    position: relative;
    max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 4rem;
}
.annot .marker { left: 50%; top: 0; }
.annot__label { font-size: 0.75rem; color: var(--amber); margin-bottom: 0.9rem; }
.annot__text { font-size: 1.18rem; line-height: 1.75; max-width: 46rem; }
.annot a {
    display: inline-block; margin-top: 1.1rem; color: var(--amber);
    text-decoration: none; font-size: 0.95rem;
}
.annot a:hover, .annot a:focus-visible { text-decoration: underline; }

/* ---- Forecast (contact) ---- */
.forecast {
    position: relative;
    max-width: var(--maxw); margin: 0 auto; padding: 3.5rem 1.5rem 6rem;
}
.forecast .marker { left: 65%; top: 1rem; background: var(--bg); border: 2px solid var(--amber); }
.forecast__pitch { color: var(--muted); max-width: 44rem; margin-bottom: 2rem; }
.forecast__links { margin-top: 1.6rem; display: flex; gap: 1.6rem; font-size: 0.9rem; }
.forecast__links a { color: var(--muted); }
.forecast__links a:hover, .forecast__links a:focus-visible { color: var(--amber); }

.foot {
    position: relative; z-index: 2;
    max-width: var(--maxw); margin: 0 auto;
    border-top: 1px solid var(--line);
    padding: 1.6rem 1.5rem 2.2rem; font-size: 0.75rem; color: var(--muted);
}

/* ---- Reveals ---- */
@media (prefers-reduced-motion: no-preference) {
    html.js .reveal {
        opacity: 0; transform: translateY(18px);
        transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out);
        transition-delay: var(--reveal-delay, 0ms);
    }
    html.js .reveal.is-in { opacity: 1; transform: none; }

    .hero > * { animation: settle 600ms var(--ease-out) backwards; }
    .hero h1 { animation-delay: 60ms; }
    .hero .hero__tag { animation-delay: 120ms; }
    .hero .hero__actions { animation-delay: 180ms; }
    @keyframes settle {
        from { opacity: 0; transform: translateY(12px); }
    }
}

/* ---- Mobile: line hugs the left edge, points stack ---- */
@media (max-width: 760px) {
    .hero { padding-top: 3rem; padding-bottom: 5rem; }
    .hero .marker { left: 1.5rem; }
    .point { width: 100%; }
    .point--left .marker, .point--right .marker { left: -1.05rem; right: auto; }
    .obs, .regimes, .annot, .forecast { padding-left: 2.2rem; }
    .annot .marker { left: 0.4rem; }
    .forecast .marker { left: 0.4rem; }
    .nav nav { gap: 1rem; }
}
