/* ==========================================================================
   Poorvi Sharma — personal site
   Design tokens first, then layout, then components.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* --- Tokens: light (default) ---------------------------------------------- */
:root {
  --bg:            #faf9f7;
  --bg-sunken:     #f2f0ec;
  --surface:       #ffffff;
  --surface-2:     #f7f5f2;
  --ink:           #14131a;
  --ink-soft:      #45424f;
  --ink-muted:     #6f6b7a;
  --line:          #e4e0da;
  --line-strong:   #d3cec6;
  --accent:        #4f3ddb;
  --accent-ink:    #3b2cb8;
  --accent-wash:   #eeebfd;
  --accent-contrast: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 19, 26, .05), 0 1px 3px rgba(20, 19, 26, .04);
  --shadow-md: 0 4px 12px rgba(20, 19, 26, .06), 0 12px 28px rgba(20, 19, 26, .05);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1120px;
  --prose: 68ch;
  --radius: 14px;
  --radius-lg: 22px;

  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.09rem + 0.3vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.32rem + 0.62vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.62rem + 1.4vw, 2.9rem);
  --step-4: clamp(2.5rem, 1.9rem + 3vw, 4.6rem);
}

/* --- Tokens: dark --------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg:            #0b0a0f;
  --bg-sunken:     #08070c;
  --surface:       #14131b;
  --surface-2:     #1b1a24;
  --ink:           #eeecf4;
  --ink-soft:      #b8b4c4;
  --ink-muted:     #8b8698;
  --line:          #262430;
  --line-strong:   #34313f;
  --accent:        #a494ff;
  --accent-ink:    #c3b8ff;
  --accent-wash:   #1c1830;
  --accent-contrast: #100d1c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .35);
}

/* --- Base ----------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Fraunces is a variable font. SOFT rounds off the terminals and WONK swaps in
   the angled, slightly irregular letterforms — together they are what stop it
   reading as a stock corporate serif. Grouped so every display-font element
   gets the same treatment. */
h1, h2, h3, h4,
.wordmark__name,
.site-footer__name {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-optical-sizing: auto;
}

h1, h2, h3, h4 {
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

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

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

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

.skip-link {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -120%);
  z-index: 100; padding: .7rem 1.2rem;
  background: var(--accent); color: var(--accent-contrast);
  border-radius: 0 0 10px 10px; text-decoration: none;
  transition: transform .18s ease;
}
.skip-link:focus { transform: translate(-50%, 0); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

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

.eyebrow {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  margin-right: auto;
  line-height: 1.15;
}
.wordmark__name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}
.wordmark__role {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav__toggle { display: none; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
  list-style: none;
  padding: 0;
}
.nav__links a {
  position: relative;
  text-decoration: none;
  font-size: .95rem;
  color: var(--ink-soft);
  padding-block: .35rem;
  transition: color .18s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__links a[aria-current="page"] { color: var(--ink); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-toggle svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  grid-area: 1 / 1;
  transition: opacity .2s ease, transform .3s ease;
}
.theme-toggle__moon { fill: currentColor; stroke: none; }
:root[data-theme="light"] .theme-toggle__moon { opacity: 0; transform: rotate(-40deg) scale(.6); }
:root[data-theme="dark"]  .theme-toggle__sun  { opacity: 0; transform: rotate(40deg) scale(.6); }

/* htmx navigation progress bar */
.htmx-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
body.is-navigating .htmx-progress {
  opacity: 1;
  animation: progress-slide 1.1s cubic-bezier(.25, .8, .3, 1) infinite;
}
@keyframes progress-slide {
  0%   { transform: scaleX(0);   transform-origin: left; }
  55%  { transform: scaleX(.75); transform-origin: left; }
  100% { transform: scaleX(1);   transform-origin: right; }
}

/* --- Hero (always dark, hosts the WebGL canvas) --------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  background: #08070d;
  color: #f2f0f8;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* Radial vignette keeps text legible over the particle field. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Eased off from .75: the avatar sits at the right edge, where this vignette
     is strongest, so it was dimming her more than it was helping the headline.
     The bottom fade does most of the work of grounding the section. */
  background:
    radial-gradient(135% 95% at 45% 0%, transparent 45%, rgba(8, 7, 13, .45) 100%),
    linear-gradient(to bottom, transparent 58%, #08070d 100%);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(520px, 84vh, 780px);
  padding-block: clamp(4rem, 12vh, 8rem);
}

/* Keeps the copy clear of the avatar, which the WebGL scene places on the
   right. Below 900px the avatar recentres behind the text, so the cap lifts
   and the extra bottom padding gives it room. */
.hero__content { max-width: 34rem; }

@media (max-width: 900px) {
  .hero__content { max-width: none; }
  .hero__inner { padding-bottom: clamp(9rem, 34vh, 16rem); }
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  align-self: flex-start;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #b5abe6;
  padding: .42rem .9rem;
  border: 1px solid rgba(180, 168, 255, .28);
  border-radius: 100px;
  background: rgba(120, 100, 255, .07);
  backdrop-filter: blur(4px);
}
.hero__kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a494ff;
  box-shadow: 0 0 10px 2px rgba(164, 148, 255, .8);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.75); }
}

