/* ==========================================================================
   Kishore — portfolio design system
   Layers keep specificity flat and predictable:
   tokens → reset → layout → type → components → utilities
   ========================================================================== */
@layer tokens, reset, base, layout, components, utilities;

/* --------------------------------------------------------------------------
   Fonts (self-hosted, latin subset, woff2 only)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-var-latin.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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;
}

@layer tokens {
  :root {
    /* Surface + ink -------------------------------------------------------- */
    --bg:            #080808;      /* carried over from the original site */
    --bg-raised:     #101211;
    --bg-sunken:     #050606;
    --line:          rgb(255 255 255 / 9%);
    --line-strong:   rgb(255 255 255 / 18%);

    --ink:           #f2f4f3;
    --ink-muted:     #a3aba8;      /* 8.1:1 on --bg */
    --ink-faint:     #7c8481;      /* 4.6:1 on --bg — decorative meta only */

    /* Brand — both values are the original site's teals ---------------------*/
    --accent:        #6fb6aa;      /* 8.4:1 on --bg */
    --accent-deep:   #43867b;      /* 4.7:1 on --bg */
    --accent-wash:   rgb(111 182 170 / 12%);
    --on-accent:     #05100e;

    --focus:         #9fd6cc;

    /* Type ----------------------------------------------------------------- */
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system,
                 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
                 'Liberation Mono', monospace;

    --text-xs:  clamp(0.75rem,  0.735rem + 0.08vw, 0.8125rem);
    --text-sm:  clamp(0.875rem, 0.86rem  + 0.09vw, 0.9375rem);
    --text-base:clamp(1rem,     0.97rem  + 0.16vw, 1.0625rem);
    --text-md:  clamp(1.0625rem,1.02rem  + 0.22vw, 1.1875rem);
    --text-lg:  clamp(1.25rem,  1.17rem  + 0.4vw,  1.5rem);
    --text-xl:  clamp(1.5rem,   1.35rem  + 0.75vw, 2rem);
    --text-2xl: clamp(2rem,     1.66rem  + 1.7vw,  3.25rem);
    --text-3xl: clamp(2.75rem,  1.9rem   + 4.2vw,  6rem);

    --leading-tight: 1.06;
    --leading-snug:  1.28;
    --leading-body:  1.68;
    --tracking-tight:-0.022em;
    --tracking-wide: 0.14em;

    /* Space — 4px base ----------------------------------------------------- */
    --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
    --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 2.5rem;   --sp-8: 3rem;
    --sp-9: 4rem;     --sp-10: 5rem;    --sp-11: 6rem;

    --section-y: clamp(4rem, 8vw, 7.5rem);
    --gutter:    clamp(1.25rem, 5vw, 4rem);
    --shell:     88rem;
    --measure:   62ch;

    /* Shape + depth -------------------------------------------------------- */
    --r-xs: 3px;  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;
    --shadow-lift: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 70%);

    /* Motion --------------------------------------------------------------- */
    --ease:      cubic-bezier(0.22, 0.72, 0.28, 1);
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --dur-1: 140ms;  --dur-2: 240ms;  --dur-3: 420ms;

    --nav-h: 4.25rem;

    color-scheme: dark;
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + var(--sp-5));
    /* Page scrollbar hidden (scrolling still works); the reading-progress
       hairline at the top stands in for it. */
    scrollbar-width: none;
  }
  html::-webkit-scrollbar { display: none; }   /* older Chromium / Safari */

  body,
  h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
    margin: 0;
  }

  ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }

  body {
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  img, picture, video, svg { display: block; max-width: 100%; }
  img, video { height: auto; }

  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }

  h1, h2, h3, h4 {
    font-weight: 600;
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
  }

  p { text-wrap: pretty; }

  a { color: inherit; }

  address { font-style: normal; }

  :where(a, button, input, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--r-xs);
  }

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

/* ==========================================================================
   Layout primitives
   ========================================================================== */
