/* ============================================================================
   Page composition for adityaseth.in: nav, hero, sections, footer.
   Depends on tokens.css and base.css. Replaces custom.css and aditya.css.
   ========================================================================= */

/* ---- Navigation ---------------------------------------------------------- */

.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-4) var(--gutter);
    background: transparent;
    border-bottom: 1px solid transparent;
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

/* The old site faded the navbar out past 500px of scroll, which hid the only
   way back. It stays put now and just gains a hairline once you leave the top. */
.nav[data-scrolled] {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom-color: var(--line);
}

/* Over the hero photo the nav is glass on a dark image, so its own ink has to
   be light regardless of the page theme. Once scrolled it rejoins the theme. */
.nav:not([data-scrolled]) .nav__brand { color: #fff; }
.nav:not([data-scrolled]) .nav__links a { color: rgba(255, 255, 255, 0.76); }
.nav:not([data-scrolled]) .nav__links a:hover,
.nav:not([data-scrolled]) .nav__links a:focus-visible,
.nav:not([data-scrolled]) .nav__links a[aria-current] { color: #fff; }
.nav:not([data-scrolled]) .icon-btn {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.08);
}
.nav:not([data-scrolled]) .icon-btn:hover { color: #fff; border-color: #fff; }

@media (max-width: 860px) {
    /* The dropped panel is a surface even at the top, so it keeps theme ink. */
    .nav:not([data-scrolled]) .nav__links a { color: var(--ink-soft); }
    .nav:not([data-scrolled]) .nav__links a[aria-current] { color: var(--accent); }
}

.nav__brand {
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-2);
    font: 600 var(--step-0) / 1 var(--font-display);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.nav__brand span {
    color: var(--accent);
    font-family: var(--font-mono);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    margin-left: auto;
    font: 500 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.04em;
}

.nav__links a {
    position: relative;
    color: var(--ink-soft);
    padding-block: var(--sp-2);
    transition: color var(--dur-1) var(--ease-out);
}

.nav__links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-2) var(--ease-out);
}

.nav__links a:hover,
.nav__links a:focus-visible,
.nav__links a[aria-current] {
    color: var(--ink);
}

.nav__links a[aria-current]::after,
.nav__links a:hover::after {
    transform: scaleX(1);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink-soft);
    background: color-mix(in srgb, var(--surface-2) 60%, transparent);
    transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-spring);
}

.icon-btn:hover {
    color: var(--ink);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.nav__toggle { display: none; }

@media (max-width: 860px) {
    .nav__links {
        position: fixed;
        inset: 64px var(--sp-4) auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--sp-3);
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: color-mix(in srgb, var(--surface) 96%, transparent);
        box-shadow: var(--shadow-lg);
        font-size: var(--step-0);
        transform-origin: top;
        transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
    }

    .nav__links:not([data-open]) {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.96) translateY(-8px);
    }

    .nav__links a {
        padding: var(--sp-4);
        border-radius: var(--radius-sm);
    }

    .nav__links a::after { display: none; }
    .nav__links a[aria-current] { background: var(--accent-soft); color: var(--accent); }
    .nav__toggle { display: grid; }
}

/* ---- Hero ---------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

/* The ripple canvas and still image live at z-index 0 inside .hero-ripple;
   everything else in the hero sits above, over a legibility scrim. */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    /* The deck shuffles through bright sunsets as well as dark storm skies, so
       the scrim has to hold contrast against the brightest frame, not the
       average one.

       It must do that WITHOUT hiding the water. The previous version stacked a
       full-bleed vertical wash (0.82 -> 0.55 -> 0.88) under a diagonal one, and
       those multiply: the clearest point on the whole hero still sat under
       about 60% black, and the top corners under 96%. The refraction was
       running the entire time and nobody could see it, which is the real reason
       the effect stopped reading as water.

       So the scrim is now LOCAL to the copy. It is opaque where the text
       actually sits, falls to nothing by 72% across, and keeps only a thin fade
       at the top for the nav and at the very bottom for the section seam. The
       right side of the hero, where there is no text, is left clear so the
       surface is plainly visible and the pointer trail is obvious. */
    background:
        linear-gradient(100deg,
            rgba(5, 6, 10, 0.9) 0%,
            rgba(5, 6, 10, 0.82) 26%,
            rgba(5, 6, 10, 0.46) 50%,
            rgba(5, 6, 10, 0.12) 64%,
            rgba(5, 6, 10, 0) 74%),
        linear-gradient(180deg,
            rgba(5, 6, 10, 0.62) 0%,
            rgba(5, 6, 10, 0.12) 12%,
            rgba(5, 6, 10, 0) 30%,
            rgba(5, 6, 10, 0) 74%,
            rgba(5, 6, 10, 0.58) 100%);
}

