/* ==========================================================================
   Jonathan Rodrigues — "Headliner × Index"
   Top half: Headliner (poster type, color bands, marquee).
   Below the numbers: Index (Swiss tables, numbered lists, hairline rules).
   ========================================================================== */

/* ---------- Self-hosted fonts: Instrument Serif (headlines) + Instrument Sans (body), latin subset, from @fontsource 5.3.0 ---------- */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Color — "Clay" (dark) is the default for every visitor; "Gallery" (light) is set with <html data-palette="gallery">.
     The header switch and the inline script in <head> set data-palette (dark unless the visitor chose light).
     accent = colored text (name, clock, hovers); band = big color fields (marquee, badge, footer, row hover) */
  --c-page: #151311; --c-ink: #EFEAE2; --c-ink-2: #BCB5AA; --c-soft: #D5CFC5; --c-ink-3: #9C958A;
  --c-line: #2B2723; --c-hair: #332E29; --c-surface: #1F1C19;
  --c-accent: #E39A74; --c-band: #C9724D; --c-on-band: #151311;
  color-scheme: dark;

  /* Type: Instrument Serif for headlines (one weight, 400, uppercase), Instrument Sans for body (400/700) */
  --display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max: 1376px;
  --gutter: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Gallery palette (light). Both palettes: all text pairs checked ≥ 4.5:1 ---------- */
html[data-palette="gallery"] {
  --c-page: #F3F0E9; --c-ink: #161513; --c-ink-2: #4F4B44; --c-soft: #36332E; --c-ink-3: #625D54;
  --c-line: #D6D0C4; --c-hair: #DDD8CD; --c-surface: #E7E2D8;
  --c-accent: #2A3DBF; --c-band: #2A3DBF; --c-on-band: #F3F0E9;
  color-scheme: light;
}

