/* ==========================================================================
   DESIGN A — "Nightshift"
   Dark cinematic ground, amber as a large light source rather than a border.
   Type: Fraunces (his own original display choice) + Manrope + IBM Plex Mono.
   ========================================================================== */

:root {
  --ink-950: #08080A;
  --ink-900: #0C0C0F;
  --ink-850: #121216;
  --ink-800: #17171C;
  --ink-700: #22222A;
  --ink-600: #32323C;

  --amber-200: #FFE3B0;
  --amber-300: #FFCE7A;
  --amber-400: #F0A428;
  --amber-500: #D98510;
  --amber-700: #7A4A08;

  --paper: #F6F1E7;
  --paper-dim: #B9B2A6;
  --paper-faint: #8A8478;

  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --raised: var(--ink-850);
  --line: #24242C;
  --line-soft: #1A1A20;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --wrap: 78rem;
  --pad: clamp(1.25rem, 5vw, 4.5rem);

  --e: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }   /* #projects ships hidden */
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: clamp(1rem, .12vw + .97rem, 1.0625rem);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber-400); color: #100B02; }

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

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber-400);
  display: flex; align-items: center; gap: .75rem;
}
.eyebrow::before {
  content: ""; width: 2.25rem; height: 1px; background: var(--amber-500);
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Custom cursor ---------- */
#cur, #cur-dot {
  transition: opacity .3s ease;
  position: fixed; top: 0; left: 0; z-index: 900;
  pointer-events: none; border-radius: 50%;
  mix-blend-mode: difference;
}
#cur { opacity: 0; width: 34px; height: 34px; border: 1px solid rgba(255,206,122,.75); margin: -17px 0 0 -17px; }
#cur-dot { opacity: 0; width: 5px; height: 5px; background: var(--amber-300); margin: -2.5px 0 0 -2.5px; }
@media (hover: none), (prefers-reduced-motion: reduce) { #cur, #cur-dot { display: none; } }

/* ---------- Nav ---------- */
#nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--pad);
  transition: background-color .4s var(--e), border-color .4s var(--e), padding .4s var(--e);
  border-bottom: 1px solid transparent;
}
#nav.solid {
  background: rgba(8,8,10,.86);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
  padding-block: .7rem;
}
@supports not (backdrop-filter: blur(1px)) { #nav.solid { background: rgba(8,8,10,.97); } }

.brand { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; }
.brand em { font-style: italic; color: var(--amber-400); }

.nav-links { display: none; gap: 2rem; }
@media (min-width: 64rem) { .nav-links { display: flex; } }
.nav-links a {
  position: relative; font-size: .85rem; color: var(--paper-dim);
  transition: color .25s var(--e);
}
/* WCAG 2.2 SC 2.5.8 asks for a 24px minimum target. These links are 22px of
   text, and the obvious fix - padding plus inline-block - drags the hover
   underline down with the padding box. An absolutely positioned ::before
   enlarges the HIT AREA instead: the target becomes 43px, the layout does not
   move by a pixel, and ::after is left alone to be the underline. Measured
   with elementFromPoint, not getBoundingClientRect, which cannot see it. */
.nav-links a::before { content: ""; position: absolute; inset: -.65rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.4rem; height: 1px;
  background: var(--amber-400); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--e);
}
.nav-links a:hover, .nav-links a.on { color: var(--paper); }
.nav-links a.on::after, .nav-links a:hover::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.15rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--ink-600); color: var(--paper);
  transition: border-color .3s var(--e), color .3s var(--e), background-color .3s var(--e), transform .3s var(--e);
  will-change: transform;
}
.btn:hover { border-color: var(--amber-400); color: var(--amber-200); }
.btn-amber {
  background: var(--amber-400); border-color: var(--amber-400); color: #140D02;
}
.btn-amber:hover { background: var(--amber-300); border-color: var(--amber-300); color: #140D02; }
.btn svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ---------- Hero ---------- */
#hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }

#field { position: absolute; inset: 0; z-index: 0; opacity: .42; }

/* the amber light source — this is where the accent is spent */
.glow {
  position: absolute; z-index: 1; pointer-events: none;
  width: min(120vw, 1500px); aspect-ratio: 1;
  left: var(--gx, 62%); top: var(--gy, 46%);
  translate: -50% -50%;
  background:
    radial-gradient(circle at center,
      rgba(240,164,40,.17) 0%,
      rgba(217,133,16,.085) 26%,
      rgba(122,74,8,.035) 46%,
      transparent 68%);
  transition: left .9s var(--e), top .9s var(--e);
}
.vig {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(8,8,10,.75) 100%);
}

.hero-inner { position: relative; z-index: 3; width: 100%; padding-block: 8rem 4rem; }

.hero-grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 64rem) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }

/* audience pills */
.aud { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 2rem; }
.aud button {
  padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--ink-700);
  font-size: .78rem; color: var(--paper-faint);
  transition: all .3s var(--e);
}
.aud button:hover { border-color: var(--ink-600); color: var(--paper-dim); }
.aud button[aria-pressed="true"] {
  background: rgba(240,164,40,.13); border-color: rgba(240,164,40,.55); color: var(--amber-200);
}

.hero-h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.7rem, 6.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.hero-h em { font-style: italic; color: var(--amber-300); }
.hero-h .w { display: inline-block; }

.lede {
  margin-top: 1.6rem; max-width: 46ch;
  font-size: clamp(1.02rem, .35vw + .95rem, 1.2rem);
  color: var(--paper-dim);
  min-height: 5.4em;
}
.lede strong { color: var(--paper); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }

