/* ═══════════════════════════════════════════════════════════════════
   arc.css · Scrollytelling research-arc page
   Left sticky stage (frames swapped by arc.js) + right chapter track.
   ═══════════════════════════════════════════════════════════════════ */

.arc-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 3.6rem 1.6rem 5rem;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.arc-hero {
    text-align: center;
    margin: 0 auto 3.4rem;
    max-width: 760px;
}
.arc-hero-kicker {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1rem;
}
.arc-hero-h1 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.08;
    margin: 0 0 1.4rem;
    letter-spacing: -0.03em;
    color: var(--text);
}
.arc-hero-h1 em {
    font-style: normal;
    color: var(--accent);
}
.arc-hero-intro {
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-soft);
    max-width: 620px;
    margin: 0 auto;
}
.arc-hero-progress {
    margin: 2rem auto 0;
    max-width: 280px;
    height: 3px;
    background: var(--accent-bg);
    border-radius: 999px;
    overflow: hidden;
}
.arc-hero-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--amber));
    border-radius: 999px;
    transition: width .4s var(--ease);
}

/* ─── Two-column scrollytelling layout ────────────────────────── */
.arc-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: flex-start;
    position: relative;
}

/* Left: sticky stage with rotating frames */
.arc-stage {
    position: sticky;
    top: 6rem;
    height: calc(100vh - 8rem);
    max-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.arc-stage-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 470px;
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        var(--card);
    background-size: 28px 28px, 28px 28px, auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.arc-frame {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.97) translateY(6px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
    pointer-events: none;
    padding: 1.4rem;
}
.arc-frame.is-active {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.arc-svg { width: 100%; height: 100%; }

/* ─── Stage frame 1: Origin ───────────────────────────────────── */
.arc-hex {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
}
.arc-bond {
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linecap: round;
}
.arc-atom { fill: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
    .arc-frame.is-active .arc-hex,
    .arc-frame.is-active .arc-bond {
        animation: arc-draw 0.9s ease-out both;
    }
    .arc-frame.is-active .arc-atom {
        animation: arc-pop 0.5s 0.4s var(--ease) both;
    }
}
@keyframes arc-draw {
    from { stroke-dasharray: 600; stroke-dashoffset: 600; }
    to   { stroke-dasharray: 600; stroke-dashoffset: 0; }
}
@keyframes arc-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ─── Stage frame 2: Sieve ────────────────────────────────────── */
.arc-grid polygon {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.1;
    opacity: 0.6;
}
.arc-wave {
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 4 4;
    opacity: 0.7;
}
.arc-hex--lit {
    fill: var(--accent-bg);
    stroke: var(--accent);
    stroke-width: 2.4;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}
.arc-tag {
    fill: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
@media (prefers-reduced-motion: no-preference) {
    .arc-frame.is-active .arc-wave {
        stroke-dasharray: 4 4;
        animation: arc-wave-shift 2.4s linear infinite;
    }
}
@keyframes arc-wave-shift {
    to { stroke-dashoffset: -32; }
}

/* ─── Stage frame 3: Editorial ────────────────────────────────── */
.arc-page {
    fill: var(--card-soft);
    stroke: var(--border);
    stroke-width: 1;
}
.arc-page--top { fill: var(--card); }
.arc-page-lines line {
    stroke: var(--text-soft);
    stroke-width: 1.4;
    stroke-linecap: round;
    opacity: 0.55;
}
.arc-stamp {
    fill: var(--accent-bg);
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
}
.arc-stamp-text {
    fill: var(--accent);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
@media (prefers-reduced-motion: no-preference) {
    .arc-frame.is-active .arc-stamp {
        animation: arc-stamp-rotate 14s linear infinite;
        transform-origin: 232px 92px;
    }
}
@keyframes arc-stamp-rotate {
    to { transform: rotate(360deg); }
}

/* ─── Stage frame 4: Network ──────────────────────────────────── */
.arc-node {
    fill: var(--card-soft);
    stroke: var(--accent);
    stroke-width: 1.5;
}
.arc-node--center {
    fill: var(--accent);
    stroke: var(--accent);
}
.arc-node--center + .arc-node-text {
    fill: var(--bg);
    font-weight: 700;
}
.arc-node-text {
    fill: var(--text);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
}
.arc-edge {
    stroke: var(--accent);
    stroke-width: 1.4;
    stroke-linecap: round;
    opacity: 0.5;
}
@media (prefers-reduced-motion: no-preference) {
    .arc-frame.is-active .arc-edge {
        stroke-dasharray: 140;
        stroke-dashoffset: 140;
        animation: arc-edge-draw .8s .15s ease-out forwards;
    }
    .arc-frame.is-active .arc-node--tool {
        animation: arc-pop 0.45s .55s var(--ease) both;
    }
}
@keyframes arc-edge-draw {
    to { stroke-dashoffset: 0; }
}

/* ─── Stage frame 5: Horizon ──────────────────────────────────── */
.arc-horizon-base {
    stroke: var(--text-soft);
    stroke-width: 1.5;
    opacity: 0.4;
    stroke-dasharray: 2 4;
}
.arc-branch {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.6;
    stroke-linecap: round;
    opacity: 0.65;
}
.arc-branch-end { fill: var(--amber); }
.arc-branch-anchor {
    fill: var(--accent);
    stroke: var(--bg);
    stroke-width: 2;
}
@media (prefers-reduced-motion: no-preference) {
    .arc-frame.is-active .arc-branch {
        stroke-dasharray: 220;
        stroke-dashoffset: 220;
        animation: arc-edge-draw 0.9s ease-out forwards;
    }
    .arc-frame.is-active .arc-branch:nth-child(4) { animation-delay: .08s; }
    .arc-frame.is-active .arc-branch:nth-child(5) { animation-delay: .16s; }
    .arc-frame.is-active .arc-branch:nth-child(6) { animation-delay: .24s; }
    .arc-frame.is-active .arc-branch:nth-child(7) { animation-delay: .32s; }
    .arc-frame.is-active .arc-branch-end {
        animation: arc-pop .45s .8s var(--ease) both;
    }
}

/* ─── Right: scrolling track of chapters ──────────────────────── */
.arc-track {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.arc-step {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
    position: relative;
    opacity: 0.4;
    transition: opacity .45s var(--ease);
}
.arc-step.is-active { opacity: 1; }
.arc-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 30%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-glow), transparent);
    opacity: 0.5;
}
.arc-step-kicker {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.85rem;
}
.arc-step-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 1.2rem;
    letter-spacing: -0.022em;
}
.arc-step-body {
    font-family: var(--body);
    font-size: 0.97rem;
    line-height: 1.78;
    color: var(--text-soft);
    margin: 0 0 1.2rem;
}
.arc-step-body strong { color: var(--text); font-weight: 600; }
.arc-step-body em     { color: var(--text); font-style: normal; font-weight: 600; }

/* Milestone card at the bottom of a chapter */
.arc-milestone {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s var(--ease), transform .2s var(--ease);
    max-width: 100%;
}
a.arc-milestone:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.arc-milestone-dot {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-bg);
}
.arc-milestone-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.arc-milestone-label {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.arc-milestone-sub {
    font-family: var(--body);
    font-size: 0.82rem;
    color: var(--text-soft);
    line-height: 1.45;
}

/* ─── Final CTA ──────────────────────────────────────────────── */
.arc-final {
    margin: 4rem auto 0;
    text-align: center;
    max-width: 620px;
    padding: 2.2rem;
    background:
        radial-gradient(120% 140% at 50% 0%, var(--accent-bg), transparent 60%),
        var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.arc-final .sec-kicker { justify-content: center; }
.arc-final-body {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0.7rem 0 1.4rem;
}
.arc-final-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.74rem 1.4rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    font-family: var(--body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .18s var(--ease), border-color .18s var(--ease),
                transform .18s var(--ease), box-shadow .18s var(--ease);
}
.arc-final-cta svg { width: 16px; height: 16px; }
.arc-final-cta:hover {
    background: var(--accent-d);
    border-color: var(--accent-d);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -12px var(--accent-glow);
}
.arc-final-cta:active { transform: scale(0.97); }
.arc-final-sub {
    margin: 1.3rem 0 0;
    font-size: 0.82rem;
    color: var(--text-soft);
}
.arc-final-sub a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-glow);
}
.arc-final-sub a:hover { color: var(--accent-d); }

/* ─── Responsive: collapse to single-column on narrow ─────────── */
@media (max-width: 880px) {
    .arc-wrap {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }
    .arc-track { order: 1; }
    .arc-step {
        min-height: auto;
        opacity: 1;
        padding: 1.4rem 0;
    }
    /* On mobile the chapters stand alone; hide the rotating stage */
    .arc-stage { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .arc-step { opacity: 1; }
    .arc-frame {
        transition: opacity .45s var(--ease);
        transform: none;
    }
}
