/* ===================================================================
 * Arjit Priyam — portfolio
 *
 * Apple-style: system typography with size-specific tracking,
 * translucent materials, and motion that is scroll-driven and
 * gesture-driven. Anything a pointer can touch is animated by the
 * spring engine in js/main.js, never by a CSS transition — springs
 * can be grabbed and reversed mid-flight, transitions cannot.
 *
 * CSS transitions here are reserved for discrete state changes
 * (hover, colour, focus) that no gesture ever interrupts.
 *
 * TOC
 * 01. tokens
 * 02. reset & base
 * 03. typography
 * 04. buttons & controls
 * 05. header, nav, mobile menu
 * 06. intro (scrubbed hero)
 * 07. statement & stats
 * 08. about
 * 09. work carousel
 * 10. journey timeline
 * 11. contact & footer
 * 12. project sheet
 * 13. scroll-driven primitives
 * 14. accessibility tiers
 * ------------------------------------------------------------------- */


/* ===================================================================
 * 01. tokens
 *
 * The complete light palette lives on bare :root, so a page with no
 * theme signal still has every colour defined. Dark redefines only the
 * tokens — twice: once for the system preference (unless the user
 * explicitly chose light) and once for the explicit dark choice, so
 * the toggle wins in both directions.
 * ------------------------------------------------------------------- */

:root {
    --bg:               #fbfbfd;
    --bg-alt:           #f2f2f5;
    --surface:          #ffffff;
    --surface-sunken:   #f0f0f3;

    --material:         rgba(251, 251, 253, 0.72);
    --material-thick:   rgba(255, 255, 255, 0.88);
    --material-edge:    rgba(255, 255, 255, 0.7);
    --material-blur:    24px;

    --text:             #1d1d1f;
    --text-secondary:   #6e6e73;
    --text-tertiary:    #86868b;

    --accent:           #0071e3;
    --accent-hover:     #0077ed;
    --accent-text:      #ffffff;
    --separator:        rgba(0, 0, 0, 0.10);
    --separator-strong: rgba(0, 0, 0, 0.20);
    --fill:             rgba(0, 0, 0, 0.04);
    --fill-hover:       rgba(0, 0, 0, 0.07);

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md:  0 2px 6px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.09);
    --shadow-lg:  0 4px 12px rgba(0, 0, 0, 0.08), 0 32px 80px rgba(0, 0, 0, 0.18);

    --aurora-1: rgba(0, 113, 227, 0.22);
    --aurora-2: rgba(120, 90, 235, 0.18);
    --aurora-3: rgba(64, 200, 224, 0.16);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 30px;
    --r-2xl: 40px;
    --r-pill: 999px;

    /* rem-based rhythm so a larger text setting scales layout with it */
    --gutter: clamp(1.25rem, 4vw, 3.5rem);
    --wrap: 78rem;
    --section-y: clamp(6rem, 14vh, 12rem);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:               #000000;
        --bg-alt:           #0a0a0c;
        --surface:          #151517;
        --surface-sunken:   #1d1d1f;

        --material:         rgba(20, 20, 22, 0.72);
        --material-thick:   rgba(28, 28, 30, 0.88);
        --material-edge:    rgba(255, 255, 255, 0.10);

        --text:             #f5f5f7;
        --text-secondary:   #a1a1a6;
        --text-tertiary:    #86868b;

        --accent:           #2997ff;
        --accent-hover:     #47a6ff;
        --accent-text:      #ffffff;
        --separator:        rgba(255, 255, 255, 0.12);
        --separator-strong: rgba(255, 255, 255, 0.24);
        --fill:             rgba(255, 255, 255, 0.06);
        --fill-hover:       rgba(255, 255, 255, 0.11);

        --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md:  0 2px 8px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.45);
        --shadow-lg:  0 4px 16px rgba(0, 0, 0, 0.5), 0 40px 90px rgba(0, 0, 0, 0.65);

        --aurora-1: rgba(0, 113, 227, 0.32);
        --aurora-2: rgba(140, 90, 255, 0.24);
        --aurora-3: rgba(0, 190, 220, 0.20);

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg:               #000000;
    --bg-alt:           #0a0a0c;
    --surface:          #151517;
    --surface-sunken:   #1d1d1f;

    --material:         rgba(20, 20, 22, 0.72);
    --material-thick:   rgba(28, 28, 30, 0.88);
    --material-edge:    rgba(255, 255, 255, 0.10);

    --text:             #f5f5f7;
    --text-secondary:   #a1a1a6;
    --text-tertiary:    #86868b;

    --accent:           #2997ff;
    --accent-hover:     #47a6ff;
    --accent-text:      #ffffff;
    --separator:        rgba(255, 255, 255, 0.12);
    --separator-strong: rgba(255, 255, 255, 0.24);
    --fill:             rgba(255, 255, 255, 0.06);
    --fill-hover:       rgba(255, 255, 255, 0.11);

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:  0 2px 8px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg:  0 4px 16px rgba(0, 0, 0, 0.5), 0 40px 90px rgba(0, 0, 0, 0.65);

    --aurora-1: rgba(0, 113, 227, 0.32);
    --aurora-2: rgba(140, 90, 255, 0.24);
    --aurora-3: rgba(0, 190, 220, 0.20);

    color-scheme: dark;
}


