/* ==========================================================================
   Victor Adoghe — Portfolio
   Editorial / Swiss design system

   1.  Tokens
   2.  Reset & base
   3.  Layout primitives
   4.  Typography & rules
   5.  Buttons, chips, links
   6.  Header & navigation
   7.  Hero
   8.  Ticker
   9.  About
   10. Selected work
   11. Skills
   12. Experience
   13. Contact
   14. Footer
   15. Toasts & utilities
   16. Motion / reveal
   17. Case-study pages
   18. Responsive & touch refinements
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  /* Palette — dark is the default canvas */
  --bg:          #0a0a0b;
  --bg-2:        #0f0f11;
  --surface:     #131316;
  --surface-2:   #1a1a1e;
  --ink:         #f4f3f1;
  --ink-2:       #a3a19c;
  --ink-3:       #6b6963;
  --line:        rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent:      #ff5b2e;
  --accent-soft: rgba(255, 91, 46, 0.14);
  --accent-ink:  #0a0a0b;
  --shadow:      0 24px 60px -24px rgba(0, 0, 0, 0.7);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-display: clamp(2.75rem, 1.1rem + 7.2vw, 8rem);
  --fs-h2:      clamp(2rem, 1.1rem + 3.4vw, 4.25rem);
  --fs-h3:      clamp(1.35rem, 1.1rem + 1vw, 2rem);
  --fs-lede:    clamp(1.1rem, 0.98rem + 0.7vw, 1.6rem);
  --fs-body:    clamp(0.95rem, 0.92rem + 0.15vw, 1.0625rem);
  --fs-meta:    0.75rem;

  --lh-display: 0.94;
  --lh-tight:   1.1;
  --lh-body:    1.65;
  --tracking-meta: 0.14em;

  /* Space & layout */
  --pad:       clamp(1.15rem, 4.5vw, 5rem);
  --max:       1440px;
  --gap:       clamp(1rem, 2vw, 2rem);
  --section-y: clamp(4.5rem, 10vw, 10rem);
  --header-h:  clamp(58px, 8vw, 68px);

  /* Notch / rounded-display insets. Fall back to 0 where env() is unsupported. */
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Minimum comfortable touch target — applied on coarse pointers only */
  --tap: 44px;

  --r:    2px;
  --r-md: 4px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  0.45s;
}

[data-theme='light'] {
  --bg:          #f2f1ec;
  --bg-2:        #ecebe5;
  --surface:     #ffffff;
  --surface-2:   #f8f7f3;
  --ink:         #131211;
  --ink-2:       #5c5951;
  --ink-3:       #8f8b81;
  --line:        rgba(19, 18, 17, 0.14);
  --line-strong: rgba(19, 18, 17, 0.32);
  --accent:      #d93a10;
  --accent-soft: rgba(217, 58, 16, 0.1);
  --accent-ink:  #ffffff;
  --shadow:      0 24px 60px -30px rgba(19, 18, 17, 0.28);
  color-scheme: light;
}

[data-theme='dark'] { color-scheme: dark; }

@media (prefers-color-scheme: light) {
  :root[data-theme='auto'] {
    --bg:          #f2f1ec;
    --bg-2:        #ecebe5;
    --surface:     #ffffff;
    --surface-2:   #f8f7f3;
    --ink:         #131211;
    --ink-2:       #5c5951;
    --ink-3:       #8f8b81;
    --line:        rgba(19, 18, 17, 0.14);
    --line-strong: rgba(19, 18, 17, 0.32);
    --accent:      #d93a10;
    --accent-soft: rgba(217, 58, 16, 0.1);
    --accent-ink:  #ffffff;
    --shadow:      0 24px 60px -30px rgba(19, 18, 17, 0.28);
    color-scheme: light;
  }
}

/* Kill transitions while the theme swaps so the flip is instant */
[data-theme-switching='true'] *,
[data-theme-switching='true'] *::before,
[data-theme-switching='true'] *::after {
  transition: none !important;
  animation: none !important;
}

/* 2. Reset & base ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` contains stray overflow without making <body> a scroll container,
     which is what keeps html's scroll-padding-top working for anchor jumps. */
  overflow-x: hidden;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

/* Film grain — sits above everything, never intercepts pointer events */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* Long unbroken strings (URLs, package names) must not push the page sideways */
p, li, dd, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* Code samples in the articles/case studies are authored wide on purpose —
   let them scroll inside their own box rather than widening the document. */
