/* ==========================================================================
   IGARASHI DEV — portfolio
   Brand board: Void Black / Graphite / Silver / Mineral White / Titanium Gray
   Type: Archivo (display, variable width) · Geist (body) · JetBrains Mono
   ========================================================================== */

@layer reset, tokens, base, layout, components, sections, motion;

/* ---------------------------------------------------------------- reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  img, svg, canvas { display: block; max-width: 100%; }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
  a { color: inherit; text-decoration: none; }
  ul[role="list"], ol { list-style: none; padding: 0; }
  ul { padding: 0; list-style: none; }
}

/* --------------------------------------------------------------- tokens */
@layer tokens {
  :root {
    /* palette (brand board 02) */
    --void: #000000;
    --graphite: #1A1A1F;
    --silver: #C0C0C0;
    --mineral: #F5F5F7;
    --titanium: #6B6F76;

    /* derived — color-mix only */
    --bg: var(--void);
    --surface: color-mix(in srgb, var(--graphite) 55%, var(--void));
    --surface-2: var(--graphite);
    --line: color-mix(in srgb, var(--mineral) 11%, transparent);
    --line-strong: color-mix(in srgb, var(--mineral) 22%, transparent);
    --text: var(--mineral);
    --text-2: color-mix(in srgb, var(--mineral) 68%, var(--titanium));
    --text-3: var(--titanium);
    --live: color-mix(in srgb, var(--mineral) 92%, var(--silver));

    --chrome: linear-gradient(115deg,
      var(--mineral) 0%, var(--silver) 28%, var(--titanium) 46%,
      var(--mineral) 58%, var(--silver) 78%, var(--titanium) 100%);

    /* type */
    --f-display: "Archivo", system-ui, sans-serif;
    --f-body: "Geist", "Archivo", system-ui, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, monospace;

    --fs-hero: clamp(3rem, 1rem + 6.5vw, 8rem);
    --fs-h2: clamp(2.4rem, 1rem + 5.6vw, 6.4rem);
    --fs-h3: clamp(1.4rem, 1rem + 1.4vw, 2rem);
    --fs-lede: clamp(1.05rem, .95rem + .4vw, 1.3rem);

    /* space & shape */
    --gutter: clamp(16px, 4vw, 56px);
    --maxw: 1440px;
    --r-sm: 6px;
    --r: 10px;
    --r-lg: 18px;
    --header-h: 72px;

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);
  }

  /* dark-only brand: same values whatever the OS preference */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="light"]) { color-scheme: dark; }
  }
  :root[data-theme="dark"] { color-scheme: dark; }

  @property --sheen {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
  }
  @property --spot {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
  }
}

/* ----------------------------------------------------------------- base */
@layer base {
  html {
    color-scheme: dark;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    background: var(--bg);
  }
  body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }
  /* digital grain — texture system 09 */
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: .06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  ::selection { background: var(--mineral); color: var(--void); }
  :focus-visible { outline: 1px solid var(--mineral); outline-offset: 4px; border-radius: 2px; }
  h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1; text-wrap: balance; }
  p { text-wrap: pretty; }
  strong { color: var(--text); font-weight: 600; }
  .mono { font-family: var(--f-mono); }
  .skip {
    position: fixed; left: 16px; top: -60px; z-index: 200;
    background: var(--mineral); color: var(--void); padding: 10px 16px; border-radius: var(--r-sm);
    &:focus { top: 16px; }
  }
}