.hero-figure { position: relative; }
.hero-figure img {
  width: 100%; height: auto;
  filter: contrast(1.05) saturate(1.02);
  /* a long, low-contrast falloff so the figure dissolves into the ground
     instead of ending on a visible edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0,0,0,.55) 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0,0,0,.55) 82%, transparent 100%);
}

/* floating domain cards — show the work, not just the face */
.chip {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .85rem; border-radius: .7rem;
  background: rgba(18,18,22,.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em;
  color: var(--paper-dim);
  white-space: nowrap;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.9);
}
.chip b { color: var(--amber-300); font-weight: 600; }
.chip .dot { width: .45rem; height: .45rem; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 8px #3DDC97; }
/* Kept clear of the face: the head occupies roughly 28-62% of the figure's
   width and the top 45% of its height, so nothing floats there. */
.chip-1 { left: -14%; top: 49%; }
.chip-2 { right: -8%; top: 56%; }
.chip-3 { left: -6%; bottom: 16%; }
@media (max-width: 63.99rem) {
  .chip-1 { left: 0; top: 6%; }
  .chip-2 { right: 0; top: 38%; }
  .chip-3 { left: 4%; bottom: 4%; }
}

.scrollcue {
  cursor: pointer;
  transition: color .3s var(--e);
  position: absolute; left: 50%; bottom: 1.6rem; translate: -50% 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--paper-faint);
}
.scrollcue:hover { color: var(--amber-300); }
.scrollcue span { width: 1px; height: 2.2rem; background: linear-gradient(var(--amber-400), transparent); }

/* ---------- Sections ---------- */
section.band { position: relative; padding-block: clamp(5rem, 10vw, 9rem); }
.sec-head { max-width: 52rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.sec-head h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.08; letter-spacing: -.03em;
  margin-top: 1.1rem;
}
.sec-head h2 em { font-style: italic; color: var(--amber-300); }
.sec-head p { margin-top: 1rem; color: var(--paper-dim); max-width: 54ch; }

/* stats — accent as a large fill */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden;
}
@media (min-width: 45rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--ink-900); padding: 1.6rem 1.4rem; }
.stat .n {
  font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1; color: var(--amber-300); font-variant-numeric: tabular-nums;
}
.stat .l { margin-top: .5rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-faint); }

/* about */
.about { display: grid; gap: 2.5rem; }
@media (min-width: 64rem) { .about { grid-template-columns: 1.1fr .9fr; gap: 4rem; } }
.about p + p { margin-top: 1.1rem; }
.about p { color: var(--paper-dim); }
.facts { border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-faint); }
.facts dd { font-size: .95rem; }
.facts a { border-bottom: 1px solid var(--ink-600); }
.facts a:hover { color: var(--amber-300); border-color: var(--amber-400); }

/* timeline — horizontal on desktop */
.tl { position: relative; display: grid; gap: 1px; background: var(--line); border-radius: 1rem; overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 64rem) { .tl { grid-template-columns: repeat(4, 1fr); } }
.tl-item { background: var(--ink-900); padding: 1.8rem 1.5rem; position: relative; transition: background-color .35s var(--e); }
.tl-item:hover { background: var(--ink-850); }
.tl-item .yr { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; color: var(--amber-400); }
.tl-item h3 { margin-top: .7rem; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.tl-item .role { margin-top: .3rem; font-size: .86rem; color: var(--paper-dim); }
.tl-item .bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--amber-400); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--e); }
.tl-item:hover .bar { transform: scaleX(1); }

/* credentials */
.creds { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
@media (min-width: 45rem) { .creds { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 90rem) { .creds { grid-template-columns: repeat(3, 1fr); } }
.cred { background: var(--ink-900); padding: 1.3rem; display: flex; gap: 1rem; align-items: center; transition: background-color .3s var(--e); }
.cred:hover { background: var(--ink-850); }
.cred img { width: 2.6rem; height: 2.6rem; object-fit: contain; filter: grayscale(1) brightness(1.7) contrast(.85); transition: filter .4s var(--e); }
.cred:hover img { filter: none; }
.cred .t { font-size: .9rem; font-weight: 600; line-height: 1.35; }
.cred .i { margin-top: .2rem; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--paper-faint); }
.cred.feature { grid-column: 1 / -1; background: linear-gradient(120deg, rgba(240,164,40,.16), rgba(240,164,40,.03) 55%), var(--ink-850); }
.cred.feature img { width: 4.5rem; height: 4.5rem; filter: none; }
.cred.feature .t { font-size: 1.15rem; }

/* stack — a logo wall. Every file in images/technology/ is a single-path SVG
   with NO fill attribute, so it renders pure black: invisible on this ground.
   Inverting to paper is one line and is correct in both themes, where tinting
   or 13 inline sprites would not be. Mixed aspects (1:1 glyphs through 2.95:1
   wordmarks) are handled by capping BOTH axes and letting contain decide. */
.stack { display: grid; gap: clamp(1.75rem, 3vw, 2.5rem); }
.stack-title {
  display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem;
  font-family: var(--font-mono); font-weight: 500; font-size: .66rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--paper-faint);
}
.stack-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: .9rem; overflow: hidden;
}
.tech {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .75rem; padding: 1.35rem .75rem; background: var(--surface);
  transition: background .3s var(--e);
}
.tech img {
  width: 100%; max-width: 6rem; height: 2.2rem; object-fit: contain;
  filter: invert(1) opacity(.72); transition: filter .3s var(--e), opacity .3s var(--e);
}
.tech span {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em;
  color: var(--paper-faint); text-align: center;
}
@media (hover: hover) {
  .tech:hover { background: var(--raised); }
  .tech:hover img { filter: invert(1) opacity(1); }
}

.sec-more { margin-top: 1.25rem; }
.sec-more a {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber-400);
  padding-block: .6rem; transition: color .3s var(--e);
}
.sec-more svg { width: .8rem; height: .8rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) { .sec-more a:hover { color: var(--amber-200); } }

