/* ==========================================================================
   elaineleigh.com — "The Journey"
   White gallery aesthetic, prehistoric undercurrent. Montserrat carries the
   walk; Cormorant Garamond speaks the poetry. All motion is opacity/transform
   (GPU-composited) and honours prefers-reduced-motion.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/cormorant-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/cormorant-italic-latin.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
    --ink:        #151616;   /* darkest — Astra global 2 */
    --slate:      #393C40;   /* headings dark            */
    --stone:      #626262;   /* section titles           */
    --fog:        #848181;   /* soft labels              */
    --body:       #595959;   /* body text                */
    --mist:       #8c8c8c;   /* muted                    */
    --bone:       #F6F6F6;   /* subtle bg                */
    --chalk:      #F1F0F0;   /* alt bg                   */
    --white:      #FFFFFF;
    --accent:     #737880;   /* Astra link colour        */
    --moss:       #5d6b5d;   /* a breath of green for strata chips */

    --font-sans:  'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;

    --container:  1140px;
    --header-height: 92px;

    --ease-out:   cubic-bezier(.19, 1, .22, 1);
    --shadow-card:  0 6px 24px rgba(21, 22, 22, .08);
    --shadow-lift:  0 18px 44px rgba(21, 22, 22, .16);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--body);
    background: var(--white);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.15; margin: 0 0 .5em; color: var(--stone); }
a { color: var(--accent); transition: color .2s ease; }
a:hover, a:focus-visible { color: var(--slate); }

.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.br-desktop { display: none; }
@media (min-width: 768px) { .br-desktop { display: inline; } }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 18px; z-index: 200; }
.skip-link:focus { left: 0; color: #fff; }

/* ==========================================================================
   Motion primitives
   ========================================================================== */
.anim {
    opacity: 0;
    transition: opacity 1.1s ease-out, transform 1.1s var(--ease-out);
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform;
}
.fade-in-up    { transform: translate3d(0, 48px, 0); }
.fade-in-left  { transform: translate3d(-64px, 0, 0); }
.fade-in-right { transform: translate3d(64px, 0, 0); }
.anim.is-visible { opacity: 1; transform: translate3d(0, 0, 0); }

.light-speed-in.is-visible {
    animation: lightSpeedIn 1s var(--ease-out) both;
    animation-delay: var(--delay, 0s);
    transition: none;
}
@keyframes lightSpeedIn {
    0%   { opacity: 0; transform: translate3d(60%, 0, 0) skewX(-30deg); }
    60%  { opacity: 1; transform: skewX(18deg); }
    80%  { transform: skewX(-4deg); }
    100% { opacity: 1; transform: none; }
}

/* word-by-word reveal (spans injected by JS) */
.split-words .w {
    display: inline-block;
    opacity: 0;
    transform: translate3d(0, 1.1em, 0) rotate(2deg);
    transition: opacity .7s ease, transform .9s var(--ease-out);
    transition-delay: calc(var(--wi) * 45ms);
    will-change: opacity, transform;
}
.split-words.is-visible .w { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .anim, .split-words .w, .light-speed-in.is-visible,
    .tri-arm, .fragment, .passage-track, .notes-line-progress,
    .threshold-triskele, .interlude-spiral svg, .footer-spiral svg {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: absolute; inset: 0 0 auto; height: var(--header-height); z-index: 90; }
.site-header.is-stuck {
    position: fixed;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 14px rgba(21, 22, 22, .08);
    animation: headerDrop .35s ease-out;
}
@keyframes headerDrop { from { transform: translateY(-100%); } to { transform: none; } }

.header-inner {
    max-width: 1320px;
    height: var(--header-height);
    margin-inline: auto;
    padding-inline: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.header-logo img { width: 160px; height: auto; }

.nav-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-link {
    position: relative;
    display: inline-block;
    padding: 12px 16px;
    font-size: .8125rem;
    font-weight: 400;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slate);
    text-decoration: none;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 16px; right: 16px; bottom: 6px;
    height: 1px;
    background: var(--slate);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease-out);
}
.nav-link:hover::after, .nav-link:focus-visible::after { transform: scaleX(1); }

.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 7px; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; }
.menu-toggle-bar { height: 1.5px; width: 100%; background: var(--slate); transition: transform .3s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* ==========================================================================
   Journey rail
   ========================================================================== */
.journey-rail {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 18px;
    opacity: 0;
    transition: opacity .5s ease;
}
.journey-rail.is-ready { opacity: 1; }
.journey-rail a { display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; text-decoration: none; }
.rail-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid var(--fog);
    background: transparent;
    transition: background-color .3s ease, transform .3s ease, border-color .3s ease;
}
.rail-label {
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--fog);
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .3s ease, transform .3s ease;
    white-space: nowrap;
}
.journey-rail a:hover .rail-label,
.journey-rail a.is-active .rail-label { opacity: 1; transform: none; }
.journey-rail a.is-active .rail-dot { background: var(--ink); border-color: var(--ink); transform: scale(1.4); }
.journey-rail.on-dark .rail-dot { border-color: rgba(255,255,255,.6); }
.journey-rail.on-dark a.is-active .rail-dot { background: #fff; border-color: #fff; }
.journey-rail.on-dark .rail-label { color: rgba(255,255,255,.75); }

@media (max-width: 921px) { .journey-rail { display: none; } }

/* ==========================================================================
   I. Threshold
   ========================================================================== */
.threshold {
    position: relative;
    min-height: 100vh; min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-height) + 24px) 24px 96px;
    overflow: hidden;
    background: var(--white);
}