/* ===================================================================
 * 02. reset & base
 * ------------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
                 system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    line-height: 1.5;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    padding: 0.6rem 1rem;
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

section[data-section] {
    position: relative;
    padding-block: var(--section-y);
}

/* scroll progress — 1:1 with page position, no easing between frames */
.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 150;
    height: 2px;
    pointer-events: none;
}
.scroll-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}


/* ===================================================================
 * 03. typography
 *
 * Tracking is size-specific — large display type tightens as it grows,
 * body sits near zero, small uppercase labels open up. Leading tracks
 * size inversely.
 * ------------------------------------------------------------------- */

.display {
    margin: 0.3em 0 0;
    font-size: clamp(2.75rem, 1.1rem + 7vw, 7rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.032em;
}
.display .line {
    display: block;
    overflow: hidden;      /* hero lines rise out from behind this edge */
    padding-bottom: 0.04em;
}
.display .line > span {
    display: block;
    will-change: transform, opacity;
}
.display .line--muted { color: var(--text-tertiary); }

.section-title {
    margin: 0.4em 0 0;
    font-size: clamp(2rem, 1.1rem + 3.6vw, 3.75rem);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.026em;
    max-width: 22ch;
}
.section-title--big {
    font-size: clamp(2.25rem, 1.1rem + 4.6vw, 4.75rem);
    max-width: 18ch;
    margin-inline: auto;
    text-align: center;
}

.statement {
    margin: 0;
    font-size: clamp(1.75rem, 0.9rem + 3.4vw, 3.5rem);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.024em;
    max-width: 24ch;
}

.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.eyebrow::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--separator);
}
.eyebrow--spaced { margin-top: 3.5rem; }

.lede {
    margin-top: 1.6rem;
    max-width: 44ch;
    font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3125rem);
    line-height: 1.5;
    letter-spacing: -0.004em;
    color: var(--text-secondary);
}
.lede--center {
    margin-inline: auto;
    text-align: center;
    max-width: 40ch;
}

.attention {
    margin: 1.75rem 0 1.5rem;
    font-size: clamp(1.2rem, 1rem + 0.85vw, 1.65rem);
    line-height: 1.38;
    letter-spacing: -0.016em;
    font-weight: 500;
    color: var(--text);
}