.hero__headline {
  /* Sized independently of --step-4: this headline is a full sentence rather
     than a short title, so it needs to be smaller and wider than page headings
     or it runs to five lines and pushes the buttons off screen. */
  font-size: clamp(2.05rem, 1.55rem + 2.3vw, 3.5rem);
  line-height: 1.14;
  margin-top: 1.6rem;
  max-width: 19ch;
  color: #fbfaff;
}
.hero__headline em {
  font-style: italic;
  color: #b9aaff;
}

.hero__subhead {
  margin-top: 1.5rem;
  max-width: 54ch;
  font-size: var(--step-1);
  color: #c5c0d6;
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2.4rem;
}

.hero__scroll {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #79738f;
}
.hero__scroll::before {
  content: "";
  width: 34px; height: 1px;
  background: currentColor;
  animation: scroll-line 2.4s ease-in-out infinite;
}
@keyframes scroll-line {
  0%, 100% { transform: scaleX(1); opacity: .45; }
  50%      { transform: scaleX(1.7); opacity: 1; }
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .78rem 1.4rem;
  border-radius: 100px;
  border: 1px solid transparent;
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover { box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--accent) 75%, transparent); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* On the dark hero the ghost button needs its own palette. */
.hero .btn--primary { background: #6f5bff; color: #fff; box-shadow: 0 8px 26px -8px rgba(111, 91, 255, .8); }
.hero .btn--ghost { border-color: rgba(255, 255, 255, .22); color: #e8e5f4; }
.hero .btn--ghost:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }

.btn__arrow { transition: transform .2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* --- Sections ------------------------------------------------------------- */
.section { padding-block: clamp(3.5rem, 9vh, 6.5rem); }
.section--sunken { background: var(--bg-sunken); border-block: 1px solid var(--line); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4vh, 3rem);
}
.section__title { font-size: var(--step-3); max-width: 20ch; }
.section__lead { margin-top: .9rem; max-width: 56ch; color: var(--ink-soft); }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.link-more:hover { text-decoration: underline; }
.link-more svg { width: 15px; height: 15px; transition: transform .2s ease; }
.link-more:hover svg { transform: translateX(3px); }

/* --- Focus cards ---------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
}

/* Two across rather than four. Four questions in the default grid gives each
   card ~280px, which is too narrow for a couple of sentences to breathe. */
.card-grid--pairs {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}

.card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.card__index {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .05em;
}
.card__title { font-size: var(--step-2); margin-top: .8rem; }
.card__body { margin-top: .75rem; color: var(--ink-soft); font-size: .97rem; }

/* --- Open questions -------------------------------------------------------- */
/* A list of ideas rather than a grid of cards. Boxes made these read as a
   framework of principles; hairline-separated rows read as things being
   thought about. */
.questions { display: grid; }

.question {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 clamp(1.2rem, 3vw, 2.6rem);
  padding-block: clamp(1.5rem, 3.4vh, 2.3rem);
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.question:last-child { border-bottom: 1px solid var(--line); }

.question__index {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .05em;
}

.question__body { display: block; max-width: 46ch; }

.question__title {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: var(--step-2);
  line-height: 1.18;
  letter-spacing: -0.008em;
  transition: color .2s ease;
}

.question__note {
  display: block;
  margin-top: .55rem;
  color: var(--ink-muted);
  font-size: .97rem;
}

/* Only questions that link anywhere get affordances. */
.question__cue { opacity: 0; transition: opacity .2s ease, transform .2s ease; color: var(--accent); }
.question__cue svg { display: block; }
.question--link:hover .question__title { color: var(--accent); }
.question--link:hover .question__cue { opacity: 1; transform: translateX(3px); }

@media (max-width: 620px) {
  .question { grid-template-columns: auto minmax(0, 1fr); gap: 0 1rem; }
  .question__cue { display: none; }
}

/* --- Now list ------------------------------------------------------------- */
.now-list { list-style: none; padding: 0; display: grid; gap: .9rem; }
.now-list li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--ink-soft);
}
/* Arrows rather than bullets: these are directions being followed, not a
   checklist of completed items. */
