/* =============================================================
   drewroper.com — landing page
   Largely typographic. Dark. Fine lines. Utilitarian microcopy.
   Token-driven so fonts/colors can be swapped from one place.
   ============================================================= */

:root {
  /* Type ------------------------------------------------------ */
  /* --font-display rotates on each page load; set by script.js. */
  --font-display: 'Instrument Serif', 'Times New Roman', Times, serif;
  --font-serif:   'Instrument Serif', 'Times New Roman', Times, serif;
  --font-sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Color ----------------------------------------------------- */
  --bg:          #0c0c0d;
  --bg-elev:    #131315;
  --bg-deep:    #060607;
  --text:        #f4f1ec;
  --text-muted: #8c8a86;
  --text-faint: #56544f;
  --line:        #1f1f21;
  --line-faint: #161618;
  --line-bright:#2a2a2d;
  --accent:      #d6ff38;   /* electric lime — used sparingly */
  --pill-bg:    rgba(214, 255, 56, .12);

  /* Layout ---------------------------------------------------- */
  --container: 1280px;
  --gutter:     clamp(20px, 4vw, 40px);
  --rhythm:    clamp(48px, 9vw, 96px);
  --hairline:    1px;     /* high-hierarchy rule */
  --hairline-fine: 0.5px; /* low-hierarchy rule (renders as 1 device px on retina) */

  /* Single mono size, used everywhere mono lives. */
  --mono-size: 11px;
}

/* Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; }

/* Base ---------------------------------------------------------- */
html {
  background: var(--bg);
  scroll-behavior: smooth;
}
:target,
h2[id], main[id] { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

/* Subtle film-grain background (pure CSS, very low cost) */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 3px 3px;
}

a { color: inherit; text-decoration: none; }
main a {
  border-bottom: 1px solid var(--line-bright);
  transition: border-color .15s ease, color .15s ease;
}
main a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

.skip {
  position: absolute; left: -9999px;
  background: var(--bg-elev); color: var(--text);
  padding: .5rem 1rem; font-family: var(--font-mono); font-size: var(--mono-size);
}
.skip:focus { left: 1rem; top: 1rem; z-index: 200; }

/* TOPBAR — three-column grid: logo | clock (centered) | font pill --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  padding: .65rem var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  color: var(--text-muted);
  background: rgba(12,12,13,.78);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: var(--hairline) solid var(--line);
}
.topbar__brand   { justify-self: start;  min-width: 0; }
.topbar__clock   { justify-self: center; min-width: 0; }
.font-switch     { justify-self: end;    min-width: 0; }
.topbar__cell    { white-space: nowrap; }

/* DENVER CLOCK — pinned to MT, click toggles a Denver label ---- */
.topbar__clock {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.topbar__clock:hover { color: var(--text); }
.topbar__clock.is-locating { color: var(--accent); }
.topbar__clock-text { display: inline-block; }

/* Brand mark — used in topbar + footer ----------------------- */
.brand-mark {
  width: auto;
  height: 1em;
  display: inline-block;
  flex: none;
  color: currentColor;
  vertical-align: -0.12em;
}
.brand-mark--lg { height: 28px; }

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s ease;
}
.topbar__brand:hover { color: var(--accent); }
.topbar__brand .brand-mark {
  height: 13px;
  color: var(--text);
  transition: color .2s ease;
}
.topbar__brand:hover .brand-mark { color: var(--accent); }
.topbar__brand-text { color: inherit; }

/* FONT SWITCHER (in topbar) ------------------------------------ */
.font-switch {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .55rem .25rem .4rem;
  margin: -2px 0;            /* tighten visual height */
  border: var(--hairline) solid var(--line-bright);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  line-height: 1;
  min-height: 28px;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.font-switch:hover,
.font-switch:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.font-switch__aa {
  font-family: var(--font-display);
  font-size: 12px;          /* display, not mono — kept as fixed pixel */
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text);
  min-width: 14px;
  display: inline-flex;
  justify-content: center;
  transition: color .2s ease;
}
.font-switch:hover .font-switch__aa,
.font-switch:focus-visible .font-switch__aa { color: var(--accent); }