/* The copy sits on the water, not on a panel, so each text block carries its
   own shadow. Cheaper and far less intrusive than darkening the whole frame,
   and it travels with the text when the layout reflows at phone width. */
.hero__copy {
    text-shadow: 0 1px 18px rgba(5, 6, 10, 0.72), 0 1px 3px rgba(5, 6, 10, 0.9);
}

/* The globe sits in the half the scrim deliberately leaves clear, so its own
   caption has to carry its contrast rather than borrow it from the frame. */
.hero__globe {
    text-shadow: 0 1px 14px rgba(5, 6, 10, 0.85), 0 1px 3px rgba(5, 6, 10, 0.95);
}

/* snow-globe's caption defaults to --lab-ink-soft, which is correct on the
   quiet backgrounds it was built against and much too faint once the hero
   stopped covering its water. Overridden here, in the page that creates the
   bright background, rather than in the module that has to stay generic.

   Colour alone is not enough. This caption sits in the half the scrim now
   deliberately leaves clear, and the deck shuffles through a frame of lit
   flames: measured against that frame the background luminance under these
   words reaches 0.71, which puts white type at 1.34:1. So it carries its own
   backdrop and stops depending on what the photograph is doing. */
.hero__globe .snow-globe__hint {
    display: inline-block;
    padding: 0.38em 0.8em;
    border-radius: 999px;
    background: rgba(5, 6, 10, 0.72);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    color: #fff;
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: calc(var(--sp-10) + var(--sp-6)) var(--gutter) var(--sp-9);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
    padding: var(--sp-2) var(--sp-4);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    color: #fff;
    font: 500 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.06em;
}

.hero__eyebrow i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.22);
}

.hero h1 {
    max-width: 16ch;
    margin: 0;
    color: #fff;
    font-size: var(--step-5);
    font-weight: 600;
    letter-spacing: -0.035em;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

/* Variant B replaces the static tagline with the token-stream module, which
   generates it word by word. Both variants share everything else. */
.hero__stream {
    max-width: 58ch;
    margin-top: var(--sp-4);

    /* Reserve the module's REAL height, measured rather than guessed. This
       used to reserve 6em, about 96px, against a module that mounts at 473px,
       so when token-stream arrived the hero grew 940 -> 1087 and dragged the
       whole hero layout with it: that single shift was 0.18 of the page's 0.28
       CLS on desktop. Measured mounted heights, sampled across six generated
       answers at each width: 542 at 360 and 390, 524 at 480, 457 at 600, 459
       at 700, 472 at 760, 473 from 768 up. The two reservations below cover
       the worst case on each side of that split, so nothing moves when the
       module lands and nothing moves when the answer rotates. */
    --module-h: 545px;
    min-height: var(--module-h);
}

@media (min-width: 560px) {
    .hero__stream { --module-h: 475px; }
}

/* token-stream sets its own type scale; bring it back to hero proportions so
   variant B reads as the same design as variant A, not a different one. */
.hero__stream .token-stream__out {
    font-size: var(--step-1);
    line-height: 1.5;
}

.hero__stream .module-fallback {
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--step-1);
    line-height: 1.55;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-5) var(--sp-7);
    margin-top: var(--sp-7);
    padding-top: var(--sp-6);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero__stat {
    display: grid;
    gap: 2px;
}

.hero__stat b {
    color: #fff;
    font: 600 var(--step-2) / 1 var(--font-display);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hero__stat span {
    color: rgba(255, 255, 255, 0.6);
    font: 400 var(--step--2) / 1.4 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-7);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 48px;
    padding: 0 var(--sp-6);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font: 600 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.04em;
    transition: transform var(--dur-1) var(--ease-spring), background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn--ghost {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
}

.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.14); }

.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: var(--sp-6);
    z-index: 1;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55);
    font: 400 var(--step--2) / 1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero__scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 34px;
    margin: var(--sp-3) auto 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
    animation: heroScroll 2.4s var(--ease-in-out) infinite;
}