.now-list li::before {
  content: "→";
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-size: .95em;
}

/* --- Featured piece -------------------------------------------------------- */
/* Deliberately outweighs everything else in the section. A chronological list
   of equal-weight rows gives away the one decision worth controlling: what a
   first-time visitor encounters. */
.featured {
  display: block;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.featured:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.featured__label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.featured__title {
  font-size: var(--step-3);
  margin-top: .9rem;
  max-width: 24ch;
  transition: color .2s ease;
}
.featured:hover .featured__title { color: var(--accent); }

.featured__excerpt {
  margin-top: .9rem;
  max-width: 56ch;
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.55;
}

.featured__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1.2rem;
  margin-top: 1.6rem;
}
.featured__tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.featured__date {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
}

.featured__cue {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1.4rem;
  font-size: .93rem;
  font-weight: 500;
  color: var(--accent);
}
.featured__cue svg { transition: transform .2s ease; }
.featured:hover .featured__cue svg { transform: translateX(4px); }

/* --- Supporting pieces ------------------------------------------------------ */
.more-thinking { margin-top: clamp(2rem, 5vh, 3.2rem); }
.more-thinking__label {
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1.2rem;
}
.more-thinking__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.more-post {
  display: block;
  padding: clamp(1.2rem, 2.5vw, 1.7rem) clamp(1rem, 2vw, 1.4rem);
  background: var(--bg-sunken);
  text-decoration: none;
  transition: background .2s ease;
}
.more-post:hover { background: var(--surface-2); }
.more-post__title {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: var(--step-1);
  line-height: 1.2;
  transition: color .2s ease;
}
.more-post:hover .more-post__title { color: var(--accent); }
.more-post__excerpt {
  display: block;
  margin-top: .5rem;
  font-size: .92rem;
  color: var(--ink-muted);
}
.more-post__date {
  display: block;
  margin-top: .8rem;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--ink-muted);
}

.link-more--block { margin-top: clamp(1.8rem, 4vh, 2.6rem); }

/* --- Post list ------------------------------------------------------------ */
.post-list { display: grid; gap: 0; }

.post-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .6rem 2rem;
  padding-block: clamp(1.3rem, 3vh, 1.9rem);
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background .2s ease;
}
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item:hover { background: var(--surface-2); }
.post-item:hover .post-item__title { color: var(--accent); }

.post-item__main { grid-column: 1; }
.post-item__title {
  font-size: var(--step-2);
  transition: color .2s ease;
}
.post-item__excerpt {
  margin-top: .5rem;
  color: var(--ink-muted);
  font-size: .96rem;
  max-width: 62ch;
}
.post-item__meta {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.post-item__tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .85rem;
}