.threshold-triskele {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    opacity: .07;
    pointer-events: none;
}
.threshold-triskele svg { width: min(88vmin, 780px); height: auto; animation: slowSpin 240s linear infinite; }
.tri-arm { stroke-dasharray: 640; stroke-dashoffset: 640; animation: drawArm 4.5s ease-out forwards; }
.tri-arm:nth-child(2) { animation-delay: .5s; }
.tri-arm:nth-child(3) { animation-delay: 1s; }
@keyframes drawArm  { to { stroke-dashoffset: 0; } }
@keyframes slowSpin { to { transform: rotate(360deg); } }

.threshold-inner { position: relative; max-width: 860px; }
.threshold-kicker {
    font-size: .6875rem; font-weight: 500;
    letter-spacing: .42em; text-transform: uppercase;
    color: var(--mist); margin: 0 0 28px;
}
.threshold-logo img { width: min(660px, 92%); margin-inline: auto; }
.threshold-line { font-size: clamp(1.35rem, 2.6vw, 1.8rem); line-height: 1.5; color: var(--slate); margin: 30px 0 22px; }

.hero-divider { padding-block: 2px; }
.hero-divider span { display: block; width: 15%; margin-inline: auto; border-top: 1.5px solid var(--fog); }

.threshold-invite { margin: 26px 0 0; font-size: .9375rem; color: var(--body); }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.scroll-cue-label { font-size: .625rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--mist); }
.scroll-cue-line { width: 1px; height: 56px; background: var(--fog); overflow: hidden; position: relative; }
.scroll-cue-line::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--ink);
    animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }

/* ==========================================================================
   II. Prologue
   ========================================================================== */
.prologue { position: relative; padding: 140px 24px 120px; background: var(--white); overflow: hidden; }
.prologue-inner { position: relative; max-width: 780px; margin-inline: auto; text-align: center; z-index: 2; }

.prologue-eyebrow {
    font-size: .6875rem; font-weight: 500;
    letter-spacing: .42em; text-transform: uppercase;
    color: var(--mist); margin: 0 0 22px;
}
.prologue-eyebrow--light { color: rgba(255,255,255,.65); }

.prologue-statement {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(1.9rem, 4.6vw, 3.1rem);
    line-height: 1.32;
    color: var(--slate);
    margin: 0 0 34px;
}
.prologue-body { font-size: 1.0625rem; line-height: 1.9; margin: 0 auto; max-width: 640px; }