@keyframes heroScroll {
    0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

/* The generated tagline carries a prompt row, a replay control and a hint, so
   the hero runs a tighter rhythm than a static paragraph would need in order
   to keep the CTA and stats above the fold. */
.hero__inner { padding-top: var(--sp-10); padding-bottom: var(--sp-8); }
.hero h1 { font-size: var(--step-4); }
.hero__cta { margin-top: var(--sp-5); }
.hero__meta { margin-top: var(--sp-5); padding-top: var(--sp-5); }

@media (max-height: 760px) {
    .hero__meta { display: none; }
    .hero__inner { padding-top: var(--sp-9); }
}

/* The cue is decorative and only has room on a genuinely tall screen; below
   that it collides with the stats row, so it goes rather than crowds. */
@media (max-width: 860px), (max-height: 1000px) {
    .hero__scroll { display: none; }
}

/* ---- Reveal -------------------------------------------------------------- */

/* The hidden starting state is gated on html[data-js], which every page sets
   from an inline head script before first paint. Ungated, a page with no
   JavaScript rendered 43 of 43 reveal blocks at opacity 0, which is the whole
   body of the homepage: invisible to a visitor with JS off, and to any crawler
   that does not execute scripts. This site exists to be read by those
   crawlers, so the content has to survive without JS. */
[data-js] [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(0);
    transition:
        opacity 0.8s var(--ease-out) var(--reveal-delay, 0ms),
        transform 0.9s var(--ease-out) var(--reveal-delay, 0ms),
        filter 0.8s var(--ease-out) var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

[data-js] [data-reveal="fade"]  { transform: none; }
[data-js] [data-reveal="blur"]  { transform: scale(1.03); filter: blur(14px); }
[data-js] [data-reveal="scale"] { transform: scale(0.94) translateY(16px); }
[data-js] [data-reveal="left"]  { transform: translateX(-38px); }
[data-js] [data-reveal="right"] { transform: translateX(38px); }

[data-js] [data-reveal][data-revealed] {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

/* Section bands cross-fade as they come and go, so the page reads as one
   continuous piece rather than a stack of separate screens. */
.section > .wrap {
    transition: opacity 0.6s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    [data-js] [data-reveal] { opacity: 1; transform: none; transition: none; }
    .hero__scroll::after { animation: none; }
}

/* ---- Footer -------------------------------------------------------------- */

.footer {
    padding-block: var(--sp-9) var(--sp-7);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--sp-8) var(--sp-6);
}

.footer h2 {
    font-size: var(--step-2);
    letter-spacing: -0.02em;
    max-width: 18ch;
}

.footer__col h3 {
    margin-bottom: var(--sp-4);
    color: var(--ink-faint);
    font: 600 var(--step--2) / 1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer__col ul { display: grid; gap: var(--sp-3); list-style: none; padding: 0; }

.footer__col a {
    color: var(--ink-soft);
    transition: color var(--dur-1) var(--ease-out);
}

.footer__col a:hover { color: var(--accent); }

.footer__base {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: center;
    justify-content: space-between;
    margin-top: var(--sp-8);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font: 400 var(--step--2) / 1.6 var(--font-mono);
}

/* ---- Footer motion -------------------------------------------------------
 *
 * The footer is the last thing on every page, so it is the one place where
 * motion costs nothing: there is nothing below it to interrupt. All of it is
 * transform and opacity, and none of it starts until .is-in is set by
 * initFooter() in js/site.js, which only sets it while the footer is on
 * screen. Under prefers-reduced-motion .is-in is set once and these rules
 * resolve to the finished state with no animation at all.
 * ------------------------------------------------------------------------ */

.footer { position: relative; overflow: hidden; isolation: isolate; }

/* Two slow lights behind the type. Blurred radial gradients on one promoted
   layer: no repaint, no per-frame work on the main thread. */
.footer::before {
    content: "";
    position: absolute;
    inset: -40% -20%;
    z-index: -1;
    background:
        radial-gradient(32% 38% at 14% 26%, var(--accent-soft), transparent 68%),
        radial-gradient(28% 34% at 86% 78%, var(--accent-soft), transparent 70%);
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
    will-change: transform;
    pointer-events: none;
}

.footer.is-in::before {
    opacity: 0.6;
    transform: none;
    animation: footer-drift 24s var(--ease-in-out) infinite alternate;
}

@keyframes footer-drift {
    from { transform: translate3d(-2%, 0, 0) scale(1); }
    to   { transform: translate3d(2%, -3%, 0) scale(1.08); }
}

/* The headline rises a word at a time out of its own line box. The mask has
   to sit lower than the baseline or it shears the descenders off g, p and y;
   the negative margin gives that padding back so line height is unchanged. */
.footer h2.is-split { overflow: visible; }

.footer__word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.18em;
    margin-bottom: -0.18em;
}

.footer__word + .footer__word { margin-left: 0.28em; }

.footer__word > span {
    display: inline-block;
    transform: translate3d(0, 110%, 0);
    transition: transform 0.72s var(--ease-out);
    transition-delay: calc(var(--w, 0) * 52ms);
}

.footer.is-in .footer__word > span { transform: none; }

/* The two link columns and the email button follow the headline in.
   Scoped to .is-anim, which initFooter() sets the moment it runs, so with
   JavaScript off the footer is simply a finished footer rather than three
   invisible columns waiting for a class that will never arrive. */
.footer.is-anim .footer__col,
.footer.is-anim .btn,
.footer.is-anim .footer__base {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.footer.is-in .footer__col,
.footer.is-in .btn,
.footer.is-in .footer__base { opacity: 1; transform: none; }

.footer.is-in .btn { transition-delay: 220ms; }
.footer.is-in .footer__col:nth-of-type(1) { transition-delay: 160ms; }
.footer.is-in .footer__col:nth-of-type(2) { transition-delay: 240ms; }
.footer.is-in .footer__base { transition-delay: 340ms; }

/* A link that wipes an underline in from the left and steps aside for it. */
.footer__col a {
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
}

.footer__col a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-2) var(--ease-out);
}

.footer__col a:hover::after,
.footer__col a:focus-visible::after { transform: scaleX(1); }

.footer__col a:hover,
.footer__col a:focus-visible { transform: translate3d(3px, 0, 0); }

.footer__col a { transition: color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-out); }

