/* ------------------------------------------------------------------
   Sandeep Vijayarao, portfolio

   Theme: light and dark. Follows the system setting; the nav toggle
   pins a choice in localStorage as <html data-theme>. Light uses white
   and #f5f5f7 canvases; dark uses black and #1c1c1e. The measured
   numbers always sit on a dark band. Colour is Apple's: neutral greys
   and one blue accent, #0066cc on light and #2997ff on dark. The
   data-hue attributes in the markup now all resolve to that blue.

   Type: Geist, large display sizes with tight tracking, 17px body.
   Radius: tiles 28px, small surfaces 18px, pills 999px, code 6px.
   Motion: one ease-out curve, transform/opacity only, entrances
   ~700ms, interactions 150-250ms, all of it off under reduced motion.
------------------------------------------------------------------- */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --band: #000000;
  --tile-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.1);

  /* light canvas */
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --surface: #ffffff;
  --line: #d2d2d7;
  --line-soft: rgba(0, 0, 0, 0.08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-rgb: 110, 110, 115;

  /* one accent. The per-domain hue tokens are kept so [data-hue]
     markup keeps working, but every one of them is the same blue. */
  --blue: #0066cc;       --blue-rgb: 0, 102, 204;
  --blue-d: #2997ff;     --blue-d-rgb: 41, 151, 255;
  --btn: #0071e3;
  --red: #d70015;        --red-d: #ff453a;
  /* the one exception to the single accent: the "open to work" dot */
  --green: #248a3d;      --green-d: #30d158;

  --hue-agent: var(--blue);    --hue-agent-rgb: var(--blue-rgb);
  --hue-vision: var(--blue);   --hue-vision-rgb: var(--blue-rgb);
  --hue-llm: var(--blue);      --hue-llm-rgb: var(--blue-rgb);
  --hue-product: var(--blue);  --hue-product-rgb: var(--blue-rgb);
  --hue-tools: var(--blue);    --hue-tools-rgb: var(--blue-rgb);

  --hue-agent-d: var(--blue-d);   --hue-agent-d-rgb: var(--blue-d-rgb);
  --hue-vision-d: var(--blue-d);  --hue-vision-d-rgb: var(--blue-d-rgb);
  --hue-llm-d: var(--blue-d);     --hue-llm-d-rgb: var(--blue-d-rgb);
  --hue-product-d: var(--blue-d); --hue-product-d-rgb: var(--blue-d-rgb);
  --hue-tools-d: var(--blue-d);   --hue-tools-d-rgb: var(--blue-d-rgb);

  --accent: var(--hue-agent);
  --accent-rgb: var(--hue-agent-rgb);
  --accent-d: var(--hue-agent-d);
  --accent-d-rgb: var(--hue-agent-d-rgb);
  --accent-ink: #ffffff;

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-tile: 28px;
  --r-surface: 18px;
  --r-token: 6px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 1120px;
  --nav-h: 52px;
  --section: 7.5rem;
}

/* ---------- dark theme ---------- */
/* Same token names, dark values. Written twice because CSS cannot share
   one block between an attribute and a media query. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --nav-bg: rgba(22, 22, 23, 0.78);
  --band: #161617;
  --tile-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.6);
  --bg: #000000;
  --bg-2: #1c1c1e;
  --surface: #1c1c1e;
  --line: #424245;
  --line-soft: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --muted-rgb: 161, 161, 166;
  --hue-agent: var(--hue-agent-d);     --hue-agent-rgb: var(--hue-agent-d-rgb);
  --hue-vision: var(--hue-vision-d);   --hue-vision-rgb: var(--hue-vision-d-rgb);
  --hue-llm: var(--hue-llm-d);         --hue-llm-rgb: var(--hue-llm-d-rgb);
  --hue-product: var(--hue-product-d); --hue-product-rgb: var(--hue-product-d-rgb);
  --hue-tools: var(--hue-tools-d);     --hue-tools-rgb: var(--hue-tools-d-rgb);
  --red: var(--red-d);
  --green: var(--green-d);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nav-bg: rgba(22, 22, 23, 0.78);
    --band: #161617;
    --tile-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.6);
    --bg: #000000;
    --bg-2: #1c1c1e;
    --surface: #1c1c1e;
    --line: #424245;
    --line-soft: rgba(255, 255, 255, 0.12);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --muted-rgb: 161, 161, 166;
    --hue-agent: var(--hue-agent-d);     --hue-agent-rgb: var(--hue-agent-d-rgb);
    --hue-vision: var(--hue-vision-d);   --hue-vision-rgb: var(--hue-vision-d-rgb);
    --hue-llm: var(--hue-llm-d);         --hue-llm-rgb: var(--hue-llm-d-rgb);
    --hue-product: var(--hue-product-d); --hue-product-rgb: var(--hue-product-d-rgb);
    --hue-tools: var(--hue-tools-d);     --hue-tools-rgb: var(--hue-tools-d-rgb);
    --red: var(--red-d);
    --green: var(--green-d);
  }
}

/* ---------- domain hues ---------- */