.prologue-stats { display: flex; justify-content: center; gap: clamp(32px, 7vw, 84px); margin-top: 72px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stat-number { font-family: var(--font-serif); font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .6875rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--fog); text-align: center; }

.prologue-fragments { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.fragment { position: absolute; width: clamp(120px, 16vw, 230px); box-shadow: var(--shadow-card); opacity: .5; will-change: transform; }
.fragment img { filter: saturate(.6); }
.fragment-1 { top: 12%; left: 4%; transform: rotate(-5deg); }
.fragment-2 { bottom: 10%; right: 5%; transform: rotate(4deg); }

/* ==========================================================================
   III. Chapters
   ========================================================================== */
.chapters { padding: 120px 0 40px; background: var(--white); }
.chapters-head { text-align: center; max-width: 760px; margin: 0 auto 40px; padding-inline: 24px; }

.section-title { font-size: clamp(2.1875rem, 5vw, 3.125rem); font-weight: 300; color: var(--stone); margin-bottom: 18px; }
.chapters-intro { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--body); line-height: 1.6; }
.chapters-intro strong { font-weight: 600; font-style: normal; letter-spacing: .04em; color: var(--slate); }

.chapter {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: center;
    gap: clamp(32px, 6vw, 88px);
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(48px, 8vh, 96px) 28px;
}
.chapter--flip .chapter-media { order: 2; }
.chapter--flip .chapter-text  { order: 1; }

.chapter-media { position: relative; }
.chapter-figure {
    margin: 0;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
    transition: transform .5s var(--ease-out), box-shadow .5s ease;
    will-change: transform;
}
.chapter-figure:hover { box-shadow: var(--shadow-lift); }
.chapter-figure img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transform: scale(1.06) translateY(var(--py, 0));   /* parallax breathing room */
    transition: transform .2s linear;
    will-change: transform;
}

.chapter-numeral {
    position: absolute;
    top: -.55em;
    right: -8px;
    font-family: var(--font-serif);
    font-size: clamp(5rem, 11vw, 8.5rem);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(21, 22, 22, .18);
    pointer-events: none;
}
.chapter--flip .chapter-numeral { right: auto; left: -8px; }

.chapter-count { font-size: .6875rem; font-weight: 500; letter-spacing: .38em; text-transform: uppercase; color: var(--mist); margin: 0 0 14px; }
.chapter-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 300; color: var(--slate); margin: 0 0 10px; }
.chapter-tagline { font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--fog); margin: 0 0 18px; }
.chapter-desc { max-width: 52ch; margin: 0 0 26px; }

.strata-label {
    display: block;
    font-size: .625rem; font-weight: 600;
    letter-spacing: .3em; text-transform: uppercase;
    color: var(--mist); margin-bottom: 10px;
}
.strata-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.stratum-chip {
    display: inline-block;
    padding: 7px 18px;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--slate);
    text-decoration: none;
    border: 1px solid #DDDBDB;
    border-radius: 999px;
    transition: border-color .3s ease, background-color .3s ease, color .3s ease, transform .3s var(--ease-out);
}
.stratum-chip:hover, .stratum-chip:focus-visible {
    border-color: var(--slate);
    background: var(--ink);
    color: var(--white);
    transform: translateY(-2px);
}

/* ==========================================================================
   IV. The Passage — scroll-driven horizontal gallery
   ========================================================================== */
.passage { position: relative; background: var(--bone); }
.passage-sticky {
    position: sticky;
    top: 0;
    min-height: 100vh; min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-block: 48px;
}
.passage-head { text-align: center; padding-inline: 24px; margin-bottom: 40px; }
.passage-hint { color: var(--fog); font-size: 1.05rem; }

