/* ============================================================
   johanthegoat.xyz — Alphonso "Johan" Braga
   ============================================================
   Editorial, typographic, quiet. Hierarchy comes from type size
   and whitespace; separation comes from hairlines, not cards or
   shadows. One accent, used only where something is actionable.
   Light by default, dark on request or by system preference.
   ============================================================ */

:root {
  color-scheme: light;

  --bg:        #fcfbf9;
  --bg-2:      #f5f3ef;
  --bg-3:      #edeae4;
  --text:      #14140f;
  --muted:     #63615c;
  --faint:     #726f66;
  --line:      #e2ded6;
  --line-firm: #cdc8be;
  --accent:    #1b4fd8;
  --accent-bg: #e8eeff;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --pad: clamp(1.15rem, 4.5vw, 4rem);
  --maxw: 1180px;
  --readw: 68ch;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* ---------------------------------------------------------------
     Type scale: a perfect fourth (1.333) at the top end, compressed
     to a minor third (1.2) on small screens so the headline cannot
     bully everything else on a phone. Each step is a real clamp
     between those two ratios rather than a number picked by eye.
     --------------------------------------------------------------- */
  --step--2: clamp(0.69rem, 0.67rem + 0.11vw, 0.75rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.20vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.95rem + 0.24vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.11rem + 0.43vw, 1.44rem);
  --step-2:  clamp(1.44rem, 1.30rem + 0.71vw, 1.84rem);
  --step-3:  clamp(1.73rem, 1.50rem + 1.13vw, 2.36rem);
  --step-4:  clamp(2.07rem, 1.72rem + 1.76vw, 3.05rem);
  --step-5:  clamp(2.49rem, 1.95rem + 2.68vw, 3.98rem);
  --step-6:  clamp(2.99rem, 2.18rem + 4.02vw, 5.23rem);
  --step-7:  clamp(3.58rem, 2.37rem + 6.05vw, 6.95rem);

  /* Named roles, so components ask for meaning rather than a number. */
  --t-hero:  var(--step-7);
  --t-sec:   var(--step-4);
  --t-item:  var(--step-2);
  --t-body:  var(--step-0);
  --t-small: var(--step--1);
  --t-micro: var(--step--2);

  /* Line heights tighten as type grows, which is how it stays readable
     at both ends instead of loose at the top and cramped at the bottom. */
  --lh-display: 1.02;
  --lh-heading: 1.15;
  --lh-body: 1.65;
  --lh-tight: 1.35;

  /* Tracking follows size in the opposite direction. */
  --tr-display: -0.032em;
  --tr-heading: -0.018em;
  --tr-body: -0.003em;
  --tr-caps: 0.16em;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #0d0d0f;
  --bg-2:      #141417;
  --bg-3:      #1c1c21;
  --text:      #eceae5;
  --muted:     #9d9a94;
  --faint:     #8a877f;
  --line:      #24242a;
  --line-firm: #34343c;
  --accent:    #89a9ff;
  --accent-bg: #16203a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0d0d0f;
    --bg-2:      #141417;
    --bg-3:      #1c1c21;
    --text:      #eceae5;
    --muted:     #9d9a94;
    --faint:     #8a877f;
    --line:      #24242a;
    --line-firm: #34343c;
    --accent:    #89a9ff;
    --accent-bg: #16203a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  overflow-x: hidden;

  /* Newsreader carries an optical-size axis. Letting the browser drive it
     means the display cuts get the finer strokes and tighter spacing they
     were drawn for, and body text keeps its sturdier forms. */
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paragraphs get `pretty`, which spends a little layout time avoiding
   widows and short last lines. Headings get `balance`, which evens the
   ragged edge across lines instead of leaving one word stranded. */
p, li, dd, figcaption, blockquote { text-wrap: pretty; }
h1, h2, h3, h4, .lede, .hero__pitch, .contact__big { text-wrap: balance; }

/* Uppercase mono labels need air; lowercase display needs the opposite. */
.mono, .eyebrow, kbd, .chip, th {
  font-feature-settings: "tnum" 1;
  letter-spacing: var(--tr-caps);
}

/* Numbers that sit in columns or tick upward must not reflow. */
.stat b, .tech__n, .row__aside, .typing__stats b, .pj-facts dd {
  font-variant-numeric: tabular-nums;
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: fixed; left: -9999px; top: 0; z-index: 999;
  background: var(--text); color: var(--bg); padding: .8rem 1.2rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- primitives ---------- */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.mono {
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  font-weight: 400;
}

/* The numbered section rule — the spine of the whole page. */
.sec { padding-block: clamp(3.5rem, 7vw, 6rem); border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; }

.sec__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}
.sec__label { display: flex; align-items: baseline; gap: .7rem; }
.sec__label b { font-family: var(--mono); font-size: var(--t-micro); color: var(--accent); font-weight: 500; letter-spacing: .14em; }
.sec__label h2 {
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: var(--tr-caps);
  text-transform: uppercase; color: var(--faint); margin: 0; font-weight: 400;
}
.sec__more { font-size: var(--t-small); color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.sec__more:hover { color: var(--accent); }

.lede {
  font-size: var(--t-item);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-heading);
  max-width: 34ch; margin: 0;
}

.ext::after { content: "↗"; font-size: .8em; margin-left: .25em; color: var(--faint); }

/* ---------- header ---------- */

.hdr {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) { .hdr { background: var(--bg); } }

.hdr__in { display: flex; align-items: center; gap: 1rem; height: 3.4rem; }

.brand { font-weight: 600; letter-spacing: -.015em; font-size: .95rem; display: flex; align-items: baseline; gap: .5rem; flex: none; }
.brand i { font-style: normal; color: var(--faint); font-weight: 400; font-size: var(--t-micro); font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.hdr__nav { display: flex; align-items: center; gap: 1.35rem; margin-left: auto; }
.hdr__nav a { font-size: var(--t-small); color: var(--muted); transition: color .18s var(--ease); white-space: nowrap; }
.hdr__nav a:hover, .hdr__nav a[aria-current="page"] { color: var(--text); }

.hdr__tools { display: flex; align-items: center; gap: .4rem; flex: none; }

.tool {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .6rem .35rem .7rem;
  border: 1px solid var(--line); border-radius: 5px;
  font-size: var(--t-small); color: var(--muted);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.tool:hover { color: var(--text); border-color: var(--line-firm); }
kbd {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .04em;
  padding: .15rem .3rem; border: 1px solid var(--line); border-radius: 3px;
  color: var(--faint); background: var(--bg-2); line-height: 1;
}

.icon-btn {
  width: 2rem; height: 2rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 5px; color: var(--muted);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-firm); }
.icon-btn svg { width: 15px; height: 15px; }
:root[data-theme="dark"] .icon-sun, :root:not([data-theme="light"]) .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon, :root:not([data-theme="light"]) .icon-moon { display: block; }
.icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .icon-moon { display: none; }
}

.burger { display: none; }

.tool__icon { display: none; width: 15px; height: 15px; }

@media (max-width: 940px) {
  .hdr__nav { display: none; }
  .burger { display: grid; }
  /* Collapse the labelled tools to a single icon rather than an empty pill. */
  .tool span, .tool kbd { display: none; }
  .tool { padding: .4rem; }
  .tool__icon { display: block; }
  .tool--desk { display: none; }
}

/* mobile sheet */
.sheet {
  position: fixed; inset: 3.4rem 0 0; z-index: 99;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 1.5rem var(--pad) 3rem; overflow-y: auto;
  display: none; flex-direction: column; gap: .25rem;
}
.sheet[data-open="true"] { display: flex; }
.sheet a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.sheet a:last-of-type { border-bottom: 0; }
.sheet__group { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-top: 1.25rem; }
body[data-locked="true"] { overflow: hidden; }

/* ---------- hero ---------- */

.hero { padding-block: 0 clamp(2rem, 4vw, 3rem); }
.hero__top { display: flex; align-items: center; gap: 1.15rem; margin-bottom: 1.75rem; }

.avatar {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); object-fit: cover; background: var(--bg-2);
}
.avatar--fallback {
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.6rem; color: var(--muted);
}