/* A sheen that crosses the email button once on hover. */
.footer .btn { position: relative; overflow: hidden; }

.footer .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.34) 50%, transparent 62%);
    transform: translate3d(-120%, 0, 0);
    pointer-events: none;
}

.footer .btn:hover::after,
.footer .btn:focus-visible::after { animation: footer-sheen 0.75s var(--ease-out); }

@keyframes footer-sheen {
    to { transform: translate3d(120%, 0, 0); }
}

/* ---- The sign-off route -------------------------------------------------- */

.footer__sign {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.footer__route { overflow: visible; flex: none; }

.footer__routeline,
.footer__routedraw {
    fill: none;
    stroke-linecap: round;
}

.footer__routeline {
    stroke: currentColor;
    stroke-width: 1;
    opacity: 0.28;
    stroke-dasharray: 2 4;
}

/* The solid overlay draws itself along the dotted line, so the route reads as
   being travelled rather than as being decorated. */
.footer__routedraw {
    stroke: var(--accent);
    stroke-width: 1.4;
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
}

.footer.is-in .footer__routedraw { animation: footer-draw 6s linear infinite; }

@keyframes footer-draw {
    0%        { stroke-dashoffset: 140; }
    45%, 100% { stroke-dashoffset: 0; }
}

.footer__stop {
    fill: var(--surface);
    stroke: var(--accent);
    stroke-width: 1.4;
}

/* The travelling mark follows the identical path via offset-path, so it can
   never fall out of register with the line beneath it. */
.footer__plane {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    offset-rotate: 0deg;
    offset-distance: 0%;
    opacity: 0;
}

.footer.is-in .footer__plane { animation: footer-fly 6s linear infinite; }

@keyframes footer-fly {
    0%            { offset-distance: 0%;   opacity: 0; }
    6%            { opacity: 1; }
    45%           { offset-distance: 100%; opacity: 1; }
    56%, 100%     { offset-distance: 100%; opacity: 0; }
}

/* Two head offices on one small board, read like an office clock wall. */
.footer__clocks {
    display: grid;
    gap: 4px;
    justify-items: start;
}

.footer__clock {
    display: grid;
    grid-template-columns: 6px auto auto auto;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.footer__clock b {
    font-weight: 600;
    color: var(--ink-soft);
}

.footer__clock span { color: var(--ink-faint); }

.footer__clock time {
    color: var(--ink);
    font-weight: 600;
}

/* A pulse, so the clock looks like it is running even between minutes. */
.footer__clock i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

.footer.is-in .footer__clock i { animation: footer-pulse 2.4s var(--ease-in-out) infinite; }

@keyframes footer-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.72); }
}

@media (prefers-reduced-motion: reduce) {
    .footer.is-in::before,
    .footer.is-in .footer__routedraw,
    .footer.is-in .footer__plane,
    .footer.is-in .footer__clock i,
    .footer .btn:hover::after { animation: none; }

    .footer__word > span,
    .footer__col,
    .footer .btn,
    .footer__base { transition: none; }

    .footer__routedraw { stroke-dashoffset: 0; }
    .footer__plane { offset-distance: 100%; opacity: 1; }
}

/* ---- Back to top ---------------------------------------------------------
 * Same size and position as the blog's button so the two halves of the site
 * agree, drawn with this page's tokens. Built by initBackToTop() in
 * js/site.js, and only where the page does not already carry one.
 * ------------------------------------------------------------------------ */

.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: var(--z-nav, 60);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    color: var(--ink-soft);
    font-size: 0.95rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity var(--dur-2) var(--ease-out),
        transform var(--dur-2) var(--ease-out),
        color var(--dur-1) var(--ease-out),
        border-color var(--dur-1) var(--ease-out),
        background var(--dur-1) var(--ease-out);
}

.to-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.to-top:hover,
.to-top:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface);
    transform: translateY(-2px);
}