/* projects — ships hidden; see the comment above #projects in a.html */
.projects { display: grid; gap: 1.25rem; }
@media (min-width: 45rem) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 80rem) { .projects { grid-template-columns: repeat(3, 1fr); } }
.proj {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 1rem;
  overflow: hidden; transition: border-color .3s var(--e), transform .3s var(--e);
}
.proj-media {
  display: grid; place-items: center; aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--raised), var(--ink-800));
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.proj-media img { width: 100%; height: 100%; object-fit: cover; }
.proj-ph {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em;
  color: var(--paper-faint); opacity: .55;
}
.proj-body { display: block; padding: 1.35rem 1.35rem 0; }
.proj-yr {
  display: block; font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--amber-400);
}
.proj h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 1.32rem;
  line-height: 1.2; letter-spacing: -.02em; margin: .55rem 0;
  transition: color .3s var(--e);
}
.proj p { font-size: .92rem; color: var(--paper-dim); }
.proj-tech {
  display: block; margin-top: .9rem; font-family: var(--font-mono);
  font-size: .66rem; letter-spacing: .06em; color: var(--paper-faint);
}
.proj .go {
  margin-top: auto; padding: 1.15rem 1.35rem 1.35rem;
  display: flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber-400); transition: color .3s var(--e);
}
.proj .go svg { width: .8rem; height: .8rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) {
  .proj:hover { border-color: rgba(240,164,40,.5); transform: translateY(-3px); }
  .proj:hover h3 { color: var(--amber-200); }
  .proj:hover .go { color: var(--amber-300); }
}

/* writing */
.posts { border-top: 1px solid var(--line); }
.post {
  display: grid; gap: .35rem 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line);
  position: relative; transition: padding-left .4s var(--e);
}
@media (min-width: 45rem) { .post { grid-template-columns: 8rem 1fr auto; align-items: baseline; } }
.post:hover { padding-left: 1rem; }
.post::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--amber-400); transform: scaleY(0); transition: transform .4s var(--e); }
.post:hover::before { transform: scaleY(1); }
.post .d { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; color: var(--paper-faint); }
.post h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; transition: color .3s var(--e); }
.post:hover h3 { color: var(--amber-200); }
.post p { font-size: .88rem; color: var(--paper-faint); margin-top: .3rem; max-width: 62ch; }
.post .go { font-family: var(--font-mono); font-size: .68rem; color: var(--amber-400); white-space: nowrap; }

/* quotes */
.quotes { display: grid; gap: 1.5rem; }
@media (min-width: 64rem) { .quotes { grid-template-columns: repeat(2, 1fr); align-items: start; } }
.quote { padding: 1.6rem 1.6rem 1.6rem 1.9rem; border-radius: 1rem; background: var(--ink-900); border: 1px solid var(--line); position: relative; }
.quote::before { content: ""; position: absolute; left: 0; top: 1.6rem; bottom: 1.6rem; width: 2px; border-radius: 2px; background: var(--amber-400); }
.quote.lead { grid-column: 1 / -1; background: linear-gradient(140deg, rgba(240,164,40,.10), transparent 60%), var(--ink-900); }
.quote p { color: var(--paper-dim); }
.quote.lead p { font-size: 1.1rem; }
.quote .who { margin-top: 1rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper); }
.quote .role { display: block; margin-top: .25rem; font-size: .72rem; letter-spacing: .06em; text-transform: none; color: var(--paper-faint); font-family: var(--font-sans); }

/* contact */
#contact { position: relative; overflow: hidden; }
#contact .glow2 {
  position: absolute; left: 50%; bottom: -40%; translate: -50% 0; z-index: 0;
  width: min(110vw, 1200px); aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(circle, rgba(240,164,40,.14), transparent 62%);
}
#contact .wrap { position: relative; z-index: 1; }
.mail {
  display: inline-block; margin: 1.4rem 0 2rem;
  font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 3rem);
  letter-spacing: -.03em; line-height: 1.1;
  background-image: linear-gradient(var(--amber-400), var(--amber-400));
  background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: color .3s var(--e);
}
.mail:hover { color: var(--amber-200); }

footer { border-top: 1px solid var(--line); padding-block: 2rem; }
.foot { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.soc { display: flex; gap: .5rem; }
.soc a { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--paper-dim); transition: all .3s var(--e); }
.soc a:hover { border-color: var(--amber-400); color: var(--amber-300); }
.soc svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

/* The second address sits under the display one, deliberately quieter - two
   addresses at equal weight makes a visitor choose instead of just writing. */
.mail-alt { margin-top: .55rem; font-size: .92rem; color: var(--paper-faint); }
.mail-alt a { border-bottom: 1px solid var(--ink-700); transition: color .3s var(--e), border-color .3s var(--e); }
@media (hover: hover) { .mail-alt a:hover { color: var(--amber-300); border-color: var(--amber-400); } }
@media (pointer: coarse) { .mail-alt a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; } }

/* ==========================================================================
   BLOG - listing and article

   Everything here is expressed in the tokens above, so the light theme follows
   with no parallel rules. The handful of exceptions sit in the light block: a
   surface, a veil and a literal, which are what tokens cannot carry.

   The listing is a LIST, not a card grid. Of eight engineer blogs measured,
   only the one published by a magazine used cards, and it reads like a CMS.
   ========================================================================== */

/* ---------- Listing ---------- */
section.blog-head { padding-block: clamp(7rem, 12vw, 10rem) clamp(2rem, 4vw, 3rem); }

/* Featured entry - the newest post, given room the others do not get. One
   large entry followed by rows is what stops a feed reading as uniform. */