.hero__name { font-size: 1.05rem; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.hero__where { font-size: var(--t-small); color: var(--faint); margin: .15rem 0 0; display: flex; align-items: center; gap: .45rem; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: #23a35a; flex: none; }
:root[data-theme="dark"] .pulse { background: #3ecf7b; }

.hero__pitch {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--t-hero);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  /* The capital I has almost no left sidebearing, so flush-left leaves it
     looking indented against the text beneath. Pull it back optically.
     Must come after the shorthand or the shorthand resets it. */
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.5rem);
  margin-left: -0.055em;
  /* Balance rather than a hard clamp, so it never orphans a single word. */
  max-width: 18ch;
  text-wrap: balance;
}
.hero__pitch em { font-style: italic; }
.hero__intro { color: var(--muted); max-width: var(--readw); margin: 0 0 1.75rem; }

/* ---------- the stack, directly under the headline ---------- */

/* Full bleed, sitting directly under the header as the first thing on the
   page. It is edge to edge rather than inside .wrap, so it reads as a band. */
.hstack {
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

/* One lane. The lane clips, the track slides. */
.hstack__lane {
  display: flex;
  overflow: hidden;
  padding-block: 1.1rem;
  /* Fade both ends so names never collide with the edge of the page. */
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.hstack__track {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1.6rem;
  padding-right: 1.6rem;
  animation: hstack-slide linear infinite;
  animation-duration: calc(var(--lane-speed, 72) * 1s);
  will-change: transform;
}
.hstack__lane:hover .hstack__track { animation-play-state: paused; }
@keyframes hstack-slide { to { transform: translateX(-100%); } }

.hstack__item {
  white-space: nowrap;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.5;
  color: var(--text);
  letter-spacing: -.008em;
  display: inline-flex;
  align-items: center;
  gap: 1.6rem;
  transition: color .16s var(--ease);
}
/* A dot between entries, drawn on the item rather than as a separate node. */
.hstack__item::after {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--line-firm);
  flex: none;
}
.hstack__item:hover { color: var(--accent); }

@media (max-width: 680px) {
  .hstack__lane { padding-block: .9rem; }
  .hstack__track { gap: 1.15rem; padding-right: 1.15rem; }
  .hstack__item { gap: 1.15rem; }
}

/* Motion off: stop the slide and let the lane scroll by hand, so the full list
   stays reachable instead of frozen part-way through. */
@media (prefers-reduced-motion: reduce) {
  .hstack__track { animation: none; }
  .hstack__track[aria-hidden="true"] { display: none; }
  .hstack__lane { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
}
}

@media (max-width: 680px) {
  .hstack__row { grid-template-columns: 1fr; }
  .hstack__items a { font-size: .85rem; }
}

.socials { display: flex; flex-wrap: wrap; gap: .4rem; }
.socials a {
  font-size: var(--t-small); color: var(--muted);
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 100px;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.socials a:hover { color: var(--text); border-color: var(--line-firm); }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--bg); padding: 1.15rem clamp(.75rem, 1.6vw, 1.25rem); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.05; letter-spacing: -.02em; }
.stat span { display: block; margin-top: .3rem; font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

/* ---------- list rows (blog, experience, index) ---------- */

.rows { border-top: 1px solid var(--line); }
.row {
  display: grid; gap: .2rem 1.5rem; align-items: baseline;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background .18s var(--ease);
}
.row:hover { background: var(--bg-2); }
.row__link { position: absolute; inset: 0; }
.row__when { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding-top: .3rem; }
.row__body { min-width: 0; }
.row__title {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--t-item);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  margin: 0;
}
.row:hover .row__title { color: var(--accent); }
.row__desc { color: var(--muted); font-size: var(--t-small); margin: .3rem 0 0; max-width: 62ch; }
.row__aside { font-family: var(--mono); font-size: var(--t-micro); color: var(--faint); white-space: nowrap; letter-spacing: .08em; text-align: right; padding-top: .3rem; }
.row__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }

@media (max-width: 720px) {
  .row { grid-template-columns: 1fr auto; }
  .row__when { grid-column: 1 / -1; padding-top: 0; }
  .row__aside { align-self: start; }
}

.chip {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .2rem .45rem; border: 1px solid var(--line); border-radius: 3px; color: var(--faint);
}
.chip--live { border-color: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--accent); }

/* ---------- projects ---------- */

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); margin-bottom: clamp(2rem, 4vw, 3rem); }

.feat { display: block; }
.feat__shot {
  aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line); margin-bottom: .85rem;
}
.feat__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.feat:hover .feat__shot img { transform: scale(1.025); }
.feat__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.feat__name {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--step-1);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  margin: 0;
}
.feat:hover .feat__name { color: var(--accent); }
.feat__desc { color: var(--muted); font-size: var(--t-small); margin: .35rem 0 0; }

/* ---------- stack ---------- */

.stack-group { padding-block: 1.35rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem 2rem; align-items: start; }
.stack-group:first-child { border-top: 1px solid var(--line); }
.stack-group h3 { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: .25rem 0 0; font-weight: 400; }
.stack-items { display: flex; flex-wrap: wrap; gap: .4rem; }
.stack-items span { font-size: var(--t-small); color: var(--muted); padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 4px; }
@media (max-width: 720px) { .stack-group { grid-template-columns: 1fr; } }