.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 767px) {
    .to-top { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .to-top { transition: opacity var(--dur-1) linear; }
    .to-top:hover, .to-top:focus-visible { transform: none; }
}

/* ---- Preloader ----------------------------------------------------------- */

.preloader {
    position: fixed;
    inset: 0;
    z-index: var(--z-loader);
    background: var(--bg);
}

/* A module injects its own stylesheet with useStyles(), which lands a frame or
   two after the module itself. dream-loader positions its caption at a
   PERCENTAGE of its own height, so in that gap it laid out against auto height
   and then jumped 373px once height:100% arrived: 0.094 of CLS from an element
   nobody is even supposed to notice. Stated here instead, in the eagerly
   loaded sheet, so the box is the right size on the very first frame. */
.preloader > * {
    height: 100%;
}

.preloader[data-done] {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out);
}

/* ---- Sections ------------------------------------------------------------ */

/* An alternating band. Where it also carries data-theme="dark" the token
   bridge re-resolves inside it, so modules follow the band, not the page. */
.section--alt { background: var(--surface); }
.section--alt[data-theme="dark"] { background: var(--bg); }

.section__head h2 { margin-bottom: var(--sp-4); }
.section__head .lede { margin-bottom: 0; }
.section__head .btn { margin-top: var(--sp-5); }

.prose {
    max-width: var(--measure);
    color: var(--ink-soft);
}

.about__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--sp-6);
    margin-top: var(--sp-8);
}

.awards__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--sp-8);
    align-items: center;
}

/* ---- Stat bar ------------------------------------------------------------ */

.statbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--sp-6);
    margin: var(--sp-9) 0 0;
    padding-top: var(--sp-6);
    border-top: 1px solid var(--line);
}

.statbar dt {
    color: var(--ink-faint);
    font: 400 var(--step--2) / 1.4 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.statbar dd {
    margin: var(--sp-2) 0 0;
    font: 600 var(--step-3) / 1 var(--font-display);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ---- Fallback content ----------------------------------------------------
   These styles matter more than they look: the fallback is the real content,
   so it has to be presentable on its own for crawlers and without JS. */

.cardgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-5);
}

.cardgrid--tight { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.cardgrid li {
    padding: var(--sp-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.cardgrid h3 { margin-bottom: var(--sp-2); font-size: var(--step-1); }
.cardgrid p { color: var(--ink-soft); font-size: var(--step--1); }

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-5);
}

.skills-list h3 {
    margin-bottom: var(--sp-2);
    font: 600 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.skills-list p { color: var(--ink-soft); }

.timeline { display: grid; gap: var(--sp-5); }

.timeline li {
    display: grid;
    gap: 2px;
    padding-left: var(--sp-5);
    border-left: 2px solid var(--line);
}

.timeline b { font-size: var(--step-1); font-weight: 600; }
.timeline span { color: var(--ink-soft); }
.timeline time { color: var(--ink-faint); font: 400 var(--step--2) / 1.4 var(--font-mono); }

.quote {
    max-width: var(--measure);
    margin-bottom: var(--sp-6);
    padding-left: var(--sp-5);
    border-left: 2px solid var(--accent);
}

.quote p { font-size: var(--step-1); font-style: italic; }
.quote cite { display: block; margin-top: var(--sp-3); color: var(--ink-soft); font: 400 var(--step--1) / 1 var(--font-mono); font-style: normal; }

.contact-fallback { display: grid; gap: var(--sp-4); justify-items: start; }
.contact-fallback p { color: var(--ink-soft); }

.btn--line {
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn--line:hover { border-color: var(--accent); color: var(--accent); }

/* ---- FAQ -----------------------------------------------------------------
   Visible again. Hidden FAQ markup is a structured-data violation, and these
   answers are the richest thing on the page for answer engines. Generated
   from content/faq.json: never hand-edit between the markers. */

.faq { display: grid; gap: var(--sp-7); }

.faq-group-title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    font: 600 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.faq-list { display: grid; gap: var(--sp-2); }

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color var(--dur-1) var(--ease-out);
}

.faq-item[open] { border-color: var(--line-strong); }

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    cursor: pointer;
    font-weight: 500;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }

.faq-item summary i {
    flex-shrink: 0;
    color: var(--ink-faint);
    transition: transform var(--dur-2) var(--ease-spring);
}

.faq-item[open] summary i { transform: rotate(45deg); }

.faq-item p {
    padding: 0 var(--sp-5) var(--sp-5);
    max-width: var(--measure);
    color: var(--ink-soft);
}

.faq-item a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }


/* ---- About page ---------------------------------------------------------- */

/* The nav is a surface from the start on pages with no hero behind it. */
.about-hero { padding-top: calc(var(--sp-10) + var(--sp-5)); }

.about-hero__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--sp-8);
    align-items: center;
}

.about-hero h1 {
    margin-bottom: var(--sp-5);
    font-size: var(--step-4);
}

.about-hero .hero__cta { margin-top: var(--sp-6); }
.about-hero .btn--line { border-color: var(--line-strong); color: var(--ink); }