/* ===================================================================
 * 04. buttons & controls
 *
 * Press feedback is applied on pointer-down by the spring engine.
 * The transitions here only cover colour, which no gesture interrupts.
 * ------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.7rem;
    border-radius: var(--r-pill);
    font-size: 1rem;
    font-weight: 550;
    letter-spacing: -0.006em;
    white-space: nowrap;
    cursor: pointer;
    will-change: transform;
    transition: background-color 200ms ease, color 200ms ease;
}
.btn--primary {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--plain { background: var(--fill); color: var(--text); }
.btn--plain:hover { background: var(--fill-hover); }
.btn--large { padding: 1.1rem 2.2rem; font-size: 1.0625rem; }

.btn__arrow {
    width: 16px;
    height: 16px;
    transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1);
}
.btn:hover .btn__arrow { transform: translateX(3px); }

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-pill);
    color: var(--text);
    background: transparent;
    will-change: transform;
    transition: background-color 200ms ease, opacity 200ms ease;
}
.icon-btn:hover { background: var(--fill-hover); }
.icon-btn svg { width: 18px; height: 18px; }


/* ===================================================================
 * 05. header, nav, mobile menu
 *
 * The header is a translucent layer content scrolls under. It gains
 * its material only once something is actually behind it, and its
 * hide-on-scroll offset is spring-driven from JS.
 * ------------------------------------------------------------------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem var(--gutter);
    padding-top: max(0.75rem, env(safe-area-inset-top));
    background: transparent;
    will-change: transform;
    transition: background-color 300ms ease, box-shadow 300ms ease;
}
.site-header.is-scrolled {
    background: var(--material);
    -webkit-backdrop-filter: blur(var(--material-blur)) saturate(180%);
    backdrop-filter: blur(var(--material-blur)) saturate(180%);
    box-shadow: 0 1px 0 var(--separator);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: opacity 200ms ease;
}
.wordmark:hover { opacity: 0.65; }
.wordmark__glyph {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 650;
}
@media (max-width: 480px) {
    .wordmark__text { display: none; }
}

/* the interactive layer sits on the structural one — lighter material,
   never light-translucent stacked on light-translucent */
.nav-pill {
    position: relative;
    display: none;
    padding: 0.3rem;
    border-radius: var(--r-pill);
    background: var(--material-thick);
    -webkit-backdrop-filter: blur(var(--material-blur)) saturate(180%);
    backdrop-filter: blur(var(--material-blur)) saturate(180%);
    border: 1px solid var(--material-edge);
    box-shadow: var(--shadow-sm);
}
@media (min-width: 861px) { .nav-pill { display: block; } }

.nav-pill ul { position: relative; z-index: 1; display: flex; gap: 0.1rem; }
.nav-pill a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: var(--r-pill);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text-secondary);
    transition: color 220ms ease;
}
.nav-pill a:hover { color: var(--text); }
.nav-pill a.is-current { color: var(--text); font-weight: 550; }

.nav-pill__indicator {
    position: absolute;
    top: 0.3rem;
    left: 0;
    height: calc(100% - 0.6rem);
    border-radius: var(--r-pill);
    background: var(--fill-hover);
    opacity: 0;
    pointer-events: none;
    will-change: transform, width;
}

.header-actions { display: flex; align-items: center; gap: 0.25rem; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.menu-toggle { display: grid; }
@media (min-width: 861px) { .menu-toggle { display: none; } }
.menu-toggle__bars { display: block; width: 18px; height: 12px; position: relative; }
.menu-toggle__bars i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.6px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}
.menu-toggle__bars i:first-child { top: 2px; }
.menu-toggle__bars i:last-child  { bottom: 2px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:first-child {
    transform: translateY(3.2px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:last-child {
    transform: translateY(-3.2px) rotate(-45deg);
}

.menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    will-change: opacity;
}
.menu-sheet {
    position: fixed;
    z-index: 95;
    top: calc(env(safe-area-inset-top) + 4rem);
    left: var(--gutter);
    right: var(--gutter);
    padding: 0.75rem;
    border-radius: var(--r-xl);
    background: var(--material-thick);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--material-edge);
    box-shadow: var(--shadow-lg);
    transform-origin: top right;   /* anchored to the button that opened it */
    will-change: transform, opacity;
}
.menu-sheet a {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: var(--r-md);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: background-color 160ms ease;
}
.menu-sheet a:active { background: var(--fill-hover); }
.menu-sheet__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--separator);
}
.menu-sheet__social a { font-size: 0.875rem; color: var(--text-secondary); padding: 0.6rem 0.8rem; }