/* ---------- empty state for unfilled sections ---------- */

.awaiting {
  border: 1px dashed var(--line-firm); border-radius: 4px;
  padding: 1.15rem 1.25rem; color: var(--faint); font-size: var(--t-small);
}
.awaiting code { font-family: var(--mono); font-size: .8em; color: var(--muted); }

/* ---------- contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (max-width: 780px) { .contact { grid-template-columns: 1fr; } }
.contact__big {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--t-sec);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  margin: 0 0 1rem;
}
.contact p { color: var(--muted); margin: 0 0 1.25rem; }
.mailto { font-size: var(--t-item); color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.mailto:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */

.ftr { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; }
.ftr__in { display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between; align-items: center; font-size: var(--t-small); color: var(--faint); }
.ftr a:hover { color: var(--text); }

/* ============================================================
   Command palette (⌘K)
   ============================================================ */

.pal-back {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, #000 42%, transparent);
  display: none; align-items: flex-start; justify-content: center;
  padding: clamp(3rem, 12vh, 8rem) 1rem 2rem;
}
.pal-back[data-open="true"] { display: flex; }

.pal {
  width: min(100%, 560px); background: var(--bg); border: 1px solid var(--line-firm);
  border-radius: 8px; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column; max-height: min(70vh, 480px);
}
.pal input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  padding: .95rem 1.1rem; font: inherit; font-size: .95rem;
  background: transparent; color: var(--text);
}
.pal input::placeholder { color: var(--faint); }
.pal input:focus { outline: 0; }

.pal__list { overflow-y: auto; padding: .35rem; }
.pal__item {
  display: flex; align-items: baseline; gap: .75rem; width: 100%; text-align: left;
  padding: .55rem .75rem; border-radius: 5px; font-size: var(--t-small);
}
.pal__item[aria-selected="true"] { background: var(--accent-bg); }
.pal__item b { font-weight: 500; color: var(--text); }
.pal__item span { color: var(--faint); font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .1em; text-transform: uppercase; margin-left: auto; white-space: nowrap; }
.pal__none { padding: 1.5rem .75rem; text-align: center; color: var(--faint); font-size: var(--t-small); }
.pal__foot { border-top: 1px solid var(--line); padding: .5rem .85rem; display: flex; gap: 1rem; font-size: var(--t-micro); color: var(--faint); font-family: var(--mono); letter-spacing: .08em; }

/* ============================================================
   Typing test (⌘J)
   ============================================================ */

.typing { max-width: 100%; }
.typing__quote {
  font-family: var(--mono); font-size: clamp(.9rem, 1.4vw, 1.05rem); line-height: 2;
  letter-spacing: .01em; color: var(--faint); word-break: break-word;
  border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem;
  background: var(--bg-2); cursor: text;
}
.typing__quote b { color: var(--text); font-weight: 400; }
.typing__quote i { font-style: normal; color: #c0392b; border-bottom: 2px solid #c0392b; }
:root[data-theme="dark"] .typing__quote i { color: #ff8a7a; border-color: #ff8a7a; }
.typing__quote u {
  text-decoration: none; border-left: 2px solid var(--accent);
  margin-left: -2px; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { border-color: transparent } }

.typing__stats { display: flex; gap: 1.75rem; margin-top: 1rem; flex-wrap: wrap; }
.typing__stats div b { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 400; line-height: 1; }
.typing__stats div span { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.typing__hint { font-size: var(--t-small); color: var(--faint); margin-top: .9rem; }
.typing input.ghost { position: absolute; opacity: 0; pointer-events: none; }

/* ============================================================
   Article
   ============================================================ */

.art-head { padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; }
.art-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--step-5);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-display);
  margin: .5rem 0 .75rem; max-width: 24ch;
}
.art-head .lede { color: var(--muted); font-family: var(--sans); font-size: 1.05rem; max-width: var(--readw); }
.art-meta { display: flex; align-items: center; gap: .7rem; margin-top: 1.5rem; font-size: var(--t-small); color: var(--faint); }
.art-meta .avatar { width: 30px; height: 30px; }