/* --------------------------------------------------------------- layout */
@layer layout {
  .shell {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .section { padding-block: clamp(96px, 14vw, 200px) 0; }
}

/* ----------------------------------------------------------- components */
@layer components {
  .ico {
    width: 1.15em; height: 1.15em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .ico--lg { width: 30px; height: 30px; }

  /* overline / mono labels — board section headers */
  .overline, .mono-label {
    font-family: var(--f-mono);
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-2);
    font-weight: 400;
  }
  .mono-label {
    display: flex; justify-content: space-between; gap: 16px;
    padding-bottom: 14px; margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
  }

  .chrome-text {
    background: var(--chrome);
    background-size: 220% 100%;
    background-position: var(--sheen) 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sheen 9s var(--ease-io) infinite alternate;
  }
  @keyframes sheen { to { --sheen: 100%; } }

  /* lockup */
  .lockup {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: var(--f-display);
    font-stretch: 112%;
    letter-spacing: -.01em;
    font-size: 1.05rem;
    line-height: 1;
    b { font-weight: 800; }
    font-weight: 300;
  }
  .lockup__mark { width: 30px; height: 30px; }

  /* buttons */
  .btn {
    --pad: 16px 22px;
    position: relative;
    display: inline-flex; align-items: center; gap: 14px;
    padding: var(--pad);
    border-radius: var(--r-sm);
    font-family: var(--f-mono);
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    transition: background .4s var(--ease-out), color .4s var(--ease-out), border-color .4s, translate .5s var(--ease-out);
    translate: var(--mx, 0) var(--my, 0);
    .ico { transition: translate .4s var(--ease-out); }
    &:hover .ico { translate: 4px 0; }
  }
  .btn--sm { --pad: 10px 16px; font-size: .7rem; }
  .btn--primary {
    background: var(--mineral); color: var(--void);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--titanium) 60%, transparent), 0 10px 40px -12px color-mix(in srgb, var(--mineral) 35%, transparent);
    &:hover { background: var(--silver); }
  }
  .btn--ghost {
    border: 1px solid var(--line-strong); color: var(--text);
    background: color-mix(in srgb, var(--void) 40%, transparent);
    backdrop-filter: blur(8px);
    &:hover { border-color: var(--mineral); background: color-mix(in srgb, var(--mineral) 6%, transparent); }
  }

  .icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: background .3s, border-color .3s, color .3s;
    &:hover { background: var(--mineral); color: var(--void); border-color: var(--mineral); }
    &:disabled { opacity: .3; pointer-events: none; }
  }
  .icon-btn--lg { width: 56px; height: 56px; }

  /* panels with pointer spotlight (OLED glass) */
  .panel {
    position: relative;
    isolation: isolate;
    background: linear-gradient(180deg, color-mix(in srgb, var(--graphite) 70%, transparent), color-mix(in srgb, var(--graphite) 25%, transparent));
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color .4s, --spot .5s;
    &::before {
      content: "";
      position: absolute; inset: 0; z-index: -1;
      opacity: var(--spot);
      background: radial-gradient(420px circle at var(--px, 50%) var(--py, 50%), color-mix(in srgb, var(--mineral) 12%, transparent), transparent 60%);
      transition: opacity .4s;
    }
    &:hover { --spot: 1; border-color: var(--line-strong); }
  }

  .chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase;
  }
  .chip--live::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--mineral) 60%, transparent);
    animation: pulse 2.4s infinite;
  }
  @keyframes pulse {
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
  .chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    li {
      font-family: var(--f-mono); font-size: .72rem; letter-spacing: .04em;
      padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2);
    }
  }

  .ticks {
    display: grid; gap: 12px;
    li {
      position: relative; padding-left: 26px; color: var(--text-2);
      &::before {
        content: ""; position: absolute; left: 2px; top: .7em;
        width: 12px; height: 1px; background: var(--silver);
      }
    }
  }

  /* section header — "01  LOGO SYSTEM" from the board */
  .section__head {
    display: flex; align-items: center; gap: 18px;
    margin-bottom: clamp(48px, 7vw, 96px);
  }
  .section__num {
    font-family: var(--f-mono); font-size: 1.15rem; font-weight: 500; color: var(--text);
  }
  .section__label {
    font-family: var(--f-mono); font-weight: 400; font-size: .85rem;
    letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  }
  .section__rule { flex: 1; height: 1px; background: var(--line); transform-origin: left; }
  .section__aside {
    font-family: var(--f-mono); font-size: .72rem; color: var(--text-3);
    letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  }
  @media (width < 720px) { .section__aside { display: none; } }
}