/* ===================================================================
 * 06. intro — scroll-scrubbed hero
 *
 * The section is tall; its inner layer is sticky. Scroll position
 * drives scale/opacity/offset, so the hero recedes as the next
 * section arrives instead of just scrolling past.
 * ------------------------------------------------------------------- */

.s-intro {
    padding: 0;
    height: 175svh;          /* the scrub runway */
}
.intro-sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    will-change: transform, opacity;
}

/* static wash — never a moving full-viewport background */
.intro-aurora {
    position: absolute;
    inset: -15% -10% auto -10%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    filter: blur(90px);
}
.intro-aurora span { position: absolute; display: block; border-radius: 50%; }
.intro-aurora span:nth-child(1) { width: 46vw; height: 46vw; top: 8%;  left: 2%;   background: var(--aurora-1); }
.intro-aurora span:nth-child(2) { width: 40vw; height: 40vw; top: 28%; right: 4%;  background: var(--aurora-2); }
.intro-aurora span:nth-child(3) { width: 32vw; height: 32vw; top: -4%; left: 40%;  background: var(--aurora-3); }

.intro-inner { position: relative; }

.intro-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }

.intro-social {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin-top: 3rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.intro-social a { position: relative; transition: color 200ms ease; }
.intro-social a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.intro-social a:hover { color: var(--text); }
.intro-social a:hover::after { transform: scaleX(1); }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: clamp(1.5rem, 4vh, 2.5rem);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 200ms ease;
}
.scroll-cue:hover { color: var(--text); }
.scroll-cue__track {
    display: block;
    width: 22px;
    height: 34px;
    border: 1.5px solid currentColor;
    border-radius: var(--r-pill);
    position: relative;
    opacity: 0.55;
}
.scroll-cue__dot {
    position: absolute;
    left: 50%;
    top: 6px;
    width: 3px;
    height: 6px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: currentColor;
    will-change: transform, opacity;
    /* ~1.4s cycle — well clear of the ~0.2Hz band that reads as an
       uncomfortable slow oscillation, and it is a tiny element */
    animation: cue-drop 1.4s cubic-bezier(0.32, 0.72, 0, 1) infinite;
}

@keyframes cue-drop {
    0%        { transform: translateY(0);    opacity: 0; }
    22%       { opacity: 1; }
    72%, 100% { transform: translateY(13px); opacity: 0; }
}


/* ===================================================================
 * 07. statement & stats
 * ------------------------------------------------------------------- */

.s-statement {
    background: var(--bg-alt);
    border-block: 1px solid var(--separator);
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    margin-top: clamp(3.5rem, 8vh, 6rem);
    padding-top: clamp(3rem, 6vh, 4rem);
    border-top: 1px solid var(--separator);
}
@media (min-width: 861px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.stat__num {
    display: block;
    font-size: clamp(2.5rem, 1.5rem + 3vw, 4rem);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;   /* no width jitter while counting */
    color: var(--accent);
}
.stat__label {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--text-secondary);
    max-width: 18ch;
}


/* ===================================================================
 * 08. about
 * ------------------------------------------------------------------- */

.about-grid { display: grid; gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
@media (min-width: 861px) {
    .about-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .about-media { position: sticky; top: 7rem; }
}

.about-photo {
    border-radius: var(--r-2xl);
    overflow: hidden;
    background: var(--surface-sunken);
    box-shadow: var(--shadow-md);
}
.about-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    /* oversized so the parallax offset never exposes an edge */
    scale: 1.12;
    will-change: transform;
}

.about-copy > p:not(.attention) { color: var(--text-secondary); max-width: 60ch; }
.about-copy > p + p { margin-top: 1.15em; }
.about-cta { margin-top: 2.25rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.75rem; }
.chips li {
    padding: 0.6rem 1.15rem;
    border-radius: var(--r-pill);
    background: var(--fill);
    border: 1px solid var(--separator);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.006em;
    transition: background-color 200ms ease, border-color 200ms ease;
}
.chips li:hover { background: var(--fill-hover); border-color: var(--separator-strong); }