.prose {
  max-width: var(--readw);
  font-size: var(--step-1);
  line-height: 1.75;
  letter-spacing: var(--tr-body);
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--step-3);
  letter-spacing: var(--tr-heading);
  line-height: var(--lh-heading);
  margin-top: 2.2em;
}
.prose h3 { font-size: 1.15rem; font-weight: 600; margin-top: 1.8em; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { border-left: 2px solid var(--line-firm); padding-left: 1.1em; color: var(--muted); font-style: italic; margin-left: 0; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--bg-3); padding: .12em .35em; border-radius: 3px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; overflow-x: auto; font-size: .85rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { border: 1px solid var(--line); border-radius: 4px; margin-block: 1.6em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.2em; }

/* ---------- pagination ---------- */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; font-size: var(--t-small); }
.pager span { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; color: var(--faint); }
.pager a:hover { color: var(--accent); }
.pager .off { color: var(--faint); pointer-events: none; }

/* ---------- project case study ---------- */

.pj-head { padding-block: clamp(2.5rem, 5vw, 4rem) 1.75rem; }
.pj-kicker {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: baseline;
  color: var(--faint); margin: 0 0 .9rem;
}
.pj-kicker span { opacity: .45; }
.pj-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--step-5);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-display);
  margin: 0 0 1rem; max-width: 20ch;
}
.pj-lede {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem); line-height: 1.55;
  color: var(--muted); max-width: var(--readw); margin: 0;
}
.pj-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.05rem; border: 1px solid var(--line-firm); border-radius: 5px;
  font-size: var(--t-small);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { border-color: var(--text); }
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* full-width cover */
.pj-cover {
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; background-size: cover; background-position: center;
  aspect-ratio: 16 / 10;
}
.pj-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* narrative + sidebar */
.pj-cols {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 4rem); align-items: start;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 900px) { .pj-cols { grid-template-columns: 1fr; } }

.pj-step {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0 1.25rem;
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
  border-top: 1px solid var(--line);
}
.pj-story .pj-step:first-child { border-top: 0; padding-top: 0; }
.pj-step__n {
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .14em;
  color: var(--accent); margin: .35rem 0 0;
}
.pj-step h2 {
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  letter-spacing: -.005em; margin: 0 0 .5rem; color: var(--text);
}
.pj-step p {
  margin: 0; color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.08rem); line-height: 1.7; max-width: 62ch;
}
@media (max-width: 560px) {
  .pj-step { grid-template-columns: 1fr; }
  .pj-step__n { margin-bottom: .4rem; }
}

/* sidebar */
.pj-side { position: sticky; top: 4.5rem; display: grid; gap: 1.5rem; }
@media (max-width: 900px) { .pj-side { position: static; } }

.pj-facts { display: grid; border-top: 1px solid var(--line); }
.pj-facts > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: .7rem; border-bottom: 1px solid var(--line);
}
.pj-facts dt {
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.pj-facts dd { margin: 0; font-size: var(--t-small); text-align: right; }
.pj-facts a { color: var(--accent); }

.pj-sec h3 {
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); font-weight: 400;
  margin: 0 0 .7rem;
}
a.chip { transition: border-color .18s var(--ease), color .18s var(--ease); }
a.chip:hover { border-color: var(--accent); color: var(--accent); }

.pj-points { list-style: none; margin: 0; padding: 0; }
.pj-points li {
  position: relative; padding-left: 1rem; padding-block: .35rem;
  font-size: var(--t-small); color: var(--muted);
}
.pj-points li::before {
  content: ""; position: absolute; left: 0; top: .95em;
  width: 5px; height: 1px; background: var(--accent);
}