.font-switch__label {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: var(--mono-size);
}
.font-switch__name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-switch__icon {
  color: var(--text-faint);
  font-size: var(--mono-size);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), color .2s ease;
}
.font-switch:hover .font-switch__icon,
.font-switch:focus-visible .font-switch__icon {
  color: var(--accent);
  transform: rotate(180deg);
}
.font-switch.is-spinning .font-switch__icon {
  animation: fs-spin .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes fs-spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.dot--live {
  background: #5fbf85;
  box-shadow: 0 0 0 0 rgba(95,191,133,.8);
  animation: pulse 2.4s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(95,191,133,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(95,191,133,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,191,133,0); }
}

/* SHARED SECTION HEAD ------------------------------------------ */
/* No defined sections — content blocks just flow on the page.
   The hero gets a bit more breathing room, history and work follow
   without a top border or visual chrome. */
section {
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
}
.history { padding-top: clamp(1rem, 3vw, 2rem); }
.work    { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

/* HERO ---------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 7vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  border-top: 0;
}
.hero__grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas:
    'name    portrait'
    'about   portrait';
  column-gap: clamp(2rem, 6vw, 5rem);
  row-gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.hero__name { grid-area: name; }
.hero__about { grid-area: about; max-width: 60ch; }
.hero__portrait { grid-area: portrait; align-self: start; }

.eyebrow {
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow span:first-child { color: var(--text-faint); }

.hero__name h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--h1-weight, 400);
  font-style: normal;
  /* Pin variable-font weight axis to whatever the rotating font asks for.
     Set per-load by script.js via --h1-weight (defaults to 400). */
  font-variation-settings: 'wght' var(--h1-weight, 400);
  /* Per-font size multiplier so we can quiet down dominant display
     faces (Boldonse) and bump up tiny ones (VT323). Defaults to 1. */
  --h1-base-size: clamp(3.5rem, 7vw, 5.75rem);
  font-size: calc(var(--h1-base-size) * var(--h1-scale, 1));
  line-height: .95;
  letter-spacing: -.025em;
  color: var(--text);
  position: relative;
  /* Wrap long words and pseudo-words sanely. Critical for the editable
     headline easter egg, where someone may type 'aaaaaaaaaaaaaaaa…'. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
  max-width: 100%;
}
/* Force consistent weight across the editable contenteditable markup
   — anything the browser inserts inherits the same weight. */
.hero__name h1,
.hero__name h1 * {
  font-weight: var(--h1-weight, 400) !important;
  font-variation-settings: 'wght' var(--h1-weight, 400) !important;
}
/* EDITABLE HEADLINE -------------------------------------------- */
.h1--placeholder {
  cursor: text;
  outline: none;
  caret-color: var(--accent);
  -webkit-tap-highlight-color: transparent;
}
/* Blinking caret sits at the trailing edge of the last visual line.
   Because the H1 is one inline text node now (no block spans), the
   ::after pseudo lands inline at the end of whatever wrapped down. */
.h1--placeholder::after {
  content: '';
  display: inline-block;
  width: 0.05em;
  height: 0.78em;
  background: currentColor;
  vertical-align: -0.06em;
  margin-left: 0.06em;
  animation: h1-blink 1s steps(1) infinite;
  pointer-events: none;
}
.h1--placeholder:focus::after { display: none; }
.h1--placeholder:hover { color: var(--text); }
@keyframes h1-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .h1--placeholder::after { animation: none; }
}

.lede {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0;
  max-width: 60ch;
}
.lede a { color: var(--text); }

/* H2 — section titles use the rotating display face */
.h2,
.history__title,
.work__title,
.colophon__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -.012em;
  color: var(--text);
}

/* Company names: same h2 hierarchy, but in the body sans (Geist).
   A medium weight gives them heading presence without leaving body.
   Specificity bumped (.history descendant) to win against any earlier
   .history__company rule that might still be in stale caches. */
.history .history__company {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-style: normal;
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--text);
}