/* Lower (Index) section tokens — "dark" follows the page palette; "light" is a white sheet */
body[data-lower-theme="dark"] .lower {
  --bg: var(--c-page); --ink: var(--c-ink); --muted: var(--c-ink-3); --soft: var(--c-soft);
  --rule: var(--c-ink); --hair: var(--c-hair); --tag: var(--c-accent);
  --hover-bg: var(--c-band); --hover-ink: var(--c-on-band); --link-hover: var(--c-accent);
}
body[data-lower-theme="light"] .lower {
  --bg: #FFFFFF; --ink: #0B0B0B; --muted: #5C5C5C; --soft: #3D3D3D;
  --rule: #0B0B0B; --hair: #D6D6D6; --tag: #0B0B0B;
  --hover-bg: var(--c-band); --hover-ink: var(--c-on-band); --link-hover: #5C5C5C;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; } /* never side-scroll, even if the display font fails to load */
body {
  margin: 0;
  background: var(--c-page);
  color: var(--c-ink);
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.accent { color: var(--c-accent); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--c-band); color: var(--c-on-band); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.contact :focus-visible { outline-color: var(--c-on-band); }

/* ---------- Header ---------- */
.site-header {
  display: flex; flex-wrap: nowrap; gap: 16px; justify-content: space-between; align-items: center; white-space: nowrap; /* always one line */
  padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--c-line);
}
.logo { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: 1px; }
.nav { display: flex; flex-wrap: nowrap; gap: 28px; font-size: 14px; font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; transition: color .2s; }
.nav a:hover { color: var(--c-accent); }
.header-end { display: flex; align-items: center; gap: 24px; }
.theme-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; color: var(--c-ink-3);
}
.js .theme-toggle { display: inline-flex; }
/* Header "Replay intro": text on desktop, ↺ icon on phones (see the 600px rule) */
.hdr-replay {
  display: none; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; color: var(--c-ink-3); transition: color .2s;
}
.js .hdr-replay { display: inline-flex; }
.hdr-replay:hover { color: var(--c-accent); }
.hdr-replay-icon { font-size: 1.15em; line-height: 1; letter-spacing: 0; }
/* Narrower screens: icon only, then tighter spacing; below 390px the footer button is the replay control */
@media (max-width: 960px) {
  .hdr-replay { justify-content: center; min-width: 44px; }
  .hdr-replay-text { display: none; }
  .hdr-replay-icon { font-size: 22px; }
  .header-end { gap: 16px; }
}
@media (max-width: 389px) { .js .hdr-replay { display: none; } }
@media (prefers-reduced-motion: reduce) { .js .hdr-replay { display: none; } }
.theme-toggle .tt-opt { padding: 4px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.theme-toggle .tt-opt.is-on { color: var(--c-ink); border-bottom-color: var(--c-accent); }
.tt-icon { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; box-shadow: inset -7px 0 0 currentColor; } /* half-filled circle, used on small screens */
.theme-toggle:hover .tt-opt:not(.is-on) { color: var(--c-accent); }
/* Short cross-fade while switching palettes (skipped under reduced motion in main.js) */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .35s ease, color .35s ease, fill .35s ease, border-color .35s ease !important;
}
.clock { font-size: 14px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; color: var(--c-ink-2); }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; padding-top: 72px; padding-bottom: 56px; }
.hero-copy { flex: 999 1 640px; min-width: 0; container-type: inline-size; }
.eyebrow { margin: 0 0 28px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 400; letter-spacing: 2px; text-transform: uppercase; color: var(--c-ink-2); }
.hero .eyebrow { align-items: flex-start; } /* one line on desktop; on phones it wraps and the dot stays on the first line */
.hero .eyebrow .live-dot { margin-top: 4px; flex: none; }
/* Desktop/tablet: keep the title on one line. It is ~57.7em wide at .1em tracking, so 1.65cqi of the copy column fits it (minus the dot) */
@media (min-width: 721px) {
  .hero .eyebrow { white-space: nowrap; letter-spacing: .1em; font-size: clamp(10px, 1.65cqi, 14px); }
  .hero .eyebrow .live-dot { margin-top: .3em; }
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-accent); display: inline-block; animation: blink 1.6s ease-in-out infinite; }
.hero-name {
  margin: 0; font-family: var(--display); font-weight: 400;
  /* "RODRIGUES" is ~4.2em wide in Instrument Serif, so 22.4cqi fills ~94% of the copy column (vw line is the fallback) */
  font-size: clamp(48px, 15vw, 220px); font-size: clamp(40px, 22.4cqi, 230px); line-height: 1; letter-spacing: -1px; text-transform: uppercase;
}
/* clip vertically only, so the slide-up mask never crops long names sideways */
/* The clip box reaches .22em below the line so the serif J's tail isn't cut off; layout height is unchanged */
.mask { display: block; padding-bottom: .22em; margin-bottom: -.22em; clip-path: inset(0 -100vw 0 -100vw); }
.rise { display: block; animation: rise 1.1s var(--ease) both; }
.rise-2 { animation-delay: .14s; }
.hero-lede { margin: 36px 0 0; max-width: 620px; font-size: 21px; line-height: 1.5; color: var(--c-soft); }
.fade-in { animation: fade-up .9s .5s var(--ease) both; }