/* ---- Pill nav fallback --------------------------------------------------- */

.pillnav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    padding: var(--sp-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    width: max-content;
    max-width: 100%;
}

.pillnav a {
    padding: var(--sp-2) var(--sp-5);
    border-radius: var(--radius-pill);
    color: var(--ink-soft);
    font: 500 var(--step--1) / 1.6 var(--font-mono);
}

.pillnav a:hover { background: var(--surface-2); color: var(--ink); }

/* ---- Work detail --------------------------------------------------------
   Driven by image-wheel's onSelect. Pre-populated in the markup with the
   first project so it is never empty and reads correctly without JS. */

.workdetail {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--sp-7);
    align-items: center;
    margin-top: var(--sp-8);
    padding: var(--sp-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.workdetail__media img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.workdetail__body h3 {
    margin: var(--sp-2) 0 var(--sp-3);
    font-size: var(--step-3);
    letter-spacing: -0.02em;
}

.workdetail__body p { color: var(--ink-soft); max-width: 56ch; }

.workdetail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-5);
}

.workdetail__tags li {
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-faint);
    font: 500 var(--step--2) / 1.7 var(--font-mono);
}

.workdetail__hint {
    margin-top: var(--sp-5);
    color: var(--ink-faint) !important;
    font: 400 var(--step--2) / 1.6 var(--font-mono);
}

@media (max-width: 860px) {
    .workdetail { grid-template-columns: 1fr; gap: var(--sp-5); }
}

/* Separates the in-page story anchors from links to other pages. */
.nav__sep {
    width: 1px;
    height: 16px;
    background: var(--line-strong);
    opacity: 0.6;
}

@media (max-width: 860px) {
    .nav__sep { width: auto; height: 1px; margin: var(--sp-2) var(--sp-4); }
}

/* ---- Act marks and seams -------------------------------------------------
   The page is one long story, so it needs chapter furniture: a numbered act
   mark to break the scroll into readable stretches, and a seam module that
   carries the eye from one act to the next. */

.actmark {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    max-width: var(--maxw);
    margin: 0 auto;
    padding: var(--sp-6) var(--gutter) 0;
}

/* A chapter marker that opens a dark section used to sit transparent, which
   meant it showed the LIGHT page background, then handed off with zero gap
   into the dark section starting flush underneath it: a small pale tab
   floating on top of a hard black rectangle with no visual relationship
   between the two. Flat colour cuts between sections are the established
   rhythm of this page (certifications into awards, rooms into words), so the
   fix is not to soften the seam - it is to put the marker IN the colour it is
   introducing, the way a book prints a chapter's opening page in that
   chapter's own palette rather than the previous one's.

   data-theme="dark" on the marker (set by hand on the three that precede a
   dark section: Skills, Recognition, Hobbies) re-resolves every token below
   to the dark theme, so --bg, --line and --ink-faint already come out right
   with no extra rule for them.

   The marker's own box is centered at `max-width`, narrower than the
   viewport, so a plain `background` would leave pale strips on either side at
   any viewport wider than --maxw. box-shadow's spread extends the fill
   edge-to-edge without that gap, and unlike width:100vw it never adds to the
   page's scrollable area, so it cannot reintroduce the horizontal-scrollbar
   bugs `.hero::after` and friends were built to avoid. clip-path trims the
   shadow back to the element's own vertical span, so it does not bleed into
   the section above or below. */
.actmark[data-theme="dark"] {
    background: var(--bg);
    box-shadow: 0 0 0 100vmax var(--bg);
    clip-path: inset(0 -100vmax);
}

.actmark__num {
    font: 600 var(--step-2) / 1 var(--font-mono);
    color: var(--accent);
    letter-spacing: 0.04em;
}

.actmark__label {
    flex: 1;
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--line);
    color: var(--ink-faint);
    font: 500 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* A seam is a transition, not a section: no padding of its own. */
.section--seam { padding-block: 0; overflow: hidden; }

.chapternav { margin-top: calc(var(--sp-7) * -1); margin-bottom: var(--sp-8); }

/* ---- Tab groups ---------------------------------------------------------
   Related modules share one section. A hidden panel is display:none, so its
   module never intersects and never mounts until the tab is chosen. */

.tabs { margin-top: var(--sp-6); }

.tabs__bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
    padding: var(--sp-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    width: max-content;
    max-width: 100%;
}

.tabs__bar button {
    padding: var(--sp-2) var(--sp-5);
    border-radius: var(--radius-pill);
    color: var(--ink-soft);
    font: 500 var(--step--1) / 1.7 var(--font-mono);
    white-space: nowrap;
    transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.tabs__bar button:hover { color: var(--ink); }

.tabs__bar button[aria-selected="true"] {
    background: var(--ink);
    color: var(--bg);
}

.tabs__panel[hidden] { display: none; }

/* The panel fades in on switch, so a tab change reads as a transition rather
   than a jump cut. */
.tabs__panel:not([hidden]) { animation: tabIn 0.42s var(--ease-out); }

@keyframes tabIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tabs__panel:not([hidden]) { animation: none; }
}