[data-hue="agent"]   { --accent: var(--hue-agent);   --accent-rgb: var(--hue-agent-rgb);   --accent-d: var(--hue-agent-d);   --accent-d-rgb: var(--hue-agent-d-rgb); }
[data-hue="vision"]  { --accent: var(--hue-vision);  --accent-rgb: var(--hue-vision-rgb);  --accent-d: var(--hue-vision-d);  --accent-d-rgb: var(--hue-vision-d-rgb); }
[data-hue="llm"]     { --accent: var(--hue-llm);     --accent-rgb: var(--hue-llm-rgb);     --accent-d: var(--hue-llm-d);     --accent-d-rgb: var(--hue-llm-d-rgb); }
[data-hue="product"] { --accent: var(--hue-product); --accent-rgb: var(--hue-product-rgb); --accent-d: var(--hue-product-d); --accent-d-rgb: var(--hue-product-d-rgb); }
[data-hue="tools"]   { --accent: var(--hue-tools);   --accent-rgb: var(--hue-tools-rgb);   --accent-d: var(--hue-tools-d);   --accent-d-rgb: var(--hue-tools-d-rgb); }

/* ---------- dark number bands ---------- */
/* Same token names, dark values, so every rule inside just works. */

.case-strip,
.oss-strip {
  --bg: #000000;
  --bg-2: #161617;
  --surface: #1d1d1f;
  --line: #333336;
  --line-soft: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --muted-rgb: 161, 161, 166;
  --accent: var(--accent-d);
  --accent-rgb: var(--accent-d-rgb);
  background: var(--band);
  color: var(--text);
  color-scheme: dark;
}
.case-strip [data-hue],
.oss-strip [data-hue] {
  --accent: var(--accent-d);
  --accent-rgb: var(--accent-d-rgb);
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

a { color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-2);
  padding: 0.12em 0.38em;
  border-radius: var(--r-token);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-token);
}
.card:focus-visible { border-radius: var(--r-tile); }

::selection { background: rgba(var(--accent-rgb), 0.18); color: var(--text); }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 200ms var(--ease);
}
.skip:focus { top: 0.6rem; }

#top-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

/* ---------- cross-page view transitions ---------- */

@view-transition { navigation: auto; }

.nav { view-transition-name: site-nav; }
.footer { view-transition-name: site-footer; }

@media (prefers-reduced-motion: no-preference) {
  /* the page you leave gets out of the way fast; the new one settles in */
  ::view-transition-old(root) { animation: vt-out 160ms var(--ease-io) both; }
  ::view-transition-new(root) { animation: vt-in 520ms var(--ease) both; }
}

::view-transition-old(site-nav),
::view-transition-new(site-nav),
::view-transition-old(site-footer),
::view-transition-new(site-footer) { animation: none; }

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -1px 0 transparent;
  transition: box-shadow 300ms var(--ease);
}
.nav.scrolled { box-shadow: inset 0 -1px 0 var(--line-soft); }

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-end { display: flex; align-items: center; gap: 1.25rem; }
.nav nav { display: flex; gap: 2rem; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: -0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms var(--ease);
}
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.nav nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav nav a[aria-current="page"] { color: var(--text); font-weight: 560; }

