/* ============================================================
   Hiten Patel — portfolio v2 · "hand-built, no page builder"
   Warm editorial-workshop direction: asymmetric type, italic
   serif marginalia, dashed rules, figure captions, paper grain.
   Display: Bricolage Grotesque · Body: Instrument Sans ·
   Notes: Newsreader italic. Accent tweakable via [data-accent].
   ============================================================ */

/* Self-hosted variable fonts for the active theme (data-type="friendly":
   Gabarito for display, Hanken Grotesk for body). Latin subset, ~34KB each.
   Self-hosting removes the blocking Google Fonts request that was the LCP
   bottleneck on mobile (3.6s -> target sub-2.5s). */
@font-face {
  font-family: "Gabarito";
  src: url("/fonts/gabarito-latin-var.woff2") format("woff2-variations"),
       url("/fonts/gabarito-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-latin-var.woff2") format("woff2-variations"),
       url("/fonts/hanken-grotesk-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-latin-var.woff2") format("woff2-variations"),
       url("/fonts/newsreader-italic-latin-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --font-note: "Newsreader", "Georgia", serif;

  /* dark theme (default) — warm charcoal, not blue-black */
  --bg: #12100c;
  --bg-2: #171410;
  --surface: #1c1914;
  --line: rgba(240, 234, 223, 0.11);
  --line-strong: rgba(240, 234, 223, 0.26);
  --text: #f0eadf;
  --text-2: #b5ab9b;
  --text-3: #948b7a;

  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, 0.13);
  --accent-line: rgba(255, 180, 84, 0.4);
  --accent-ink: #201403;

  --wrap: 1060px;
  color-scheme: dark;
}

:root[data-accent="lime"] {
  --accent: #c4e36f;
  --accent-soft: rgba(196, 227, 111, 0.12);
  --accent-line: rgba(196, 227, 111, 0.4);
  --accent-ink: #131904;
}

:root[data-theme="light"] {
  --bg: #f6f1e7;
  --bg-2: #f0e9db;
  --surface: #fbf8f1;
  --line: rgba(33, 28, 20, 0.13);
  --line-strong: rgba(33, 28, 20, 0.32);
  --text: #211c14;
  --text-2: #5e5749;
  --text-3: #6e6553;

  --accent: #a25c00;
  --accent-soft: rgba(162, 92, 0, 0.1);
  --accent-line: rgba(162, 92, 0, 0.38);
  --accent-ink: #fff6e8;
  color-scheme: light;
}
:root[data-theme="light"][data-accent="lime"] {
  --accent: #4f6a0e;
  --accent-soft: rgba(90, 122, 18, 0.1);
  --accent-line: rgba(90, 122, 18, 0.35);
  --accent-ink: #f8ffe8;
}

/* Friendly — soft geometric display, approachable and clear (only active theme) */
:root[data-type="friendly"] {
  --font-display: "Gabarito", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Hanken Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  position: relative;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.015em;
  font-weight: 700;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 28px; }

/* the italic-serif voice used for asides, captions, margin notes */
.it {
  font-family: var(--font-note);
  font-style: italic;
  font-weight: 480;
  letter-spacing: 0;
}
.note {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--accent);
  font-size: 17.5px;
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px dashed transparent;
  transition: border-color 0.3s ease, background-color 0.35s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line-strong); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  margin-right: auto;
}
.brand .brand-dot {
  color: var(--accent);
  font-size: 15px;
  align-self: center;
}

.site-nav { display: flex; gap: 26px; }
.site-nav a {
  text-decoration: none;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--accent); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.3s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); transform: rotate(40deg); }
.theme-toggle svg { width: 16px; height: 16px; }
:root[data-theme="light"] .icon-sun { display: none; }
:root:not([data-theme="light"]) .icon-moon { display: none; }

/* ---------- hero ---------- */

.hero { padding: 96px 0 72px; }

.hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 44px;
}
.hero-id img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  rotate: -2deg;
  box-shadow: 3px 3px 0 var(--accent-soft);
}
.hero-id .id-name { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.hero-id .id-role { color: var(--text-2); font-size: 13.5px; }

.badge-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-open .pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex: none;
}
.badge-open .pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
}