/* ---- Review layout pieces ----------------------------------------------- */

/* Tighter bands, asked for directly. */
.section--tight { padding-block: clamp(32px, 3.4vw, 60px); }

/* Badge inline beside the heading rather than stacked under it. */
.section__head--withbadge {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(200px, 22vw, 280px);
    gap: var(--sp-7);
    align-items: center;
    max-width: none;
}

.section__head--withbadge > div { max-width: var(--measure); }
.section__badge { min-height: 0; }

@media (max-width: 860px) {
    .section__head--withbadge { grid-template-columns: 1fr; }
    .section__badge { display: none; }
}

/* Two-column split: diff left, ticket right. */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--sp-6);
    align-items: start;
}

@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* Award: medal left, detail right. */
.awardgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-8);
    align-items: center;
}

.awardgrid__detail { display: grid; gap: var(--sp-4); justify-items: start; }
.awardgrid__detail .statbar { margin-top: var(--sp-2); }

@media (max-width: 900px) { .awardgrid { grid-template-columns: 1fr; } }

/* Summary story: a tall host so the sticky track has room to travel. */
.storyhost { height: 420vh; }
@media (max-width: 760px) { .storyhost { height: 520vh; } }

/* Snow globe at the hero's entry point. */
/* The hero is two columns: the copy on the left, the globe on the right.
   Previously the globe was absolutely pinned to the edge, which is why it
   sat out of sync with everything around it and overlapped the stats. */
.hero__inner--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 380px);
    gap: clamp(24px, 4vw, 72px);
    align-items: center;
}

.hero__copy { min-width: 0; }

.hero__globe {
    min-height: 0;
    align-self: center;
    justify-self: center;
    width: 100%;
}

@media (max-width: 1040px) {
    .hero__inner--split { grid-template-columns: 1fr; }
    .hero__globe { display: none; }
}

/* ---- Contact ------------------------------------------------------------ */

.contactgrid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--sp-8);
    align-items: start;
}

.contactgrid h3 { margin-bottom: var(--sp-5); font-size: var(--step-1); }

.contactgrid form { display: grid; gap: var(--sp-4); }

.contactgrid__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

.contactgrid label { display: grid; gap: var(--sp-2); }