/* "Open source" does not fit beside the name on phones */
.nav-short { display: none; }

/* ---------- display type ---------- */

h1, h2, h3 { font-weight: 600; color: var(--text); }

h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  letter-spacing: -0.035em;
  line-height: 1.07;
  text-wrap: balance;
}

/* ---------- page header (sub-pages) ---------- */

.page-header { padding-block: 6.5rem 1rem; }

.page-header h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  letter-spacing: -0.045em;
  line-height: 1.03;
  max-width: 18ch;
  text-wrap: balance;
}

.page-header .lede {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  max-width: 40rem;
  text-wrap: pretty;
}
.page-header .lede a {
  color: var(--accent);
  text-decoration: none;
}

.case-context {
  margin-bottom: 1rem;
  order: -1;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-header:has(.case-context) { display: flex; flex-direction: column; }
.page-header:has(.case-context) > * { align-self: flex-start; }
.page-header .case-actions { margin-top: 2.25rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 150ms var(--ease), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--btn);
  color: #ffffff;
}

.btn-ghost {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ext { font-size: 0.85em; }

/* ---------- hero (home) ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: 8rem 2rem;
}

.hero-copy { display: flex; flex-direction: column; align-items: center; }

.hero-eyebrow {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-sub {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  max-width: 38rem;
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- proof strip ---------- */

.proof {
  margin-top: var(--section);
  background: var(--bg-2);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  padding-block: 4rem;
}

.proof-item { display: flex; flex-direction: column; gap: 0.35rem; }
.proof-item strong {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.proof-item span { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

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

section.work,
section.about,
section.contact,
section.teaser,
section.next { padding-block: var(--section); }

section.work { padding-top: 4rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.more-link,
.section-head .more-link {
  color: var(--accent);
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- cards: grey tiles on the white canvas ---------- */

.card {
  display: block;
  position: relative;
  background: var(--bg-2);
  border-radius: var(--r-tile);
  padding: 2.25rem;
  text-decoration: none;
  transition: transform 300ms var(--ease);
}
a.card:active { transform: scale(0.99); }

/* lift shadow lives on a pseudo-element so only opacity animates */
a.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--tile-shadow);
  transition: opacity 300ms var(--ease);
}

.card h3 {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding-right: 1.5rem;
}

.card p {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 58ch;
}

.card .metric {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 1rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}
.tags li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  line-height: 1.3;
}

.card-arrow {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: var(--muted);
  transition: transform 250ms var(--ease);
}

/* featured tiles */

.card-featured {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  padding: 3.5rem;
  margin-bottom: 1.25rem;
}

.card-featured h3 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  padding-right: 0;
}
.card-featured-copy > p:not(.card-context) { font-size: 1.1rem; }

.card-context,
.card p.card-context {
  margin-top: 0.6rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-link-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
}
.card-link-hint .ext { transition: transform 250ms var(--ease); }

.card-featured-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  border-left: 1px solid var(--line-soft);
  padding-left: 3rem;
}

.stat { display: flex; flex-direction: column; gap: 0.3rem; }

.stat-num {
  display: block;
  font-family: var(--sans);
  font-size: clamp(2.5rem, 4.6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--muted); font-size: 0.95rem; line-height: 1.4; }

.card-featured-alt { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.card-featured-alt .card-featured-stats {
  border-left: 0;
  border-right: 1px solid var(--line-soft);
  padding-left: 0;
  padding-right: 3rem;
}

article.card { cursor: default; }

/* tile grid */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.work-group {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.035em;
  margin: 5rem 0 1.5rem;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }

.card-grid-bg {
  background-color: var(--bg-2);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

.card-tint {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(var(--accent-rgb), 0.08) 0%, transparent 55%),
    var(--bg-2);
}

.work-more {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 1.05rem;
  text-align: center;
}
.work-more a { color: var(--accent); text-decoration: none; }

/* ---------- case studies ---------- */

.case-strip { margin-top: 4.5rem; }

.case-strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding-block: 4.5rem;
}