@layer layout {
  .shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .section { padding-block: var(--section-y); }
  .section + .section { border-top: 1px solid var(--line); }

  .section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-5);
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
  }

  .section__title {
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
  }
  .section__title .qualifier { color: var(--accent); font-weight: 500; }
  .section__title::after {
    content: '';
    display: block;
    width: 2.5rem;
    height: 2px;
    margin-top: var(--sp-4);
    background: var(--accent);
    transform-origin: left;
  }

  .section__index {
    flex: none;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    color: var(--ink-faint);
  }

  /* Asymmetric split used by About and Near-Term Targets */
  .split {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
  }
  @media (min-width: 60rem) {
    .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr); align-items: start; }
    .split--reverse { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); }
    .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

/* ==========================================================================
   Components
   ========================================================================== */
@layer components {

  /* -- shared text roles -------------------------------------------------- */
  .eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--accent);
  }

  .lede { font-size: var(--text-md); color: var(--ink-muted); max-width: var(--measure); }
  .prose { color: var(--ink-muted); max-width: var(--measure); }
  .prose + .prose { margin-top: var(--sp-4); }

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

  .skip-link {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    z-index: 200;
    padding: var(--sp-3) var(--sp-4);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    border-radius: var(--r-sm);
    transform: translateY(calc(-100% - var(--sp-5)));
    transition: transform var(--dur-2) var(--ease);
  }
  .skip-link:focus-visible { transform: none; }

  /* -- links -------------------------------------------------------------- */
  .link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    padding-block: var(--sp-1);
  }
  .link::after {
    content: '';
    width: 0.7em; height: 0.7em;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-0.05em, 0.05em);
    transition: transform var(--dur-2) var(--ease);
  }
  .link:hover::after,
  .link:focus-visible::after { transform: rotate(45deg) translate(0.12em, -0.12em); }
  .link:hover { color: var(--ink); }

  .link-inline {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent-deep);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  }
  .link-inline:hover { color: var(--accent); text-decoration-color: var(--accent); }

  /* -- buttons ------------------------------------------------------------ */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 2.875rem;
    padding: var(--sp-3) var(--sp-5);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background-color var(--dur-2) var(--ease),
                border-color var(--dur-2) var(--ease),
                color var(--dur-2) var(--ease);
  }
  .btn--primary { background: var(--accent); color: var(--on-accent); }
  .btn--primary:hover { background: #8ccabf; }
  .btn--ghost { border-color: var(--line-strong); color: var(--ink); }
  .btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
  .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

  /* -- intro overlay ------------------------------------------------------ */
  .intro {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: var(--sp-5);
    background: #000;
    opacity: 1;
    transition: opacity var(--dur-3) var(--ease-out);
  }
  /* The clip is cropped tight around the animation (800×488, logo centred), so
     it just needs a sensible width: edge-to-edge minus a gutter on phones,
     capped on large screens so the logo doesn't balloon. */
  .intro__video {
    width: min(100%, 40rem);
    height: auto;
    max-height: 100%;
    aspect-ratio: 800 / 488;
    object-fit: contain;
    background: #000;
  }
  .intro[hidden] { display: none; }
  .intro.is-leaving { opacity: 0; pointer-events: none; }

  html[data-intro='playing'] body { overflow: hidden; }

  /* -- site header / nav --------------------------------------------------- */
  .site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 100;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color var(--dur-2) var(--ease),
                border-color var(--dur-2) var(--ease),
                translate var(--dur-3) var(--ease-out);
  }
  .site-header.is-hidden { translate: 0 -100%; }
  .site-header.is-stuck {
    background: rgb(8 8 8 / 82%);
    border-bottom-color: var(--line);
    backdrop-filter: blur(14px) saturate(140%);
  }
  @supports not (backdrop-filter: blur(1px)) {
    .site-header.is-stuck { background: rgb(8 8 8 / 97%); }
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    min-height: var(--nav-h);
  }

  .brand {
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
  }
  .brand__initial { color: var(--accent); }

  .nav__list {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1.4vw, 1.375rem);
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav__link {
    display: block;
    padding: var(--sp-2) var(--sp-1);
    font-size: var(--text-sm);
    color: var(--ink-muted);
    text-decoration: none;
    transition: color var(--dur-1) var(--ease);
  }
  .nav__link::after {
    content: '';
    display: block;
    height: 1px;
    margin-top: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-2) var(--ease);
  }
  .nav__link:hover, .nav__link[aria-current='true'] { color: var(--ink); }
  .nav__link:hover::after,
  .nav__link:focus-visible::after,
  .nav__link[aria-current='true']::after { transform: scaleX(1); }

  .nav__icon--close { display: none; }

  .nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem; height: 2.75rem;
    margin-right: calc(var(--sp-2) * -1);
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink);
  }
  .nav__scrim { display: none; }

  @media (max-width: 64rem) {
    .nav__toggle {
      display: inline-flex;
      order: 3;
      position: relative;
      z-index: 100;          /* stays tappable once the panel slides over */
    }
    body[data-nav='open'] .nav__icon--open { display: none; }
    body[data-nav='open'] .nav__icon--close { display: block; }
    .nav__scrim {
      display: block;
      position: fixed;
      inset: 0;
      z-index: 98;
      background: rgb(0 0 0 / 55%);
      opacity: 0;
      visibility: hidden;
      transition: opacity var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
    }
    .nav__list {
      position: fixed;
      inset-block: 0;
      inset-inline-end: 0;
      z-index: 99;
      width: min(19rem, 82vw);
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: calc(var(--nav-h) + var(--sp-5)) var(--sp-6) var(--sp-6);
      background: var(--bg-raised);
      border-left: 1px solid var(--line);
      overflow-y: auto;
      transform: translateX(100%);
      visibility: hidden;
      transition: transform var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
    }
    .nav__link {
      padding: var(--sp-4) 0;
      font-size: var(--text-md);
      border-bottom: 1px solid var(--line);
    }
    .nav__link::after { display: none; }
    body[data-nav='open'] .nav__list {
      transform: none;
      visibility: visible;
      transition: transform var(--dur-3) var(--ease-out), visibility 0s;
    }
    body[data-nav='open'] .nav__scrim {
      opacity: 1;
      visibility: visible;
      transition: opacity var(--dur-2) var(--ease), visibility 0s;
    }
    body[data-nav='open'] { overflow: hidden; }
  }

  /* -- hero ---------------------------------------------------------------- */
  .hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + var(--sp-8));
    padding-bottom: var(--sp-9);
    overflow: hidden;
    isolation: isolate;
  }
  .hero__grid {
    display: grid;
    gap: var(--sp-6);
    align-items: end;
  }
  .hero__copy { position: relative; z-index: 2; container-type: inline-size; }
  .hero__title {
    margin-top: var(--sp-4);
    font-size: var(--text-3xl);
    /* "Hi, I'm Kishore" is ~6.2em wide; cap the size to what the column fits. */
    font-size: min(var(--text-3xl), calc(100cqi / 6.4));
    line-height: 0.98;
    letter-spacing: -0.035em;
    font-weight: 600;
  }
  .hero__greeting { display: block; white-space: nowrap; }
  .hero__name { color: var(--accent); }
  .hero__position {
    display: block;
    margin-top: var(--sp-5);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
    color: var(--ink);
  }
  .hero__company {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color var(--dur-2) var(--ease);
  }
  .hero__company:hover { text-decoration-color: currentColor; }
  .hero__roles {
    display: block;
    margin-top: var(--sp-3);
    font-family: var(--font-mono);
    font-size: clamp(1rem, 0.7rem + 1.5vw, 1.75rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ink-muted);
    min-height: 1.4em;
  }
  .hero__caret {
    display: inline-block;
    margin-left: 0.12ch;
    color: var(--accent);
    animation: caret-blink 1.1s steps(1, end) infinite;
  }
  @keyframes caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }


  .hero__portrait { display: none; }

  /* Mobile / tablet: full-bleed photographic backdrop with a legibility scrim */
  .hero__backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
  }
  .hero__backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Keeps the face and raised hand in frame from narrow phones to
       landscape tablets. */
    object-position: 58% 24%;
  }
  .hero__backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to top, var(--bg) 6%, rgb(8 8 8 / 78%) 34%, rgb(8 8 8 / 18%) 70%, rgb(8 8 8 / 35%) 100%);
  }

  /* Phones / tablets: the copy sits in the darkened lower band, clear of the
     face. */
  @media (max-width: 55.99rem) {
    .hero { align-items: end; }
  }
  /* Landscape phones: too short for the photo to read, so let copy centre. */
  @media (max-width: 55.99rem) and (max-height: 30rem) and (orientation: landscape) {
    .hero { align-items: center; }
    .hero__backdrop img { object-position: 50% 30%; }
  }

  @media (min-width: 56rem) {
    .hero__backdrop { display: none; }
    .hero {
      /* Portrait is 2:3 — cap its width so its full height always fits
         beneath the fixed header, even on short laptop screens. */
      --portrait-w: min(34vw, 30rem, calc((100svh - var(--nav-h) - var(--sp-5)) * 2 / 3));
    }
    .hero__portrait {
      display: block;
      position: absolute;
      inset-block-end: 0;
      inset-inline-end: max(0px, calc((100vw - var(--shell)) / 2));
      z-index: 1;
      width: max(17rem, var(--portrait-w));
      -webkit-mask-image:
        linear-gradient(to bottom, transparent 0%, #000 9%, #000 74%, transparent 99%),
        linear-gradient(to right, transparent 0%, #000 12%, #000 94%, transparent 100%);
      mask-image:
        linear-gradient(to bottom, transparent 0%, #000 9%, #000 74%, transparent 99%),
        linear-gradient(to right, transparent 0%, #000 12%, #000 94%, transparent 100%);
      -webkit-mask-composite: source-in;
      mask-composite: intersect;
    }
    .hero__portrait img { width: 100%; }
    .hero__grid { grid-template-columns: minmax(0, 1fr) max(17rem, var(--portrait-w)); }
  }


  /* -- tabs (About, Near-Term Targets) ------------------------------------- */
  .tabs__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-5);
    margin: 0 0 var(--sp-6);
    padding: 0 0 var(--sp-3);
    border-bottom: 1px solid var(--line);
  }
  .tabs__tab {
    position: relative;
    padding: var(--sp-2) 0;
    background: none;
    border: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-faint);
    transition: color var(--dur-1) var(--ease);
  }
  .tabs__tab::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: calc(var(--sp-3) * -1 - 1px);
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-2) var(--ease);
  }
  .tabs__tab:hover { color: var(--ink-muted); }
  .tabs__tab[aria-selected='true'] { color: var(--ink); }
  .tabs__tab[aria-selected='true']::after { transform: scaleX(1); }
  .tabs { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tabs__panel { grid-row: 2; grid-column: 1; }
  .tabs__panel[hidden] { display: block; visibility: hidden; }

  .deflist { display: grid; gap: var(--sp-5); margin: 0; }
  .deflist > div { display: grid; gap: var(--sp-1); }
  .deflist dt {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .deflist dd { margin: 0; color: var(--ink-muted); }

  /* -- portrait figure ----------------------------------------------------- */
  .portrait {
    position: relative;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, var(--bg-raised), var(--bg-sunken));
    border: 1px solid var(--line);
    overflow: hidden;
  }
  .portrait img { width: 100%; }

  /* About: the photo is exactly as tall as the text beside it (cropped to
     fit) instead of its natural 2:3 height towering over the copy. */
  @media (min-width: 60rem) {
    .split--about { align-items: stretch; }
    .split--about .portrait { min-height: 22rem; }
    .split--about .portrait picture { position: absolute; inset: 0; }
    .split--about .portrait img {
      height: 100%;
      object-fit: cover;
      object-position: 50% 30%;
    }
  }
  /* Tablets / phones: full width, but capped so it doesn't fill the screen. */
  @media (max-width: 59.99rem) {
    .split--about .portrait img {
      max-height: min(36rem, 110vw);
      object-fit: cover;
      object-position: 50% 25%;
    }
  }

  /* Body copy shared by the timeline entries */
  .entry__body { margin-top: var(--sp-3); color: var(--ink-muted); max-width: var(--measure); }
  .entry__body b { color: var(--ink); font-weight: 600; }

  /* -- highlight cards (Achievements) ---------------------------------------
     Self-contained cards: the whole surface is the link target, and a soft
     light follows the pointer across it (see initSpotlight in main.js). */
  .highlights {
    display: grid;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .highlight {
    --mx: 50%;
    --my: 0%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    isolation: isolate;
    transition: border-color var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out),
                opacity var(--dur-3) var(--ease-out);
  }
  .highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(28rem circle at var(--mx) var(--my), rgb(111 182 170 / 9%), transparent 60%);
    opacity: 0;
    transition: opacity var(--dur-3) var(--ease);
  }
  .highlight:hover,
  .highlight:focus-within { border-color: rgb(111 182 170 / 35%); }
  .highlight:hover::before,
  .highlight:focus-within::before { opacity: 1; }
  @media (hover: hover) {
    .js .highlight.is-revealed:hover { transform: translateY(-3px); }
  }

  .highlight__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgb(111 182 170 / 25%);
    border-radius: var(--r-md);
    background: var(--accent-wash);
    color: var(--accent);
  }
  .highlight__icon svg { width: 1.25rem; height: 1.25rem; }
  .highlight__kicker {
    margin-top: var(--sp-6);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .highlight__title { margin-top: var(--sp-2); font-size: var(--text-lg); }
  .highlight__body { margin-top: var(--sp-3); color: var(--ink-muted); }
  .highlight__body b { color: var(--ink); font-weight: 600; }
  .highlight__link { margin-top: auto; padding-top: var(--sp-5); align-self: flex-start; }
  .highlight__link::before { content: ''; position: absolute; inset: 0; }   /* whole card clickable */
  .highlight:hover .highlight__link::after { transform: rotate(45deg) translate(0.12em, -0.12em); }

  /* -- project rows (My Works) ----------------------------------------------
     Wide, editorial rows: outlined index, title + stack, and a round action.
     A faint band sweeps in behind the row on hover. */
  .projects { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
  .project {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-4) clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
    padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(0rem, 1.5vw, 1.25rem);
    border-bottom: 1px solid var(--line);
    isolation: isolate;
  }
  .project::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--accent-wash), transparent 85%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 560ms var(--ease-out);
  }
  .project:hover::before,
  .project:focus-within::before { transform: scaleX(1); }

  .project__num {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--accent);
  }
  @media (min-width: 48rem) {
    .project { grid-template-columns: 6.5rem minmax(0, 1fr) auto; }
    .project__num {
      grid-column: auto;
      font-size: var(--text-2xl);
      line-height: 1;
      letter-spacing: -0.04em;
      color: transparent;
      -webkit-text-stroke: 1px var(--ink-faint);
      transition: color var(--dur-3) var(--ease), -webkit-text-stroke-color var(--dur-3) var(--ease);
    }
    .project:hover .project__num,
    .project:focus-within .project__num { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
  }

  .project__title { font-size: var(--text-xl); line-height: 1.2; }
  .project__link { text-decoration: none; transition: color var(--dur-2) var(--ease); }
  .project__link::after { content: ''; position: absolute; inset: 0; }   /* whole row clickable */
  .project:hover .project__link { color: var(--accent); }
  .project__body { margin-top: var(--sp-3); color: var(--ink-muted); max-width: var(--measure); }

  .project__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: var(--sp-4) 0 0;
    padding: 0;
    list-style: none;
  }
  .project__tags li {
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-muted);
  }

  .project__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    align-self: center;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-muted);
    white-space: nowrap;
    transition: color var(--dur-2) var(--ease);
  }
  .project__cta-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
                color var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out);
  }
  .project__cta-icon svg { width: 1rem; height: 1rem; }
  .project:hover .project__cta,
  .project:focus-within .project__cta { color: var(--ink); }
  .project:hover .project__cta-icon,
  .project:focus-within .project__cta-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    transform: rotate(45deg);
  }
  /* Phones: the round action sits beside the index, label hidden. */
  @media (max-width: 47.99rem) {
    .project__cta { grid-row: 1; grid-column: 2; align-self: start; }
    .project__cta-label { display: none; }
    .project__num { grid-column: 1; }
    .project__main { grid-column: 1 / -1; }
  }

  /* -- timeline (Experience) ------------------------------------------------
     Date on the left of an accent rule, role details on the right. Adjacent
     items' rules meet, so multiple roles read as one continuous line. */
  .timeline { display: grid; margin: 0; padding: 0; list-style: none; }
  .timeline__item {
    display: grid;
    grid-template-columns: clamp(6.75rem, 12vw, 8.5rem) minmax(0, 1fr);
    align-items: start;
  }
  .timeline__when {
    padding-top: var(--sp-2);
    padding-right: clamp(0.875rem, 3vw, 2.25rem);
    text-align: right;
    font-family: var(--font-mono);
  }
  .timeline__date--wide { display: grid; gap: 0.15em; }
  .timeline__date--narrow { display: none; }
  .timeline__month time { white-space: nowrap; }
  .timeline__year {
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--accent);
  }
  .timeline__month {
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .timeline__body {
    position: relative;
    padding: var(--sp-2) 0 clamp(2.25rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem);
    border-left: 3px solid var(--line);
  }
  .timeline__body::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    width: 3px;
    background: var(--accent-deep);
    transform-origin: top;
  }
  .timeline__item:last-child .timeline__body { padding-bottom: var(--sp-5); }
  /* The ongoing role gets the brighter teal, so the line brightens toward the present. */
  .timeline__item--current .timeline__body::before { background: var(--accent); }
  .timeline__role {
    font-size: var(--text-lg);
    line-height: 1.2;
    color: var(--accent);
  }
  .timeline__org {
    margin-top: var(--sp-1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
    opacity: 0.85;
  }
  .timeline__body .entry__body { text-align: justify; }
  /* Phones: a side column is too cramped, so the rule moves to the item and
     the date becomes a one-line range ("AUG – DEC 2025") above the
     role, inside the rule. */
  @media (max-width: 30rem) {
    .timeline__item {
      position: relative;
      grid-template-columns: minmax(0, 1fr);
      padding-left: var(--sp-4);
      border-left: 2px solid var(--line);
    }
    .timeline__item::before {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: -2px;
      width: 2px;
      background: var(--accent-deep);
      transform-origin: top;
    }
    .timeline__item--current::before { background: var(--accent); }
    .timeline__body::before { display: none; }
    .timeline__when { padding: var(--sp-2) 0 0; text-align: left; }
    .timeline__date--wide { display: none; }
    .timeline__date--narrow {
      display: block;
      font-size: var(--text-xs);
      font-weight: 500;
      line-height: var(--leading-snug);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
    }
    .timeline__body { padding: var(--sp-2) 0 var(--sp-8); border-left: 0; }
    .timeline__body .entry__body { text-align: left; }
  }

  /* -- progress meter ------------------------------------------------------ */
  .meter { margin-top: var(--sp-6); max-width: 26rem; }
  .meter__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
  }
  .meter__label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .meter__value {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.02em;
  }
  .meter__track {
    height: 3px;
    margin-top: var(--sp-3);
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
  }
  .meter__fill {
    height: 100%;
    width: var(--value, 0%);
    background: var(--accent);
    border-radius: inherit;
    transform-origin: left;
    animation: meter-in var(--dur-3) var(--ease-out) both;
  }
  @keyframes meter-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  /* -- contact ------------------------------------------------------------- */
  .contact__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-5);
  }
  .channels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
  }
  .channel img { width: 1.25rem; height: 1.25rem; }
  .channel:hover { border-color: var(--accent); background: var(--accent-wash); }

  .form { display: grid; gap: var(--sp-4); max-width: 34rem; }
  .field { display: grid; gap: var(--sp-2); }
  .field__label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .field__control {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-size: var(--text-sm);
    transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
  }
  .field__control::placeholder { color: var(--ink-faint); }
  .field__control:hover { border-color: var(--line-strong); }
  .field__control:focus { border-color: var(--accent); outline-offset: 1px; }
  textarea.field__control { resize: vertical; min-height: 8rem; }

  .form__foot { display: grid; gap: var(--sp-3); justify-items: start; }
  .form__status { font-size: var(--text-sm); min-height: 1.5em; color: var(--accent); }
  .form__status[data-state='error'] { color: #e08c84; }
  .form__note { font-size: var(--text-xs); color: var(--ink-faint); }

  /* -- footer -------------------------------------------------------------- */
  .site-footer {
    padding-block: var(--sp-7);
    border-top: 1px solid var(--line);
    text-align: center;
  }
  .site-footer p {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    color: var(--ink-faint);
  }
  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-2) var(--sp-5);
    margin-top: var(--sp-3);
  }
  .site-footer__links a {
    color: var(--ink-muted);
    text-decoration: none;
    transition: color var(--dur-1) var(--ease);
  }
  .site-footer__links a:hover { color: var(--accent); }
}