.contactgrid label span {
    color: var(--ink-soft);
    font: 500 var(--step--2) / 1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contactgrid input,
.contactgrid textarea {
    width: 100%;
    padding: var(--sp-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: 400 var(--step-0) / 1.5 var(--font-body);
    transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}

.contactgrid input:focus,
.contactgrid textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.contactgrid textarea { resize: vertical; min-height: 120px; }
.contactgrid button { justify-self: start; }

.contactgrid__status { min-height: 1.4em; font: 400 var(--step--1) / 1.5 var(--font-mono); color: var(--ink-soft); }
.contactgrid__status.is-ok { color: #2e7d32; }
.contactgrid__status.is-bad { color: #c62828; }
[data-theme="dark"] .contactgrid__status.is-ok { color: #81c784; }
[data-theme="dark"] .contactgrid__status.is-bad { color: #ef9a9a; }
.contactgrid__status a { color: var(--accent); text-decoration: underline; }

.contactgrid__links { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.contactgrid__links a { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-soft); }
.contactgrid__links a:hover { color: var(--accent); }
.contactgrid__links i { width: 18px; color: var(--ink-faint); }

.contactgrid__where { margin-bottom: var(--sp-4); color: var(--ink-soft); }

.contactgrid__map {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
}

@media (max-width: 900px) {
    .contactgrid { grid-template-columns: 1fr; }
    .contactgrid__row { grid-template-columns: 1fr; }
}

/* The contact form waits for the packet to arrive, then opens. */
[data-js] .contactgrid.is-waiting {
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.contactgrid.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .contactgrid.is-waiting { transition: none; }
}

/* The embedded map, brought to life rather than sitting flat. */
.contactgrid__map iframe {
    filter: grayscale(1) contrast(1.05);
    transition: filter 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    transform: scale(1.01);
}

.contactgrid__map:hover iframe,
.contactgrid__map:focus-within iframe {
    filter: grayscale(0) contrast(1);
    transform: scale(1.04);
}

[data-theme="dark"] .contactgrid__map iframe { filter: grayscale(1) invert(0.9) hue-rotate(180deg) contrast(0.9); }
[data-theme="dark"] .contactgrid__map:hover iframe { filter: grayscale(0.2) invert(0.9) hue-rotate(180deg) contrast(0.95); }

/* The ticket sits centred in its column beside the diff, rather than pinned
   to the top of a tall box. */
.split__col:last-child {
    display: grid;
    place-items: center;
    align-self: stretch;
}

.split__col:last-child > [data-module] { width: 100%; }

/* ---- Achievements and volunteering -------------------------------------- */

.achgrid,
.volgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--sp-4);
}

.achgrid li,
.volgrid li {
    display: grid;
    gap: var(--sp-2);
    align-content: start;
    padding: var(--sp-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}

.achgrid li:hover,
.volgrid li:hover { border-color: var(--accent); transform: translateY(-3px); }

.achgrid h3,
.volgrid h3 { font-size: var(--step-0); font-weight: 600; }
.achgrid p { color: var(--ink-soft); font-size: var(--step--1); }

.volgrid img {
    width: 30px; height: 30px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 3px;
}

.volgrid p { color: var(--ink-soft); font-size: var(--step--1); }
.volgrid time { color: var(--ink-faint); font: 400 var(--step--2) / 1.4 var(--font-mono); }
.volgrid small { color: var(--ink-faint); font-size: var(--step--2); line-height: 1.5; }

/* The globe sits on the hero photo, so it must not bring its own panel. */
.hero__globe .snow-globe {
    background: transparent !important;
    min-height: 0;
    border: 0;
}

.hero__globe .snow-globe canvas { background: transparent; }

/* Its own caption duplicates what the hint already says, and the shake
   control reads better small against a photograph. */
.hero__globe .snow-globe button {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    backdrop-filter: blur(8px);
}

/* ---- Hobbies: one stage, two states ------------------------------------- */

/* The two states cross-dissolve in place rather than one vanishing and the
   other appearing. During the swap the stage is pinned to an explicit height
   and both children are taken out of flow and stacked, so the rings can still
   be on screen while the reel rises through them and the section below never
   jumps. `inset: 0 0 auto 0` rather than `inset: 0`: pinning the bottom too
   would force the incoming reel to the OUTGOING height, and the whole point
   of the pass is to measure its real height and animate the stage to it. */

.hobbies__stage {
    position: relative;
    transition: height 0.52s var(--ease-out);
}

.hobbies__rings[hidden], .hobbies__reel[hidden] { display: none; }
.hobbies__stage[data-state="reel"] .hobbies__rings { display: none; }

.hobbies__stage[data-state="morphing"] { overflow: hidden; }

.hobbies__stage[data-state="morphing"] > .hobbies__rings,
.hobbies__stage[data-state="morphing"] > .hobbies__reel {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
}

/* The outgoing rings must not swallow a second click mid-dissolve. */
.hobbies__stage[data-state="morphing"] > .hobbies__rings { pointer-events: none; }

.hobbies__rings { cursor: pointer; }

.hobbies__hint {
    margin-top: var(--sp-4);
    color: var(--ink-faint);
    font: 400 var(--step--2) / 1.6 var(--font-mono);
}

/* ---- The closing puzzle -------------------------------------------------- */

.endpuzzle {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--sp-7);
    align-items: center;
}

.endpuzzle__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
}

.endpuzzle__links a {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-soft);
    font: 500 var(--step--1) / 1 var(--font-mono);
    transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.endpuzzle__links a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) { .endpuzzle { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    .hobbies__stage { transition: none; }
}

/* ---- Work: the wheel and its card --------------------------------------- */

.workstage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: var(--sp-7);
    align-items: center;
}

.workcard {
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}

.workcard[data-open] { opacity: 1; transform: none; }

.workcard__media {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    line-height: 0;
}

.workcard__media img { width: 100%; height: auto; display: block; }

.workcard__tag {
    color: var(--accent);
    font: 500 var(--step--2) / 1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.workcard__title {
    margin: var(--sp-2) 0 var(--sp-3);
    font-size: var(--step-2);
    letter-spacing: -0.02em;
}

.workcard__blurb { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.6; }

.workcard__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
}

.workcard__tags li {
    padding: 3px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-faint);
    font: 500 var(--step--2) / 1.7 var(--font-mono);
}

.workcard__link { justify-self: start; margin-top: var(--sp-3); }
.workcard__link[hidden] { display: none; }

@media (max-width: 1000px) {
    .workstage { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .workcard { transition: none; }
}

/* Experience: the line and the receipt side by side. */
.split--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }

.split__label {
    margin-bottom: var(--sp-4);
    color: var(--accent);
    font: 600 var(--step--2) / 1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* The achievements row, now inside Awards rather than a section of its own. */
.awardgrid__more {
    margin: var(--sp-8) 0 var(--sp-4);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--line);
    font: 600 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* The trace runs the full width of the section, above the form. */
.tracewide { margin-bottom: var(--sp-7); }
