/* ==========================================================================
   victorsalomon.in — design system (2026 redesign)
   Tokens → base → layout → components → nav → footer → motion
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/instrument-serif-italic-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/instrument-serif-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/instrument-serif-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/instrument-serif-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(/assets/fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(/assets/fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(/assets/fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(/assets/fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ---------- Tokens ---------- */
:root {
    color-scheme: light;

    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --ink: #111318;
    --muted: #5B6270;
    --line: #E6E4DE;
    --accent: #2F5BFF;
    --accent-ink: #FFFFFF;
    --accent-soft: #E8EEFF;
    --accent-strong: #2449E0;   /* accent text on --accent-soft (AA 5.8:1) */
    --nav-bg: rgba(250, 250, 247, 0.86);

    --shadow-sm: 0 1px 2px rgba(17, 19, 24, 0.04), 0 2px 6px rgba(17, 19, 24, 0.04);
    --shadow-md: 0 2px 4px rgba(17, 19, 24, 0.04), 0 12px 32px -8px rgba(17, 19, 24, 0.12);

    --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --fs-h1: clamp(2.5rem, 6vw, 4.5rem);
    --fs-h2: clamp(1.8rem, 3.5vw, 2.75rem);
    --fs-h3: 1.25rem;
    --fs-body: 1.0625rem;
    --fs-small: 0.875rem;
    --fs-eyebrow: 0.8125rem;

    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --section-y: clamp(64px, 10vw, 128px);
    --nav-h: 68px;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0E1014;
        --surface: #161A21;
        --ink: #F2F3F5;
        --muted: #A2AAB6;
        --line: #262C36;
        --accent: #6E8BFF;
        --accent-ink: #0E1014;
        --accent-soft: #1B2340;
        --accent-strong: #6E8BFF;
        --nav-bg: rgba(14, 16, 20, 0.82);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0E1014;
    --surface: #161A21;
    --ink: #F2F3F5;
    --muted: #A2AAB6;
    --line: #262C36;
    --accent: #6E8BFF;
    --accent-ink: #0E1014;
    --accent-soft: #1B2340;
    --accent-strong: #6E8BFF;
    --nav-bg: rgba(14, 16, 20, 0.82);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

h1, h2 {
    font-family: var(--font-display);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }

h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.005em;
}

p {
    margin: 0 0 1em;
    max-width: 68ch;
}

p:last-child { margin-bottom: 0; }

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img { height: auto; }

button {
    font: inherit;
    color: inherit;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

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

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
}

.section + .section { padding-top: 0; }

.section-tight {
    padding-block: clamp(16px, 3vw, 32px);
}

.section-tight + .section { padding-top: clamp(48px, 8vw, 96px); }

.section-header {
    display: grid;
    gap: 12px;
    margin-bottom: clamp(32px, 5vw, 56px);
    max-width: 720px;
}

.section-header p {
    color: var(--muted);
    margin: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.muted { color: var(--muted); }

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
        color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -6px var(--accent);
}

.btn-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.btn-secondary:hover {
    border-color: var(--ink);
}

.btn-ghost {
    min-height: 44px;
    padding-inline: 4px;
    color: var(--ink);
}

.btn-ghost .arrow { transition: transform 0.2s var(--ease); }
.btn-ghost:hover .arrow { transform: translateX(4px); }