/* live embed */
.pj-embed {
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}
.pj-embed__bar {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem .85rem; border-bottom: 1px solid var(--line);
  background: var(--bg-2); font-family: var(--mono);
  font-size: var(--t-micro); letter-spacing: .1em; color: var(--faint);
}
.pj-embed__bar a:hover { color: var(--accent); }
.pj-embed iframe { width: 100%; height: min(70vh, 660px); border: 0; display: block; background: #000; }

.note {
  border-left: 2px solid var(--accent); background: var(--accent-bg);
  padding: .8rem 1rem; font-size: var(--t-small); color: var(--muted);
  margin-top: 1.25rem; border-radius: 0 4px 4px 0;
}

.nextup { border-top: 1px solid var(--line); padding-block: 2rem; }
.nextup a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.nextup b { font-family: var(--serif); font-weight: 400; font-size: var(--t-item); letter-spacing: -.015em; }
.nextup a:hover b { color: var(--accent); }

/* ---------- motion ---------- */

.fade { opacity: 0; transform: translateY(10px); }
.fade.in { opacity: 1; transform: none; transition: opacity .55s var(--ease), transform .55s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .fade { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Hero canvas, scroll progress, and card depth
   ============================================================ */

.hero { position: relative; overflow: hidden; }
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: auto;
  /* Fades out toward the copy so the type always wins. */
  mask-image: linear-gradient(100deg, transparent 0%, #000 42%, #000 100%);
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, #000 42%, #000 100%);
  opacity: .85;
}
.hero .wrap { position: relative; z-index: 1; pointer-events: none; }
.hero .wrap a, .hero .wrap button { pointer-events: auto; }

/* reading progress */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: var(--accent); z-index: 300;
  will-change: transform;
}

/* counters hold their space so nothing reflows as they tick up */
.stat b { font-variant-numeric: tabular-nums; }

/* project cards get real depth on hover without a drop shadow */
.feat__shot { position: relative; }
.feat__shot::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
  pointer-events: none;
}
.feat { transition: transform .5s var(--ease); }
.feat:hover { transform: translateY(-3px); }

/* the art covers are wide and dark; keep the crop centred on their subject */
.feat__shot img.art, .pj-embed img.art { object-position: center; }

@media (prefers-reduced-motion: reduce) {
  #hero-canvas { display: none; }
  .feat:hover { transform: none; }
}

/* ============================================================
   Avatar that turns toward the pointer
   ============================================================
   Eight directions, but continuous rather than eight sprites:
   one real photograph on a 3D-tilted plane, so it leans north,
   north-east, east and so on as the cursor moves around it.
   ============================================================ */

.av {
  width: 62px; height: 62px; flex: none;
  perspective: 320px;
  position: relative;
}
.av__plate {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transform-style: preserve-3d;
  transition: transform .35s var(--ease);
  will-change: transform;
}
.av__plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }

/* The lit edge slides around the rim, so the direction reads even
   at 62px where the tilt alone is nearly invisible. */
