/* Mobile first: base rules target phones; wider layouts are added
   with min-width queries at 720px and 960px. */

/* ========================
   TOKENS & RESET
   ======================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #FAF9F5;
    --fg: #141413;
    --fg-hover: #3D3D3A;
    --muted: #5E5D59;
    --line: #1414131A;
    --line-strong: #14141333;
    --soft: #F0EEE6;
    --accent: #D97757;
    --radius: 8px;
    --radius-lg: 16px;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --wrap: 1160px;
    --gutter: 20px;
    --nav-h: 60px;
    color-scheme: light;
}

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
nav,
.btn,
.stats {
    font-family: var(--sans);
}

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

img {
    height: auto;
}

a {
    color: inherit;
}

ul,
ol {
    list-style: none;
}

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

.mono {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ========================
   NAV
   ======================== */
#navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

#navbar.scrolled,
#navbar.open {
    border-bottom-color: var(--line);
}

#navbar.open {
    background: var(--bg);
}

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

.nav-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

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

/* Menu panel — opened by the toggle on small screens */
.nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    padding: 4px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

#navbar.open .nav-links {
    display: block;
}

.nav-links a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: inherit;
    cursor: pointer;
}

.js .nav-toggle {
    display: inline-flex;
}

.nav-toggle span {
    width: 18px;
    height: 1.5px;
    background: var(--fg);
    transition: transform 0.2s ease;
}

#navbar.open .nav-toggle span:first-child {
    transform: translateY(3.75px) rotate(45deg);
}

#navbar.open .nav-toggle span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
}

.lang-switch {
    display: flex;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.lang-switch a,
.lang-switch span {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--muted);
}

.lang-switch [aria-current="true"] {
    background: var(--fg);
    color: var(--bg);
}

/* ========================
   HERO
   ======================== */
#hero {
    padding: calc(var(--nav-h) + 28px) 0 56px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.hero-photo {
    order: -1;
    width: min(56vw, 240px);
}

.hero-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: var(--soft);
    border-radius: var(--radius-lg);
}

.eyebrow {
    color: var(--muted);
    margin-bottom: 16px;
}

h1 {
    font-size: clamp(52px, 15vw, 84px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}

.hero-roles {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line-strong);
    line-height: 1.9;
}

.hero-roles span {
    color: var(--accent);
    padding: 0 6px;
}

.hero-lead {
    margin-top: 20px;
    max-width: 34em;
    font-size: 18px;
    line-height: 1.5;
}