pre {
  margin: 1.25rem 0;
  padding: 1rem clamp(0.85rem, 3vw, 1.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  font-size: clamp(0.78rem, 0.7rem + 0.35vw, 0.9rem);
  line-height: 1.6;
  tab-size: 2;
}
pre code {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-wrap: break-word;
}

/* Same rule for any table that ends up in an article */
.table-scroll, table { display: block; max-width: 100%; overflow-x: auto; }

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

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-md);
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 3. Layout primitives ----------------------------------------------------- */

/* padding-inline uses max() so a landscape notch never eats the first character */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--pad), var(--safe-l));
  padding-right: max(var(--pad), var(--safe-r));
}

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

/* 4. Typography & rules ---------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow-num { color: var(--accent); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-strong);
  margin-bottom: clamp(1.75rem, 4vw, 3.5rem);
}
.section-head .eyebrow-meta {
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-title {
  font-size: var(--fs-h2);
  max-width: 20ch;
  margin-top: clamp(0.75rem, 2vw, 1.5rem);
}
.section-title .accent { color: var(--accent); }

.lede {
  font-size: var(--fs-lede);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 34ch;
  text-wrap: pretty;
}

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

/* 5. Buttons, chips, links ------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.35rem;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              transform 0.3s var(--ease);
}
/* Wipe fill on hover */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s var(--ease);
}
.btn:hover::before,
.btn:focus-visible::before { transform: scaleY(1); }
.btn:hover, .btn:focus-visible { color: var(--accent-ink); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn-primary { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-line: var(--accent); }
.btn-primary::before { background: var(--ink); }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--bg); border-color: var(--ink); }

.btn-sm { padding: 0.6rem 0.95rem; }

/* Resume button carries both an icon and a label; the icon only appears once
   the button collapses at the nav breakpoint. */
.resume-btn .resume-icon { display: none; }

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              background 0.25s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }

/* Theme icon swap */
.icon-sun, .icon-moon { display: none; }
:root[data-resolved-theme='dark'] .icon-sun,
:root[data-resolved-theme='light'] .icon-moon { display: block; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              background 0.25s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease), color 0.25s var(--ease);
  padding-bottom: 2px;
}
.link:hover, .link:focus-visible { background-size: 100% 1px; color: var(--accent); }

/* 6. Header & navigation --------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
              backdrop-filter 0.35s var(--ease);
}
.site-header.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  will-change: transform;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 500 0.8rem / 1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 0.5s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(45deg) scale(1.15); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  position: relative;
  display: block;
  padding: 0.55rem 0.75rem;
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a:hover::after { transform: scaleX(1); }
.nav-menu a[aria-current='true'] { color: var(--ink); }
.nav-menu a[aria-current='true']::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Full-screen mobile navigation */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  /* `safe` keeps the top of the list reachable once it outgrows the viewport */
  align-content: center;
  align-content: safe center;
  padding-block: calc(var(--header-h) + 1rem) calc(var(--pad) + var(--safe-b));
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
  /* A landscape phone can't fit five 3.5rem links — scroll instead of clipping */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.nav-overlay[hidden] { display: none; } /* pre-JS / no-JS fallback */
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.nav-overlay li {
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.nav-overlay li:last-child { border-bottom: 1px solid var(--line); }
.nav-overlay.is-open li { opacity: 1; transform: none; }
.nav-overlay.is-open li:nth-child(1) { transition-delay: 0.08s; }
.nav-overlay.is-open li:nth-child(2) { transition-delay: 0.14s; }
.nav-overlay.is-open li:nth-child(3) { transition-delay: 0.2s; }
.nav-overlay.is-open li:nth-child(4) { transition-delay: 0.26s; }
.nav-overlay.is-open li:nth-child(5) { transition-delay: 0.32s; }
.nav-overlay a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 11vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.nav-overlay a span {
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  color: var(--accent);
}
.nav-overlay a:hover { color: var(--accent); }
.nav-overlay-foot {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}
.nav-overlay-foot a { color: var(--ink-2); text-decoration: none; }
.nav-overlay-foot a:hover { color: var(--accent); }

@media (max-width: 880px) {
  .nav-menu { display: none; }
  .nav-toggle { display: inline-flex; flex-direction: column; }

  /* The resume button collapses to an icon rather than disappearing - a visitor
     on a phone still needs to be able to download the CV without hunting for it
     inside the menu. Sized to match the theme toggle sitting next to it. */
  .header-actions .resume-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-color: var(--line);
  }
  .header-actions .resume-btn .resume-label { display: none; }
  .header-actions .resume-btn .resume-icon { display: block; width: 18px; height: 18px; }
}