.hero-photo { flex: 1 1 300px; position: relative; display: flex; justify-content: center; }
.photo-frame {
  position: relative; width: 300px; height: 380px; background: var(--c-surface); border: 1px solid var(--c-hair);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.photo-fallback { color: var(--c-ink-3); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.badge { position: absolute; width: 150px; height: 150px; left: -40px; bottom: -48px; z-index: 2; animation: spin 22s linear infinite; }
.badge circle { fill: var(--c-band); }
.badge text { font-family: var(--body); font-size: 15px; font-weight: 700; letter-spacing: 4.55px; fill: var(--c-on-band); } /* main.js fine-tunes this so the text exactly fills the ring */

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; padding: 22px 0; background: var(--c-band); color: var(--c-on-band); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.marquee-track { display: flex; width: max-content; gap: 40px; align-items: center; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: flex; align-items: center; gap: 40px; font-family: var(--display); font-weight: 400; font-size: 40px; text-transform: uppercase; white-space: nowrap; }
.marquee-item svg { width: 22px; height: 22px; fill: var(--c-on-band); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding-top: 72px; padding-bottom: 72px; }
.stat { border-top: 2px solid var(--c-ink); padding-top: 20px; }
.stat-num { font-family: var(--display); font-weight: 400; font-size: 112px; line-height: 1; }
.stat-label { font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--c-ink-2); }

/* ---------- Lower (Index) ---------- */
.lower { background: var(--bg); color: var(--ink); }
.block { padding-top: 88px; padding-bottom: 80px; }
.block + .block { padding-top: 48px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
.block-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 48px; text-transform: uppercase; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.text-link { font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; transition: color .15s; }
.text-link:hover { color: var(--link-hover); }

.row {
  display: grid; grid-template-columns: 64px minmax(0, 5fr) minmax(0, 4fr) 96px; gap: 16px; align-items: baseline;
  padding: 20px 12px; border-bottom: 1px solid var(--hair);
  transition: background .15s, color .15s;
}
.row > span:first-child { font-size: 14px; }
.row-head { padding: 12px; border-bottom: 1px solid var(--rule); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.row-title { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; text-transform: uppercase; }
.row .soft { font-size: 15px; }
.tag { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tag); }
a.row:hover { background: var(--hover-bg); color: var(--hover-ink); }
a.row:hover span { color: var(--hover-ink); }
.row-ext { font-family: var(--body); font-size: .7em; vertical-align: .25em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Project pop-out ---------- */
.lightbox { width: fit-content; max-width: min(92vw, 1100px); max-height: 94vh; padding: 0; border: 0; background: transparent; color: var(--c-ink); overflow: visible; }
.lightbox::backdrop { background: rgba(12, 11, 10, .86); }
.lightbox[open] { animation: lb-in .35s var(--ease-out); }
.lb-open, .lb-open body { overflow: hidden; }
.lightbox-figure { position: relative; margin: 0; padding: 12px; background: var(--c-page); }
.lightbox-media { display: block; }
.lightbox-media img { display: block; width: auto; max-width: 100%; max-height: 74vh; margin: 0 auto; }
.lightbox-media[href] img { cursor: pointer; }
.lightbox-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 14px 4px 2px; }
.lightbox-no { font-size: 14px; color: var(--c-ink-3); }
.lightbox-title { flex: 1 1 240px; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; text-transform: uppercase; }
.lightbox-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; border-bottom: 2px solid var(--c-accent); transition: color .15s; }
.lightbox-link:hover { color: var(--c-accent); }
.lightbox-link[hidden] { display: none; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c-page); color: var(--c-ink); font: 400 28px/1 var(--body);
}
.lightbox-close:hover { background: var(--c-ink); color: var(--c-page); }
@keyframes lb-in { from { opacity: 0; transform: scale(.96); } }

.clients { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 24px; }
.clients li { counter-increment: c; display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--hair); font-size: 20px; font-weight: 700; }
.clients li::before { content: counter(c, decimal-leading-zero); width: 28px; flex: none; font-size: 13px; font-weight: 400; color: var(--muted); }
.clients li:has(> a) { padding: 0; }
.clients li > a { flex: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0; transition: color .15s; }
.clients li > a::after { content: "↗"; content: "↗" / ""; font-size: 14px; color: var(--muted); transition: color .15s; }
.clients li > a:hover, .clients li > a:hover::after { color: var(--link-hover); }