.feat { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: center; }
@media (min-width: 64rem) { .feat { grid-template-columns: 1.05fr .95fr; } }
.feat-media {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 1rem; border: 1px solid var(--line); background: var(--surface);
}
.feat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--e); }
.feat-body .eyebrow { margin-bottom: 1rem; }
.feat h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 3.4vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em;
  transition: color .3s var(--e);
}
.feat h2 em { font-style: italic; color: var(--amber-300); }
.feat p { margin-top: 1rem; color: var(--paper-dim); max-width: 46ch; }
@media (hover: hover) {
  .feat a:hover h2 { color: var(--amber-200); }
  .feat a:hover .feat-media img { transform: scale(1.03); }
}

/* Row metadata. The time element carries the machine-readable date the
   homepage .post rows never had. */
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--paper-faint);
}
.meta .topic { color: var(--amber-400); }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.entries { margin-top: clamp(3.5rem, 7vw, 5.5rem); border-top: 1px solid var(--line); }
.entry {
  display: grid; gap: .35rem 1.5rem; align-items: start;
  padding: 1.6rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left .35s var(--e);
}
@media (min-width: 45rem) { .entry { grid-template-columns: 11rem 1fr; } }
@media (min-width: 64rem) { .entry { grid-template-columns: 11rem 1fr 9rem; } }
.entry-thumb {
  display: none; aspect-ratio: 16 / 9; overflow: hidden; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--surface);
}
@media (min-width: 64rem) { .entry-thumb { display: block; grid-column: 3; grid-row: 1 / span 3; } }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 1.35rem;
  line-height: 1.2; letter-spacing: -.02em; transition: color .3s var(--e);
}
@media (min-width: 45rem) { .entry h3 { grid-column: 2; } }
@media (max-width: 44.99rem) { .entry .meta { margin-bottom: .5rem; } }
/* In the 11rem column the three tokens wrap, and an inline dot separator then
   dangles at the end of each line. Stacked, the dots are redundant. */
@media (min-width: 45rem) {
  /* Spanning both rows matters: stacked, the meta is ~75px tall, and left in
     row 1 alone it set that row's height and pushed the blurb 87px clear of
     its own title. */
  .entry .meta {
    grid-column: 1; grid-row: 1 / span 2;
    flex-direction: column; align-items: flex-start; gap: .3rem;
  }
  .entry .meta .sep { display: none; }
  .entry h3 { grid-row: 1; }
  .entry p { grid-row: 2; margin-top: .4rem; }
}
.entry p { font-size: .92rem; color: var(--paper-dim); max-width: 60ch; }
@media (min-width: 45rem) { .entry p { grid-column: 2; } }
.entry:last-child { border-bottom: 0; }
@media (hover: hover) {
  .entry:hover { padding-left: 1rem; }
  .entry:hover h3 { color: var(--amber-200); }
}

/* Progressive reveal. The hidden state is added BY SCRIPT - the markup and the
   stylesheet leave every entry visible, so a failed CDN or a blocked script
   shows all nine rather than none. This is deliberately the opposite of .rv,
   which is opacity:0 in CSS and needs GSAP to ever appear. */
.entry.is-queued { opacity: 0; transform: translateY(18px); }
.entry.is-shown { opacity: 1; transform: none; transition: opacity .6s var(--e), transform .6s var(--e); }
@media (prefers-reduced-motion: reduce) {
  .entry.is-queued { opacity: 1 !important; transform: none !important; }
}
.entries-end {
  margin-top: 2.5rem; text-align: center;
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--paper-faint);
}

/* ---------- Article ---------- */
section.art-head, header.art-head { padding-block: clamp(7rem, 12vw, 10rem) clamp(1.5rem, 3vw, 2.5rem); }
.art-head .wrap { max-width: 52rem; }
.art-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em;
  margin-top: 1.2rem;
}
.art-title em { font-style: italic; color: var(--amber-300); }
.art-standfirst {
  margin-top: 1.2rem; max-width: 54ch;
  font-size: clamp(1.05rem, .4vw + .95rem, 1.25rem); color: var(--paper-dim);
}
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper-faint);
}
.byline a { color: var(--paper-dim); border-bottom: 1px solid var(--ink-700); padding-block: .5rem; }
@media (hover: hover) { .byline a:hover { color: var(--amber-300); border-color: var(--amber-400); } }

.art-cover { margin-block: clamp(1.5rem, 4vw, 3rem); }
.art-cover .wrap { max-width: 64rem; }
/* height:auto is load-bearing. The img carries width/height attributes (they
   reserve space and stop layout shift), and that presentational height wins
   over aspect-ratio, which only computes a height when height is auto. Without
   it the box was 880x675 instead of 880x495 and object-fit:cover ate 96px off
   each side of the artwork. */
.art-cover img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 1rem; border: 1px solid var(--line);
}
.art-cover figcaption {
  margin-top: .75rem; font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .1em; color: var(--paper-faint);
}

/* The measure. Figures, code and the pull quote are allowed out of it by a
   fixed amount and nothing else is - a hero that ignores the column is how an
   article page stops being readable. */
.art-body { --measure: 34rem; padding-bottom: clamp(3rem, 6vw, 5rem); }
.art-body > * { max-width: var(--measure); margin-inline: auto; }
.art-body p, .art-body ul, .art-body ol { margin-top: 1.35rem; line-height: 1.75; }
.art-body ul, .art-body ol { padding-left: 1.2rem; list-style: disc; }
.art-body ol { list-style: decimal; }
.art-body li { margin-top: .5rem; }
.art-body h2 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.15; letter-spacing: -.02em; margin-top: clamp(2.75rem, 5vw, 3.75rem);
}
.art-body h3 {
  font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em;
  margin-top: 2.25rem; color: var(--paper);
}
.art-body a:not(.btn) { color: var(--amber-300); border-bottom: 1px solid var(--amber-700); }
@media (hover: hover) { .art-body a:not(.btn):hover { border-color: var(--amber-400); } }
.art-body strong { color: var(--paper); font-weight: 600; }
.art-body code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: .3rem; padding: .1em .35em;
}
.art-body pre {
  max-width: calc(var(--measure) + 6rem);
  margin-top: 1.75rem; padding: 1.25rem 1.4rem; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: .8rem;
}
.art-body pre code {
  background: none; border: 0; padding: 0; font-size: .82rem; line-height: 1.7;
  color: var(--paper-dim); white-space: pre;
}
.art-body figure { max-width: calc(var(--measure) + 6rem); margin-top: 2rem; }
.art-body figure img { width: 100%; height: auto; border-radius: .8rem; border: 1px solid var(--line); }
.art-body figcaption {
  margin-top: .7rem; font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .1em; color: var(--paper-faint);
}
.art-body blockquote {
  max-width: calc(var(--measure) + 3rem);
  margin-top: 2.25rem; padding: 1.4rem 1.6rem;
  background: var(--ink-900); border-left: 2px solid var(--amber-400); border-radius: .6rem;
}
.art-body blockquote p { margin-top: 0; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.45; }
.art-body hr { max-width: var(--measure); margin: clamp(2.5rem,5vw,3.5rem) auto 0; border: 0; border-top: 1px solid var(--line); }

