/* ═══════════════════════════════════════════════════════════════════
   arc.css · Scrollytelling research-arc page
   Two-column layout: left sticky stage (line-art frames), right
   scrolling track of chapters. arc.js toggles .is-active on both.
   ═══════════════════════════════════════════════════════════════════ */

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

/* ─── Hero (centered manifesto opening) ────────────────────────── */
.arc-hero {
    text-align: center;
    margin: 0 auto 3.6rem;
    max-width: 780px;
}
.arc-hero-kicker {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.06rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    color: var(--accent);
    margin: 0 0 0.9rem;
}
.arc-hero-h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(2.3rem, 4.6vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 1.3rem;
    letter-spacing: -0.014em;
    color: var(--text);
    padding-bottom: 0.08em;
}
.arc-hero-h1 em {
    font-style: italic;
    color: var(--accent);
}
.arc-hero-intro {
    font-size: var(--fs-body);
    line-height: 1.72;
    color: var(--text-soft);
    max-width: 620px;
    margin: 0 auto;
}
.arc-hero-progress {
    margin: 2.2rem auto 0;
    max-width: 260px;
    height: 2px;
    background: var(--border-s);
    border-radius: 999px;
    overflow: hidden;
}
.arc-hero-progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 999px;
    transition: width .4s var(--ease);
}

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

/* Left: sticky stage with rotating frames on a figure-grid plate */
.arc-stage {
    position: sticky;
    top: 5rem;
    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:
        radial-gradient(90% 120% at 15% 0%, var(--halo), transparent 60%),
        var(--card-soft);
    border: 1px solid var(--border-s);
    border-radius: var(--radius);
    overflow: hidden;
}
.arc-stage-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-s) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-s) 1px, transparent 1px);
    background-size: 52px 52px;
    background-position: center;
    opacity: 0.55;
    pointer-events: none;
}
.arc-frame {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.965) translateY(8px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
    pointer-events: none;
    padding: 1.6rem;
}
.arc-frame.is-active {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.arc-svg { width: 100%; height: 100%; }

/* ─── Stage SVG styling · 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 var(--ease) 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.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ─── Stage · Frame 2: Sieve ──────────────────────────────────── */
.arc-grid polygon {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.1;
}
.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.6;
    filter: drop-shadow(0 0 12px 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);
    stroke: var(--border);
    stroke-width: 1;
}
.arc-page--top { fill: var(--card-soft); }
.arc-page-lines line {
    stroke: var(--text-soft);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.55;
}
.arc-stamp {
    fill: var(--amber-bg);
    stroke: var(--amber);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
}
.arc-stamp-text {
    fill: var(--amber);
    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 16s linear infinite;
        transform-origin: 232px 92px;
    }
}
@keyframes arc-stamp-rotate {
    to { transform: rotate(360deg); }
}

/* ─── Stage · Frame 4: Network ─────────────────────────────────── */
.arc-node {
    fill: var(--card);
    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 var(--ease) 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(--muted);
    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(--accent); }
.arc-branch-anchor {
    fill: var(--amber);
    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 .9s var(--ease) 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: 2.2rem 0;
    position: relative;
}
.arc-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 30%;
    bottom: 0;
    height: 1px;
    background: var(--border-s);
}
.arc-step-kicker {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    color: var(--accent);
    margin: 0 0 0.8rem;
}
.arc-step-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.6rem, 2.8vw, 2.15rem);
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 1.2rem;
    letter-spacing: -0.008em;
    padding-bottom: 0.06em;
}
.arc-step-body {
    font-size: var(--fs-body);
    line-height: 1.76;
    color: var(--text-soft);
    margin: 0 0 1.15rem;
}
.arc-step-body strong { color: var(--text); font-weight: 600; }
.arc-step-body em     { color: var(--text); font-style: italic; }

/* Milestone note at the bottom of a chapter */
.arc-milestone {
    margin-top: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0 0.75rem 1.1rem;
    border-left: 2px solid var(--accent);
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    max-width: 100%;
}
a.arc-milestone:hover {
    border-color: var(--amber);
    transform: translateX(3px);
}
.arc-milestone-dot { display: none; }
.arc-milestone-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.arc-milestone-label {
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.004em;
}
.arc-milestone-sub {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.45;
}

/* ─── In-view emphasis (driven by arc.js) ──────────────────────── */
.arc-step {
    opacity: 0.4;
    transition: opacity .5s var(--ease);
}
.arc-step.is-active { opacity: 1; }

/* ─── Final CTA ──────────────────────────────────────────────── */
.arc-final {
    margin: 4.5rem auto 0;
    text-align: center;
    max-width: 640px;
    padding: 2.5rem 2.2rem 2.6rem;
    background:
        radial-gradient(80% 130% at 50% 0%, var(--halo), transparent 65%),
        var(--card-soft);
    border: 1px solid var(--border-s);
    border-radius: var(--radius);
}
.arc-final-body {
    color: var(--text-soft);
    font-size: var(--fs-body);
    line-height: 1.7;
    margin: 0.7rem 0 1.5rem;
}
.arc-final-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease),
                box-shadow var(--t-fast) 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(-2px);
    box-shadow: 0 14px 28px -12px var(--accent-glow);
}
.arc-final-cta:active { transform: translateY(0) scale(0.98); }
.arc-final-sub {
    margin: 1.4rem 0 0;
    font-size: 0.95rem;
    color: var(--text-soft);
}
.arc-final-sub a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-glow);
    transition: color var(--t-fast) var(--ease);
}
.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.5rem 0;
    }
    /* On mobile, hide the rotating stage: chapters stand alone */
    .arc-stage { display: none; }
    .arc-main { padding: 3rem 1.4rem 4rem; }
}