.hero-cta {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid var(--fg);
    border-radius: var(--radius);
    background: var(--fg);
    color: var(--bg);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost {
    background: transparent;
    color: var(--fg);
}

/* ========================
   SECTIONS
   ======================== */
.section {
    border-top: 1px solid var(--line);
    padding: 56px 0;
}

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

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

.section-label b {
    color: var(--fg);
    font-weight: 400;
    margin-right: 10px;
}

h2 {
    font-size: clamp(30px, 8vw, 40px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 18em;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.lead {
    margin-top: 20px;
    max-width: 38em;
    color: var(--muted);
}

.lead + .lead {
    margin-top: 14px;
}

.sub-label {
    margin-top: 48px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-strong);
}

/* Numbered rows */
.rows li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}

.rows .num {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.rows p {
    grid-column: 2;
    color: var(--muted);
}

/* Stats */
.stats {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat {
    padding: 20px 16px 24px;
    background: var(--soft);
    border-radius: var(--radius-lg);
}

.stat-value {
    font-size: clamp(44px, 12vw, 76px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-label {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

/* "Coming soon" note for sections that fill in over time */
.soon {
    margin-top: 24px;
    padding: 20px;
    background: var(--soft);
    border-radius: var(--radius-lg);
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.soon .mono {
    color: var(--fg);
}

.soon .mono::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--accent);
}

/* Clients */
.clients {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 24px;
}

.clients h3 {
    margin-bottom: 10px;
}

.clients li {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 2;
    color: var(--muted);
}

/* Cards (case studies) */
.cards {
    margin-top: 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.card {
    background: var(--soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card .mono,
.card dd,
.card p {
    color: var(--muted);
}

.card dl {
    display: grid;
    gap: 12px;
    font-size: 15px;
}

.card dt {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Talks */
.talks {
    margin-top: 36px;
    border-top: 1px solid var(--line-strong);
}

.talk {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.talk img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--soft);
    border-radius: var(--radius);
}

.talk .mono {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.talk-arrow {
    display: none;
    font-size: 22px;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Hobbies — playful cards: emoji, name, one-line tag */
.hobbies {
    margin-top: 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.hobbies li {
    padding: 20px;
    background: var(--soft);
    border-radius: var(--radius-lg);
}

.hobby-icon {
    display: block;
    margin-bottom: 14px;
    font-size: 30px;
    line-height: 1;
}

.hobby-tag {
    margin-top: 4px;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

/* ========================
   SUBPAGES
   ======================== */
.page-head {
    padding: calc(var(--nav-h) + 32px) 0 56px;
}

.page-head h1 {
    font-size: clamp(40px, 11vw, 88px);
}

.page-head .eyebrow a {
    text-decoration: none;
}

.page-intro {
    margin-top: 24px;
    max-width: 44em;
    font-size: 18px;
    line-height: 1.55;
}

.page-updated {
    margin-top: 20px;
    color: var(--muted);
}

h2.section-label {
    max-width: none;
    font-weight: 400;
    line-height: 1.6;
}

/* Small disclaimer above a list */
.note {
    padding: 14px 0;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.links {
    border-top: 1px solid var(--line-strong);
}

.links li {
    display: grid;
    gap: 8px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.links .mono,
.links p {
    color: var(--muted);
}

.links a {
    text-decoration: none;
}

.links h3 a span {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* In-page video player: thumbnail first, YouTube iframe on click */
.video {
    position: relative;
    display: block;
    max-width: 720px;
    margin: 6px 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--soft);
}

.video img,
.video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--fg);
    transition: background 0.2s ease, transform 0.2s ease;
}

.video-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent var(--bg);
}

/* Lists that follow a sub-label reuse its rule as their top line */
.sub-label + .talks,
.sub-label + .links {
    margin-top: 0;
    border-top: 0;
}

.sub-label + .hobbies {
    margin-top: 24px;
}

/* First block of a section column lines up with the section label */
.section-grid > div > :first-child {
    margin-top: 0;
}

.section-grid > div > .clients:first-child {
    padding-top: 0;
}

/* "See more" links between pages */
.more {
    display: inline-flex;
    gap: 8px;
    margin-top: 28px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.more span {
    transition: transform 0.2s ease, color 0.2s ease;
}

.card .more {
    align-self: flex-start;
    margin-top: auto;
}

.card {
    min-height: 100%;
}

/* ========================
   CONNECT & FOOTER
   ======================== */
.cta h2 {
    font-size: clamp(44px, 13vw, 72px);
    letter-spacing: -0.03em;
    line-height: 1;
}

footer {
    border-top: 1px solid var(--line);
    padding: 20px 0 32px;
    color: var(--muted);
}

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

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

.footer-inner a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
}

/* ========================
   HOVER (pointer devices only)
   ======================== */
@media (hover: hover) {
    .nav-links a:hover,
    .lang-switch a:hover,
    .footer-inner a:hover {
        color: var(--fg);
    }

    .btn:hover {
        background: var(--fg-hover);
        border-color: var(--fg-hover);
    }

    .btn-ghost:hover {
        background: var(--fg);
        border-color: var(--fg);
        color: var(--bg);
    }

    .more:hover {
        border-bottom-color: var(--fg);
    }

    .more:hover span {
        transform: translateX(3px);
        color: var(--accent);
    }

    .video:hover .video-play {
        background: var(--accent);
        transform: translate(-50%, -50%) scale(1.06);
    }

    .links a:not(.video):hover {
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    .links h3 a:hover span {
        transform: translate(3px, -3px);
        color: var(--accent);
    }

    .talk:hover .talk-arrow {
        transform: translate(3px, -3px);
        color: var(--accent);
    }
}

/* ========================
   REVEAL
   ======================== */
.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

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

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

/* ========================
   TABLET — 720px and up
   ======================== */
@media (min-width: 720px) {
    :root {
        --gutter: 32px;
        --nav-h: 64px;
    }

    body {
        font-size: 17px;
    }

    #hero {
        padding: calc(var(--nav-h) + 64px) 0 88px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
        gap: clamp(32px, 6vw, 80px);
        align-items: end;
    }

    .hero-photo {
        order: 0;
        width: auto;
    }

    h1 {
        font-size: clamp(72px, 10vw, 136px);
    }

    .eyebrow {
        margin-bottom: 24px;
    }

    .hero-roles {
        margin-top: 32px;
        padding-top: 20px;
    }

    .hero-lead {
        margin-top: 24px;
        font-size: clamp(18px, 1.6vw, 21px);
    }

    .section {
        padding: clamp(72px, 8vw, 112px) 0;
    }

    h2 {
        font-size: clamp(36px, 4.2vw, 52px);
    }

    h3 {
        font-size: 19px;
    }

    .sub-label {
        margin-top: 64px;
    }

    .rows li {
        grid-template-columns: 56px minmax(0, 15em) minmax(0, 1fr);
        gap: 16px 32px;
        padding: 22px 0;
    }

    .rows p {
        grid-column: auto;
    }

    .stats,
    .cards,
    .talks,
    .hobbies {
        margin-top: 48px;
    }

    .stat {
        padding: 28px 20px 32px;
    }

    .stat-value {
        font-size: clamp(44px, 6vw, 76px);
    }

    .clients {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px;
    }

    .talk {
        grid-template-columns: 200px minmax(0, 1fr) auto;
        gap: 28px;
        padding: 20px 0;
    }

    .talk-arrow {
        display: block;
    }

    .hobbies {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cta h2 {
        font-size: clamp(72px, 8vw, 104px);
    }

    .page-head {
        padding: calc(var(--nav-h) + 64px) 0 80px;
    }

    .page-intro {
        font-size: 20px;
    }

    .cards.cards-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========================
   DESKTOP — 960px and up
   ======================== */
@media (min-width: 960px) {
    :root {
        --gutter: 48px;
    }

    .section-grid {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: clamp(32px, 4vw, 64px);
    }

    .section-label {
        position: sticky;
        top: calc(var(--nav-h) + 24px);
        align-self: start;
    }

    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

/* ========================
   DESKTOP NAV — 960px and up
   ======================== */
@media (min-width: 960px) {
    .js .nav-toggle {
        display: none;
    }

    .nav-links,
    #navbar.open .nav-links {
        display: flex;
        position: static;
        gap: 28px;
        max-height: none;
        overflow: visible;
        padding: 0;
        background: none;
        border: 0;
    }

    .nav-links a {
        padding: 0;
        border: 0;
        font-size: 14px;
        font-weight: 400;
        letter-spacing: 0;
        color: var(--muted);
        transition: color 0.15s ease;
    }

    .nav-links a.active {
        color: var(--fg);
    }

    .lang-switch a,
    .lang-switch span {
        height: 30px;
        padding: 0 10px;
    }
}

@media (min-width: 1100px) {
    .hobbies {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