/* 7. Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: clamp(560px, 92svh, 1000px);
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 3rem) clamp(2rem, 6vw, 5rem);
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(52px, 7vw, 110px) clamp(52px, 7vw, 110px);
  -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, #000 15%, transparent 72%);
  mask-image: radial-gradient(130% 100% at 50% 0%, #000 15%, transparent 72%);
}
.hero-bloom {
  position: absolute;
  top: -18%;
  right: -8%;
  width: min(58vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0.16;
  filter: blur(70px);
  animation: drift 22s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-8%, 7%, 0) scale(1.18); }
}

.hero-inner { position: relative; z-index: 1; width: 100%; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
}
.status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fbf71;
  flex: none;
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #2fbf71;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero-title {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.045em;
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  max-width: 16ch;
}
.hero-title .accent { color: var(--accent); }
.hero-title em {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 0.055em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: rule-in 0.9s 0.7s var(--ease) forwards;
}
@keyframes rule-in { to { transform: scaleX(1); } }

/* Word-by-word entrance */
.line { display: block; overflow: hidden; }
.word {
  display: inline-block;
  transform: translateY(105%);
  animation: word-up 0.85s var(--ease) forwards;
}
@keyframes word-up { to { transform: translateY(0); } }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font: 400 var(--fs-meta) / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero-meta .sep { color: var(--ink-3); }
.rotator { color: var(--ink); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  max-width: 640px;
}
.hero-stats dt {
  font: 400 var(--fs-meta) / 1.3 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-3);
}
/* Three uppercase mono labels don't survive a 320px viewport — tighten the
   tracking first, and only drop to two columns when that stops being enough. */
@media (max-width: 420px) {
  .hero-stats { gap: 1.25rem 1rem; }
  .hero-stats dt { letter-spacing: 0.06em; font-size: 0.68rem; }
}
@media (max-width: 340px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hero-stats dd {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 1.8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  font: 400 0.65rem / 1 var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  z-index: 1;
}
.scroll-cue-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue-line::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 40%;
  background: var(--accent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}
@media (max-width: 880px) { .scroll-cue { display: none; } }

/* 8. Ticker ---------------------------------------------------------------- */

.ticker {
  border-block: 1px solid var(--line);
  padding-block: 0.9rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.ticker-group span::before {
  content: '◦';
  color: var(--accent);
  margin-right: 2.5rem;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 9. About ----------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.about-body p + p { margin-top: 1.25rem; }
.about-body p { color: var(--ink-2); max-width: 56ch; }
.about-body .lede { color: var(--ink); margin-bottom: 1.5rem; max-width: 30ch; }

.facts { margin: 0; }
.fact {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.85rem;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.fact:last-child { border-bottom: 1px solid var(--line); }
/* Below this the value column is ~150px and every entry wraps to four lines */
@media (max-width: 480px) {
  .fact { grid-template-columns: 1fr; gap: 0.35rem; }
}
.fact dt {
  font: 400 var(--fs-meta) / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-3);
}
.fact dd { margin: 0; color: var(--ink); }

/* 10. Selected work -------------------------------------------------------- */

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4.5rem) var(--gap);
}
/* Two columns hold up through tablet portrait (768–834px); below that a card
   gets too narrow for the title + description to read well. */
@media (max-width: 700px) {
  .work-grid { grid-template-columns: 1fr; gap: clamp(2.5rem, 9vw, 3.5rem); }
}

.work-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.25rem;
}
.work-card[hidden] { display: none; }

/* Only runs when the filter changes — an always-on animation would override
   the [data-reveal] entrance and cards would never fade in on scroll. */
.work-card.is-filtering { animation: card-in 0.45s var(--ease) both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Featured card spans the row and splits horizontally on wide screens */
.work-card.is-featured { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .work-card.is-featured {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
  }
  .work-card.is-featured .work-title { font-size: clamp(2rem, 3vw, 3rem); }
}

.work-media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  aspect-ratio: 16 / 10;
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}
.work-card:hover .work-media img,
.work-media:focus-visible img { transform: scale(1.04); }