/* ------------------------------------------------------------- sections */
@layer sections {

  /* ---------- header ---------- */
  .site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    height: var(--header-h);
    display: flex; align-items: center; gap: 32px;
    padding-inline: var(--gutter);
    transition: translate .5s var(--ease-out), background .4s, border-color .4s;
    border-bottom: 1px solid transparent;
    &[data-scrolled] {
      background: color-mix(in srgb, var(--void) 72%, transparent);
      backdrop-filter: blur(18px) saturate(140%);
      border-color: var(--line);
    }
    &[data-hidden] { translate: 0 -100%; }
  }
  .nav {
    display: flex; gap: 36px; margin-left: auto;
    font-family: var(--f-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
    a {
      position: relative; color: var(--text-2); padding-block: 6px; transition: color .3s;
      &::after {
        content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
        background: var(--mineral); scale: 0 1; transform-origin: right; transition: scale .5s var(--ease-out);
      }
      &:hover, &[aria-current="true"] { color: var(--text); }
      &:hover::after, &[aria-current="true"]::after { scale: 1 1; transform-origin: left; }
    }
  }
  .menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; place-items: center; }
  @media (width < 900px) {
    .nav, .nav-cta { display: none; }
    .menu-btn { display: grid; }
  }

  .mobile-nav {
    inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
    border: 0; padding: 96px var(--gutter) 40px;
    background: color-mix(in srgb, var(--void) 92%, transparent);
    backdrop-filter: blur(20px);
    color: var(--text);
    opacity: 0; translate: 0 -12px;
    transition: opacity .4s, translate .5s var(--ease-out), display .5s allow-discrete, overlay .5s allow-discrete;
    &:popover-open { opacity: 1; translate: 0 0; }
    nav { display: grid; }
    a {
      display: flex; align-items: baseline; gap: 18px;
      font-family: var(--f-display); font-weight: 700; font-stretch: 75%;
      font-size: clamp(2.6rem, 12vw, 4rem); text-transform: uppercase; line-height: 1.15;
      border-bottom: 1px solid var(--line); padding-block: 10px;
      span { font-family: var(--f-mono); font-size: .8rem; font-weight: 400; color: var(--text-3); }
    }
  }
  @starting-style { .mobile-nav:popover-open { opacity: 0; translate: 0 -12px; } }
  .menu-close { position: absolute; top: 14px; right: var(--gutter); width: 44px; height: 44px; display: grid; place-items: center; }

  /* ---------- hero ---------- */
  .hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding-block: calc(var(--header-h) + 24px) 110px;
    overflow: clip;
  }
  .hero__gl, .hero__fallback {
    position: absolute; inset: 0; width: 100%; height: 100%;
  }
  .hero__gl { z-index: 0; opacity: 0; transition: opacity 1.6s var(--ease-out); }
  .hero__gl[data-ready] { opacity: 1; }
  .hero__fallback {
    z-index: -1;
    background:
      radial-gradient(60% 50% at 72% 40%, color-mix(in srgb, var(--silver) 16%, transparent), transparent 70%),
      radial-gradient(40% 30% at 85% 70%, color-mix(in srgb, var(--titanium) 18%, transparent), transparent 70%);
  }
  .hero::after { /* legibility veil on the text side */
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(90deg, var(--void) 0%, color-mix(in srgb, var(--void) 70%, transparent) 38%, transparent 70%),
      linear-gradient(0deg, var(--void) 0%, transparent 22%);
  }
  .hero__stars {
    position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .55;
    background-image:
      radial-gradient(1px 1px at 12% 22%, var(--mineral), transparent),
      radial-gradient(1px 1px at 82% 14%, var(--mineral), transparent),
      radial-gradient(1px 1px at 64% 78%, var(--silver), transparent),
      radial-gradient(1.5px 1.5px at 92% 52%, var(--mineral), transparent),
      radial-gradient(1px 1px at 38% 88%, var(--silver), transparent),
      radial-gradient(1px 1px at 4% 64%, var(--mineral), transparent);
  }
  .hero__inner { position: relative; z-index: 2; }
  .hero__title {
    margin-block: 22px 26px;
    font-size: var(--fs-hero);
    font-weight: 700;
    font-stretch: 82%;
    letter-spacing: -.035em;
    line-height: .9;
    text-transform: uppercase;
    .line { display: block; overflow: clip; padding-bottom: .04em; }
    .line > span { display: inline-block; }
  }
  .hero__lede { max-width: 34rem; color: var(--text-2); font-size: var(--fs-lede); font-weight: 300; }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

  .brand-context {
    position: absolute; z-index: 2;
    top: calc(var(--header-h) + 40px); right: var(--gutter);
    width: 250px; padding: 18px 20px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: color-mix(in srgb, var(--void) 55%, transparent);
    backdrop-filter: blur(14px);
    font-family: var(--f-mono); font-size: .68rem; letter-spacing: .06em;
    color: var(--text-2);
    .mono-label { color: var(--text); margin-bottom: 14px; font-size: .7rem; }
    ul { display: grid; gap: 4px; color: var(--text-3); }
    &::before { /* crosshair mark */
      content: "+"; position: absolute; left: -28px; top: 10px; color: var(--text-3); font-size: 1rem;
    }
  }
  .brand-context__motto {
    margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
    color: var(--text); text-transform: uppercase; letter-spacing: .14em; line-height: 1.7; font-size: .7rem;
  }
  @media (width < 1100px) { .brand-context { display: none; } }

  .status-pill {
    position: absolute; z-index: 2; left: var(--gutter); bottom: 40px;
    display: inline-flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: color-mix(in srgb, var(--graphite) 60%, transparent);
    backdrop-filter: blur(10px);
    font-family: var(--f-mono); font-size: .7rem; color: var(--text-2);
    b { font-weight: 500; color: var(--text); }
    time { color: var(--text); font-variant-numeric: tabular-nums; }
  }
  .status-pill__dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--live);
    animation: pulse 2.4s infinite;
  }
  .scroll-cue {
    position: absolute; z-index: 2; right: var(--gutter); bottom: 40px;
    width: 26px; height: 42px; border: 1px solid var(--line-strong); border-radius: 14px;
    span {
      position: absolute; left: 50%; top: 8px; width: 2px; height: 8px; margin-left: -1px;
      background: var(--mineral); border-radius: 2px; animation: cue 2s var(--ease-io) infinite;
    }
  }
  @keyframes cue { 0% { translate: 0 0; opacity: 1; } 80% { translate: 0 14px; opacity: 0; } 100% { opacity: 0; } }
  @media (width < 600px) {
    .hero::after { background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--void) 55%, transparent) 30%, var(--void) 75%); }
    .status-pill { bottom: 24px; font-size: .62rem; }
    .scroll-cue { display: none; }
  }

  /* ---------- marquee ---------- */
  .marquee {
    border-block: 1px solid var(--line);
    overflow: clip;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    padding-block: 22px;
  }
  .marquee__track {
    display: flex; gap: 28px; width: max-content;
    font-family: var(--f-display); font-stretch: 70%; font-weight: 300;
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); text-transform: uppercase; letter-spacing: .02em;
    color: var(--text-2);
    animation: marquee 48s linear infinite;
    i { font-style: normal; color: var(--text-3); }
  }
  .marquee:hover .marquee__track { animation-play-state: paused; }
  @keyframes marquee { to { translate: -50% 0; } }

  /* ---------- about ---------- */
  .about {
    display: grid; gap: clamp(32px, 6vw, 96px);
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: end;
    @media (width < 900px) { grid-template-columns: 1fr; }
  }
  .about__statement {
    font-family: var(--f-display);
    font-size: clamp(2rem, 1rem + 3.6vw, 4.2rem);
    font-weight: 200; font-stretch: 70%;
    line-height: 1.02; letter-spacing: -.02em;
    text-transform: uppercase;
    em {
      font-style: normal; font-weight: 700;
      background: var(--chrome); background-size: 220% 100%;
      -webkit-background-clip: text; background-clip: text; color: transparent;
    }
  }
  .about__body { display: grid; gap: 18px; color: var(--text-2); font-size: 1.02rem; }

  .metrics {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    margin-top: clamp(56px, 8vw, 110px);
  }
  .metric {
    display: grid; gap: 40px; padding: 28px 24px 24px;
    min-height: 210px; align-content: space-between;
  }
  .metric__value {
    font-family: var(--f-display); font-weight: 200; font-stretch: 62%;
    font-size: clamp(3.4rem, 2rem + 4vw, 5.6rem); line-height: .85; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
  }
  .metric__label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }

  /* ---------- projects ---------- */
  .case {
    container-type: inline-size;
    padding-block: clamp(40px, 6vw, 80px) clamp(80px, 10vw, 140px);
    & + & { border-top: 1px solid var(--line); padding-top: clamp(80px, 10vw, 140px); }
  }
  .case__top {
    display: grid; gap: 24px 48px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "index index"
      "title title"
      "tagline links"
      "meta meta";
    align-items: end;
    margin-bottom: clamp(40px, 5vw, 72px);
  }
  @container (width < 760px) {
    .case__top { grid-template-columns: 1fr; grid-template-areas: "index" "title" "tagline" "meta" "links"; }
  }
  .case__index { grid-area: index; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
  .case__title {
    grid-area: title;
    font-size: clamp(3.4rem, 15cqi, 12rem);
    font-weight: 800; font-stretch: 112%;
    letter-spacing: -.05em; line-height: .85;
    span { font-weight: 200; color: var(--text-2); }
  }
  .case__tagline { grid-area: tagline; max-width: 38rem; font-size: var(--fs-lede); color: var(--text-2); font-weight: 300; }
  .case__links { grid-area: links; display: flex; gap: 12px; }
  .case__meta {
    grid-area: meta;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    > div { padding: 18px 20px 0 0; display: grid; gap: 6px; }
    > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
    dt { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
    dd { font-size: .95rem; }
  }
  @container (width < 760px) {
    .case__meta { grid-template-columns: 1fr; > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; } }
  }

  /* browser frame */
  .browser {
    position: relative;
    border-radius: var(--r-lg);
    border: 1px solid var(--line-strong);
    background: var(--graphite);
    overflow: hidden;
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--void) 80%, transparent),
      0 60px 120px -40px color-mix(in srgb, var(--mineral) 14%, transparent),
      0 30px 60px -30px var(--void);
    transform: perspective(1800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .8s var(--ease-out);
    &::after { /* glass reflection */
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(125deg, color-mix(in srgb, var(--mineral) 10%, transparent) 0%, transparent 30%);
    }
  }
  .browser__bar {
    display: flex; align-items: center; gap: 7px; height: 40px; padding-inline: 16px;
    border-bottom: 1px solid var(--line);
    i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--mineral) 18%, transparent); }
    span {
      margin-inline: auto; padding: 4px 14px; border-radius: 999px;
      background: color-mix(in srgb, var(--void) 55%, transparent);
      font-family: var(--f-mono); font-size: .68rem; color: var(--text-2);
      translate: -24px 0;
    }
  }
  .shot {
    display: block; width: 100%; cursor: zoom-in; position: relative;
    img { width: 100%; height: auto; transition: scale 1.2s var(--ease-out), filter .6s; }
    &:hover img { scale: 1.015; }
  }

  .case__grid {
    display: grid; gap: clamp(32px, 4vw, 56px);
    grid-template-columns: 1.25fr 1fr .9fr;
    margin-top: clamp(56px, 7vw, 96px);
  }
  @container (width < 1080px) { .case__grid { grid-template-columns: 1fr 1fr; } .case__block--stats { grid-column: 1 / -1; } }
  @container (width < 680px) { .case__grid { grid-template-columns: 1fr; } }
  .case__block {
    > p { color: var(--text-2); }
    > p + p { margin-top: 14px; }
  }
  .mini-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
    margin-bottom: 20px;
    > div { background: var(--void); padding: 16px 14px; display: flex; flex-direction: column-reverse; gap: 8px; }
    dt { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); line-height: 1.3; }
    dd { font-family: var(--f-display); font-stretch: 62%; font-weight: 200; font-size: 2.6rem; line-height: .9; }
  }

  /* gallery */
  .gallery { margin-top: clamp(56px, 7vw, 96px); }
  .gallery__head {
    display: flex; align-items: flex-end; gap: 20px;
    .mono-label { flex: 1; margin-bottom: 0; }
  }
  .gallery__nav { display: flex; gap: 8px; }
  .gallery__track {
    display: flex; gap: clamp(14px, 2vw, 24px);
    margin-top: 28px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 8px var(--gutter) 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    cursor: grab;
    &::-webkit-scrollbar { display: none; }
    &[data-dragging] { cursor: grabbing; scroll-snap-type: none; .shot { pointer-events: none; } }
  }
  .device {
    flex: none; width: clamp(200px, 22vw, 270px);
    scroll-snap-align: start;
    .shot {
      border-radius: 30px; overflow: hidden;
      border: 1px solid var(--line-strong);
      background: var(--graphite);
      padding: 7px;
      box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--mineral) 18%, transparent);
      img { border-radius: 23px; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; }
    }
    p { margin-top: 14px; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
  }
  .device--wide {
    width: clamp(300px, 46vw, 640px);
    .shot { border-radius: var(--r-lg); padding: 6px; img { border-radius: 12px; aspect-ratio: 16 / 10; } }
  }

  /* ---------- experience ---------- */
  .timeline { display: grid; }
  .role {
    display: grid; gap: 16px 48px;
    grid-template-columns: 220px minmax(0, 1fr);
    padding-block: 40px;
    border-top: 1px solid var(--line);
    &:last-child { border-bottom: 1px solid var(--line); }
    @media (width < 760px) { grid-template-columns: 1fr; }
    h3 {
      font-size: var(--fs-h3); font-weight: 600; font-stretch: 100%; letter-spacing: -.02em; margin-bottom: 22px;
      span { font-weight: 300; color: var(--text-3); margin-left: 6px; }
    }
    ul { display: grid; gap: 10px; color: var(--text-2); max-width: 62rem; }
    li { position: relative; padding-left: 26px; }
    li::before { content: "→"; position: absolute; left: 0; color: var(--text-3); font-family: var(--f-mono); }
    > .role__main > p { color: var(--text-2); }
  }
  .role__when { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; color: var(--text-3); padding-top: 8px; time { color: var(--text); } }
  .role--compact h3 { font-size: 1.15rem; margin-bottom: 10px; }

  .award {
    display: flex; align-items: center; gap: 24px;
    margin-top: 40px; padding: 28px;
    .mono-label { border: 0; padding: 0; margin-bottom: 6px; }
  }
  .award__text { font-family: var(--f-display); font-size: clamp(1.1rem, 1rem + .6vw, 1.5rem); font-weight: 400; }
  a.award {
    > div { flex: 1; }
    &:hover .award__cta { color: var(--text); }
    &:hover .award__cta .ico { translate: 3px -3px; }
  }
  .award__cta {
    display: inline-flex; align-items: center; gap: 10px; flex: none;
    font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-2); transition: color .3s;
    .ico { transition: translate .4s var(--ease-out); }
  }
  @media (width < 640px) {
    a.award { flex-wrap: wrap; }
    .award__cta { width: 100%; padding-left: 54px; }
  }

  /* ---------- stack ---------- */
  .caps {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  }
  .cap {
    padding: 32px 28px; display: grid; gap: 14px; align-content: start; min-height: 240px;
    .ico--lg { margin-bottom: 26px; color: var(--silver); }
    h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
    p { color: var(--text-2); font-size: .95rem; }
  }
  .edu {
    display: grid; gap: 48px; grid-template-columns: 1fr 1.4fr; margin-top: clamp(56px, 7vw, 96px);
    @media (width < 760px) { grid-template-columns: 1fr; }
    h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
    p:not(.mono-label) { color: var(--text-2); }
  }

  /* ---------- principles ---------- */
  .principles { padding-block: clamp(120px, 16vw, 220px) 0; }
  .principles__list {
    li {
      display: grid; grid-template-columns: 80px 1fr; align-items: baseline;
      border-top: 1px solid var(--line); padding-block: clamp(18px, 3vw, 36px);
      &:last-child { border-bottom: 1px solid var(--line); }
      > span { font-family: var(--f-mono); font-size: .8rem; color: var(--text-3); }
    }
  }
  .principle {
    font-family: var(--f-display); text-transform: uppercase;
    font-size: clamp(2.2rem, .8rem + 6.6vw, 7.6rem);
    font-weight: 200; font-stretch: 62%; letter-spacing: -.02em; line-height: .95;
    transition: font-weight .7s var(--ease-out), font-stretch .7s var(--ease-out), color .4s;
    color: var(--text-2);
  }
  .principles__list li:hover .principle { font-weight: 700; font-stretch: 80%; color: var(--text); }

  /* ---------- contact ---------- */
  .contact { padding-bottom: clamp(96px, 12vw, 160px); }
  .contact__title {
    font-family: var(--f-display); text-transform: uppercase;
    font-size: var(--fs-h2); font-weight: 700; font-stretch: 82%; letter-spacing: -.035em; line-height: .9;
  }
  .contact__row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
    margin-top: clamp(40px, 6vw, 80px);
  }
  .email {
    display: inline-flex; align-items: center; gap: 16px;
    padding: 18px 22px; border-radius: var(--r);
    border: 1px solid var(--line-strong);
    font-family: var(--f-mono); font-size: clamp(.8rem, .7rem + .5vw, 1.05rem);
    translate: var(--mx, 0) var(--my, 0);
    transition: border-color .3s, background .3s, translate .5s var(--ease-out);
    max-width: 100%;
    > span:nth-of-type(1) { overflow-wrap: anywhere; text-align: left; }
    &:hover { border-color: var(--mineral); background: color-mix(in srgb, var(--mineral) 5%, transparent); }
  }
  .email__hint {
    display: inline-flex; align-items: center; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line);
    color: var(--text-3); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  }
  .socials { display: flex; gap: 10px; }
  @media (width < 520px) {
    .email { width: 100%; font-size: .8rem; gap: 12px; padding: 16px; }
    .email__hint [data-copy-label] { display: none; }
  }

  /* ---------- footer ---------- */
  .site-footer {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    padding-block: 32px 40px; border-top: 1px solid var(--line);
    font-size: .8rem; color: var(--text-3);
    .mono { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; }
  }

  /* ---------- lightbox ---------- */
  .lightbox {
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    border: 0; padding: 0; background: transparent; color: var(--text);
    &::backdrop { background: color-mix(in srgb, var(--void) 90%, transparent); backdrop-filter: blur(14px); }
    &[open] { display: grid; place-items: center; }
    figure { display: grid; justify-items: center; gap: 16px; padding: 64px 72px; max-height: 100dvh; }
    img {
      max-height: calc(100dvh - 160px); max-width: min(100%, 1400px); width: auto; height: auto;
      border-radius: var(--r-lg); border: 1px solid var(--line-strong);
      view-transition-name: lightbox-img;
    }
    figcaption { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
    @media (width < 700px) { figure { padding: 64px 16px 88px; } }
  }
  .lightbox__close { position: absolute; top: 16px; right: 16px; }
  .lightbox__prev, .lightbox__next { position: absolute; top: 50%; translate: 0 -50%; }
  .lightbox__prev { left: 16px; }
  .lightbox__next { right: 16px; }
  @media (width < 700px) {
    .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; translate: none; }
    .lightbox__prev { left: calc(50% - 56px); }
    .lightbox__next { right: calc(50% - 56px); }
  }
}