/* ===================================================================
 * 09. work carousel
 *
 * The viewport keeps touch-action: pan-y so vertical page scrolling
 * stays native; JS owns only the horizontal axis. The track is moved
 * by a spring, so a flick, a snap and a mid-flight grab are all the
 * same continuous motion.
 * ------------------------------------------------------------------- */

.s-work { overflow: hidden; }
.work-head { margin-bottom: clamp(2.5rem, 6vh, 4rem); }

.work-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
}
.work-hint svg { width: 16px; height: 16px; }

.carousel__viewport {
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;          /* browser keeps vertical, we take horizontal */
    -webkit-user-select: none;
    user-select: none;
}
.carousel__viewport:focus-visible { outline-offset: -2px; }
.carousel.is-dragging .carousel__viewport { cursor: grabbing; }

.carousel__track {
    display: flex;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    /* 100% (the viewport element's content width), not 100vw — vw
       includes the scrollbar, which would offset the first card from
       the .wrap text above it by the scrollbar's width. */
    padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
    will-change: transform;
}

.pcard {
    position: relative;
    flex: 0 0 auto;
    width: min(82vw, 30rem);
    border-radius: var(--r-2xl);
    background: var(--surface);
    border: 1px solid var(--separator);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    will-change: transform;
    transition: box-shadow 320ms cubic-bezier(0.32, 0.72, 0, 1),
                border-color 320ms ease;
}
@media (min-width: 741px) { .pcard { width: 27rem; } }
.pcard:hover { box-shadow: var(--shadow-md); border-color: var(--separator-strong); }

.pcard__open { display: block; width: 100%; text-align: left; }

.pcard__media { display: block; overflow: hidden; background: var(--surface-sunken); }
.pcard__media img {
    width: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
    pointer-events: none;      /* never let the browser drag-ghost the image */
    will-change: transform;
}

.pcard__body { display: block; padding: 1.5rem 1.6rem 1.75rem; }
.pcard__cat {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.pcard__title {
    display: block;
    margin-top: 0.45rem;
    font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.7rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.02em;
}
.pcard__tags {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.pcard__link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-pill);
    color: var(--text);
    background: var(--material-thick);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--material-edge);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 260ms ease, transform 260ms cubic-bezier(0.32, 0.72, 0, 1);
}
.pcard:hover .pcard__link,
.pcard__link:focus-visible { opacity: 1; transform: scale(1); }
.pcard__link svg { width: 16px; height: 16px; }
@media (hover: none) { .pcard__link { opacity: 1; transform: none; } }

.carousel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: clamp(2rem, 4vh, 3rem);
}
.carousel__bar {
    flex: 1;
    max-width: 22rem;
    height: 3px;
    border-radius: var(--r-pill);
    background: var(--separator);
    overflow: hidden;
}
.carousel__bar span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: var(--r-pill);
    background: var(--text);
    transform-origin: left center;
    will-change: transform;
}
.carousel__nav { display: flex; gap: 0.5rem; }
.carousel__btn {
    background: var(--fill);
    border: 1px solid var(--separator);
}
.carousel__btn:hover { background: var(--fill-hover); }
.carousel__btn[disabled] { opacity: 0.32; cursor: default; }
.carousel__btn[disabled]:hover { background: var(--fill); }
.carousel__btn svg { width: 16px; height: 16px; }


/* ===================================================================
 * 10. journey timeline
 * ------------------------------------------------------------------- */