.work-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 55%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.work-card:hover .work-media::after { opacity: 1; }

.work-num {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 0.45rem 0.7rem;
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-right-radius: var(--r-md);
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--accent);
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line-strong);
  padding-top: 0.85rem;
}
.work-title {
  font-size: var(--fs-h3);
  letter-spacing: -0.035em;
  transition: color 0.3s var(--ease);
}
.work-card:hover .work-title { color: var(--accent); }
.work-year {
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  color: var(--ink-3);
  white-space: nowrap;
}
.work-desc {
  margin-top: 0.7rem;
  color: var(--ink-2);
  max-width: 48ch;
}

.work-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.work-tech li {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font: 400 0.7rem / 1.3 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.work-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.25s var(--ease), background-size 0.35s var(--ease);
}
.work-links a:hover, .work-links a:focus-visible { color: var(--accent); }
.work-links a svg { width: 12px; height: 12px; transition: transform 0.3s var(--ease); }
.work-links a:hover svg { transform: translate(2px, -2px); }
.work-links a.is-ghost {
  color: var(--ink-2);
  background-image: linear-gradient(var(--line-strong), var(--line-strong));
}
.work-links a.is-ghost:hover {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
}

.work-empty {
  grid-column: 1 / -1;
  padding: 3rem 0;
  text-align: center;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}

/* 11. Skills --------------------------------------------------------------- */

.skill-group {
  display: grid;
  grid-template-columns: minmax(140px, 0.28fr) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
  align-items: start;
}
.skill-group:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .skill-group { grid-template-columns: 1fr; gap: 0.85rem; } }

.skill-group-label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font: 500 var(--fs-meta) / 1.4 var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
}
.skill-group-label .num { color: var(--accent); }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.skill-tags li {
  position: relative;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
              background 0.25s var(--ease), transform 0.25s var(--ease);
  cursor: default;
}
.skill-tags li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-2px);
}

.skill-note {
  margin-top: 1.5rem;
  color: var(--ink-3);
  font: 400 var(--fs-meta) / 1.6 var(--font-mono);
  letter-spacing: 0.06em;
}

/* 12. Experience ----------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline-item { border-top: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 1px solid var(--line); }

.timeline-header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 0.26fr) minmax(0, 1fr) auto;
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  align-items: baseline;
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.timeline-header:hover { color: var(--accent); }
.timeline-header:hover .timeline-when { color: var(--accent); }

.timeline-when {
  font: 400 var(--fs-meta) / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.3s var(--ease);
}
.timeline-role {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.timeline-org {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-2);
}

.timeline-sign {
  position: relative;
  width: 15px;
  height: 15px;
  flex: none;
  align-self: center;
}
.timeline-sign::before,
.timeline-sign::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.timeline-sign::after { transform: translate(-50%, -50%) rotate(90deg); }
.timeline-header[aria-expanded='true'] .timeline-sign::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.timeline-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.timeline-content.is-open { grid-template-rows: 1fr; }
.timeline-content > div { overflow: hidden; }
.timeline-content ul {
  margin: 0;
  padding: 0 0 clamp(1.5rem, 3vw, 2rem);
  list-style: none;
  display: grid;
  gap: 0.65rem;
  max-width: 68ch;
}
/* 701px, not 700 — at exactly 700 the max-width query below also matches and
   the bullets would indent under a header that had already collapsed. */
@media (min-width: 701px) {
  .timeline-content ul { margin-left: calc(0.26 * 100% + clamp(1.5rem, 4vw, 4rem)); }
}
.timeline-content li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--ink-2);
}
.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

@media (max-width: 700px) {
  .timeline-header { grid-template-columns: 1fr auto; }
  .timeline-when { grid-column: 1 / -1; }
}