.tag {
  font-size: .74rem;
  font-family: var(--font-mono);
  padding: .22rem .62rem;
  border-radius: 100px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  border: 1px solid transparent;
}

/* --- Tag filter (htmx) ---------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.filter {
  font-size: .87rem;
  padding: .44rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: all .18s ease;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Fade the swapped results in/out so htmx swaps do not feel abrupt.
   The filters live inside #blog-results too, so the active state is rendered
   server-side and no JavaScript is needed to keep it in sync. */
#blog-results {
  opacity: 1;
  transition: opacity .18s ease;
}
#blog-results.htmx-swapping { opacity: 0; }

/* --- Prose (blog post body) ----------------------------------------------- */
.post-header {
  padding-block: clamp(3rem, 8vh, 5rem) clamp(1.5rem, 4vh, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.post-header__title { font-size: var(--step-4); max-width: 22ch; }
.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem;
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--ink-muted);
}
.post-header__excerpt {
  margin-top: 1.3rem;
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: var(--prose);
}

.prose {
  max-width: var(--prose);
  padding-block: clamp(2.5rem, 6vh, 4rem);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.prose > * + * { margin-top: 1.35em; }
.prose h2 {
  font-size: var(--step-3);
  color: var(--ink);
  margin-top: 2.4em;
  margin-bottom: -.3em;
}
.prose h3 {
  font-size: var(--step-2);
  color: var(--ink);
  margin-top: 1.9em;
  margin-bottom: -.4em;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.3em;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.35;
  color: var(--ink);
}
.prose code {
  font-family: var(--font-mono);
  font-size: .87em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: .12em .4em;
  border-radius: 5px;
}
.prose pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  min-width: 30rem;
}
.prose th,
.prose td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose thead th {
  color: var(--ink);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: var(--surface-2);
  white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: var(--surface-2); }

.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.6em; }
.prose figure figcaption {
  margin-top: .7rem;
  font-size: .87rem;
  color: var(--ink-muted);
  text-align: center;
}

/* --- Page header (about / blog index / etc.) ------------------------------ */
.page-header {
  padding-block: clamp(3rem, 9vh, 5.5rem) clamp(2rem, 5vh, 3rem);
}
.page-header__title { font-size: var(--step-4); max-width: 18ch; }

/* For page titles that are a full sentence rather than a two-word label.
   At --step-4 they dominate the screen and are genuinely hard to read. */
.page-header__title--sentence {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
  line-height: 1.2;
  max-width: 26ch;
}
.page-header__lead {
  margin-top: 1.3rem;
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 58ch;
}