.timeline-grid {
    display: grid;
    gap: clamp(3rem, 6vw, 5rem);
    margin-top: clamp(3rem, 7vh, 5rem);
}
@media (min-width: 861px) { .timeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.timeline-col { position: relative; padding-left: 1.75rem; }
.timeline-col__head {
    margin: 0 0 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* the spine fills as the column scrolls through the viewport */
.spine {
    position: absolute;
    left: 4px;
    top: 3.1rem;
    bottom: 0.5rem;
    width: 1px;
    background: var(--separator);
}
.spine span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top center;
    will-change: transform;
}

.entry { position: relative; }
.entry + .entry { margin-top: 2.5rem; }
.entry::before {
    content: "";
    position: absolute;
    left: -1.75rem;
    top: 0.5rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}
.entry__head { margin-bottom: 1rem; }
.entry__title { margin: 0; font-size: 1.3rem; font-weight: 600; line-height: 1.22; letter-spacing: -0.016em; }
.entry__meta { margin: 0.25rem 0 0; font-size: 0.9375rem; font-weight: 500; color: var(--text-secondary); }
.entry__when { margin: 0.15rem 0 0; font-size: 0.8125rem; letter-spacing: 0.01em; color: var(--text-tertiary); }
.entry p, .entry__list { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.6; }

/* sub-headings inside an entry — same small-caps language as .eyebrow,
   one step quieter so they read as a level below the entry title */
.entry__label {
    margin: 1.5rem 0 0.6rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.entry__strong { color: var(--text); font-weight: 600; }

.entry__courses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.entry__courses li {
    padding: 0.35rem 0.8rem;
    border-radius: var(--r-pill);
    background: var(--fill);
    border: 1px solid var(--separator);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-secondary);
    transition: background-color 200ms ease, border-color 200ms ease;
}
.entry__courses li:hover {
    background: var(--fill-hover);
    border-color: var(--separator-strong);
}
.entry__list li { position: relative; padding-left: 1.1rem; }
.entry__list li + li { margin-top: 0.6rem; }
.entry__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--separator-strong);
}


/* ===================================================================
 * 11. contact & footer
 * ------------------------------------------------------------------- */

.s-contact { text-align: center; }
.s-contact .eyebrow { justify-content: center; }
.s-contact .eyebrow::after { display: none; }
.s-contact .eyebrow::before {
    content: "";
    flex: 0 0 2.5rem;
    height: 1px;
    background: var(--separator);
}

.contact-cta { margin-top: 2.75rem; }

.contact-grid {
    display: grid;
    gap: clamp(2rem, 4vw, 3rem);
    margin-top: clamp(4rem, 9vh, 6rem);
    padding-top: clamp(3rem, 6vh, 4rem);
    border-top: 1px solid var(--separator);
    text-align: left;
}
@media (min-width: 741px) { .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.contact-block__label {
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
    letter-spacing: -0.01em;
}
.contact-links a { position: relative; transition: color 200ms ease; }
.contact-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.contact-links a:hover { color: var(--accent); }
.contact-links a:hover::after { transform: scaleX(1); }

.site-footer {
    padding-block: 2.5rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--separator);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.site-footer a { transition: color 200ms ease; }
.site-footer a:hover { color: var(--text); }


/* ===================================================================
 * 12. project sheet
 *
 * A modal task: dimming scrim plus a surface that materialises —
 * blur and scale animate together, so it reads as a real material
 * arriving rather than an opacity fade. Position is spring-driven and
 * draggable, so no CSS transition touches its transform.
 * ------------------------------------------------------------------- */

.detail-sources { display: none; }

.sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    will-change: opacity;
}

.sheet {
    position: fixed;
    z-index: 130;
    left: 0; right: 0; bottom: 0;
    max-height: 92svh;
    display: flex;
    flex-direction: column;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    background: var(--material-thick);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--material-edge);
    border-bottom: 0;
    box-shadow: var(--shadow-lg);
    overscroll-behavior: contain;
    will-change: transform, opacity;
}
@media (min-width: 741px) {
    .sheet {
        left: 50%; right: auto; bottom: auto; top: 50%;
        width: min(46rem, calc(100vw - 3rem));
        max-height: min(86svh, 52rem);
        border-radius: var(--r-2xl);
        border-bottom: 1px solid var(--material-edge);
    }
}

/* the handle owns the vertical gesture; the scroller keeps native
   pan-y, so the sheet and the browser never contend for one touch */
.sheet__handle {
    flex: none;
    display: grid;
    place-items: center;
    height: 26px;
    cursor: grab;
    touch-action: none;
}
.sheet__handle:active { cursor: grabbing; }
.sheet__handle span {
    display: block;
    width: 36px;
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--separator-strong);
}