.hero h1 {
  font-size: clamp(44px, 8.2vw, 96px);
  font-weight: 750;
  line-height: 1.02;
  max-width: 14ch;
  margin-bottom: 40px;
}
.hero h1 .it {
  font-weight: 460;
  font-size: 0.97em;
  color: var(--text-2);
}
.hero h1 .squig {
  position: relative;
  white-space: nowrap;
  color: var(--accent);
}
.hero h1 .squig svg {
  position: absolute;
  left: 0; right: 0;
  bottom: -0.08em;
  width: 100%;
  height: 0.16em;
  overflow: visible;
  color: var(--accent);
}
.hero h1 .squig svg path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.hero-cols {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.hero .lede {
  font-size: 19px;
  color: var(--text-2);
  max-width: 54ch;
}
.hero .lede strong { color: var(--text); font-weight: 600; }
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  margin-top: 30px;
}

.textlink {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 17.5px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-line);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.textlink .arr { transition: translate 0.2s ease; display: inline-block; }
.textlink:hover { color: var(--accent); border-bottom-color: var(--accent); }
.textlink:hover .arr { translate: 3px 0; }
.textlink.down:hover .arr { translate: 0 3px; }

.hero-aside {
  border-top: 1px dashed var(--line-strong);
  font-size: 15px;
}
.hero-aside dl { margin: 0; }
.hero-aside .fact {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.hero-aside dt {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 2px;
}
.hero-aside dd { margin: 0; color: var(--text-2); }
.hero-aside dd strong { color: var(--text); font-weight: 600; }

/* ---------- client ticker ---------- */

.marquee {
  border-block: 1px dashed var(--line-strong);
  padding: 16px 0;
  overflow: hidden;
}
.marquee .marquee-track {
  display: flex;
  width: max-content;
  gap: 0;
}
.marquee .marquee-group {
  display: flex;
  align-items: baseline;
  gap: 44px;
  padding-right: 44px;
  white-space: nowrap;
}
.marquee .m-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 19px;
  color: var(--text-2);
}
.marquee .m-star { color: var(--accent); font-size: 16px; }
.marquee .m-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- sections ---------- */

.section { padding: 96px 0 0; }
.section:last-of-type { padding-bottom: 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 48px;
}
.sec-head .sec-index {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--accent);
  font-size: 19px;
  white-space: nowrap;
}
.sec-head h2 {
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 720;
}
.sec-head .rule {
  flex: 1;
  border-bottom: 1px dashed var(--line-strong);
  align-self: center;
  min-width: 40px;
}
.sec-head .sec-note { white-space: nowrap; }

/* the parts most people skip — unboxed triptych */
.skip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.skip-item { border-top: 2px solid var(--text); padding-top: 18px; }
.skip-item h3 {
  font-size: 21px;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.skip-item h3 .glyph { color: var(--accent); font-size: 17px; }
.skip-item p { color: var(--text-2); font-size: 15.5px; }

/* ---------- featured engagement (fig. 1) ---------- */

.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.featured .featured-tag {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.featured h3 {
  font-size: clamp(24px, 3vw, 33px);
  margin-bottom: 16px;
}
.featured p { color: var(--text-2); margin-bottom: 14px; }
.featured .featured-meta {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 24px;
}

.fig-frame {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 26px;
  position: relative;
}
.fig-frame::before, .fig-frame::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
}
.fig-frame::before { top: -5px; left: -5px; border-width: 1px 0 0 1px; }
.fig-frame::after { bottom: -5px; right: -5px; border-width: 0 1px 1px 0; }
.fig-cap {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-3);
  font-size: 15.5px;
  margin-top: 14px;
}
.fig-cap .fig-no { color: var(--accent); }

/* ---------- work history — editorial rows ---------- */