/* Portrait — dithered, ambient-animated canvas ----------------- */
.hero__portrait { margin: 0; }
.portrait__frame {
  position: relative;
  aspect-ratio: 3 / 2;
  background: #0e0e10;
  overflow: hidden;
}
.portrait__canvas { cursor: pointer; }
.portrait__canvas.is-drawing { cursor: crosshair; }

/* Draw-mode pill in the top-right of the portrait. Desktop only. */
.portrait__draw {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 2;
  padding: .3rem .7rem;
  border: var(--hairline) solid var(--line-bright);
  border-radius: 999px;
  background: rgba(12, 12, 13, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, border-color .2s ease;
}
.portrait__draw:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.portrait__draw.is-active {
  color: var(--accent);
  border-color: var(--accent);
}
@media (max-width: 760px) {
  .portrait__draw { display: none; }
}
.portrait__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.portrait__corner {
  position: absolute; width: 10px; height: 10px;
  border: var(--hairline) solid var(--accent);
}
.portrait__corner--tl { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; }
.portrait__corner--tr { top: -1px; right: -1px; border-left: 0;  border-bottom: 0; }
.portrait__corner--bl { bottom: -1px; left: -1px;  border-right: 0; border-top: 0; }
.portrait__corner--br { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

.hero__portrait figcaption {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: .85rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero__portrait figcaption > :nth-child(1) { justify-self: start;  text-align: left;  }
.hero__portrait figcaption > :nth-child(2) { justify-self: center; text-align: center; }
.hero__portrait figcaption > :nth-child(3) { justify-self: end;    text-align: right; }


/* HISTORY LIST -------------------------------------------------- */
.history__list {
  list-style: none;
  margin: 0; padding: 0;
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  gap: 1.5rem;
}
.history__item {
  display: grid;
  gap: .75rem;
  padding: 1.5rem 0;
  border-bottom: var(--hairline) solid var(--line-bright);
}
.history__item:first-child { padding-top: 0; }
.history__item:last-child  { border-bottom: 0; }

.history__top {
  display: flex; align-items: baseline; gap: .9rem;
}
.history__pill {
  display: inline-block;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .12em;
  text-transform: uppercase;
  align-self: center;
}
.history__year {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .08em;
  color: var(--text-muted);
  font-feature-settings: 'tnum';
  padding: .2rem .55rem;
  border: var(--hairline) solid var(--line-bright);
  border-radius: 999px;
}

.history__bottom {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  color: var(--text-muted);
}
.history__role { color: var(--text-muted); }
.history__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.history__loc {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: var(--mono-size);
}

/* WORK ---------------------------------------------------------- */
.work__title,
.history__title {
  max-width: var(--container);
  margin: 0 auto clamp(1rem, 2vw, 1.75rem);
}
.work-grid {
  max-width: var(--container);
  margin: 0 auto;
  column-count: 4;
  column-gap: clamp(.6rem, 1.4vw, 1.1rem);
}
.work-cell {
  position: relative;
  break-inside: avoid;
  margin: 0 0 clamp(.6rem, 1.4vw, 1.1rem);
  background: var(--bg-elev);
  overflow: hidden;
  /* aspect-ratio is set per-image by JS once the image loads, so each
     cell takes its photo's natural orientation. 4/5 is just a fallback
     for the brief moment before load. */
  aspect-ratio: var(--ratio, 4 / 5);
}
.work-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity .55s ease;
}
.work-cell.is-fading img { opacity: 0; }

@media (max-width: 1100px) {
  .work-grid { column-count: 3; }
}

/* WORK — mobile autoplay slideshow ----------------------------- */
.work-slides { display: none; }
.work-slides__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--bg-elev);
  border: var(--hairline-fine) solid var(--line);
  overflow: hidden;
}
.work-slides__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.work-slides__stage img.is-active { opacity: 1; }
.work-slides__dots {
  /* Hidden visually; the dots stay in the DOM (with their tab roles)
     for accessibility but the user opted out of the indicator row. */
  display: none;
}
.work-slides__dots .dot {
  width: 5px; height: 5px;
  background: var(--text-faint);
  border-radius: 50%;
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.work-slides__dots .dot.is-active {
  background: var(--text);
  transform: scale(1.4);
}

/* On tablets and below, swap masonry for the slideshow */
@media (max-width: 760px) {
  .work-grid   { display: none; }
  .work-slides { display: block; }
}

/* FOOTER -------------------------------------------------------- */
.footer {
  border-top: var(--hairline) solid var(--line);
  padding: var(--rhythm) var(--gutter) clamp(2rem, 4vw, 3rem);
  background: var(--bg-deep);
}

.footer__social {
  max-width: var(--container);
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer__social a {
  color: var(--text);
  border-bottom: var(--hairline) solid transparent;
  padding-bottom: 1px;
  transition: border-color .15s ease, color .15s ease;
}
.footer__social a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer__meta {
  max-width: var(--container);
  margin: 2.5rem auto 0;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  color: var(--text-faint);
}
.footer__copy {
  display: grid;
  gap: .25rem;
}
.footer__copy-line { display: block; }
/* Two tones: copyright slightly brighter, the disclaimer dimmer. */
.footer__copy-line:first-child  { color: var(--text-muted); }
.footer__copy-line:last-child   { color: var(--text-faint); }

/* Desktop ≥760px: one row, copyright pinned left, disclaimer pinned right */
@media (min-width: 760px) {
  .footer__copy {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

/* Claude mark — used inline in the colophon "Created with" link */
.claude-mark {
  display: inline-block;
  font-size: 1em;
  line-height: 1;
  color: var(--accent);
  margin-right: .15em;
  transform-origin: 50% 55%;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.colophon__row a:hover .claude-mark {
  transform: rotate(60deg);
}

.footer__rule {
  max-width: var(--container);
  margin: 2.5rem auto 1.25rem;
  height: 1px;
  background: var(--line);
}
.footer__signoff {
  max-width: var(--container);
  margin: 0 auto 1.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.footer__signoff .brand-mark { color: var(--text); }
@media (max-width: 640px) {
  .footer__signoff .brand-mark { height: 22px; }
}
/* COLOPHON ----------------------------------------------------- */
.colophon {
  max-width: var(--container);
  margin: 2.5rem auto 0;
  padding: 0;
}
.colophon__head {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: var(--hairline) solid var(--line);
  color: var(--text-muted);
}
/* .colophon__title visual style lives in the unified H2 rule above. */
.colophon__title { text-transform: none; }

.colophon__list {
  margin: 0; padding: 0;
  display: grid;
  gap: 0;
}
.colophon__row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: var(--hairline-fine) solid var(--line);
  align-items: baseline;
}
.colophon__row:last-child { border-bottom: 0; }

.colophon__row dt {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.colophon__row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .02em;
  color: var(--text-muted);
  line-height: 1.5;
}
.colophon__row dd a {
  color: var(--text);
  border-bottom: var(--hairline) solid var(--line-bright);
  transition: color .15s ease, border-color .15s ease;
  padding-bottom: 1px;
}
.colophon__row dd a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.colophon__row dd .dim { color: var(--text-faint); }
.colophon__row dd .ext {
  display: inline-block;
  margin-left: 2px;
  font-size: var(--mono-size);
  vertical-align: 1px;
  color: var(--text-faint);
}
.colophon__row dd a:hover .ext { color: var(--accent); }

.swatches {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}
.sw {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: .04em;
  color: var(--text-muted);
}
.sw__chip {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: var(--c);
  border: var(--hairline) solid var(--line-bright);
  flex: none;
  display: inline-block;
}

/* CHANGELOG drawer — easter egg under "Last touched" ----------- */
.changelog {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: 400;
  letter-spacing: .04em;
}
/* The summary acts as the visible "Last touched" row, matching the
   colophon row layout exactly so it reads as part of the dl above. */
.changelog__summary {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-top: var(--hairline-fine) solid var(--line);
  align-items: baseline;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.changelog__summary::-webkit-details-marker { display: none; }
.changelog__summary::marker { content: ''; }
.changelog__key {
  font-size: var(--mono-size);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.changelog__value {
  display: inline-flex;
  align-items: baseline;
  gap: .65rem;
  color: var(--text-faint);
}
.changelog__caret {
  display: inline-block;
  font-size: var(--mono-size);
  line-height: 1;
  color: var(--text-faint);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), color .2s ease;
  transform-origin: 50% 50%;
}
.changelog__summary:hover .changelog__caret,
.changelog[open] .changelog__caret { color: var(--accent); }
.changelog[open] .changelog__caret { transform: rotate(90deg); }

/* List: hierarchy through spacing, color, and indent — never size/weight. */
.changelog__list {
  list-style: none;
  margin: 0;
  padding: 1rem 0 1.5rem;
  display: grid;
  gap: 1.25rem;       /* generous breathing room between entries */
}
.changelog__list li {
  display: grid;
  gap: .35rem;        /* time -> message */
  font-feature-settings: 'tnum';
}
.changelog__list time { color: var(--text-faint); }
.changelog__msg {
  position: relative;
  padding-left: 1rem;     /* aligns wrapped lines flush with body text */
  color: var(--text-muted);
}
.changelog__msg::before {
  content: '└';
  position: absolute;
  left: 0;
  color: var(--text-faint);
}

/* =============================================================
   RESPONSIVE — mobile-first considered, layered breakpoints
   ============================================================= */

/* TABLET (≤1024px) -------------------------------------------- */
@media (max-width: 1024px) {
  .font-switch__label { display: none; }
}

/* LARGE MOBILE / SMALL TABLET (≤900px) ------------------------ */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      'name'
      'portrait'
      'about';
    column-gap: 0;
  }
  .hero__portrait {
    max-width: none;
    width: 100%;
  }
  .hero__name h1 { --h1-base-size: clamp(3.25rem, 9vw, 5rem); }
  .lede { font-size: 1rem; }
}

/* MOBILE (≤640px) --------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --rhythm: clamp(40px, 12vw, 64px);
    --gutter: clamp(16px, 5vw, 24px);
  }
  h2[id], main[id] { scroll-margin-top: 64px; }

  /* Topbar: keep three-column grid, just shrink everything */
  .topbar {
    font-size: var(--mono-size);
    gap: .4rem;
    padding: .5rem var(--gutter);
  }
  .font-switch { min-width: 0; }                /* allow ellipsis to engage */
  .font-switch__name { max-width: 10ch; }

  /* Hero */
  .hero { padding-top: clamp(2rem, 8vw, 3rem); }
  .hero__name h1 {
    --h1-base-size: clamp(3.75rem, 15vw, 5.625rem);
    letter-spacing: -.025em;
  }
  .lede { font-size: 1rem; line-height: 1.55; }
  /* History — stack the bottom row */
  .history__list { gap: 1rem; }
  .history__item { padding: 1.1rem 0; }
  .history__top {
    flex-wrap: wrap;
    gap: .55rem .75rem;
  }
  .history__company { font-size: 1rem; }
  .history__year { margin-left: auto; }
  .history__bottom {
    flex-wrap: wrap;
    gap: .35rem .9rem;
  }
  .history__rule { display: none; }
  .history__loc { width: 100%; }

  .footer__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Colophon — collapse to label-over-value on phones */
  .colophon__row {
    grid-template-columns: 1fr;
    gap: .25rem;
    padding: .85rem 0;
  }
  .swatches { gap: .65rem; }
}

/* SMALL MOBILE (≤380px) — iPhone SE / Android small ----------- */
@media (max-width: 380px) {
  .topbar { font-size: var(--mono-size); }
  .font-switch__name { display: none; }      /* Aa + ↻ only */
  .font-switch { padding: .25rem .5rem; gap: .4rem; }

  .hero__name h1 { --h1-base-size: clamp(3.4375rem, 16.25vw, 4.6875rem); }
  .lede { font-size: 1.05rem; }

  .history__company { font-size: 1rem; }
}

/* TOUCH-FIRST MOTION GUARD ------------------------------------ */
@media (hover: none) {
  /* Disable hover-only transforms that look weird on tap */
  .colophon__row a:hover .claude-mark { transform: none; }
  .font-switch:hover .font-switch__icon { transform: none; }
}