.sheet__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    width: 32px;
    height: 32px;
    background: var(--fill);
}
.sheet__close:hover { background: var(--fill-hover); }
.sheet__close svg { width: 14px; height: 14px; }

.sheet__scroller {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.sheet__content img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-top: 0.85rem;
}

.detail__body { padding: 1.85rem clamp(1.35rem, 4vw, 2.5rem) 0.5rem; }
.detail__cat {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.detail__title {
    margin: 0.45rem 0 1rem;
    font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.022em;
}
.detail__body > p { color: var(--text-secondary); max-width: 60ch; line-height: 1.6; }
.detail__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.detail__tags li {
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-pill);
    background: var(--fill);
    border: 1px solid var(--separator);
    font-size: 0.8125rem;
    font-weight: 500;
}


/* ===================================================================
 * 13. scroll-driven primitives
 *
 * Initial states are gated behind .js so a no-JS visitor gets the
 * whole page, fully visible, with nothing to undo.
 * ------------------------------------------------------------------- */

.js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    will-change: transform, opacity;
}
.js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition: opacity 720ms cubic-bezier(0.32, 0.72, 0, 1),
                transform 720ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* word-by-word: each word is its own scrubbed layer */
.word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}
.word > span {
    display: inline-block;
    will-change: transform, opacity;
}
.js [data-words] .word > span { opacity: 0.12; }

.js [data-hero-el] { opacity: 0; will-change: transform, opacity; }


/* ===================================================================
 * 14. accessibility tiers
 *
 * Reduced motion is a gentler equivalent, not an absence of feedback:
 * travel, scale and parallax go; opacity and colour, which carry
 * meaning, stay.
 * ------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    /* the hero runway collapses — nothing left to scrub */
    .s-intro { height: auto; }
    .intro-sticky { position: static; height: auto; min-height: 100svh; }

    .js [data-reveal] { transform: none; transition: opacity 220ms ease; }
    .js [data-hero-el] { opacity: 1; }
    .js [data-words] .word > span { opacity: 1; }
    .about-photo img { scale: 1; }

    .sheet, .sheet-scrim, .menu-sheet, .menu-scrim { transition: opacity 200ms ease; }

    .btn:hover .btn__arrow { transform: none; }
    .intro-social a::after, .contact-links a::after { transition: none; }
    .menu-toggle__bars i { transition: none; }
    .scroll-cue__dot { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header.is-scrolled,
    .nav-pill,
    .menu-sheet,
    .sheet,
    .pcard__link {
        background: var(--surface);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .sheet-scrim, .menu-scrim {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.65);
    }
    .intro-aurora { display: none; }
}

@media (prefers-contrast: more) {
    :root {
        --text-secondary: #3a3a3c;
        --text-tertiary: #4a4a4e;
        --separator: rgba(0, 0, 0, 0.35);
        --separator-strong: rgba(0, 0, 0, 0.55);
    }
    :root[data-theme="dark"] {
        --text-secondary: #e2e2e6;
        --text-tertiary: #c9c9ce;
        --separator: rgba(255, 255, 255, 0.4);
        --separator-strong: rgba(255, 255, 255, 0.6);
    }
    .nav-pill, .menu-sheet, .sheet, .pcard, .chips li, .detail__tags li {
        border-color: var(--separator-strong);
    }
    .intro-aurora { display: none; }
}

@media print {
    .site-header, .scroll-cue, .scroll-progress, .sheet, .sheet-scrim,
    .menu-sheet, .menu-scrim, .intro-aurora, .carousel__foot { display: none !important; }
    .s-intro { height: auto; }
    .intro-sticky { position: static; height: auto; }
    .js [data-reveal], .js [data-hero-el] { opacity: 1 !important; transform: none !important; }
    .js [data-words] .word > span { opacity: 1 !important; }
    .carousel__viewport { overflow: visible; }
    .carousel__track { flex-wrap: wrap; transform: none !important; }
    body { background: #fff; color: #000; }
}