.passage-track {
    display: flex;
    align-items: stretch;
    gap: clamp(28px, 4vw, 56px);
    padding-inline: max(28px, calc((100vw - var(--container)) / 2));
    width: max-content;
    will-change: transform;
}
.passage-item { margin: 0; width: clamp(240px, 30vw, 380px); flex-shrink: 0; }
.passage-frame {
    background: var(--white);
    padding: 14px;
    box-shadow: var(--shadow-card);
    transition: transform .5s var(--ease-out), box-shadow .5s ease;
}
.passage-item:hover .passage-frame { transform: translateY(-8px); box-shadow: var(--shadow-lift); }
.passage-frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.passage-item figcaption { padding: 14px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.passage-title { font-size: .9375rem; font-weight: 500; color: var(--slate); }
.passage-meta { font-size: .75rem; letter-spacing: .06em; color: var(--mist); }
.passage-meta em { font-style: italic; color: var(--fog); }

.passage-item--end { display: flex; }
.passage-endcard {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 100%;
    border: 1px dashed #CFCCCC;
    text-align: center;
    text-decoration: none;
    color: var(--fog);
    font-size: 1.35rem;
    line-height: 1.4;
    padding: 24px;
    transition: border-color .3s ease, color .3s ease;
}
.passage-endcard:hover { border-color: var(--slate); color: var(--slate); }
.passage-endlink { font-family: var(--font-sans); font-size: .75rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; }

/* ==========================================================================
   V. Interlude — the dark beneath
   ========================================================================== */
.interlude {
    position: relative;
    padding: clamp(120px, 20vh, 200px) 24px;
    background: #101112;
    color: #EDEBE8;
    text-align: center;
    overflow: hidden;
}
.interlude-spiral {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: #EDEBE8;
    opacity: .08;
    pointer-events: none;
}
.interlude-spiral svg { width: min(120vmin, 900px); animation: slowSpin 180s linear infinite reverse; }

.interlude-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.7rem, 4vw, 2.9rem);
    line-height: 1.45;
    max-width: 900px;
    margin: 0 auto;
    color: #EDEBE8;
    position: relative;
}
.interlude-attr { margin: 34px 0 0; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(237, 235, 232, .5); position: relative; }

/* ==========================================================================
   VI. Field Notes — timeline
   ========================================================================== */
.field-notes { padding: 130px 24px 110px; background: var(--white); }

.notes-timeline { position: relative; max-width: 1080px; margin: 70px auto 0; }
.notes-line {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    background: #E4E2E1;
    transform: translateX(-50%);
}
.notes-line-progress {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: var(--slate);
    transform: scaleY(var(--progress, 0));
    transform-origin: top;
    will-change: transform;
}

.note { position: relative; width: 50%; padding: 34px 0; }
.note--left  { padding-right: clamp(36px, 5vw, 64px); }
.note--right { margin-left: 50%; padding-left: clamp(36px, 5vw, 64px); }

.note-node {
    position: absolute;
    top: 62px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid var(--slate);
    z-index: 2;
}
.note--left  .note-node { right: -6px; }
.note--right .note-node { left: -5px; }

.note-card {
    background: var(--white);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
    transition: transform .5s var(--ease-out), box-shadow .5s ease;
}
.note-card:hover { box-shadow: var(--shadow-lift); }
.note-media { display: block; overflow: hidden; }
.note-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .7s var(--ease-out); filter: saturate(.85); }
.note-card:hover .note-media img { transform: scale(1.05); filter: saturate(1); }

.note-body { padding: 22px 26px 20px; }
.note-epoch {
    display: inline-block;
    font-size: .625rem; font-weight: 600;
    letter-spacing: .26em; text-transform: uppercase;
    color: var(--moss);
    margin: 0 0 10px;
}
.note-title { font-size: 1.25rem; font-weight: 400; line-height: 1.4; margin: 0 0 10px; }
.note-title a { color: var(--slate); text-decoration: none; transition: color .2s ease; }
.note-title a:hover { color: var(--accent); }
.note-excerpt { font-size: .9rem; line-height: 1.75; margin: 0 0 16px; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--chalk); padding-top: 14px; }
.note-foot time { font-size: .75rem; color: var(--mist); }

.post-readmore {
    font-size: .7rem; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: color .3s ease, border-color .3s ease;
}
.post-readmore:hover { color: var(--ink); border-bottom-color: currentColor; }

/* ==========================================================================
   VII. Contact
   ========================================================================== */