/* one left edge with the page header; the reading column is capped per child */
.case-body {
  max-width: var(--container);
  margin-inline: auto;
  padding-block: 2rem var(--section);
}
.case-body > * { max-width: 46rem; }
.case-body { overflow-wrap: break-word; }
.case-body :not(pre) > code { overflow-wrap: anywhere; }

.case-body h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-top: 4rem;
  margin-bottom: 1.1rem;
}

.case-body p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 65ch;
}
.case-body p + p { margin-top: 1.15rem; }
.case-body strong { color: var(--text); font-weight: 600; }

.case-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 65ch;
}
.case-list li { padding-left: 1.4rem; position: relative; }
.case-list li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.case-body .tags li { background: var(--bg-2); }
.case-tags { margin-top: 0.4rem; }

.case-actions {
  margin-top: 3.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.case-body p.case-note { font-size: 0.95rem; }

/* ---------- experience / education rows ---------- */

.block { padding-block: 4rem 1rem; }
.block:last-of-type { padding-bottom: 2rem; }
.block h2 { margin-bottom: 2.5rem; }

.exp-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}
.exp-row:last-child { border-bottom: 1px solid var(--line); }

.exp-head h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.exp-org { color: var(--text); font-size: 1rem; margin-top: 0.2rem; }
.exp-dates {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.exp-desc { color: var(--muted); font-size: 1.05rem; line-height: 1.55; max-width: 60ch; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 5rem;
}

.about-bio p {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 60ch;
}
.about-bio p:first-child { color: var(--text); font-size: 1.3rem; letter-spacing: -0.015em; line-height: 1.5; }
.about-bio p + p { margin-top: 1.25rem; }

.about-stack {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-radius: var(--r-tile);
  padding: 2rem;
}

.stack-group { padding-block: 1.25rem; }
.stack-group + .stack-group { border-top: 1px solid var(--line-soft); }
.stack-group:first-child { padding-top: 0; }
.stack-group:last-child { padding-bottom: 0; }

.stack-group h3 { font-size: 1rem; letter-spacing: -0.015em; }
.stack-group .tags { margin-top: 0.7rem; }

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

section.contact { padding-block: 3rem var(--section); }

.contact-email {
  display: inline-block;
  font-size: clamp(1.15rem, 5.2vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  padding-bottom: 0.15em;
  transition: background-size 350ms var(--ease);
}

.contact-links {
  margin-top: 2.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  transition: background-color 200ms ease, transform 150ms var(--ease);
}
.contact-links a:active { transform: scale(0.97); }

/* ---------- next-page links ---------- */

section.next { padding-block: 5rem var(--section); }
.case-body + .next,
.block + .next,
.contact + .next { padding-top: 0; }

.next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.next-link:first-of-type { border-top: 1px solid var(--line); }
.next-link > div { transition: transform 300ms var(--ease); }

.next-link strong {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  transition: color 200ms ease;
}
.next-link span { color: var(--muted); font-size: 1rem; }
.next-link .ext {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1.5rem;
  transition: transform 300ms var(--ease);
}

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

.footer {
  background: var(--bg-2);
  padding-block: 1.6rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

/* ---------- open source (live GitHub stats) ---------- */

.oss-strip { margin-top: 4.5rem; }

.oss-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.5rem 2rem;
  padding-block: 4.5rem;
}

.oss { padding-block: 5rem var(--section); }

.oss-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.oss-pr {
  --accent: var(--muted);
  --accent-rgb: var(--muted-rgb);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1.25rem;
  padding: 1.4rem 1.6rem;
  background: var(--bg-2);
  border-radius: var(--r-surface);
  text-decoration: none;
  transition: transform 300ms var(--ease), background-color 200ms ease;
}
.oss-pr[data-state="merged"] { --accent: var(--hue-agent); --accent-rgb: var(--hue-agent-rgb); }
.oss-pr[data-state="closed"] { --accent: var(--muted); --accent-rgb: var(--muted-rgb); }
.oss-pr:active { transform: scale(0.995); }

.oss-repo {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.oss-pill {
  justify-self: end;
  align-self: start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}

.oss-title {
  grid-column: 1 / -1;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.oss-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
}

.oss-empty { color: var(--muted); }
.oss-empty a { color: var(--accent); }

.oss-note {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.oss-note a { color: var(--accent); }

.oss-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.oss-filters button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-2);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  min-height: 2.5rem;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 150ms var(--ease);
}
.oss-filters button:active { transform: scale(0.97); }
.oss-filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.oss-count { color: inherit; opacity: 0.6; font-variant-numeric: tabular-nums; }
.oss-count:empty { display: none; }

/* ---------- open to work ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.95rem 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .status-dot { animation: status-pulse 2.4s var(--ease-io) infinite; }
  @keyframes status-pulse {
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 0%, transparent); }
  }
}

.hire { padding-bottom: var(--section); }
.hire-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  padding: 3rem;
  background: var(--bg-2);
  border-radius: var(--r-tile);
}
.hire-card .status { background: var(--bg); }
.hire-card h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.hire-card p:not(.status) { margin-top: 0.75rem; color: var(--muted); max-width: 34rem; }
.hire-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- open-source journey ---------- */

.oss-areas { padding-block: var(--section) 0; }

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.area {
  padding: 2rem;
  background: var(--bg-2);
  border-radius: var(--r-tile);
}
.area h3 { font-size: 1.3rem; letter-spacing: -0.025em; }
.area-repos {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.area p:not(.area-repos) { margin-top: 0.9rem; color: var(--muted); line-height: 1.5; }

.journey { padding-block: var(--section) 0; }

.journey-list { list-style: none; }
.journey-list li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--line);
}
.journey-list li:last-child { border-bottom: 1px solid var(--line); }
.journey-date {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 0.2rem;
}
.journey-list strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.journey-list p { margin-top: 0.35rem; color: var(--muted); line-height: 1.5; max-width: 40rem; }

/* home page: latest pull requests */
.oss-teaser { padding-block: var(--section) 0; }
.oss-teaser .oss-list { gap: 0.6rem; }
.oss-orgs {
  margin: -1.75rem 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 44rem;
}

/* ---------- entrance + reveal motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 800ms var(--ease) var(--d, 0s),
      transform 800ms var(--ease) var(--d, 0s);
  }
  [data-reveal].in { opacity: 1; transform: none; }

  .hero-eyebrow,
  .hero-sub,
  .hero-actions,
  .page-header .lede,
  .page-header .case-context,
  .page-header .case-actions { animation: rise 800ms var(--ease) both; }
  .hero-sub { animation-delay: 180ms; }
  .hero-actions { animation-delay: 260ms; }
  .page-header .lede { animation-delay: 120ms; }
  .page-header .case-actions { animation-delay: 200ms; }

  .hero h1:not(.split),
  .page-header h1:not(.split) { animation: rise 800ms var(--ease) both; }

  /* start state lives in the keyframes, so a stalled animation never hides the title */
  .h-word {
    display: inline-block;
    animation: word-rise 800ms var(--ease) both;
    animation-delay: calc(var(--wi) * 55ms);
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes word-rise {
  from { opacity: 0; transform: translateY(0.4em); }
  to { opacity: 1; transform: none; }
}
/* ---------- hover: fine pointers only ---------- */

@media (hover: hover) and (pointer: fine) {
  .nav nav a:hover,
  .theme-toggle:hover { color: var(--text); }
  .theme-toggle:hover { background: var(--bg-2); }

  .btn-primary:hover { background: #0077ed; }
  .btn-ghost:hover { background: var(--btn); color: #ffffff; box-shadow: inset 0 0 0 1px var(--btn); }
  .more-link:hover,
  .work-more a:hover,
  .page-header .lede a:hover,
  .oss-note a:hover { text-decoration: underline; text-underline-offset: 3px; }

  a.card:hover { transform: translateY(-4px); }
  a.card:hover::after { opacity: 1; }
  a.card:hover .card-arrow,
  a.card:hover .card-link-hint .ext { transform: translateX(4px); }

  .contact-email:hover { background-size: 100% 2px; }
  .contact-links a:hover { background: color-mix(in srgb, var(--bg-2) 100%, #000 5%); }
  .footer-links a:hover { color: var(--text); }

  .next-link:hover > div { transform: translateX(0.6rem); }
  .next-link:hover strong { color: var(--accent); }
  .next-link:hover .ext { transform: translateX(4px); }

  .oss-pr:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--bg-2) 100%, #000 3%); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .next-link > div, .next-link .ext, .card-arrow, .oss-pr { transition: none; }
  a.card:hover, .oss-pr:hover { transform: none; }
}

/* ---------- tablet ---------- */

@media (max-width: 880px) {
  :root { --section: 5.5rem; }

  .hero { padding-top: 5rem; }

  .proof-grid { grid-template-columns: 1fr 1fr; gap: 2rem; padding-block: 3rem; }

  .card-featured {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem;
  }
  .card-featured-stats,
  .card-featured-alt .card-featured-stats {
    border: 0;
    border-top: 1px solid var(--line-soft);
    padding: 2rem 0 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 3rem;
  }
  .card-featured-alt .card-featured-stats { order: 2; }

  .exp-row { grid-template-columns: 1fr; gap: 0.8rem; }

  .work-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }

  .about-grid { grid-template-columns: 1fr; gap: 3rem; }

  .oss-grid { grid-template-columns: repeat(3, 1fr); }

  .area-grid { grid-template-columns: 1fr; }
}

/* ---------- phone ---------- */

@media (max-width: 640px) {
  :root { --section: 4.5rem; }

  .container { padding-inline: 1rem; }

  .nav-full { display: none; }
  .nav-short { display: inline; }
  .nav-inner { gap: 0.9rem; }
  .nav-name { font-size: 0.92rem; }
  .nav-end { gap: 0.6rem; }
  .nav nav { gap: 0.85rem; }
  .nav nav a { font-size: 0.84rem; }
  .theme-toggle { margin-right: -0.35rem; }
}

/* the full name stays in titles and copy; the bar keeps room for the toggle */
@media (max-width: 400px) {
  .nav-last { display: none; }

  .page-header { padding-block: 4rem 0.5rem; }
  .page-header h1 { letter-spacing: -0.04em; }

  .hero { padding-top: 4rem; }
  .hero h1 { letter-spacing: -0.045em; }

  .proof-grid { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2.5rem; }

  .card { padding: 1.75rem; border-radius: 22px; }
  .card-arrow { top: 1.6rem; right: 1.6rem; }
  .card-featured { padding: 2rem 1.5rem; }
  .card-featured-stats,
  .card-featured-alt .card-featured-stats { flex-direction: column; gap: 1.5rem; }

  .work-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }

  .case-strip, .oss-strip { margin-top: 3rem; }
  .case-strip-grid { grid-template-columns: 1fr; gap: 2rem; padding-block: 3rem; }
  .case-body h2 { margin-top: 3rem; }
  .case-body p, .case-list { font-size: 1.05rem; }

  .oss-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; padding-block: 3rem; }
  .oss-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .oss { padding-top: 3.5rem; }
  .oss-pr { padding: 1.2rem 1.25rem; }
  .status-more { display: none; }
  .area { padding: 1.5rem; border-radius: 22px; }
  .hire-card { padding: 2rem 1.5rem; border-radius: 22px; }
  .journey-list li { grid-template-columns: 1fr; }

  .about-stack { padding: 1.5rem; border-radius: 22px; }

  .next-link { padding-block: 1.5rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- user preferences ---------- */

@media (prefers-contrast: more) {
  :root { --muted: #424245; --line: #86868b; --line-soft: rgba(0, 0, 0, 0.3); }
  .case-strip, .oss-strip { --muted: #d2d2d7; }
  :root[data-theme="dark"] { --muted: #d2d2d7; --line: #86868b; --line-soft: rgba(255, 255, 255, 0.35); }
  .tags li { color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
}

@media (forced-colors: active) {
  .card, .oss-pr, .about-stack, .area, .hire-card { border: 1px solid CanvasText; }
}