.btn-sm {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ---------- Chips ---------- */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.chip-neutral {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
        border-color 0.25s var(--ease);
}

.card-body {
    display: grid;
    gap: 10px;
    padding: 24px;
}

.card-interactive:hover,
.card-interactive:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Whole-card link: the title's link stretches over the card */
.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card-link {
    text-decoration: none;
}

.card-link:focus-visible {
    outline: none;
}

.card:has(.card-link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---------- Icon button ---------- */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.icon-btn:hover {
    color: var(--ink);
    background: var(--accent-soft);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Theme toggle shows the icon for the theme you'd switch to */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

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

/* ---------- Navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    border-bottom: 1px solid transparent;
    background: transparent;
    transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
        box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
    background: var(--bg);
    border-bottom-color: var(--line);
    box-shadow: var(--shadow-sm);
}

/* Blur only on desktop: backdrop-filter would trap the fixed mobile sheet inside the header */
@media (min-width: 1024px) {
    .site-header.is-scrolled {
        background: var(--nav-bg);
        -webkit-backdrop-filter: saturate(160%) blur(12px);
        backdrop-filter: saturate(160%) blur(12px);
    }
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.monogram {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-size: 1.125rem;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-links a:hover { color: var(--ink); }

.nav-links a[aria-current="true"],
.nav-links a[aria-current="page"] {
    color: var(--ink);
    background: var(--accent-soft);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-actions .btn { margin-left: 8px; }

.nav-toggle,
.nav-resume-mobile {
    display: none;
}

.nav-sheet { display: contents; }
.nav-sheet-head { display: none; }

@media (max-width: 1023px) {
    .nav-desktop-only { display: none; }

    .nav-resume-mobile,
    .nav-toggle {
        display: inline-flex;
    }

    .nav-mobile-bar {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .nav-toggle { color: var(--ink); }

    .nav-sheet {
        position: fixed;
        inset: 0;
        z-index: 150;
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 16px var(--gutter) 32px;
        background: var(--bg);
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
    }

    .nav-sheet.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s;
    }

    .nav-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: calc(var(--nav-h) - 16px);
    }

    .nav-sheet .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--line);
    }

    .nav { gap: 8px; }

    .nav-mobile-bar .btn { padding-inline: 14px; }

    .nav-sheet .nav-links a {
        display: flex;
        justify-content: space-between;
        min-height: 60px;
        padding: 0 4px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        color: var(--ink);
        font-family: var(--font-display);
        font-size: 2rem;
    }

    .nav-sheet .nav-links a[aria-current] {
        background: transparent;
        color: var(--accent);
    }

    .nav-sheet .nav-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-sheet .nav-actions .btn {
        order: -1;
        width: 100%;
        margin: 0 0 8px;
    }

    body.nav-open { overflow: hidden; }
}

/* Very narrow phones: keep the monogram, drop the name so Resume + menu fit */
@media (max-width: 359px) {
    .wordmark-name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

@media (min-width: 1024px) {
    .nav-mobile-bar { display: none; }

    .nav-sheet {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: space-between;
        gap: 24px;
        margin-left: 24px;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding-block: 32px;
    color: var(--muted);
    font-size: var(--fs-small);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Motion ---------- */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Without JS, never hide content */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

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

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---------- 404 ---------- */
.not-found {
    display: grid;
    place-items: start;
    gap: 20px;
    min-height: calc(100vh - var(--nav-h) - 100px);
    align-content: center;
}

.not-found .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   Homepage sections
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
    padding-block: clamp(40px, 8vw, 112px) clamp(40px, 6vw, 72px);
}

.hero-grid {
    display: grid;
    gap: 28px;
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: 22px;
    justify-items: start;
}

.hero h1 {
    max-width: 16ch;
}

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

.hero-sub {
    margin: 0;
    max-width: 58ch;
    color: var(--muted);
    font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 6px;
}

.portrait {
    position: relative;
    width: calc(100% - 14px);
    max-width: 440px;
    margin: 8px 0 0;
    justify-self: start;
}

/* Offset accent block behind the photo */
.portrait::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--accent) 45%, transparent) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
        var(--accent-soft);
    transform: translate(14px, 14px);
}

.portrait picture,
.portrait img {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 24px;
}

.portrait img {
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 50% 18%;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

.portrait-tag {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.portrait-tag .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        gap: clamp(40px, 6vw, 88px);
    }

    .portrait {
        width: calc(100% - 14px);
        margin: 0 14px 0 0;
        justify-self: end;
    }

    .portrait img { aspect-ratio: 4 / 5; }
}

/* ---------- Results strip ---------- */
.results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.result {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: clamp(18px, 3vw, 28px);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.result:nth-child(2n) { border-right: 0; }
.result:nth-child(n + 3) { border-bottom: 0; }

.result-value {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.result-value .to {
    color: var(--accent);
}

.result-label {
    color: var(--muted);
    font-size: var(--fs-small);
    line-height: 1.45;
}

@media (min-width: 1024px) {
    .results { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .result { border-bottom: 0; }
    .result:nth-child(2n) { border-right: 1px solid var(--line); }
    .result:last-child { border-right: 0; }
}

/* ---------- Where I work (intersection visual) ---------- */
.where {
    display: grid;
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

@media (min-width: 900px) {
    .where { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.where-figure {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.where-figure svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.where-ring {
    fill: none;
    stroke: var(--line);
    stroke-width: 1.5;
}

.where-spoke {
    fill: none;
    stroke: var(--line);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke 0.25s var(--ease);
}

.where-spoke.is-active {
    stroke: var(--accent);
}

.where-ring,
.where-spoke {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.js .where-figure:not(.is-visible) .where-ring,
.js .where-figure:not(.is-visible) .where-spoke {
    stroke-dashoffset: 1;
}

.where-figure.is-visible .where-ring,
.where-figure.is-visible .where-spoke {
    transition: stroke-dashoffset 1s var(--ease), stroke 0.25s var(--ease);
}

.where-figure.is-visible .where-spoke { transition-delay: 0.35s, 0s; }

.where-core {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 30%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 2.4vw, 1.35rem);
    line-height: 1.1;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 10px var(--accent-soft);
}

.where-node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: clamp(0.8125rem, 1.6vw, 0.9375rem);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
        border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.where-node:hover {
    border-color: var(--accent);
}

.where-node[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    transform: translate(-50%, -50%) scale(1.04);
}

@media (max-width: 479px) {
    .where-node {
        padding: 6px 12px;
        white-space: normal;
        text-align: center;
        max-width: 108px;
    }
}

.where-panel {
    display: grid;
    gap: 14px;
    min-height: 220px;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.where-panel h3 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 400;
    line-height: 1.1;
}

.where-panel .what {
    margin: 0;
    font-size: 1.125rem;
}

.where-proof {
    display: grid;
    gap: 4px;
    margin: 4px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.where-proof dt {
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.where-proof dd {
    margin: 0;
    color: var(--muted);
}

.where-hint {
    margin: 0;
    font-size: var(--fs-small);
    color: var(--muted);
}

/* ---------- Featured case studies ---------- */
.case-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .case-grid > :first-child { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
    .case-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .case-grid > :first-child { grid-column: auto; }
}

.case-cover {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
}

.case-cover svg {
    width: 100%;
    height: 100%;
}

.case-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    font-size: var(--fs-small);
    color: var(--muted);
}

.case-meta img {
    height: 22px;
    width: auto;
}

.case-outcome {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--accent-strong);
}

.card-cta {
    margin-top: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.card-cta .arrow {
    display: inline-block;
    transition: transform 0.2s var(--ease);
}

.card-interactive:hover .card-cta .arrow { transform: translateX(4px); }

/* Logo shown per theme */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

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

/* ---------- Experience timeline ---------- */
.timeline {
    position: relative;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tl-item {
    position: relative;
    display: grid;
    gap: 6px 32px;
    padding: 0 0 36px 32px;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: -10px;
    width: 2px;
    background: var(--line);
}

.tl-item:last-child::before { display: none; }

.tl-item::after {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
}

.tl-item:first-child::after { background: var(--accent); }

.tl-dates {
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.tl-body {
    display: grid;
    gap: 6px;
}

.tl-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-tile {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #FFFFFF;
    overflow: hidden;
}

.logo-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-tile.is-padded img {
    width: 70%;
    height: 70%;
}

.logo-tile.is-text {
    background: #14161C;
    border-color: #14161C;
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 1.125rem;
}

.tl-company {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
}

.tl-role {
    color: var(--muted);
    font-size: 0.9375rem;
}

.tl-desc {
    margin: 0;
    font-size: var(--fs-small);
    color: var(--muted);
}

.tl-impact {
    margin: 4px 0 0;
}

.tl-link {
    justify-self: start;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-strong);
}

.tl-link:hover { text-decoration: underline; }

@media (min-width: 768px) {
    .tl-item {
        grid-template-columns: 180px minmax(0, 1fr);
        padding-left: 0;
    }

    .tl-item::before { left: 205px; }
    .tl-item::after { left: 200px; }
    .tl-body { padding-left: 48px; }
    .tl-dates { padding-top: 10px; text-align: right; padding-right: 8px; }
}

/* ---------- Side projects ---------- */
.project-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 640px) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.project-shot {
    position: relative;
    aspect-ratio: 2 / 1;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.project-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
}

.project-card .card-body {
    flex: 1;
    grid-template-rows: auto auto 1fr auto;
}

.project-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 6px;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-strong);
}

.project-links a:hover { text-decoration: underline; }

/* ---------- Toolkit ---------- */
.toolkit {
    display: grid;
    gap: 16px;
}

@media (min-width: 768px) {
    .toolkit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.toolkit-group {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.toolkit-group h3 { font-size: 1rem; }

/* ---------- About ---------- */
.about {
    display: grid;
    gap: clamp(28px, 5vw, 64px);
}

@media (min-width: 900px) {
    .about { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.about-copy p {
    font-size: 1.125rem;
}

.facts {
    display: grid;
    gap: 18px;
    align-content: start;
    margin: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.facts dt {
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.facts dd {
    margin: 4px 0 0;
    font-size: 0.9375rem;
}

/* ---------- Writing list ---------- */
.writing-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.writing-list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 16px;
    align-items: center;
    padding: 18px 4px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background-color 0.2s var(--ease), padding 0.2s var(--ease);
}

.writing-list a:hover {
    background: var(--surface);
    padding-inline: 12px;
}

.writing-title {
    font-weight: 600;
}

.writing-desc {
    grid-column: 1;
    color: var(--muted);
    font-size: var(--fs-small);
}

.writing-source {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: var(--fs-small);
}

.writing-source svg { width: 16px; height: 16px; }

/* ---------- Coaching band ---------- */
.coaching {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: clamp(20px, 3vw, 28px) clamp(20px, 4vw, 36px);
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.coaching p {
    margin: 0;
    max-width: 60ch;
}

.coaching strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
}

/* ---------- Contact ---------- */
.contact {
    display: grid;
    justify-items: center;
    gap: 20px;
    text-align: center;
}

.contact h2,
.contact-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    max-width: 14ch;
}

.contact p {
    color: var(--muted);
    max-width: 52ch;
    margin: 0;
}

.contact .hero-ctas {
    justify-content: center;
}

/* ==========================================================================
   Case-study pages
   ========================================================================== */

.cs-hero {
    padding-block: clamp(32px, 6vw, 80px) clamp(28px, 4vw, 48px);
}

.cs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: var(--fs-small);
    font-weight: 500;
    text-decoration: none;
}

.cs-back:hover { color: var(--ink); }

.cs-hero-head {
    display: grid;
    gap: 18px;
    max-width: 860px;
}

.cs-company {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9375rem;
}

.cs-company strong {
    color: var(--ink);
    font-weight: 600;
}

.cs-hero h1 {
    font-size: clamp(2.25rem, 5.5vw, 4rem);
}

.cs-lede {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
}

.cs-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 4px 0 0;
    font-size: var(--fs-small);
}

.cs-facts div { display: grid; gap: 2px; }

.cs-facts dt {
    color: var(--muted);
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cs-facts dd {
    margin: 0;
    font-weight: 500;
}

.results-3 {
    margin-top: clamp(28px, 4vw, 40px);
}

@media (min-width: 1024px) {
    .results.results-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .results.results-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .results.results-3 .result { border-bottom: 0; border-right: 1px solid var(--line); }
    .results.results-3 .result:last-child { border-right: 0; }
}

@media (max-width: 639px) {
    .results.results-3 { grid-template-columns: 1fr; }
    .results.results-3 .result { border-right: 0; border-bottom: 1px solid var(--line); }
    .results.results-3 .result:last-child { border-bottom: 0; }
}

/* Body */
.cs-body {
    display: grid;
    gap: clamp(40px, 6vw, 64px);
    padding-bottom: var(--section-y);
}

.cs-section {
    display: grid;
    gap: 16px;
    max-width: 760px;
}

.cs-section > h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.cs-section h3 {
    margin-top: 12px;
}

.cs-section > p { margin: 0; }

.cs-section p,
.cs-section li {
    font-size: 1.0625rem;
}

.cs-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-list li {
    position: relative;
    padding-left: 24px;
    max-width: 68ch;
}

.cs-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.7em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.cs-list strong { font-weight: 600; }

.cs-callout {
    margin: 4px 0 0;
    padding: 20px 24px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--accent-soft);
    color: var(--ink);
}

.cs-visual {
    margin: 8px 0 0;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.cs-visual svg {
    width: 100%;
    height: auto;
}

.cs-visual figcaption {
    margin-top: 12px;
    color: var(--muted);
    font-size: var(--fs-small);
}

.cs-shot {
    margin: 8px 0 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Prev / next */
.cs-pager {
    display: grid;
    gap: 16px;
    padding-top: clamp(32px, 5vw, 48px);
    border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
    .cs-pager { grid-template-columns: 1fr 1fr; }
}

.cs-pager a {
    display: grid;
    gap: 4px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cs-pager a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cs-pager .next { text-align: right; }

.cs-pager small {
    color: var(--muted);
    font-size: var(--fs-small);
}

.cs-pager span {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.2;
}

.cs-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: clamp(24px, 4vw, 36px);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--bg);
}

.cs-cta p {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.15;
}

.cs-cta .btn-secondary {
    background: transparent;
    border-color: color-mix(in srgb, var(--bg) 35%, transparent);
    color: var(--bg);
}

.cs-cta .btn-secondary:hover { border-color: var(--bg); }

.cs-cta .hero-ctas { margin: 0; }

/* Before/after comparison bars */
.compare {
    display: grid;
    gap: 14px;
}

.compare-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.compare-label {
    color: var(--muted);
    font-size: var(--fs-small);
    font-weight: 600;
}

.compare-track {
    height: 28px;
    border-radius: var(--radius-pill);
    background: var(--line);
    overflow: hidden;
}

.compare-bar {
    display: block;
    width: var(--w);
    min-width: 8px;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--muted);
}

.compare-bar.is-after { background: var(--accent); }

.compare-value {
    min-width: 3.5ch;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.compare .compare-row:last-of-type .compare-value { color: var(--accent-strong); }

.compare figcaption { margin-top: 0; }