.xp { border-top: 1px dashed var(--line-strong); }
.xp-row {
  display: grid;
  grid-template-columns: 130px 1fr 180px;
  gap: 34px;
  padding: 38px 0;
  border-bottom: 1px dashed var(--line);
}
.xp-when {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-3);
  line-height: 1.4;
  transition: color 0.2s ease;
}
.xp-row:hover .xp-when { color: var(--accent); }
.xp-co h3 { font-size: 26px; display: inline; }
.xp-co .xp-role {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-2);
  font-size: 17px;
  margin-left: 12px;
}
.xp-body { margin-top: 12px; }
.xp-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 15.5px;
  display: grid;
  gap: 8px;
}
.xp-body li { padding-left: 20px; position: relative; }
.xp-body li::before {
  content: "✳";
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-size: 11px;
}
.xp-body strong { color: var(--text); font-weight: 600; }
.xp-note { text-align: right; padding-top: 6px; }

/* ---------- what I reach for — prose, not chips ---------- */

.reach { max-width: 70ch; }
.reach p { color: var(--text-2); font-size: 18px; }
.reach p + p { margin-top: 20px; }
.reach strong {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid var(--accent-line);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.reach strong:hover { border-bottom-color: var(--accent); color: var(--accent); }
.reach .lately {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
  font-size: 16px;
}
.reach .lately .it { color: var(--accent); margin-right: 6px; }

/* ---------- projects — figures, not cards ---------- */

.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px 48px;
}
.proj { display: flex; flex-direction: column; }
.proj.proj-wide { grid-column: 1 / -1; }
.proj.proj-wide .proj-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.proj.proj-wide .proj-body { padding-top: 0; }
.proj-media {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.proj-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proj-body { padding-top: 18px; }
.proj-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.proj h3 { font-size: 23px; }
.proj h3 a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.proj h3 a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.proj .proj-year {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-3);
  font-size: 15.5px;
  white-space: nowrap;
}
.proj p { color: var(--text-2); font-size: 15.5px; margin-bottom: 14px; }
.proj .textlink { font-size: 15.5px; }

/* ---------- reading + certs — two text columns ---------- */

.cols-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 64px;
}
.cols-2 h3 { font-size: 22px; margin-bottom: 14px; }
.cols-2 p { color: var(--text-2); font-size: 15.5px; }
.cols-2 p + p { margin-top: 12px; }
.cert-list { display: grid; margin-top: 6px; }
.cert-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.cert-item:last-child { border-bottom: none; }
.cert-item .cert-year {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--accent);
  font-size: 16px;
}
.cert-item .cert-name { font-weight: 600; font-size: 15px; }
.cert-item .cert-org { color: var(--text-3); font-size: 13.5px; }

/* ---------- contact ---------- */

.contact { padding: 120px 0 96px; text-align: left; }
.contact .contact-kicker { margin-bottom: 18px; }
.contact h2 {
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 740;
  max-width: 20ch;
  margin-bottom: 36px;
}
.contact .mail-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(30px, 6.4vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 3px solid var(--accent-line);
  transition: border-color 0.2s ease, letter-spacing 0.3s ease;
  margin-bottom: 40px;
  overflow-wrap: anywhere;
}
.contact .mail-link:hover { border-bottom-color: var(--accent); letter-spacing: 0; }
.contact .contact-sub { color: var(--text-2); font-size: 18px; max-width: 50ch; margin-bottom: 26px; }
.contact .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  color: var(--text-2);
  font-size: 15.5px;
  margin-top: 18px;
}
.contact .contact-links a {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact .contact-links a:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- FAQ ---------- */

.faq { display: grid; gap: 14px; margin-top: 30px; max-width: 78ch; }
.faq details {
  border-top: 1px dashed var(--line-strong);
  padding: 18px 4px 6px;
}
.faq details:last-of-type { border-bottom: 1px dashed var(--line-strong); padding-bottom: 18px; }
.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 18.5px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
  width: 12px;
  flex: none;
  transition: transform 0.18s ease;
  transform-origin: center;
}
.faq details[open] summary::before { content: "−"; }
.faq summary:hover { color: var(--accent); }
.faq details p {
  color: var(--text-2);
  font-size: 16.5px;
  margin: 12px 0 4px 26px;
  max-width: 68ch;
}
.faq details p a { color: var(--text); border-bottom: 1px solid var(--accent-line); text-decoration: none; }
.faq details p a:hover { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px dashed var(--line-strong); padding: 26px 0 30px; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 14px;
}
.site-footer .it { font-size: 15px; }
.site-footer .m-star { color: var(--accent); }
.site-footer .footer-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 14px;
}
.site-footer .footer-social a {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}
.site-footer .footer-social a:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- case study pages ---------- */