/* --- About: timeline ------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

.timeline { display: grid; gap: 2.4rem; }
.timeline__item {
  position: relative;
  padding-left: 1.8rem;
  border-left: 1px solid var(--line);
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -5px; top: .55em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}
.timeline__period {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
}
.timeline__role { font-size: var(--step-2); margin-top: .25rem; }
.timeline__org { color: var(--accent); font-weight: 500; font-size: .97rem; margin-top: .2rem; }
.timeline__summary { margin-top: .7rem; color: var(--ink-soft); }
.timeline__highlights { margin-top: .8rem; padding-left: 1.1rem; color: var(--ink-soft); }
.timeline__highlights li + li { margin-top: .4rem; }
.timeline__highlights li::marker { color: var(--accent); }

.skill-group + .skill-group { margin-top: 1.8rem; }
.skill-group__name {
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: .8rem;
}
.skill-list { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; }
.skill-list li {
  font-size: .86rem;
  padding: .34rem .8rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
}

/* --- Empty state ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: clamp(3rem, 10vh, 5.5rem) 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-state__title { font-size: var(--step-2); }
.empty-state p { margin-top: .8rem; color: var(--ink-muted); max-width: 46ch; margin-inline: auto; }

/* --- Contact -------------------------------------------------------------- */
.contact-links { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.2rem, 3vh, 1.7rem) 0;
  background: var(--bg);
  text-decoration: none;
  transition: padding .22s ease, background .22s ease;
}
.contact-link:hover { padding-inline: 1.2rem; background: var(--surface-2); }
.contact-link__label { font-size: var(--step-2); }
.contact-link__value {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: .86rem;
}
.contact-link__value svg { width: 15px; height: 15px; flex: none; transition: transform .2s ease; }
.contact-link:hover .contact-link__value { color: var(--accent); }
.contact-link:hover .contact-link__value svg { transform: translateX(3px); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(4rem, 10vh, 7rem);
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  padding-top: clamp(2.5rem, 6vh, 4rem);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  padding-bottom: 2.5rem;
}
.site-footer__name {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: 1.3rem;
}
.site-footer__tagline { max-width: 30ch; margin-top: .35rem; font-size: .93rem; }
.site-footer__links, .site-footer__social { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.site-footer__links a, .site-footer__social a {
  font-size: .92rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .18s ease;
}
.site-footer__links a:hover, .site-footer__social a:hover { color: var(--accent); }
.site-footer__legal {
  border-top: 1px solid var(--line);
  padding-block: 1.4rem;
  font-size: .85rem;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 720px) {
  .nav__toggle {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
  }
  .nav__toggle-bar,
  .nav__toggle-bar::before,
  .nav__toggle-bar::after {
    display: block;
    width: 15px; height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .24s ease, opacity .18s ease;
  }
  .nav__toggle-bar::before, .nav__toggle-bar::after { content: ""; position: absolute; }
  .nav__toggle-bar::before { transform: translateY(-5px); }
  .nav__toggle-bar::after  { transform: translateY(5px); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::before { transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::after  { transform: rotate(-45deg); }

  .nav__links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1.15rem, 4vw, 2.5rem) 1.5rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav__links[data-open="true"] { display: flex; }
  .nav__links a { display: block; padding-block: .9rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__links a::after { display: none; }

  .post-item { grid-template-columns: minmax(0, 1fr); }
  .post-item__meta { grid-column: 1; grid-row: auto; order: -1; margin-bottom: .3rem; }
  .contact-link { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

/* --- Resume --------------------------------------------------------------- */
.r-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 4vw, 3rem);
  margin-top: clamp(1.8rem, 4vh, 2.6rem);
}
.r-stat { display: grid; gap: .2rem; }
.r-stat__value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--accent);
}
.r-stat__label { font-size: .88rem; color: var(--ink-muted); max-width: 16ch; }
.r-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: clamp(1.8rem, 4vh, 2.4rem); }

/* Before / after scrubber */
.scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 3vh, 2.2rem);
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
}
.scrub__input { width: 100%; accent-color: var(--accent); cursor: grab; }
.scrub__input:active { cursor: grabbing; }

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: clamp(.9rem, 2vw, 1.3rem);
}
.impact {
  margin: 0;
  padding: 1.3rem 1.4rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.impact__label { font-size: .9rem; color: var(--ink-soft); }
.impact__org {
  display: block;
  margin-top: .15rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-muted);
}
.impact__value {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.impact__bar {
  height: 6px;
  margin-top: 1rem;
  border-radius: 100px;
  background: var(--bg-sunken);
  overflow: hidden;
}
/* min-width keeps a sliver visible: a 1-month → 10-minute drop is 0.02% of the
   bar, and an empty track would read as "no data" rather than "almost none". */
.impact__bar span {
  display: block;
  height: 100%;
  width: calc(var(--fill, 1) * 100%);
  min-width: 4px;
  border-radius: inherit;
  background: var(--accent);
}
.impact__range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-top: .9rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ink-muted);
}
.impact__change {
  margin-left: auto;
  padding: .15rem .55rem;
  border-radius: 100px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-weight: 500;
}

