/* Self-hosted fonts (mirror of Google Fonts subset, latin + latin-ext only).
   Inter Tight and JetBrains Mono are variable fonts: the 14 @font-face blocks
   below all resolve to 4 binaries. Per-weight blocks let the browser pick the
   right variation from the wght axis — do not "simplify" by deleting blocks. */
/* latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/fonts/inter-tight-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;
}
/* latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/inter-tight-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;
}
/* latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/inter-tight-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;
}
/* latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/inter-tight-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;
}
/* latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/inter-tight-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;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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;
}
  :root {
    --bg: #ffffff;
    --fg: #0a0a0a;
    --fg-2: #404040;
    --fg-3: #737373;
    --fg-4: #a3a3a3;
    --rule: #e5e5e5;
    --rule-strong: #d4d4d4;
    --accent: #737373;
    --font-display: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --pad-x: 48px;
    --pad-y: 48px;

    /* Type scale — change these to retune the whole site at once.
       Mono captions (uppercase JetBrains Mono labels): 10/11/12.
       Body (Inter Tight): 13 → 18 (tight to default fluid).
       Headlines: clamp() for fluid scaling. */
    --fs-mono-2xs: 10px;
    --fs-mono-xs:  11px;
    --fs-mono-sm:  12px;

    --fs-body-2xs: clamp(13px, 0.95vw, 15px);   /* timeline desc, c4-tk b */
    --fs-body-xs:  14px;                         /* about-footer v */
    --fs-body-sm:  15px;                         /* hero-meta v, side panel v */
    --fs-body-md:  clamp(15px, 1.15vw, 18px);    /* about-sub, c4-s */
    --fs-body-lg:  clamp(17px, 1.2vw, 20px);     /* prominent body, timeline role */

    --fs-h-md:     clamp(20px, 1.9vw, 26px);     /* email-panel value */
    --fs-h-lg:     clamp(28px, 3.6vw, 56px);     /* h3 / section subtitle */
    --fs-h-xl:     clamp(40px, 4.6vw, 68px);     /* contact h */
    --fs-h-2xl:    clamp(40px, 5vw, 76px);       /* about-stmt */
    --fs-h-3xl:    clamp(44px, 7.5vw, 124px);    /* h2 */
    --fs-h-4xl:    clamp(56px, 10.5vw, 176px);   /* h1 hero */
    --fs-display:  clamp(64px, 8.4vw, 124px);    /* Trefika display */
  }
  :root[data-theme="dark"] {
    --bg: #0a0a0a;
    --fg: #fafafa;
    --fg-2: #d4d4d4;
    --fg-3: #a3a3a3;
    --fg-4: #525252;
    --rule: #262626;
    --rule-strong: #404040;
  }
  @media (max-width: 720px) {
    :root { --pad-x: 24px; --pad-y: 28px; }
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-display);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .35s ease, color .35s ease;
  }
  body { overflow: hidden; }

  #root, .deck {
    height: 100vh;
    width: 100vw;
  }

  /* Chrome */
  .chrome {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    padding: var(--pad-y) var(--pad-x);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-3);
  }
  .chrome > * { pointer-events: auto; }
  .chrome .tl { grid-column: 1; grid-row: 1; }
  .chrome .tr { grid-column: 2; grid-row: 1; justify-self: end; display: flex; gap: 24px; align-items: center; }
  .chrome .tr nav { display: contents; }
  .chrome .bl { grid-column: 1; grid-row: 3; align-self: end; }
  .chrome .br { grid-column: 2; grid-row: 3; align-self: end; justify-self: end; display: flex; gap: 20px; align-items: center; }

  .mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fg);
    letter-spacing: 0.12em;
  }
  .mark .dot {
    width: 8px; height: 8px; background: var(--fg); border-radius: 50%;
  }
  .chrome .tl .mark:not(.mark-mobile) {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .45s ease, transform .45s ease;
  }
  .chrome.nav--scrolled .tl .mark:not(.mark-mobile) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .chrome a, .chrome button {
    color: var(--fg-3);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: color .2s ease;
  }
  .chrome a:hover, .chrome button:hover { color: var(--fg); }

  .section-indicator {
    display: flex; align-items: baseline; gap: 14px;
  }
  .section-indicator .num {
    font-variant-numeric: tabular-nums;
    color: var(--fg);
    font-weight: 500;
  }
  .section-indicator .name {
    color: var(--fg-3);
  }
  .section-indicator .sep {
    width: 24px; height: 1px; background: var(--rule-strong);
    display: inline-block;
    transform: translateY(-3px);
  }

  /* Theme toggle icon */
  .theme-toggle {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid var(--fg-3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    display: inline-block;
    transition: border-color .2s ease;
  }
  .theme-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--fg);
    clip-path: inset(0 50% 0 0);
  }
  .theme-toggle:hover { border-color: var(--fg); }

  /* Scroll container */
  .deck {
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  .deck::-webkit-scrollbar { display: none; }

  section.screen {
    min-height: 100vh;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    padding: calc(var(--pad-y) + 40px) var(--pad-x) calc(var(--pad-y) + 40px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 1fr auto;
    gap: 24px;
    align-content: center;
  }

  /* Push inner content of labeled screens below the pinned eyebrow.
     `section.X-screen` (specificity 0,1,1) ties section.screen and wins by
     source order. Plain `.X-screen` (0,1,0) would lose. */
  section.about-screen, section.exp-screen, .contact-screen.v4 {
    padding-top: calc(var(--pad-y) + 96px);
  }

  /* Section eyebrow — pinned at a consistent position on every screen,
     independent of each section's inner grid layout. */
  .section-eyebrow {
    position: absolute;
    top: calc(var(--pad-y) + 40px);
    left: var(--pad-x);
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
    z-index: 5;
    pointer-events: none;
  }

  /* typography */
  .eyebrow {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-3);
  }
  .display {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.92;
    margin: 0;
  }
  .h1 { font-size: var(--fs-h-4xl); }
  .h2 { font-size: var(--fs-h-3xl); }
  .h3 { font-size: var(--fs-h-lg); font-weight: 400; letter-spacing: -0.02em; line-height: 1.08; }
  .body {
    font-size: var(--fs-body-lg);
    line-height: 1.45;
    color: var(--fg-2);
    font-weight: 400;
    letter-spacing: -0.005em;
  }
  .mono { font-family: var(--font-mono); }

  .rule { height: 1px; background: var(--fg); width: 100%; }
  .rule-thin { height: 1px; background: var(--rule-strong); width: 100%; }

  /* entry animations — driven by data-active */
  .reveal > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  section.screen[data-active="true"] .reveal > * {
    opacity: 1;
    transform: translateY(0);
  }

  /* HERO */
  .hero-name {
    grid-column: 1 / span 12;
    grid-row: 1;
    align-self: end;
  }
  .hero-meta {
    grid-column: 1 / span 12;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    gap: 24px;
    align-items: start;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
    margin-top: 24px;
  }
  .hero-meta .cell { display: flex; flex-direction: column; gap: 10px; }
  .hero-meta .k {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-4);
  }
  .hero-meta .v {
    font-size: var(--fs-body-sm);
    color: var(--fg);
    line-height: 1.4;
    font-weight: 400;
  }

  /* Hero mark / geometry — removed */

  /* ABOUT — V2 poster + meta footer */
  section.about-screen {
    grid-template-rows: auto auto auto 1fr auto;
    align-content: stretch;
    row-gap: 0;
  }
  .about-stmt {
    grid-column: 1 / span 11;
    grid-row: 2;
    font-size: var(--fs-h-2xl);
    line-height: 1.02;
    letter-spacing: -0.025em;
    font-weight: 500;
    color: var(--fg);
    margin: 0;
  }
  .about-stmt em { font-style: normal; color: var(--fg-3); }
  .about-sub {
    grid-column: 1 / span 7;
    grid-row: 3;
    font-size: var(--fs-body-md);
    line-height: 1.55;
    color: var(--fg-2);
    margin: 32px 0 0;
    max-width: 56ch;
  }
  .about-footer {
    grid-column: 1 / span 12;
    grid-row: 5;
    align-self: end;
  }
  .about-footer .cells {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-top: 18px;
  }
  .about-footer .cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .about-footer .cell:nth-child(1) { grid-column: 1 / span 3; }
  .about-footer .cell:nth-child(2) { grid-column: 4 / span 3; }
  .about-footer .cell:nth-child(3) { grid-column: 7 / span 3; }
  .about-footer .cell:nth-child(4) { grid-column: 10 / span 3; }
  .about-footer .k {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-4);
  }
  .about-footer .v {
    font-size: var(--fs-body-xs);
    color: var(--fg);
    line-height: 1.45;
    font-weight: 400;
  }
  .about-footer .v .muted { color: var(--fg-3); }

  @media (max-width: 900px) {
    .about-stmt { grid-column: 1 / span 12; }
    .about-sub  { grid-column: 1 / span 12; }
    .about-footer .cell { grid-column: 1 / span 6 !important; }
  }

  /* TIMELINE — old horizontal styles removed; see EXPERIENCE below */

  /* EXPERIENCE — vertical tabular list */
  section.exp-screen {
    grid-template-rows: auto 1fr;
    align-content: stretch;
  }
  .exp-head {
    grid-column: 1 / span 12;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: end;
    padding-bottom: clamp(14px, 2vh, 28px);
    border-bottom: 1px solid var(--rule);
  }
  .exp-head .title { grid-column: 1 / span 7; }
  .exp-head .meta  { grid-column: 9 / span 4; align-self: end; padding-bottom: 6px; }

  .exp-list {
    grid-column: 1 / span 12;
    list-style: none;
    margin: 0;
    padding: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  .exp-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding: clamp(8px, 1.4vh, 16px) 0;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
  }
  .exp-row:last-child { border-bottom: 0; }

  .exp-years {
    grid-column: 1 / span 2;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-sm);
    letter-spacing: 0.1em;
    color: var(--fg-3);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
  }
  .exp-years .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--fg);
    position: absolute;
    left: -16px; top: 6px;
  }
  .exp-years .y1 { color: var(--fg); font-weight: 500; }
  .exp-years .y2 { color: var(--fg-4); font-size: var(--fs-mono-xs); }

  .exp-role {
    grid-column: 3 / span 4;
    font-size: var(--fs-body-lg);
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--fg);
    font-weight: 500;
  }
  .exp-role .sep {
    margin: 0 10px;
    color: var(--fg-4);
    font-weight: 400;
  }
  .exp-role .co { color: var(--fg-2); font-weight: 400; }

  .exp-place {
    grid-column: 7 / span 2;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-3);
  }
  .exp-desc {
    grid-column: 9 / span 4;
    font-size: var(--fs-body-2xs);
    line-height: 1.5;
    color: var(--fg-2);
  }

  @media (max-width: 900px) {
    .exp-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
    .exp-years, .exp-role, .exp-place, .exp-desc { grid-column: 1 / -1; }
  }

  /* HERO META — link cell (Trefika) */
  .hero-meta .cell-link {
    text-decoration: none;
    color: inherit;
    transition: padding .18s ease;
  }
  .hero-meta .cell-link:hover { padding-left: 6px; }
  .hero-meta .cell-link .ext-arrow {
    color: var(--fg-3);
    transition: transform .22s cubic-bezier(.2,.7,.2,1), color .18s ease;
    display: inline-block;
  }
  .hero-meta .cell-link:hover .ext-arrow { transform: translate(2px, -2px); color: var(--fg); }

  .hero-role {
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
  }

  /* CONTACT — V4: card-forward, repaired proportions */
  .contact-screen.v4 {
    grid-template-rows: auto 1fr auto;
    align-content: stretch;
    row-gap: 0;
  }
  .c4-top  { grid-column: 1 / span 12; grid-row: 1; margin-bottom: 64px; padding-top: 0; }
  .c4-row  { grid-column: 1 / span 12; grid-row: 2;
             display: grid; grid-template-columns: repeat(12, 1fr);
             column-gap: 24px; align-items: stretch; }
  .c4-foot { grid-column: 1 / span 12; grid-row: 3; align-self: end; margin-top: 56px; }

  .c4-h {
    font-size: var(--fs-h-xl);
    line-height: 1.04;
    letter-spacing: -0.025em;
    font-weight: 500;
    margin: 0 0 20px;
  }
  .c4-s {
    font-size: var(--fs-body-md);
    line-height: 1.55;
    color: var(--fg-2);
    margin: 0;
    max-width: 60ch;
  }
  .c4-s em { font-style: normal; color: var(--fg-3); }

  /* Trefika primary card */
  .c4-tk {
    grid-column: 1 / span 7;
    border: 1px solid var(--fg);
    padding: 32px 36px 28px;
    display: flex; flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: var(--fg);
    transition: background .22s ease, color .22s ease;
  }
  .c4-tk:hover { background: var(--fg); color: var(--bg); }
  .c4-tk .e {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-4);
    display: flex;
    justify-content: space-between;
  }
  .c4-tk:hover .e { color: rgba(255,255,255,0.6); }
  .c4-tk .m {
    font-family: var(--font-display);
    font-size: var(--fs-display);
    line-height: 0.95;
    letter-spacing: -0.04em;
    font-weight: 500;
    margin: 36px 0 32px;
  }
  .c4-tk .b {
    font-size: var(--fs-body-xs); line-height: 1.55;
    opacity: 0.78;
    margin: 0 0 22px;
    max-width: 52ch;
  }
  .c4-tk .a {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid currentColor;
    padding-top: 16px;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .c4-tk .a .arr {
    transition: transform .22s cubic-bezier(.2,.7,.2,1);
  }
  .c4-tk:hover .a .arr { transform: translateX(6px); }

  /* Right-side stack: email panel above, github/linkedin row below */
  .c4-side {
    grid-column: 8 / span 5;
    display: flex; flex-direction: column; gap: 16px;
  }
  .c4-panel {
    border: 1px solid var(--rule-strong);
    padding: 22px 24px;
    flex: 1;
    display: flex; flex-direction: column; justify-content: space-between;
    text-decoration: none; color: var(--fg);
    transition: border-color .18s ease, padding .18s ease;
    position: relative;
  }
  .c4-panel:hover { border-color: var(--fg); }
  .c4-panel .k {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-4);
    display: flex; justify-content: space-between;
    margin-bottom: 18px;
  }
  .c4-panel .k .arr {
    transition: transform .22s ease, color .18s ease;
  }
  .c4-panel:hover .k .arr { transform: translate(2px, -2px); color: var(--fg); }

  .c4-panel.em .v {
    font-family: var(--font-display);
    font-size: var(--fs-h-md);
    letter-spacing: -0.012em;
    font-weight: 500;
    line-height: 1.1;
    word-break: break-all;
  }
  .c4-panel.em .h {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
    margin-top: 14px;
    position: relative;
    height: 1.2em;
  }
  .c4-panel.em .h .aff-default,
  .c4-panel.em .h .aff-copied {
    position: absolute;
    left: 0; top: 0;
    transition: opacity .18s ease;
  }
  .c4-panel.em .h .aff-copied { opacity: 0; color: var(--fg); }
  .c4-panel.em.copied .h .aff-default { opacity: 0; }
  .c4-panel.em.copied .h .aff-copied  { opacity: 1; }

  .c4-side .row2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  }
  .c4-side .row2 .c4-panel { padding: 18px 20px; }
  .c4-side .row2 .c4-panel .v {
    font-size: var(--fs-body-sm); letter-spacing: -0.005em; font-weight: 400;
  }
  @media (max-width: 900px) {
    .c4-tk   { grid-column: 1 / span 12; padding: 24px; }
    .c4-side { grid-column: 1 / span 12; margin-top: 16px; }
    .c4-tk .m { font-size: clamp(48px, 12vw, 80px); margin: 24px 0; }
  }

  /* Page-level entry */
  .deck { opacity: 0; transition: opacity .5s ease; }
  .deck.ready { opacity: 1; }
  /* Default: hide mobile-only chrome bits at desktop sizes */
  .mark-mobile { display: none; }
  .nav-toggle  { display: none; }
  .nav-drawer  { display: none; }

  /* ============================================================
     TABLET — 720px to 1024px
     Columns relax, type scales down, but page still uses
     snap-pagination and the desktop chrome layout.
  ============================================================ */
  @media (max-width: 1024px) {
    :root { --pad-x: 36px; --pad-y: 36px; }

    body { overflow: auto; }

    /* Tablet: deck becomes a free-scrolling document so overflowing
       sections are reachable. Snap is desktop-only. */
    .deck {
      height: auto;
      min-height: 100vh;
      overflow-y: visible;
      scroll-snap-type: none;
    }
    #root, .deck { height: auto; min-height: 100vh; width: 100%; }

    section.screen {
      min-height: 100vh;
      height: auto;
      scroll-snap-align: none;
      padding: calc(var(--pad-y) + 32px) var(--pad-x);
      align-content: start;
      grid-template-rows: auto 1fr auto;
    }

    /* About + Contact have their own grid-template-rows + align-content
       defined outside media queries — override here so they flow naturally. */
    .about-screen,
    .contact-screen.v4 {
      align-content: start;
      grid-template-rows: auto;
    }

    /* Hero: 2x2 meta grid */
    .hero-name { grid-row: 2; }
    .hero-meta {
      grid-row: 3;
      grid-template-columns: 1fr 1fr;
      justify-content: stretch;
    }

    /* About footer: 2x2 */
    .about-screen { grid-template-rows: auto auto auto 1fr auto; }
    .about-footer .cell:nth-child(1) { grid-column: 1 / span 6; }
    .about-footer .cell:nth-child(2) { grid-column: 7 / span 6; }
    .about-footer .cell:nth-child(3) { grid-column: 1 / span 6; }
    .about-footer .cell:nth-child(4) { grid-column: 7 / span 6; }
    .about-stmt { grid-column: 1 / span 12; }
    .about-sub  { grid-column: 1 / span 10; }

    /* Experience header: drop right meta */
    .exp-head .title { grid-column: 1 / span 12; }
    .exp-head .meta  { display: none; }
    .exp-row { grid-template-columns: 80px 1fr 1fr; gap: 16px; }
    .exp-years { grid-column: 1; }
    .exp-role  { grid-column: 2; }
    .exp-place { grid-column: 3; text-align: right; }
    .exp-desc  { grid-column: 1 / -1; padding-top: 6px; }

    /* Contact V4: side panel below */
    .c4-tk   { grid-column: 1 / span 12; }
    .c4-side { grid-column: 1 / span 12; margin-top: 16px; }
  }

  /* ============================================================
     MOBILE — ≤ 720px
     Switch from snap-deck to natural scrolling document.
     Slim sticky top bar with hamburger nav drawer.
  ============================================================ */
  @media (max-width: 720px) {
    :root { --pad-x: 20px; --pad-y: 16px; }

    body { overflow: auto; }

    /* Deck becomes a normal vertical document */
    .deck {
      height: auto;
      min-height: 100vh;
      overflow-y: visible;
      scroll-snap-type: none;
    }
    #root, .deck { height: auto; min-height: 100vh; width: 100%; }

    /* Sections: natural height, no snap, content flows top-down */
    section.screen {
      min-height: auto;
      height: auto;
      scroll-snap-align: none;
      padding: 32px var(--pad-x) 56px;
      grid-template-columns: 1fr;
      grid-template-rows: auto;
      gap: 0;
      align-content: start;
      border-bottom: 1px solid var(--rule);
    }
    section.screen:last-of-type { border-bottom: 0; }

    /* Sections that needed extra top padding for absolute eyebrow:
       eyebrow now flows inline, so reset. */
    .about-screen, .exp-screen, .contact-screen.v4 {
      padding-top: 32px;
    }

    /* Eyebrow: inline at top of section */
    .section-eyebrow {
      position: static;
      top: auto; left: auto;
      margin: 0 0 32px;
      pointer-events: auto;
    }

    /* CHROME — slim sticky top bar */
    .chrome {
      position: sticky;
      inset: auto;
      top: 0;
      width: 100%;
      padding: 14px var(--pad-x);
      background: var(--bg);
      border-bottom: 1px solid var(--rule);
      grid-template-columns: 1fr auto;
      grid-template-rows: auto;
      gap: 12px;
      z-index: 100;
    }
    .chrome .tl { display: flex; align-items: center; }
    .chrome .tr { gap: 12px; }
    .chrome .br { display: none; }
    /* Hide the desktop animated mark, show the persistent mobile one */
    .chrome .tl .mark:not(.mark-mobile) { display: none; }
    .mark-mobile {
      display: inline-flex;
      opacity: 1 !important;
      transform: none !important;
      pointer-events: auto !important;
      font-size: var(--fs-mono-xs);
    }
    /* Hide the desktop section nav links — replaced by hamburger */
    .chrome .tr a { display: none; }
    .nav-toggle {
      display: inline-flex;
      align-items: center; justify-content: center;
      width: 40px; height: 32px;
      margin-right: -8px;
      background: transparent;
      border: 1px solid var(--rule-strong);
      cursor: pointer;
      padding: 0;
    }
    .nav-toggle-icon {
      position: relative;
      display: inline-block;
      width: 18px; height: 12px;
    }
    .nav-toggle-icon i {
      position: absolute; left: 0; right: 0;
      height: 1.5px; background: var(--fg);
      transition: transform .25s ease, top .25s ease, opacity .2s ease;
    }
    .nav-toggle-icon i:nth-child(1) { top: 2px; }
    .nav-toggle-icon i:nth-child(2) { top: 8px; }
    .nav-toggle-icon.open i:nth-child(1) { top: 5px; transform: rotate(45deg); }
    .nav-toggle-icon.open i:nth-child(2) { top: 5px; transform: rotate(-45deg); }

    /* NAV DRAWER */
    .nav-drawer {
      display: block;
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 99;
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s ease;
    }
    .nav-drawer.open { opacity: 1; pointer-events: auto; }
    .nav-drawer-inner {
      padding: 80px var(--pad-x) 32px;
      display: flex; flex-direction: column;
      height: 100%;
    }
    .nav-drawer-list {
      list-style: none; margin: 0; padding: 0;
      display: flex; flex-direction: column;
      flex: 1;
      border-top: 1px solid var(--fg);
    }
    .nav-drawer-list li { border-bottom: 1px solid var(--rule); }
    .nav-drawer-list a {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 18px;
      align-items: baseline;
      padding: 20px 0;
      text-decoration: none;
      color: var(--fg-3);
    }
    .nav-drawer-list a.current { color: var(--fg); }
    .nav-drawer-list .num {
      font-family: var(--font-mono);
      font-size: var(--fs-mono-xs);
      letter-spacing: 0.14em;
      color: var(--fg-4);
    }
    .nav-drawer-list a.current .num { color: var(--fg); }
    .nav-drawer-list .lab {
      font-size: clamp(24px, 7vw, 32px);
      letter-spacing: -0.02em;
      font-weight: 500;
    }
    .nav-drawer-list .ar {
      font-family: var(--font-mono); font-size: var(--fs-body-xs);
      color: var(--fg-3);
    }
    .nav-drawer-foot {
      border-top: 1px solid var(--rule);
      padding-top: 18px;
      margin-top: 18px;
    }
    .theme-row {
      width: 100%;
      display: flex; justify-content: space-between; align-items: center;
      background: transparent; border: 0;
      padding: 12px 0;
      font-family: var(--font-mono);
      font-size: var(--fs-mono-xs);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--fg-3);
      cursor: pointer;
    }
    .theme-row .theme-state { color: var(--fg); }

    /* HERO */
    .hero-name { grid-column: 1; grid-row: auto; align-self: start; padding-top: 24px; }
    .hero-meta {
      grid-column: 1; grid-row: auto;
      grid-template-columns: 1fr;
      gap: 0;
      padding-top: 24px;
      margin-top: 32px;
    }
    .hero-meta .cell {
      grid-column: 1 / -1 !important;
      padding: 16px 0;
      border-bottom: 1px solid var(--rule);
    }
    .hero-meta .cell:last-child { border-bottom: 0; }
    .h1 { font-size: clamp(56px, 16vw, 84px); }
    .hero-role { font-size: var(--fs-mono-xs); }

    /* ABOUT */
    .about-screen { grid-template-rows: auto; }
    .about-stmt {
      grid-column: 1; grid-row: auto;
      font-size: clamp(36px, 9vw, 48px);
    }
    .about-sub { grid-column: 1; grid-row: auto; margin-top: 24px; }
    .about-footer {
      grid-column: 1; grid-row: auto;
      margin-top: 48px;
    }
    .about-footer .cells { grid-template-columns: 1fr 1fr; gap: 16px; }
    .about-footer .cell { grid-column: auto !important; }

    /* EXPERIENCE */
    .exp-screen { grid-template-rows: auto; }
    .exp-head {
      grid-column: 1;
      grid-template-columns: 1fr;
      padding-bottom: 16px;
    }
    .exp-head .title { grid-column: 1; }
    .exp-head .meta { display: none; }
    .exp-list { grid-column: 1; }
    .exp-row {
      grid-template-columns: 1fr;
      gap: 6px;
      padding: 16px 0;
    }
    .exp-years, .exp-role, .exp-place, .exp-desc { grid-column: 1; }
    .exp-years { flex-direction: row; gap: 8px; }
    .exp-years .dot { display: none; }
    .exp-role { font-size: var(--fs-body-md); }

    /* CONTACT V4 */
    .contact-screen.v4 { grid-template-rows: auto; }
    .c4-top  { grid-column: 1; margin-bottom: 32px; padding-top: 0; }
    .c4-row  {
      grid-column: 1;
      grid-template-columns: 1fr;
      row-gap: 16px;
    }
    .c4-tk { grid-column: 1; padding: 24px; }
    .c4-tk .m { font-size: clamp(56px, 14vw, 88px); margin: 24px 0; }
    .c4-side { grid-column: 1; margin-top: 0; }
    .c4-side .row2 { grid-template-columns: 1fr; gap: 12px; }
    .c4-foot { grid-column: 1; margin-top: 56px; }

    /* Disable reveal animations on mobile — they look weird with non-snap scroll */
    .reveal > * { opacity: 1; transform: none; }
  }

  /* ============================================================
     XL — large displays
  ============================================================ */
  @media (min-width: 1600px) {
    :root { --pad-x: 64px; --pad-y: 56px; }
  }