/* 13. Contact -------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 0.9rem + 2.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
  word-break: break-word;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.45s var(--ease), color 0.3s var(--ease);
  padding-bottom: 4px;
}
.contact-email:hover { color: var(--accent); background-size: 100% 2px; }

.contact-side .facts { margin-top: 2rem; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.45rem 0.8rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; }

.contact-form { display: grid; gap: 1.5rem; }
.field { display: grid; gap: 0.5rem; }
.field > span:first-child {
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-3);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  transition: border-color 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] { border-bottom-color: #e5484d; }

/* Reserve the line so an error appearing never shifts the layout */
.error-message {
  min-height: 1.4em;
  font: 400 0.75rem / 1.4 var(--font-mono);
  color: #e5484d;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.form-message {
  font: 400 var(--fs-meta) / 1.5 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-message.success { color: #2fbf71; }
.form-message.error { color: #e5484d; }
.btn-loader { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-loader svg { width: 14px; height: 14px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 14. Footer --------------------------------------------------------------- */

.site-footer {
  margin-top: var(--section-y);
  border-top: 1px solid var(--line-strong);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}
.footer-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--ink);
}
.footer-wordmark span { color: var(--accent); }

.socials { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 15px; height: 15px; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font: 400 var(--fs-meta) / 1.6 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-3);
  font: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.to-top:hover { color: var(--accent); }
.to-top svg { width: 12px; height: 12px; }

/* 15. Toasts & utilities --------------------------------------------------- */

/* Pinned to both edges so a long toast wraps inside the viewport instead of
   overflowing it; justify-items keeps short ones hugging the right. */
.toast-container {
  position: fixed;
  left: max(var(--pad), var(--safe-l));
  right: max(var(--pad), var(--safe-r));
  bottom: calc(1.5rem + var(--safe-b));
  z-index: 300;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font: 500 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  animation: toast-in 0.35s var(--ease) both;
}
.toast.is-out { animation: toast-out 0.3s var(--ease) both; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* 16. Motion / reveal ------------------------------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* Follow the visitor's OS motion setting */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .word { transform: none; }
  .hero-bloom,
  .status-dot::after,
  .scroll-cue-line::after { animation: none; }
  .ticker-track { animation-play-state: paused; }
}

/* 17. Case-study pages ----------------------------------------------------- */

.case {
  max-width: 74ch;
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4rem);
}
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  font: 400 var(--fs-meta) / 1 var(--font-mono);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.case-back:hover { color: var(--accent); }
.case > header { border-bottom: 1px solid var(--line-strong); padding-bottom: 1.5rem; }
.case h1 {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
}
.case h2 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.case section { margin-top: clamp(2rem, 5vw, 3rem); }
.case p { color: var(--ink-2); }
.case p + p { margin-top: 1rem; }
.case ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.5rem; color: var(--ink-2); }
.case ul li::marker { color: var(--accent); }
.case a { color: var(--accent); }
.case img { border: 1px solid var(--line); border-radius: var(--r-md); margin-block: 1.5rem; }
.case hr { border: 0; border-top: 1px solid var(--line); margin-block: 1.25rem; }
.case .small { font-size: var(--fs-meta); font-family: var(--font-mono); letter-spacing: 0.06em; }

/* 18. Responsive & touch refinements ---------------------------------------
   The per-component breakpoints live next to their components above. What
   follows is the cross-cutting behaviour: pointer type, screen orientation,
   and the two viewport extremes (small phone, tablet).
   -------------------------------------------------------------------------- */

/* --- Coarse pointers: everything tappable clears 44×44 ---------------------
   Sized with min-height/min-width rather than extra padding so the visual
   design is unchanged on mouse-driven screens. */
@media (pointer: coarse) {
  .icon-btn,
  .nav-toggle {
    width: var(--tap);
    height: var(--tap);
  }

  .btn,
  .chip,
  .copy-btn,
  .socials a {
    min-height: var(--tap);
  }

  .btn-sm { padding-inline: 1.1rem; }

  /* Links with no decoration pinned to the baseline can simply grow. They are
     already inline-flex + centred, so min-height alone re-centres the label. */
  .brand,
  .to-top,
  .case-back,
  .nav-overlay-foot a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }

  /* These two carry a background-image underline sitting at the bottom edge,
     so growing the box would strand the rule below the text. Their hit area is
     extended with a centred pseudo-element instead: a fixed 44px band, which
     lands correctly whatever the mono line-box happens to measure. */
  .work-links a,
  .contact-email {
    position: relative;
  }
  .work-links a::after,
  .contact-email::after {
    content: '';
    position: absolute;
    left: -0.4rem;
    right: -0.4rem;
    top: 50%;
    height: var(--tap);
    transform: translateY(-50%);
  }

  /* Comfortable thumb spacing once the targets are bigger. The row gaps matter
     most — these rows wrap, and 44px bands would otherwise overlap vertically. */
  .work-links { gap: 1.5rem; }
  .footer-bottom { gap: 1.25rem; }
  .nav-overlay-foot { gap: 0.25rem 1.25rem; }
}