.av__glow {
  position: absolute; inset: -2px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    color-mix(in srgb, var(--accent) 55%, transparent) 0%,
    transparent 58%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.av.is-tracking .av__glow { opacity: 1; }

.av__ring {
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.av.is-tracking .av__ring { opacity: 1; transform: scale(1); }

.art-meta .av, .art-meta .av__plate { width: 30px; height: 30px; }

@media (prefers-reduced-motion: reduce) {
  .av__plate { transform: none !important; transition: none; }
  .av__glow, .av__ring { display: none; }
}

/* ============================================================
   Blur-up image loading
   ============================================================
   The box already carries a ~20px version of the real picture as
   its background, so there is never an empty rectangle. The full
   image fades in over it once decoded.
   ============================================================ */

.feat__shot, .pj-embed {
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}
/* Hidden only once scripting has confirmed it can reveal them again, so a
   no-JS visitor sees every image rather than a page of blurred squares. */
.js img[data-fade] {
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.js img[data-fade].is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  img[data-fade] { transition: none; }
}

/* ============================================================
   Cross-document view transitions
   ============================================================
   Supported browsers cross-fade between pages instead of the
   white flash. Everywhere else this block is simply ignored.
   ============================================================ */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .26s ease both; }
@keyframes vt-out { to { opacity: 0 } }
@keyframes vt-in { from { opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ============================================================
   Cursor-follow preview on the project index
   ============================================================ */

.peek {
  position: fixed; top: 0; left: 0;
  width: min(20vw, 268px); aspect-ratio: 16 / 10;
  z-index: 60; pointer-events: none;
  overflow: hidden; border-radius: 4px;
  border: 1px solid var(--line-firm);
  background: var(--bg-2) center/cover no-repeat;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.94);
  transition: opacity .28s var(--ease), transform .36s var(--ease);
  box-shadow: 0 12px 40px color-mix(in srgb, #000 22%, transparent);
}
.peek.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Only worth it where there is a real pointer and room to show it. */
@media (max-width: 1100px), (pointer: coarse) { .peek { display: none; } }
@media (prefers-reduced-motion: reduce) { .peek { display: none; } }

/* keyboard focus on a row reads the same as hover */
.row:focus-within { background: var(--bg-2); }
.row__link:focus-visible { outline-offset: -2px; }

/* ============================================================
   Stack page
   ============================================================ */

.tech-group { margin-bottom: clamp(2rem, 4vw, 3rem); }
.tech-group h2 {
  display: flex; align-items: baseline; gap: .6rem;
  margin: 0 0 .25rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--line-firm);
  color: var(--text); font-weight: 400;
}
.tech-group h2 span { color: var(--faint); }

.tech {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 2.5rem;
  gap: .5rem 1.5rem; align-items: baseline;
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 5rem;
}
.tech:target { background: var(--accent-bg); }
.tech__name { font-weight: 500; font-size: .95rem; }
.tech__uses { display: flex; flex-wrap: wrap; gap: .3rem .75rem; }
.tech__uses a {
  font-size: var(--t-small); color: var(--muted);
  border-bottom: 1px solid transparent;
}
.tech__uses a:hover { color: var(--accent); border-bottom-color: currentColor; }
.tech__n {
  font-family: var(--mono); font-size: var(--t-micro);
  color: var(--faint); text-align: right; font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .tech { grid-template-columns: 1fr 2.5rem; }
  .tech__uses { grid-column: 1 / -1; }
}

/* The narrative column already ends on generous padding; the related section
   does not need its own full top padding on top of that. */
.pj-cols + .sec { padding-top: clamp(1rem, 2vw, 1.75rem); }

/* ============================================================
   Avatar that turns toward the pointer
   ============================================================
   Eight directions, but continuous rather than eight sprites:
   one real photograph on a 3D-tilted plane, so it leans north,
   north-east, east and so on as the cursor moves around it.
   ============================================================ */

.av {
  width: 62px; height: 62px; flex: none;
  perspective: 320px;
  position: relative;
}
.av__plate {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transform-style: preserve-3d;
  transition: transform .35s var(--ease);
  will-change: transform;
}
.av__plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }

/* The lit edge slides around the rim, so the direction reads even
   at 62px where the tilt alone is nearly invisible. */
.av__glow {
  position: absolute; inset: -2px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    color-mix(in srgb, var(--accent) 55%, transparent) 0%,
    transparent 58%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.av.is-tracking .av__glow { opacity: 1; }

.av__ring {
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.av.is-tracking .av__ring { opacity: 1; transform: scale(1); }

.art-meta .av, .art-meta .av__plate { width: 30px; height: 30px; }

@media (prefers-reduced-motion: reduce) {
  .av__plate { transform: none !important; transition: none; }
  .av__glow, .av__ring { display: none; }
}

/* ============================================================
   Blur-up image loading
   ============================================================
   The box already carries a ~20px version of the real picture as
   its background, so there is never an empty rectangle. The full
   image fades in over it once decoded.
   ============================================================ */

.feat__shot, .pj-embed {
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}
/* Hidden only once scripting has confirmed it can reveal them again, so a
   no-JS visitor sees every image rather than a page of blurred squares. */
.js img[data-fade] {
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.js img[data-fade].is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  img[data-fade] { transition: none; }
}

/* ============================================================
   Cross-document view transitions
   ============================================================
   Supported browsers cross-fade between pages instead of the
   white flash. Everywhere else this block is simply ignored.
   ============================================================ */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .26s ease both; }
@keyframes vt-out { to { opacity: 0 } }
@keyframes vt-in { from { opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ============================================================
   Cursor-follow preview on the project index
   ============================================================ */

.peek {
  position: fixed; top: 0; left: 0;
  width: min(20vw, 268px); aspect-ratio: 16 / 10;
  z-index: 60; pointer-events: none;
  overflow: hidden; border-radius: 4px;
  border: 1px solid var(--line-firm);
  background: var(--bg-2) center/cover no-repeat;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.94);
  transition: opacity .28s var(--ease), transform .36s var(--ease);
  box-shadow: 0 12px 40px color-mix(in srgb, #000 22%, transparent);
}
.peek.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Only worth it where there is a real pointer and room to show it. */
@media (max-width: 1100px), (pointer: coarse) { .peek { display: none; } }
@media (prefers-reduced-motion: reduce) { .peek { display: none; } }

/* keyboard focus on a row reads the same as hover */
.row:focus-within { background: var(--bg-2); }
.row__link:focus-visible { outline-offset: -2px; }

/* ============================================================
   Stack page
   ============================================================ */

.tech-group { margin-bottom: clamp(2rem, 4vw, 3rem); }
.tech-group h2 {
  display: flex; align-items: baseline; gap: .6rem;
  margin: 0 0 .25rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--line-firm);
  color: var(--text); font-weight: 400;
}
.tech-group h2 span { color: var(--faint); }

.tech {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 2.5rem;
  gap: .5rem 1.5rem; align-items: baseline;
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 5rem;
}
.tech:target { background: var(--accent-bg); }
.tech__name { font-weight: 500; font-size: .95rem; }
.tech__uses { display: flex; flex-wrap: wrap; gap: .3rem .75rem; }
.tech__uses a {
  font-size: var(--t-small); color: var(--muted);
  border-bottom: 1px solid transparent;
}
.tech__uses a:hover { color: var(--accent); border-bottom-color: currentColor; }
.tech__n {
  font-family: var(--mono); font-size: var(--t-micro);
  color: var(--faint); text-align: right; font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .tech { grid-template-columns: 1fr 2.5rem; }
  .tech__uses { grid-column: 1 / -1; }
}

/* The narrative column already ends on generous padding; the related section
   does not need its own full top padding on top of that. */
.pj-cols + .sec { padding-top: clamp(1rem, 2vw, 1.75rem); }

/* ============================================================
   Marquee
   ============================================================
   One continuous band of the stack, moving. Duplicated once so
   the loop is seamless, paused on hover, and stopped entirely
   for anyone who asked for reduced motion.
   ============================================================ */

.marquee {
  --speed: 48s;
  display: flex;
  overflow: hidden;
  user-select: none;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  padding-block: clamp(.9rem, 1.8vw, 1.4rem);
}
.marquee__track {
  display: flex;
  flex: none;
  min-width: 100%;
  animation: marquee-slide var(--speed) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee-slide { to { transform: translateX(-100%); } }

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(1.1rem, 2.2vw, 2.2rem);
  padding-inline: clamp(.55rem, 1.1vw, 1.1rem);
  white-space: nowrap;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
}
.marquee__item::after {
  content: "";
  flex: none;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .7;
}

/* The quieter second band. */
.marquee--mono { background: var(--bg); --speed: 62s; padding-block: .8rem; }
.marquee--mono .marquee__track { animation-direction: reverse; }
.marquee--mono .marquee__item {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
  gap: clamp(.9rem, 1.8vw, 1.6rem);
}
.marquee--mono .marquee__item::after { width: 3px; height: 3px; }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee { overflow-x: auto; }
}

/* ============================================================
   Container queries
   ============================================================
   Project cards appear in three places at three different widths:
   the home grid, the related row on a case study, and the 404.
   Sizing them to the viewport is the wrong question. Sizing them
   to the space they were actually given is the right one.
   ============================================================ */

.feat-grid { container-type: inline-size; }
.feat { container-type: inline-size; }

@container (max-width: 260px) {
  .feat__name { font-size: var(--step-0); }
  .feat__desc { font-size: var(--t-micro); }
  .feat__meta { flex-direction: column; align-items: flex-start; gap: .35rem; }
}

/* ============================================================
   Scroll-driven reveal
   ============================================================
   Where `animation-timeline` is supported this runs entirely on
   the compositor with no JavaScript and no observer. The existing
   IntersectionObserver stays as the fallback, so both paths end
   at the same visible state.
   ============================================================ */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .fade:not(.in) {
      animation: fade-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 22%;
    }
    @keyframes fade-rise {
      from { opacity: 0; transform: translateY(14px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* ============================================================
   Selection, focus and the small stuff
   ============================================================ */

::selection { background: var(--accent); color: #fff; text-shadow: none; }

/* A focus ring that follows the shape of what it is wrapping. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.row:focus-within, .feat:focus-within { background: var(--bg-2); }

/* Anchor jumps should not land under the sticky header. */
[id] { scroll-margin-top: 5.5rem; }

/* Fine hairlines stay hairlines on high-density screens. */
@media (min-resolution: 2dppx) {
  :root { --line: color-mix(in srgb, var(--text) 11%, transparent); }
}

/* Aggregated headlines. Quieter than owned content, and marked as external. */
.feed-note {
  margin: 1.25rem 0 0;
  font-size: var(--t-small);
  color: var(--faint);
  max-width: 58ch;
}
#reading .row__when { color: var(--accent); opacity: .85; }

/* ============================================================
   Runtime banner
   ============================================================
   Injected by the control surface, so it must not shift the
   sticky header or cover content when it appears.
   ============================================================ */

.banner {
  display: block;
  padding: .6rem var(--pad);
  font-size: var(--t-small);
  text-align: center;
  background: var(--accent-bg);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
a.banner:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.banner--warn { background: color-mix(in srgb, #d97706 16%, transparent); }

/* The header is sticky at top:0; with a banner above it the anchor offset
   needs to grow or headings land underneath. */
.has-banner [id] { scroll-margin-top: 8rem; }

/* Not currently taking work: the dot stops advertising that you are. */
.pulse--closed { background: var(--faint); animation: none; }