/* ==========================================================================
   Utilities + motion preferences
   ========================================================================== */
@layer utilities {
  .stack-6 > * + * { margin-top: var(--sp-6); }

  /* -- Motion ---------------------------------------------------------------
     Everything here is a one-shot animation on opacity / translate / scale,
     so it never fights the components' own transitions or hover transforms,
     and it is switched off wholesale under prefers-reduced-motion. */

  /* Scroll reveal — opt-in, only when JS is running. main.js staggers items
     that enter together through --reveal-delay. */
  .js [data-reveal]:not(.is-revealed) { opacity: 0; }
  .js [data-reveal].is-revealed {
    animation: reveal-in 720ms var(--ease-out) var(--reveal-delay, 0ms) backwards;
  }
  @keyframes reveal-in { from { opacity: 0; translate: 0 14px; } }

  /* Section rule and timeline line draw once their block is revealed */
  .js .section__head:not(.is-revealed) .section__title::after { scale: 0 1; }
  .js .section__head.is-revealed .section__title::after {
    animation: rule-in 800ms var(--ease-out) 220ms backwards;
  }
  @keyframes rule-in { from { scale: 0 1; } }

  .js .timeline__item:not(.is-revealed) .timeline__body::before,
  .js .timeline__item:not(.is-revealed)::before { scale: 1 0; }
  .js .timeline__item.is-revealed .timeline__body::before,
  .js .timeline__item.is-revealed::before {
    animation: line-draw 1100ms var(--ease-out) calc(var(--reveal-delay, 0ms) + 150ms) backwards;
  }
  @keyframes line-draw { from { scale: 1 0; } }

  /* Hero entrance: copy rises line by line, portrait settles in. Runs on load
     by default, and waits behind the intro clip while it plays. */
  [data-hero-step] { animation: hero-rise 900ms var(--ease-out) backwards; }
  [data-hero-step]:nth-child(2) { animation-delay: 140ms; }
  [data-hero-step]:nth-child(3) { animation-delay: 280ms; }
  @keyframes hero-rise { from { opacity: 0; translate: 0 22px; } }

  .hero__portrait,
  .hero__backdrop { animation: hero-settle 1400ms var(--ease-out) backwards; }
  @keyframes hero-settle { from { opacity: 0; scale: 1.035; } }

  html[data-intro='playing'] :is([data-hero-step], .hero__portrait, .hero__backdrop) {
    animation-play-state: paused;
  }

  /* Reading progress — a hairline across the top of the viewport */
  .scroll-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 150;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    transform-origin: left;
    transform: scaleX(var(--progress, 0));
    pointer-events: none;
  }
  @supports (animation-timeline: scroll()) {
    .scroll-progress {
      animation: progress-fill linear both;
      animation-timeline: scroll(root);
    }
    @keyframes progress-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal]:not(.is-revealed) { opacity: 1; }
  .js .section__head:not(.is-revealed) .section__title::after,
  .js .timeline__item:not(.is-revealed) .timeline__body::before,
  .js .timeline__item:not(.is-revealed)::before { scale: none; }
  .hero__caret { animation: none; opacity: 1; }
  .scroll-progress { display: none; }
  .site-header.is-hidden { translate: none; }
}

@media (forced-colors: active) {
  .nav__link::after, .tabs__tab::after, .link::after { forced-color-adjust: none; }
  .btn { border: 1px solid; }
}

@media print {
  .site-header, .intro, .nav__scrim, .form, .scroll-progress { display: none !important; }
  body { background: #fff; color: #000; }
}