/* --------------------------------------------------------------- motion */
@layer motion {
  /* hero entrance */
  .hero__title .line > span { translate: 0 110%; animation: rise 1.2s var(--ease-out) forwards; }
  .hero__title .line:nth-child(2) > span { animation-delay: .08s; }
  .hero__title .line:nth-child(3) > span { animation-delay: .16s; }
  .hero__title .line:nth-child(4) > span { animation-delay: .24s; }
  .hero__lede, .hero__actions, .hero .overline, .brand-context, .status-pill {
    opacity: 0; animation: fade 1.2s var(--ease-out) .5s forwards;
  }
  @keyframes rise { to { translate: 0 0; } }
  @keyframes fade { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

  /* scroll-driven reveals (progressive enhancement) */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .reveal-scale {
      animation: reveal-scale linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    .section__rule {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 90%;
    }
    .hero__inner {
      animation: hero-out linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
    .principle {
      animation: principle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
  }
  @keyframes reveal { from { opacity: 0; translate: 0 48px; filter: blur(6px); } }
  @keyframes reveal-scale { from { opacity: 0; scale: .92; translate: 0 60px; } }
  @keyframes draw { from { scale: 0 1; } }
  @keyframes hero-out { to { opacity: 0; translate: 0 -12vh; } }
  @keyframes principle { from { translate: 8vw 0; opacity: .2; } }

  /* JS fallback for browsers without scroll timelines */
  html.no-sda .reveal,
  html.no-sda .reveal-scale { opacity: 0; translate: 0 40px; transition: opacity 1s var(--ease-out), translate 1s var(--ease-out); }
  html.no-sda .reveal[data-in], html.no-sda .reveal-scale[data-in] { opacity: 1; translate: 0 0; }

  /* view transitions */
  ::view-transition-old(lightbox-img), ::view-transition-new(lightbox-img) { animation-duration: .45s; animation-timing-function: var(--ease-out); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .01ms !important; animation-iteration-count: 1 !important;
      transition-duration: .01ms !important; scroll-behavior: auto !important;
    }
    .reveal, .reveal-scale, .principle, .hero__inner, .section__rule { animation: none !important; opacity: 1 !important; translate: none !important; filter: none !important; }
    .hero__title .line > span { translate: 0 0; }
    .marquee__track { animation: none; }
  }
}