/* --- Hoverless devices: don't let tap-triggered :hover states stick -------- */
@media (hover: none) {
  .work-card:hover .work-media img,
  .socials a:hover,
  .brand:hover .brand-mark {
    transform: none;
  }
  .work-card:hover .work-media::after { opacity: 0; }
  /* Skill tags aren't interactive at all — a stuck accent state is pure noise */
  .skill-tags li:hover {
    transform: none;
    border-color: var(--line);
    background: transparent;
    color: var(--ink);
  }
  /* A stray tap on the marquee shouldn't pause it for the rest of the visit */
  .ticker:hover .ticker-track { animation-play-state: running; }
}

/* --- Tablet (portrait ~768–834px, landscape up to 1180px) ------------------ */
@media (min-width: 701px) and (max-width: 1024px) {
  .work-card .work-desc { max-width: 42ch; }
  .about-body p { max-width: 62ch; }
  /* The section rule and its meta caption stop fitting on one line first */
  .section-head { row-gap: 0.35rem; }
}

/* --- Small phones ---------------------------------------------------------- */
@media (max-width: 480px) {
  /* Side-by-side CTAs wrap into two ragged half-width buttons; stacking them
     full-width reads better and gives each a full-width tap target. */
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }

  .section-head { row-gap: 0.35rem; }
  .work-head { flex-wrap: wrap; row-gap: 0.25rem; }
  .work-head .work-year { flex-basis: 100%; }

  .footer-top { align-items: flex-start; gap: 1.5rem; }
  /* .socials is shrink-to-fit as a flex item, so it needs an explicit width
     before flex:1 on the children has anything to distribute. */
  .socials { width: 100%; }
  .socials a { flex: 1 1 auto; justify-content: center; }

  .contact-email { font-size: clamp(1.25rem, 6.5vw, 1.75rem); }

  /* A 70px blur over a 58vw circle is a measurable paint cost on mid-range
     phones, and at this size the bloom reads the same either way. */
  .hero-bloom { filter: blur(45px); width: min(80vw, 420px); }
}

@media (max-width: 360px) {
  .brand { font-size: 0.72rem; letter-spacing: 0.1em; }
  .hero-title { letter-spacing: -0.035em; }
  .chip { padding-inline: 0.7rem; }
}

/* --- Short viewports: keep the whole menu on one screen -------------------
   At the default 3.5rem the five links plus the footer run ~710px, which forces
   a scroll on a 568px phone. Scrolling still works as a safety net (see the
   overflow rules on .nav-overlay) — this just means it's rarely needed. */
@media (max-height: 700px) {
  .nav-overlay a { font-size: clamp(1.5rem, 7vw, 2.25rem); padding-block: 0.55rem; }
  .nav-overlay-foot { margin-top: 1.5rem; }
}

/* --- Short viewports (phones in landscape, small split-screen windows) -----
   The hero is built around a tall canvas; at 375px of height its min-height
   floor and vertical centring push the CTAs below the fold. */
@media (max-height: 540px) and (orientation: landscape) {
  .hero {
    min-height: 0;
    align-items: flex-start;
    padding-block: calc(var(--header-h) + 1.75rem) 2.5rem;
  }
  .hero-stats { margin-top: 2rem; }
  .section { padding-block: clamp(3rem, 8vh, 4.5rem); }

  .nav-overlay { align-content: start; }
  .nav-overlay a { font-size: clamp(1.4rem, 5vh, 2rem); padding-block: 0.5rem; }
  .nav-overlay-foot { margin-top: 1.25rem; }
}

/* --- Collapsed resume button on touch devices --------------------------------
   Once collapsed to an icon it should stay square at the full tap target, the
   way the toggles beside it do. `.btn`'s min-height alone would leave it
   oblong, so both axes are set here. */
@media (pointer: coarse) and (max-width: 880px) {
  .header-actions .resume-btn {
    width: var(--tap);
    height: var(--tap);
  }
}

/* --- Very wide screens ------------------------------------------------------
   Past the 1440px container the fixed viewport units keep growing, so cap the
   places where that would otherwise stretch a line of text too far. */
@media (min-width: 1600px) {
  .about-body p,
  .work-desc { max-width: 52ch; }
}