/* Author card. A byline that leads to more about the writer is what Google
   actually documents; the photo is the client decision on top of it. */
.author-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
  margin-top: clamp(3rem, 6vw, 4.5rem); padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 1rem;
}
.author-card img { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.author-card .who { font-family: var(--font-display); font-size: 1.2rem; }
.author-card p { margin-top: .35rem; font-size: .92rem; color: var(--paper-dim); max-width: 52ch; }
.author-card .go {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber-400); padding-block: .5rem;
}
.author-card .go svg { width: .8rem; height: .8rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.art-more { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.art-more h2 {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--paper-faint); font-weight: 500;
}
.art-more .entries { margin-top: 1.25rem; border-top: 0; }

/* ---------- Share / social popover ---------- */
/* The wrapper stays STATIC on purpose, so the popover resolves against #nav
   (position:fixed) and hangs off the header's gutter rather than off the
   button. Anchored to the button it was 18px off the left edge at 320px,
   because the button sits mid-nav with the toggle and Resume to its right. */
.share-wrap { position: static; display: flex; }
.share-menu {
  position: absolute; top: calc(100% + .35rem); right: var(--pad); z-index: 700;
  min-width: 11rem; max-width: calc(100vw - var(--pad) * 2); padding: .4rem;
  background: rgba(18,18,22,.94); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: .8rem;
  box-shadow: 0 24px 48px -26px rgba(0,0,0,.95);
}
.share-menu a {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem; border-radius: .55rem;
  font-size: .82rem; color: var(--paper-dim);
  transition: background-color .25s var(--e), color .25s var(--e);
}
.share-menu svg { width: 1rem; height: 1rem; fill: currentColor; flex: 0 0 auto; }
.share-menu a:hover, .share-menu a:focus-visible { background: var(--raised); color: var(--amber-200); }
#share[aria-expanded="true"] { border-color: var(--amber-400); color: var(--amber-300); }
@supports not (backdrop-filter: blur(1px)) { .share-menu { background: rgba(18,18,22,.99); } }
@media (prefers-reduced-motion: no-preference) {
  .share-menu { animation: share-in .22s var(--e) both; }
}
@keyframes share-in { from { opacity: 0; transform: translateY(-6px); } }

.share-menu .share-do {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .6rem .7rem; border-radius: .55rem;
  font-size: .82rem; font-weight: 600; color: var(--amber-200); text-align: left;
  transition: background-color .25s var(--e), color .25s var(--e);
}
.share-menu .share-do svg { width: 1rem; height: 1rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.share-menu .share-do .ic-ok { display: none; }
.share-menu .share-do.done { color: #3DDC97; }
.share-menu .share-do.done .ic-do { display: none; }
.share-menu .share-do.done .ic-ok { display: block; }
.share-sep { height: 1px; margin: .35rem .7rem; background: var(--line); }
@media (hover: hover) { .share-menu .share-do:hover { background: var(--raised); } }
.share-menu .share-do:focus-visible { background: var(--raised); }

/* ---------- Mobile app shell ---------- */
#tabs {
  position: fixed; z-index: 600; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12,12,15,.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 64rem) { #tabs { display: none; } }
#tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  padding: .6rem 0 .55rem; min-height: 3.4rem;
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--paper-faint); transition: color .3s var(--e);
  position: relative;
}
#tabs a svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 1.7; }
#tabs a.on { color: var(--amber-300); }
#tabs a.on::before {
  content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 1.6rem; height: 2px; border-radius: 0 0 2px 2px; background: var(--amber-400);
}
@media (max-width: 63.99rem) { body { padding-bottom: 4rem; } }

/* ---------- Reveals ---------- */
.rv { opacity: 0; transform: translateY(22px); }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .glow { transition: none; }
}

/* ==========================================================================
   v2 — RESPONSIVE TIERS
   Three width tiers only, shared by every rule above:
     < 48rem   phone   — its own hero and its own scroll behaviour
     48-64rem  tablet  — two columns, touch nav retained
     >= 64rem  desktop — full layout, pointer affordances
   ========================================================================== */

/* Visibility utilities. !important is deliberate: the elements these hide
   carry id-level or later-in-cascade display rules (#mhero{display:flex},
   .m-rail{display:flex}) that would otherwise win and show the phone layout
   on desktop. */
@media (min-width: 45rem) { .m-only { display: none !important; } }
@media (max-width: 44.99rem) { .d-only { display: none !important; } }