.cv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; padding: 20px 0; border-bottom: 1px solid var(--hair); }
.cv-row .muted { font-size: 15px; }
.cv-org { font-family: var(--display); font-weight: 400; font-size: 24px; text-transform: uppercase; }
.cv-row .soft { font-size: 17px; }
.skills { margin-top: 56px; }
.skills-title { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--rule); font-family: var(--display); font-weight: 400; font-size: 28px; text-transform: uppercase; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 24px; margin: 20px 0 0; }
.skill-group dt { margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.skill-group dd { margin: 0; }
.skill-group ul { margin: 0; padding: 0; list-style: none; }
.skill-group li { padding: 9px 0; border-top: 1px solid var(--hair); font-size: 15px; font-weight: 400; letter-spacing: .5px; text-transform: uppercase; color: var(--soft); }

/* ---------- Contact ---------- */
.contact { background: var(--c-band); color: var(--c-on-band); }
.contact-inner { padding-top: 88px; padding-bottom: 40px; container-type: inline-size; }
/* One line at every width: the address is ~13.35em wide in Instrument Serif, so 7.2cqi fills ~96% of the column (vw line is the fallback) */
.contact-email {
  display: block; font-family: var(--display); font-weight: 400; line-height: .95; text-transform: uppercase; white-space: nowrap; transition: opacity .2s;
  font-size: calc((min(100vw, var(--max)) - 2 * var(--gutter)) / 13.9);
  font-size: 7.2cqi;
}
.contact-email:hover { opacity: .7; }
.replay-intro {
  display: none; justify-self: start; align-items: center; gap: 6px; min-height: 44px; margin: -14px 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; transition: opacity .2s;
}
.js .replay-intro { display: inline-flex; }
.replay-intro:hover { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .js .replay-intro { display: none; } } /* the intro never plays with reduced motion */
.contact-meta {
  margin-top: 64px; padding-top: 16px; border-top: 2px solid var(--c-on-band);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}

/* ---------- Scroll reveal (toggled by main.js) ---------- */
.js .reveal { opacity: 0; transform: translateX(-24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out), background .15s, color .15s; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
/* ---------- Intro: streaming-app–style poster wall (main.js builds the tiles; html.intro-on is set in <head>) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--c-page);
  --tile-w: clamp(150px, 20vw, 340px); --tile-gap: clamp(10px, 1.4vw, 22px);
  transition: opacity 1s var(--ease-out);
}
html:not(.intro-on) .intro:not(.is-out) { display: none; }
.intro-on, .intro-on body { overflow: hidden; }
.intro-on .rise, .intro-on .fade-in { animation-play-state: paused; } /* hero waits for the intro to hand off */
.intro.is-out { opacity: 0; pointer-events: none; }
.intro.is-out.is-fast { transition-duration: .35s; }
.intro-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; perspective: 1600px; }
.intro-wall {
  display: flex; gap: var(--tile-gap);
  transform: rotateX(24deg) rotateZ(-12deg) scale(1.12);
  animation: wall-in 1.3s var(--ease-out) backwards;
  transition: transform 1s var(--ease-out);
}
.intro.is-out .intro-wall { transform: rotateX(8deg) rotateZ(-4deg) scale(1.7); }
.intro-col { display: flex; flex-direction: column; gap: var(--tile-gap); width: var(--tile-w); flex: none; animation: col-drift 9s linear both; will-change: transform; }
.intro-col:nth-child(even) { animation-direction: reverse; }
.intro-col:nth-child(3n) { margin-top: calc(var(--tile-w) * .3); }
.intro-tile {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: clamp(8px, .9vw, 14px);
  display: flex; flex-direction: column; justify-content: space-between; padding: 7% 8%;
  background: var(--c-surface); color: var(--c-ink);
}
.intro-tile.is-band { background: var(--c-band); color: var(--c-on-band); }
.intro-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro-tile-no { font-size: clamp(9px, .75vw, 13px); font-weight: 700; letter-spacing: 1px; }
.intro-tile-title { font-family: var(--display); font-weight: 400; font-size: clamp(13px, 1.45vw, 26px); line-height: 1.05; text-transform: uppercase; }
.intro-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: clamp(18px, 2.4vw, 32px) clamp(24px, 3.6vw, 52px); background: var(--c-page); text-align: center;
  animation: title-in 1.1s .45s var(--ease-out) backwards;
  transition: opacity .5s ease, transform 1s var(--ease-out);
}
.intro.is-out .intro-title { opacity: 0; transform: translate(-50%, -62%); }
.intro-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--c-ink-2); }
.eb-hello { display: none; }
.hello .eb-default { display: none; }
.hello .eb-hello { display: inline; font-size: 17px; letter-spacing: .5px; text-transform: none; color: var(--c-accent); }
.intro-name { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 7.4vw, 120px); line-height: .95; text-transform: uppercase; white-space: nowrap; }
.intro-skip {
  position: absolute; right: clamp(16px, 3vw, 48px); bottom: clamp(16px, 4vh, 48px);
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c-ink); color: var(--c-page); font: 700 15px/1 var(--body); letter-spacing: .3px;
  animation: fade-up .6s .6s var(--ease-out) backwards; transition: background-color .2s, color .2s;
}
.intro-skip:hover { background: var(--c-accent); color: var(--c-on-band); }
.intro :focus-visible { outline-color: var(--c-ink); }