.case-hero { padding: 72px 0 48px; }
.case-hero .crumb {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 30px;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 2px;
}
.case-hero .crumb:hover { color: var(--accent); border-color: var(--accent-line); }
.case-hero .case-kicker {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 14px;
}
.case-hero h1 { font-size: clamp(34px, 5.4vw, 60px); font-weight: 740; max-width: 17ch; margin-bottom: 22px; }
.case-hero .lede { font-size: 19px; color: var(--text-2); max-width: 58ch; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 44px;
  border-top: 1px dashed var(--line-strong);
}
.case-meta .meta-item { padding-top: 14px; }
.case-meta .meta-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 4px;
}
.case-meta .meta-value { font-weight: 600; font-size: 15px; }

.case-body { display: grid; gap: 60px; padding-bottom: 100px; }
.case-section h2 {
  font-size: clamp(24px, 3vw, 33px);
  margin-bottom: 16px;
}
.case-section h2::before {
  content: "✳ ";
  color: var(--accent);
  font-size: 0.6em;
  vertical-align: middle;
}
.case-section p { color: var(--text-2); max-width: 68ch; }
.case-section p + p { margin-top: 12px; }
.case-section a { color: var(--accent); }
.case-section figure { margin: 30px 0 0; }
.case-section figure img { border: 1px solid var(--line-strong); }
.case-section figcaption {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-3);
  font-size: 15.5px;
  margin-top: 12px;
}
.case-section ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  display: grid;
  gap: 9px;
}
.case-section ul li { padding-left: 20px; position: relative; }
.case-section ul li::before {
  content: "✳";
  position: absolute;
  left: 0; top: 1px;
  color: var(--accent);
  font-size: 11px;
}
.case-section ul strong { color: var(--text); }

.case-next {
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
  padding: 30px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
  transition: padding 0.2s ease;
}
.case-next:hover { padding-left: 14px; }
.case-next .next-label {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-3);
  font-size: 15.5px;
  margin-bottom: 6px;
}
.case-next h3 { font-size: 24px; }
.case-next:hover h3 { color: var(--accent); }
.case-next .arr { color: var(--accent); font-size: 28px; }

/* ---------- pipeline diagram (native HTML, theme-aware) ---------- */

.pipe { width: 100%; display: flex; align-items: center; gap: 12px; }
.pipe .pipe-col { display: grid; gap: 8px; flex: 1; min-width: 0; }
.pipe .pipe-node {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  transition: border-color 0.15s ease;
}
.pipe .pipe-node:hover { border-color: var(--accent-line); }
.pipe .pipe-node small { display: block; color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.pipe .pipe-node.is-src { border-color: var(--accent-line); background: var(--accent-soft); }
.pipe .pipe-out .pipe-node { font-weight: 500; font-size: 12.5px; padding: 7px 10px; }
.pipe .pipe-arrow { color: var(--text-3); flex: none; font-size: 17px; font-weight: 600; }
.pipe-result {
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-note);
  font-style: italic;
  color: var(--accent);
  font-size: 15.5px;
}
.pipe-figure {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 28px;
}

/* ---------- media placeholders ---------- */

.media-ph {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  background-color: var(--surface);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 18px 18px;
}
.media-ph .ph-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-2);
}
.media-ph .ph-note {
  font-family: var(--font-note);
  font-style: italic;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- side-note treatments (Tweaks: data-notes) ----------
   default = serif italic marginalia.
   "tape"   = small masking-tape labels.
   "plain"  = quiet small-caps annotations.
   "hidden" = asides removed entirely.                              */

:root[data-notes="tape"] .sec-note,
:root[data-notes="tape"] .xp-note {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px dashed var(--accent-line);
  padding: 6px 11px;
  rotate: -1.2deg;
}
:root[data-notes="tape"] .sec-note { align-self: center; }
:root[data-notes="tape"] .xp-note {
  justify-self: end;
  align-self: start;
  max-width: 100%;
}
:root[data-notes="tape"] .note-pre { display: none; }

:root[data-notes="plain"] .sec-note,
:root[data-notes="plain"] .xp-note {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--text-3);
}
:root[data-notes="plain"] .note-pre { display: none; }