/* ---------- TABLET (48-64rem): a real layout, not a stretched phone ---------- */
@media (min-width: 45rem) and (max-width: 63.99rem) {
  .hero-grid { grid-template-columns: 1.25fr .75fr; align-items: end; gap: 2rem; }
  #hero .hero-inner { padding-block: 6.5rem 5.5rem; }
  .hero-h { font-size: clamp(2.6rem, 6vw, 3.9rem); }
  .lede { max-width: 38ch; min-height: 6.6em; }
  .about { grid-template-columns: 1fr; gap: 2.25rem; }
  .tl { grid-template-columns: repeat(2, 1fr); }
  .creds { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .quote.lead { grid-column: 1 / -1; }
  .post { grid-template-columns: 7rem 1fr auto; }
  /* tablets are touch: keep the tab bar, keep targets generous */
  #tabs { display: grid; }
  .nav-links { display: none; }
  body { padding-bottom: 4.25rem; }
}

/* ---------- PHONE (< 48rem): a different hero entirely ---------- */
#mhero { position: relative; min-height: 100svh; padding-top: 3.5rem; display: flex; flex-direction: column; overflow: hidden; }
/* Reserves the picture zone IN FLOW so the copy can never be laid over the
   face - the portrait itself stays absolute so it still bleeds behind the
   text below this line. Grows to fill a tall phone (pinning .m-body to the
   bottom exactly as justify-content:flex-end used to), never shrinks below
   the jaw. Height = image margin-top (4.5rem, less the 3.5rem padding this
   box sits inside) + 44% of the image, 44% being the measured jawline.
   On a viewport too short for both, the hero grows past 100svh and scrolls,
   which is the honest outcome - not text across his chin. */
#mhero::before { content: ""; flex: 1 0 auto; min-height: calc(.75rem + min(60.6vw, 26.3svh)); }
#mhero .m-img {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-start; justify-content: center;
}
/* Capped by viewport HEIGHT as well as width. The portrait is top-anchored and
   .m-body is bottom-anchored, so on a SHORT phone (440x763 is a real one) the
   two met over the face. Measured landmark: the jaw is the NARROWEST point of
   the cut-out, at 40-44% of its height. Reserving to exactly that line left
   12px of clearance, which is geometrically clear and still reads as text ON
   him, so this reserves to 52% - below the collar. 60.6vw is 0.52 of the
   image width, 30.2svh is 0.52 of its capped height.
   58.7svh is 58svh scaled by the 1245:1230 aspect, i.e. "cap the height at
   58svh" expressed as a width. Tall phones keep the 118% they had. */
#mhero .m-img img {
  width: min(118%, 50.6svh); max-width: none; height: auto; margin-top: min(4.5rem, 7svh);
  filter: contrast(1.04);
}
#mhero .m-glow {
  position: absolute; z-index: 0; left: 50%; top: 34%; translate: -50% -50%;
  width: 150vw; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(240,164,40,.30), rgba(217,133,16,.10) 42%, transparent 68%);
}
#mhero .m-scrim {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to bottom,
    rgba(8,8,10,.50) 0%,
    rgba(8,8,10,.10) 20%,
    rgba(8,8,10,.80) 38%,
    rgba(8,8,10,.90) 48%,
    rgba(8,8,10,.97) 62%,
    var(--ink-950) 78%);
}
/* bottom padding clears the fixed tab bar (3.5rem) plus the safe area */
#mhero .m-body { position: relative; z-index: 3; padding: 0 var(--pad) calc(5.25rem + env(safe-area-inset-bottom, 0px)); }
/* svh in the clamp is what a vw-only clamp cannot see: a short viewport. */
#mhero .hero-h { font-size: clamp(1.95rem, min(9vw, 5.6svh), 3rem); line-height: 1.02; }
#mhero .lede { min-height: 0; margin-top: 1rem; font-size: 1rem; }
/* The phone eyebrow is ~10px, i.e. SMALL text: it needs 4.5:1, not the 3.0
   that its size flatters you into assuming. Over the photograph amber-400
   measured 3.65:1 against the lit shoulder (and 3.82:1 before this hero
   was re-cut, so it never passed). amber-300 is the same hue, brighter,
   and in LIGHT theme -300 is the DEEPER ink, so both themes improve. */
#mhero .eyebrow { font-size: .62rem; letter-spacing: .18em; color: var(--amber-300); }

/* horizontally scrollable chip row — thumb-friendly, no wrapping stack */
.m-chips {
  display: flex; gap: .45rem; overflow-x: auto; margin: .9rem calc(var(--pad) * -1) 1.05rem;
  padding: .15rem var(--pad) .5rem; scroll-snap-type: x proximity;
  /* Without this the snapport starts at the scrollport edge, so the browser
     parks the first chip at x=0 and the row loads already scrolled by exactly
     the gutter - the capsule sat clipped against the screen edge, out of line
     with every other line of copy, and read as the page having scrolled. */
  scroll-padding-left: var(--pad);
  scrollbar-width: none;
}
.m-chips::-webkit-scrollbar { display: none; }
.m-chips button {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--ink-700);
  font-size: .8rem; color: var(--paper-faint); white-space: nowrap;
  transition: all .3s var(--e);
}
.m-chips button[aria-pressed="true"] {
  background: var(--amber-400); border-color: var(--amber-400); color: #140D02; font-weight: 600;
}

/* snap rails replace grids on the phone */
.m-rail {
  display: flex; gap: .75rem; overflow-x: auto;
  padding: .25rem var(--pad) 1rem; margin-inline: calc(var(--pad) * -1);
  scroll-snap-type: x mandatory; scroll-padding-left: var(--pad); scrollbar-width: none;
}
.m-rail::-webkit-scrollbar { display: none; }
.m-rail > * {
  flex: 0 0 72%; scroll-snap-align: center;
  background: var(--ink-900); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem;
}
.m-rail .n {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  color: var(--amber-300); font-variant-numeric: tabular-nums;
}
.m-rail .l { margin-top: .5rem; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-faint); }

.m-swipe {
  display: flex; align-items: center; gap: .5rem; padding: 0 var(--pad);
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--paper-faint);
}
.m-swipe::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* phone-only scroll behaviour: cards rise and settle, no parallax (which
   reads as lag on a touch device) */