.contact {
    position: relative;
    padding: clamp(110px, 18vh, 170px) 24px;
    text-align: center;
    color: #F0F0F0;
    background:
        linear-gradient(rgba(5, 5, 6, .82), rgba(5, 5, 6, .82)),
        #CBCBCB url('../images/contact-bg.jpg') center / cover no-repeat fixed;
}
@supports (-webkit-touch-callout: none) { .contact { background-attachment: scroll; } }

.contact-inner { max-width: 729px; margin-inline: auto; }
.contact-title { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 300; color: #F5F4F2; }
.contact-divider { padding-block: 22px; }
.contact-divider span { display: block; width: 20%; margin-inline: auto; border-top: 2px solid #D5D5D4; }
.contact-lede { font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: rgba(245, 244, 242, .85); margin-bottom: 20px; }
.contact p { font-size: .9375rem; font-weight: 400; margin: .4em 0; }

.contact-button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 44px;
    font-size: .75rem; font-weight: 600;
    letter-spacing: .26em; text-transform: uppercase;
    color: var(--ink);
    background: #F5F4F2;
    text-decoration: none;
    transition: background-color .3s ease, color .3s ease, transform .3s var(--ease-out), box-shadow .3s ease;
}
.contact-button:hover, .contact-button:focus-visible {
    background: transparent;
    color: #F5F4F2;
    box-shadow: inset 0 0 0 1px #F5F4F2;
    transform: translateY(-3px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 70px 24px 44px; text-align: center; background: var(--white); color: var(--mist); font-size: .8125rem; }
.footer-spiral { display: grid; place-items: center; color: var(--fog); margin-bottom: 18px; }
.footer-spiral svg { width: 44px; animation: slowSpin 90s linear infinite; }
.footer-line { font-size: 1.3rem; color: var(--fog); margin: 0 0 26px; }

.social-icons { display: flex; justify-content: center; gap: 14px; margin: 0 0 34px; padding: 0; list-style: none; }
.social-icons a {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(21, 22, 22, .12);
    transition: transform .25s var(--ease-out), box-shadow .25s ease;
}
.social-icons svg { width: 18px; height: 18px; fill: #757575; transition: fill .25s ease; }
.social-icons a:hover, .social-icons a:focus-visible { transform: translateY(-4px) scale(1.06); box-shadow: 0 8px 20px rgba(21, 22, 22, .18); }
.social-icons a:hover svg { fill: var(--ink); }

.site-footer p { margin: .3em 0; }
.footer-credit a { color: var(--body); font-weight: 400; text-decoration: none; }
.footer-credit a:hover { color: var(--ink); }

/* ---------- Scroll to top ---------- */
.scroll-top {
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 85;
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border: 0; border-radius: 50%;
    background: var(--slate); color: #fff;
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s, background-color .2s ease;
}
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { background: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 921px) {
    .menu-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: var(--header-height);
        left: 0; right: 0;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 16px 32px rgba(21, 22, 22, .12);
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }
    .site-nav.is-open { max-height: 60vh; }
    .site-header { background: rgba(255, 255, 255, .94); }
    .nav-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 0; }
    .nav-link { padding: 15px 28px; }
    .nav-link::after { display: none; }

    .chapter { grid-template-columns: 1fr; gap: 34px; }
    .chapter--flip .chapter-media { order: 0; }
    .chapter--flip .chapter-text  { order: 1; }
    .chapter-numeral { right: 8px; }
    .chapter--flip .chapter-numeral { left: 8px; }

    .notes-line { left: 14px; }
    .note, .note--right { width: 100%; margin-left: 0; padding: 26px 0 26px 48px; }
    .note--left { padding-right: 0; }
    .note--left .note-node, .note--right .note-node { left: 9px; right: auto; }

    .prologue-stats { flex-wrap: wrap; }
    .fragment { opacity: .28; }
}

@media (max-width: 640px) {
    .threshold-line { font-size: 1.2rem; }
    .hero-divider span { width: 38%; }
    .passage-item { width: 76vw; }
    .contact { background-attachment: scroll; }
}