/* Changelog controls */
.r-controls {
  display: grid;
  gap: 1.3rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  margin-bottom: clamp(2.2rem, 5vh, 3.2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.r-controls__row { display: flex; flex-wrap: wrap; gap: 1.3rem 2.4rem; }
.r-controls__group { display: grid; gap: .6rem; }
.r-controls__label {
  font-size: .74rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.r-controls__skills { margin: 0; padding: 0; }
.r-controls__note { color: var(--ink-soft); font-size: .93rem; }
.r-controls__status { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); min-height: 1.2em; }
.r-controls__status:empty { display: none; }

.filter__count { font-family: var(--font-mono); font-size: .72rem; opacity: .65; margin-left: .15rem; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  /* Not a full pill: on a phone the lens options wrap to two rows, and a
     100px radius turns that into a blob. */
  border-radius: 1.3rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
}
.seg__btn {
  padding: .38rem .95rem;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .86rem;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Releases — the main line is solid, side projects branch off it dashed. */
.releases { display: grid; }
.rel {
  position: relative;
  padding: 0 0 clamp(2.4rem, 5vh, 3.2rem) clamp(1.4rem, 3vw, 2.2rem);
  border-left: 1.5px solid var(--line-strong);
  transition: opacity .25s ease;
}
.rel::before {
  content: "";
  position: absolute;
  left: -6px; top: .3rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.rel--branch { border-left-style: dashed; border-left-color: var(--accent); }
.rel--branch::before { background: var(--bg); border: 2px solid var(--accent); }
.rel--origin { padding-bottom: 0; border-left-color: transparent; }

.rel__period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-muted);
}
.rel__badge {
  padding: .14rem .6rem;
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
  font-size: .72rem;
}
.rel__badge--branch { background: var(--accent-wash); color: var(--accent-ink); }
.rel__role { font-size: var(--step-2); margin-top: .55rem; }
.rel__org { color: var(--accent); font-weight: 500; font-size: .97rem; margin-top: .2rem; }
.rel__about { margin-top: .6rem; color: var(--ink-soft); max-width: 62ch; }
.rel__head .link-more { margin-top: .7rem; }

.rel__entries { list-style: none; padding: 0; margin-top: 1.3rem; display: grid; gap: .2rem; }
.entry {
  position: relative;
  padding: .85rem 1rem .85rem 1.5rem;
  border-radius: var(--radius);
  transition: opacity .25s ease, background .25s ease;
}
.entry::before {
  content: "+";
  position: absolute;
  left: .5rem; top: .85rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--accent);
}
.entry__title {
  font-family: var(--font-body);
  font-variation-settings: normal;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
.entry__short, .entry__text { margin-top: .25rem; color: var(--ink-soft); max-width: 70ch; }
.entry__skills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }

.releases[data-mode="skim"] .entry__text,
.releases[data-mode="skim"] .entry__skills,
.releases[data-mode="deep"] .entry__short { display: none; }

.entry.is-dim { opacity: .3; }
.entry.is-hit { background: var(--accent-wash); }
.rel.is-quiet .rel__head { opacity: .45; }

.r-toolkit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.8rem clamp(1.5rem, 4vw, 3rem);
}
.r-toolkit .skill-group + .skill-group { margin-top: 0; }

@media (max-width: 620px) {
  .scrub { gap: .6rem; }
}

@media print {
  .site-header, .site-footer, .r-actions, .r-controls, .scrub { display: none !important; }
  .releases .entry__text { display: block !important; }
  .releases .entry__short { display: none !important; }
  .entry.is-dim, .rel.is-quiet .rel__head { opacity: 1; }
}

/* --- Motion preferences --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scroll reveal — inert when reduced motion is requested.
   Scoped to .js so the content is visible by default: if the script fails to
   load, nothing is left hidden behind a class that will never be applied. */
@media (prefers-reduced-motion: no-preference) {
  :root.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
  }
  :root.js [data-reveal].is-visible { opacity: 1; transform: none; }
}