:root[data-notes="hidden"] .sec-note,
:root[data-notes="hidden"] .xp-note { display: none; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  :root.reveal-armed:not([data-motion="off"]) .reveal {
    opacity: 0;
    translate: 0 22px;
    transition: opacity 0.7s ease, translate 0.7s ease;
  }
  :root.reveal-armed:not([data-motion="off"]) .reveal.is-in {
    opacity: 1;
    translate: 0 0;
  }
  :root:not([data-motion="off"]) .badge-open .pulse::after {
    animation: pulse-ring 2.4s ease-out infinite;
  }
  @keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 0.9; }
    70%, 100% { transform: scale(1.6); opacity: 0; }
  }
  :root:not([data-motion="off"]) .marquee .marquee-track {
    animation: marquee-scroll 36s linear infinite;
  }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  @keyframes marquee-scroll {
    to { translate: -50% 0; }
  }
  :root.reveal-armed:not([data-motion="off"]) .hero h1 .squig svg path {
    stroke-dashoffset: 1;
    animation: squig-draw 1.1s ease 0.5s forwards;
  }
  @keyframes squig-draw {
    to { stroke-dashoffset: 0; }
  }
}
/* without animation, the marquee track just sits still — make sure
   the first group is fully visible */
:root[data-motion="off"] .marquee .marquee-track { translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .marquee .marquee-track { translate: 0 0; }
}

/* view-transition theme swap */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.5s; }

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .hero-cols { grid-template-columns: 1fr; gap: 36px; }
  .skip-grid { grid-template-columns: 1fr; gap: 28px; }
  .featured { grid-template-columns: 1fr; gap: 36px; }
  .xp-row { grid-template-columns: 110px 1fr; }
  .xp-note { display: none; }
  .cols-2 { grid-template-columns: 1fr; gap: 44px; }
  .case-meta { grid-template-columns: 1fr 1fr; }
  .pipe { flex-direction: column; align-items: stretch; }
  .pipe .pipe-arrow { text-align: center; rotate: 90deg; }
  .proj.proj-wide .proj-inner { grid-template-columns: 1fr; gap: 0; }
  .proj.proj-wide .proj-body { padding-top: 18px; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding-top: 64px; }
  .hero h1 { font-size: clamp(38px, 10.5vw, 54px); }
  .badge-open .badge-text-long { display: none; }
  .xp-row { grid-template-columns: 1fr; gap: 8px; padding: 30px 0; }
  .proj-grid { grid-template-columns: 1fr; gap: 48px; }
  .section { padding-top: 72px; }
  .contact { padding: 88px 0 72px; }
  /* Mobile: drop the timeline rail since rows are single-column */
  .xp::before, .xp-row::before { display: none; }
}

/* ---------- stat callout: a number in display font with a hand-drawn lime underline ---------- */
.stat {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6' preserveAspectRatio='none'><path d='M2 4 Q 10 1 18 4 T 34 4 T 50 4 T 66 4 T 82 4 T 98 4 T 118 4' fill='none' stroke='%23c4e36f' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.22em;
  padding-bottom: 0.16em;
  white-space: nowrap;
}

/* ---------- timeline rail: dashed line + lime asterisks on the "Where I've worked" rows ---------- */
.xp { position: relative; }
.xp::before {
  content: "";
  position: absolute;
  left: 144px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--line-strong);
  pointer-events: none;
}
.xp-row { position: relative; }
.xp-row::before {
  content: "✳";
  position: absolute;
  left: 144px;
  top: 36px;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  padding: 4px 3px;
  z-index: 1;
}