@media (max-width: 44.99rem) {
  .m-pop { opacity: 0; transform: translateY(26px) scale(.965); }
  .stats { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 1fr; }
  .sec-head h2 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }
  .post { padding: 1.15rem 0; }
  .post:hover { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .m-pop { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   THEME TOGGLE (shared control, per-design styling)
   ========================================================================== */
.tt {
  width: 2.4rem; height: 2.4rem; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--ink-600); color: var(--paper-dim);
  transition: border-color .3s var(--e), color .3s var(--e), background-color .3s var(--e);
}
.tt:hover { border-color: var(--amber-400); color: var(--amber-300); }
.tt svg { width: 1.05rem; height: 1.05rem; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.tt-moon { display: none; }
[data-theme="light"] .tt-sun { display: none; }
[data-theme="light"] .tt-moon { display: block; }

/* ==========================================================================
   LIGHT THEME — "Daybreak"

   Not an inversion. Nightshift spends amber as a LIGHT SOURCE in darkness; on
   paper that premise does not exist, so amber changes job: it becomes ink and
   marmalade on a warm ground. The ink-* ramp is remapped to a paper ramp so
   every rule above follows without being rewritten.

   The amber ramp inverts with it — in dark, -200 is the lightest tint; here it
   is the deepest, because on paper the accent must DARKEN to stay legible as
   text. Where amber is a FILL rather than text it stays bright, via the
   explicit overrides further down.

   Every pair is measured, not eyeballed: contrast_check.py, body >= 4.5:1,
   large text >= 3.0:1.
   ========================================================================== */
[data-theme="light"] {
  --ink-950: #FBF6EC;   /* paper       */
  --ink-900: #F5EEE1;   /* card        */
  --ink-850: #EFE6D6;   /* raised/hover*/
  --ink-800: #E9DFCC;
  --ink-700: #DCCFB8;   /* soft border */
  --ink-600: #C9B99D;   /* strong border */

  --amber-200: #7A4508; /* deepest — hover text */
  --amber-300: #8A5109; /* em, figures          */
  --amber-400: #93540A; /* eyebrow, rules, bars */
  --amber-500: #A8620C;
  --amber-700: #E3C79C;

  --paper: #1A1512;     /* espresso body text */
  --paper-dim: #55483C;
  --paper-faint: #736354;

  --line: #E2D6C2;
  --line-soft: #EDE3D3;

  --amber-fill: #F0A428;  /* amber where it is a FILL, not text */
}

/* Selection and fills keep the bright amber — dark text sits on top of it. */
[data-theme="light"] ::selection { background: var(--amber-fill); color: #140D02; }

[data-theme="light"] .btn-amber { background: var(--amber-fill); border-color: var(--amber-fill); color: #140D02; }
[data-theme="light"] .btn-amber:hover { background: #FFB947; border-color: #FFB947; color: #140D02; }
[data-theme="light"] .m-chips button[aria-pressed="true"] { background: var(--amber-fill); border-color: var(--amber-fill); color: #140D02; }
[data-theme="light"] .aud button[aria-pressed="true"] {
  background: rgba(240,164,40,.22); border-color: rgba(147,84,10,.5); color: var(--amber-200);
}

/* Nav and tab bar: same veil, paper-side. */
[data-theme="light"] #nav.solid { background: rgba(251,246,236,.86); }
@supports not (backdrop-filter: blur(1px)) {
  [data-theme="light"] #nav.solid { background: rgba(251,246,236,.97); }
}
[data-theme="light"] #tabs { background: rgba(250,245,235,.94); }

/* The light source becomes a warm bloom sitting ON the paper rather than a
   glow cutting through black — same position, a fraction of the strength. */
[data-theme="light"] .glow {
  background:
    radial-gradient(circle at center,
      rgba(240,164,40,.26) 0%,
      rgba(217,133,16,.12) 26%,
      rgba(168,98,12,.05) 46%,
      transparent 68%);
}
/* Vignette inverts: paper closes in at the edges instead of darkness. */
[data-theme="light"] .vig {
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(251,246,236,.82) 100%);
}
[data-theme="light"] #contact .glow2 {
  background: radial-gradient(circle, rgba(240,164,40,.22), transparent 62%);
}
[data-theme="light"] #field { opacity: .30; }

/* Chips: a raised paper card, so they still lift off the portrait. */
[data-theme="light"] .chip {
  background: rgba(255,252,246,.9);
  border-color: #E0D2BA;
  box-shadow: 0 14px 30px -18px rgba(90,60,20,.45);
}
[data-theme="light"] .chip .dot { background: #12855A; box-shadow: 0 0 8px rgba(18,133,90,.55); }

/* Most badge PNGs are opaque squares on DARK grounds (IBM's are teal/maroon,
   median luminance 34-73). Dark theme lifts them to sit calmly on black.
   Darkening them for paper crushes them into black blocks, so muting here runs
   the other way - lift and fade, and let hover still restore full colour. */
[data-theme="light"] .cred img { filter: grayscale(1) brightness(1.45) contrast(.75) opacity(.65); }
[data-theme="light"] .cred:hover img { filter: none; }
/* Equal specificity to the rule above and later in the file, so the feature
   badge needs restating or it loses the full colour it is given in dark. */
[data-theme="light"] .cred.feature img { filter: none; }

/* Cursor ring reads against paper (mix-blend-mode: difference inverts it). */
[data-theme="light"] #cur { border-color: rgba(120,70,10,.55); }

/* Phone hero: the scrim pulls to paper, not to ink. */
[data-theme="light"] #mhero .m-glow {
  background: radial-gradient(circle, rgba(240,164,40,.34), rgba(217,133,16,.12) 42%, transparent 68%);
}
/* On paper the copy is dark INK, so its enemy is the dark SUIT bleeding
   through - the opposite of the dark theme, where light text over a dark suit
   is free. At .82 by 38% the eyebrow measured 3.93:1 over the shoulder. The
   veil now closes earlier; the face (0-20%) is untouched, so the portrait
   still reads, it just stops competing where the words start. */
[data-theme="light"] #mhero .m-scrim {
  /* LIGHT ONLY - the dark scrim above is untouched and stays as shipped.
     The veil was .94 paper by 34%, which washed the jacket to a silhouette.
     It now stays nearly clear through 32%, so the chest and shoulders read,
     then closes fast. It HAS to be near-opaque by 43%: the eyebrow sits at
     ~43.5% of the hero, directly over the jacket, and dark amber on a dark
     jacket measured 1.69:1 when this band was left open. */
  background: linear-gradient(to bottom,
    rgba(251,246,236,.28) 0%,
    rgba(251,246,236,.03) 22%,
    rgba(251,246,236,.12) 32%,
    rgba(251,246,236,.96) 42%,
    var(--ink-950) 52%);
}

[data-theme="light"] .share-menu { background: rgba(251,246,236,.95); }
@supports not (backdrop-filter: blur(1px)) {
  [data-theme="light"] .share-menu { background: rgba(251,246,236,.99); }
}

/* Blog: only the surfaces that are literals rather than tokens need restating. */
[data-theme="light"] .feat-media,
[data-theme="light"] .entry-thumb { background: var(--ink-850); }
[data-theme="light"] .art-body pre,
[data-theme="light"] .art-body blockquote { background: var(--ink-900); }
[data-theme="light"] .art-body code { background: var(--ink-850); }

/* The tech logos are black artwork: inverted on ink, untouched on paper. */
[data-theme="light"] .tech img { filter: none; opacity: .78; }
@media (hover: hover) {
  [data-theme="light"] .tech:hover img { filter: none; opacity: 1; }
}
[data-theme="light"] .proj-media { background: linear-gradient(135deg, var(--ink-850), var(--ink-800)); }

/* <picture> is inline by default; the hero figure and phone cover both size
   the image with width:100%, which needs a block box to sit in. */
.hero-figure picture, #mhero .m-img picture { display: block; }

/* ==========================================================================
   TOUCH TIER — keyed on the input device, not on width

   Width said "desktop" for iPad landscape (exactly 1024px = 64rem), which took
   away the tab bar and left 38-40px controls on a device driven by a thumb.
   These rules ask the real question instead. 44px is the Apple HIG / WCAG 2.5.5
   target; the audit measured the toggle at 38px and the audience chips at 32-40.
   ========================================================================== */
@media (pointer: coarse) {
  .tt { width: 2.75rem; height: 2.75rem; }
  .btn { padding-block: .85rem; }
  .aud button, .m-chips button { min-height: 2.75rem; }
  .soc a { width: 2.75rem; height: 2.75rem; }
  /* Deliberately NOT unmuting the badges here. Showing them in full colour
     because touch has no hover turned the credential grid into a field of loud
     teal and maroon squares against a calm dark page - louder than the desktop
     design it is meant to match. The muted state IS the design; the reveal is a
     pointer bonus, and no information is lost because the credential name and
     issuer are text. */
}

/* Tablet landscape is touch: keep the tab bar and drop the pointer nav, which
   width alone put back at exactly 1024px. */
@media (pointer: coarse) and (max-width: 68rem) {
  #tabs { display: grid; }
  .nav-links { display: none; }
  body { padding-bottom: 4.25rem; }
}

/* Narrow tablet (45-52rem): extending the tablet tier down to 720px gave the
   figure column ~230px, and three chips pinned by percentage offsets landed on
   top of each other. They carry real content - live topics, pod count, p99 -
   so they are re-laid rather than hidden: portrait fixed-width on the left,
   chips stacked beside it as a static column. No absolute pins, no collisions. */
@media (min-width: 45rem) and (max-width: 63.99rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure {
    display: grid; grid-template-columns: minmax(0, 15rem) 1fr;
    gap: .55rem 1.25rem; align-items: center; margin-top: .5rem;
  }
  .hero-figure picture { grid-row: span 3; }
  .chip { position: static; justify-self: start; }
  #hero .hero-inner { padding-block: 6rem 5rem; }
}

/* The desktop hero is 100svh with its content pinned to the bottom, and the tab
   bar is position:fixed OVER it - so on touch tiers the hero's last row (meta
   line, contact card, giant name) lands underneath the bar. body padding cannot
   fix this: the hero's own 100svh box is what runs under it. Reserve the bar's
   height inside the hero instead. */
@media (pointer: coarse) and (max-width: 68rem) {
  #hero { padding-bottom: 4.75rem; }
}
/* The scroll cue is absolutely pinned to the hero's bottom, so padding does not
   move it - and on touch the tab bar already occupies that space while scrolling
   needs no prompting. */
@media (pointer: coarse) { .scrollcue { display: none; } }

/* The email address is a primary contact affordance, but as a single line of
   display type its box is only ~26px tall - a thin strip for a thumb. Padding
   lifts the tap target past 44px without changing how it looks. */
/* The About facts carry the SAME affordance and were missed when .mail was
   lifted: both were 21px strips, under the 24px WCAG 2.2 minimum. The padding
   is cancelled by an equal negative margin so the rows do not grow, and the
   rule swaps border-bottom for text-decoration - a border follows the padding
   box and would drop the underline 11px below the words, where the underline
   must stay welded to the text. */
@media (pointer: coarse) {
  .mail { padding-block: .7rem; }
  .facts dd a {
    display: inline-block; padding-block: .7rem; margin-block: -.7rem;
    border-bottom: 0;
    text-decoration: underline; text-decoration-color: var(--ink-600);
    text-underline-offset: 4px;
  }
}