/* ---------- "One more thing…" (only with ?hello) ---------- */
.omt { display: none; margin-top: 40px; padding-top: 12px; border-top: 2px solid var(--c-on-band); }
.hello .omt { display: block; }
.omt summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3vw, 40px); text-transform: uppercase; }
.omt summary::-webkit-details-marker { display: none; }
.omt summary:hover { opacity: .7; }
.omt p { max-width: 640px; margin: 8px 0 0; font-size: 18px; font-weight: 400; line-height: 1.5; }

@keyframes wall-in { from { opacity: 0; transform: rotateX(24deg) rotateZ(-12deg) scale(1.5); } }
@keyframes col-drift { from { transform: translateY(-6%); } to { transform: translateY(6%); } }
@keyframes title-in { from { opacity: 0; filter: blur(14px); transform: translate(-50%, -50%) scale(1.06); } }
@keyframes rise { from { transform: translateY(130%); } to { transform: translateY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .site-header { gap: 12px; }
  .nav { gap: 20px; font-size: 13px; letter-spacing: 1px; }
  .header-end { gap: 16px; }
  .clock, .theme-toggle, .hdr-replay { font-size: 13px; }
  .clock { display: none; } /* the 9:41 hover egg needs a mouse anyway */
  .row { grid-template-columns: 44px minmax(0, 1fr); row-gap: 6px; }
  .row > span:nth-child(3), .row > span:nth-child(4) { grid-column: 2; }
  .row-head > span:nth-child(3), .row-head > span:nth-child(4) { display: none; }
  .row-title { font-size: 20px; }
  .stat-num { font-size: 88px; }
  .block-head h2 { font-size: 34px; }
  .badge { width: 110px; height: 110px; left: 0; bottom: -36px; }
}

/* Header: clock hides and the theme switch becomes an icon button so everything stays on one line */
@media (max-width: 600px) {
  .theme-toggle { justify-content: center; min-width: 44px; color: var(--c-ink); }
  .theme-toggle .tt-opt, .theme-toggle [aria-hidden="true"]:not(.tt-icon) { display: none; }
  .tt-icon { display: block; }
  .hdr-replay { color: var(--c-ink); }
  .theme-toggle:hover { color: var(--c-accent); }
}
@media (max-width: 420px) {
  .logo { font-size: 24px; }
  .header-end { gap: 4px; }
  .site-header { gap: 8px; }
  .nav { gap: clamp(10px, 3vw, 16px); font-size: clamp(11px, 3.2vw, 13px); letter-spacing: .5px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
