/* =========================================================
   Shawn Lewis — Personal Site
   Aesthetic: Modern dev-tools, bold, signal-amber accent
   Type: Bricolage Grotesque + Instrument Serif + JetBrains Mono
   ========================================================= */

:root {
  /* Default = dark */
  --bg:        oklch(0.145 0.012 250);
  --bg-2:      oklch(0.175 0.014 250);
  --surface:   oklch(0.21 0.014 250);
  --line:      oklch(0.30 0.012 250);
  --line-soft: oklch(0.24 0.012 250);
  --text:      oklch(0.965 0.005 90);
  --text-2:    oklch(0.78 0.008 90);
  --muted:     oklch(0.58 0.012 250);
  --accent:    oklch(0.82 0.15 75);   /* signal amber */
  --accent-ink: oklch(0.18 0.04 75);
  --signal-grn: oklch(0.78 0.18 145);
  --signal-red: oklch(0.68 0.20 25);

  --radius: 6px;
  --radius-lg: 12px;

  /* Premium-easing token. Used wherever the site moves something.
     Industrial-feeling deceleration — fast in, gentle settle, no overshoot. */
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-fast: 180ms;
  --motion-base: 240ms;

  --f-display: "Bricolage Grotesque", "Inter Tight", system-ui, sans-serif;
  --f-serif:   "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --f-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

html[data-theme="light"] {
  /* Warmer paper-cream base — pulls hue toward 75 (warm yellow) and
     softens contrast so the page feels editorial rather than docs-y. */
  --bg:        oklch(0.972 0.012 80);
  --bg-2:      oklch(0.945 0.018 78);
  --surface:   oklch(0.985 0.010 80);
  --line:      oklch(0.84 0.014 78);
  --line-soft: oklch(0.91 0.012 78);
  /* Text leans slightly warm too, so it doesn't read as cold-grey on cream */
  --text:      oklch(0.20 0.018 70);
  --text-2:    oklch(0.36 0.014 70);
  --muted:     oklch(0.50 0.012 70);
  /* Richer accent — bump chroma so it carries through warm bg */
  --accent:    oklch(0.60 0.18 50);
  --accent-ink: oklch(0.985 0.010 80);
  --signal-grn: oklch(0.55 0.16 145);
  --signal-red: oklch(0.55 0.20 25);
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-display);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
html { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

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

/* Subtle grid backdrop — drifts ~64px diagonally over 240s. Nearly
   imperceptible by itself but contributes a faint sense of life to
   the otherwise static page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 75%);
  z-index: 0;
  animation: grid-drift 240s linear infinite;
  will-change: background-position;
}
@keyframes grid-drift {
  from { background-position: -1px -1px; }
  to   { background-position: 63px 63px; }
}

main, header, footer, nav { position: relative; z-index: 1; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* =========================================================
   Type
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(52px, 8vw, 124px); line-height: 0.92; letter-spacing: -0.038em; }
h2 { font-size: clamp(34px, 4.4vw, 60px); line-height: 1.0;  letter-spacing: -0.028em; }
h3 { font-size: clamp(22px, 2.0vw, 28px); line-height: 1.15; }
h4 { font-size: 16px; line-height: 1.25; letter-spacing: 0; }

.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
/* Inside section h2s, ease the serif accent down so it complements
   rather than out-shouts the surrounding sans. */
h2 .serif { font-size: 0.94em; }
.mono  { font-family: var(--f-mono); font-feature-settings: "calt" 1; }

p { margin: 0; color: var(--text-2); text-wrap: pretty; }

/* =========================================================
   Top nav
   ========================================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.topnav-row {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal-grn);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--signal-grn) 25%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.brand .slash { color: var(--muted); }
.nav-links {
  display: flex; gap: 4px; margin-left: auto;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.nav-links a {
  padding: 8px 12px;
  color: var(--text-2);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  display: flex; align-items: baseline; gap: 6px;
}
.nav-links a:hover { color: var(--text); background: var(--bg-2); }
.nav-links a .idx { color: var(--muted); font-size: 10px; }

/* Section scaffolding */
section {
  padding: clamp(80px, 10vw, 140px) 0;
  border-top: 1px solid var(--line-soft);
}
section:first-of-type { border-top: 0; }

.sec-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.sec-label::before {
  content: ""; width: 32px; height: 1px; background: currentColor; opacity: 0.5;
}

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-top: clamp(80px, 10vw, 140px); padding-bottom: clamp(80px, 10vw, 140px); }

/* Hero background video — theme-split. Dark (default :root) = raw
   cinematic clip + strong scrim; light = inverted "airy" clip + lighter
   scrim. The filter sits on .hero-bg so the <video> and its poster
   fallback invert together; .hero-scrim is a separate sibling so the
   scrim colours are never inverted. Full-bleed via 100vw (body has
   overflow-x:hidden, so no scrollbar artefact). */
.hero { position: relative; isolation: isolate; }
.hero > :not(.hero-bg):not(.hero-scrim) { position: relative; z-index: 2; }

.hero-bg,
.hero-scrim {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg {
  z-index: 0;
  background: #0c0e12 url("assets/hero-bg-poster.jpg") center / cover no-repeat;
}
.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-scrim {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8,10,14,0.82) 0%, rgba(8,10,14,0.46) 55%, rgba(8,10,14,0.24) 100%),
    linear-gradient(180deg, transparent 0%, transparent 55%, var(--bg) 100%);
}
html[data-theme="light"] .hero-bg {
  filter: invert(1) hue-rotate(180deg) saturate(0.8) brightness(1.03);
}
html[data-theme="light"] .hero-scrim {
  background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--bg) 55%, transparent) 0%,
      color-mix(in oklab, var(--bg) 18%, transparent) 55%,
      transparent 100%),
    linear-gradient(180deg, transparent 0%, transparent 45%, var(--bg) 100%);
}
@media (prefers-reduced-motion: reduce), (max-width: 560px) {
  .hero-bg-video { display: none; }
}

/* Tinted panel behind the hero headline / tag / buttons only — the
   video background made the prose hard to read. The panel is pulled
   left by its own padding so the text stays at its original visual
   x-position; backdrop blur softens the busy bokeh underneath. */
.hero-textcol {
  --aug-pad-x: clamp(22px, 2.6vw, 36px);
  --aug-pad-y: clamp(20px, 2.4vw, 30px);
  position: relative;
  margin-left: calc(-1 * var(--aug-pad-x));
  padding: var(--aug-pad-y) var(--aug-pad-x);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--bg) 64%, transparent);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
}
html[data-theme="light"] .hero-textcol {
  background: color-mix(in oklab, var(--bg) 76%, transparent);
}
/* No backdrop-filter on small screens — saves a heavy compositor pass
   on mobile and the hero is single-column so the bg-color alone is
   enough. */
@media (max-width: 720px) {
  .hero-textcol {
    margin-left: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Hero load-in stagger — typography first, supporting elements after.
   `backwards` fill keeps the elements invisible before their delay fires
   so the page doesn't flash unstyled content. */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.hero .hero-status,
.hero h1,
.hero-tag,
.hero-actions,
.hero-card {
  animation: hero-fade-up 0.6s var(--ease-premium) backwards;
  will-change: transform, opacity;
}
.hero .hero-status { animation-delay: 0.05s; }
.hero h1           { animation-delay: 0.15s; }
.hero-tag          { animation-delay: 0.28s; }
.hero-actions      { animation-delay: 0.40s; }
.hero-card         { animation-delay: 0.52s; }
.hero-status {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 64px;
}
.hero-status .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text-2);
  background: color-mix(in oklab, var(--bg-2) 60%, transparent);
}
.hero-status .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal-grn); }
.hero-status .pill .dot.amber { background: var(--accent); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
}

.hero h1 .serif { color: var(--accent); }
.hero h1 .stroke {
  -webkit-text-stroke: 1.5px var(--text);
  color: transparent;
}
.hero-tag {
  margin-top: 48px;
  max-width: 56ch;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
}
.hero-tag strong { color: var(--text); font-weight: 500; }

.hero-actions { display: flex; gap: 12px; margin-top: 52px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn { transition: background var(--motion-fast) var(--ease-premium),
                   border-color var(--motion-fast) var(--ease-premium),
                   color var(--motion-fast) var(--ease-premium),
                   transform var(--motion-fast) var(--ease-premium),
                   box-shadow var(--motion-base) var(--ease-premium),
                   filter var(--motion-fast) var(--ease-premium); }
.btn:hover { border-color: var(--text); transform: translate3d(0, -1px, 0); }
.btn:active { transform: translate3d(0, 1px, 0); transition-duration: 80ms; }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 28px -10px color-mix(in oklab, var(--accent) 55%, transparent);
}
.btn .arr { transition: transform var(--motion-fast) var(--ease-premium); }
.btn:hover .arr { transform: translateX(3px); }

/* Hero portrait card */
.hero-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.hero-card .corner {
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
}
.hero-card .corner.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.hero-card .corner.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.hero-card .corner.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.hero-card .corner.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.hero-card .photo {
  width: 100%; aspect-ratio: 1 / 1;
  background: var(--bg);
  border-radius: var(--radius);
  background-size: cover;
  background-position: center 22%;
  filter: contrast(1.02) saturate(0.95);
}
.hero-card .meta {
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-2);
}
.hero-card .meta .row { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--line-soft); }
.hero-card .meta .row:first-child { border-top: 0; }
.hero-card .meta .k { color: var(--muted); }
.hero-card .meta .v { color: var(--text); }

/* =========================================================
   Marquee ticker (right under hero)
   ========================================================= */
.ticker {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  padding: 18px 0;
  background: color-mix(in oklab, var(--bg-2) 50%, transparent);
}
.ticker-row {
  display: flex; gap: 56px;
  white-space: nowrap;
  animation: tick 60s linear infinite;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.ticker-row span { display: inline-flex; align-items: center; gap: 12px; }
.ticker-row span::before { content: "◆"; color: var(--accent); font-size: 10px; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================
   Credentials strip — three facts at a glance (critique #10)
   ========================================================= */
.creds-section {
  padding: clamp(48px, 6vw, 88px) 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.creds-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
}
.cred {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.cred-link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  transition: color 0.18s ease;
}
.cred-link:hover { color: var(--accent); }
.cred-link:hover .cred-num { color: var(--accent); }
.cred-num {
  font-family: var(--f-display);
  font-size: clamp(40px, 5.6vw, 76px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 0.18s ease;
}
.cred-plus {
  font-size: 0.5em;
  color: var(--accent);
  vertical-align: 0.4em;
  margin-left: 2px;
  letter-spacing: 0;
}
.cred-lab {
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cred-sub {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 880px) {
  .creds-row { grid-template-columns: 1fr; gap: 22px; }
  .cred { padding-left: 14px; }
  .cred-num { font-size: clamp(48px, 12vw, 64px); }
}

/* =========================================================
   Origin section — bench photo + 2-paragraph story
   ========================================================= */
.origin-h {
  max-width: 14ch;
  margin-bottom: 36px;
}
.origin-figure {
  margin: 8px 0 48px;
  padding: 0;
}
.origin-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.origin-figure figcaption {
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.origin-body {
  max-width: 68ch;
}
.origin-body p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 22px;
  color: var(--text);
}
.origin-body p:last-child { margin-bottom: 0; }
.origin-body strong { font-weight: 500; }

@media (max-width: 720px) {
  .origin-body p { font-size: 15px; }
  .origin-figure { margin-bottom: 28px; }
}

/* =========================================================
   Stack diagram
   ========================================================= */
.stack {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .stack { grid-template-columns: 1fr; } }

.stack-copy h2 .serif { color: var(--accent); }
.stack-copy p { margin-top: 24px; font-size: 17px; max-width: 50ch; }

.stack-vis {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.stack-layer {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px dashed var(--line-soft);
  cursor: default;
  transition: background 0.18s ease;
  position: relative;
}
.stack-layer:first-child { border-top: 0; }
.stack-layer:hover { background: var(--bg-2); }
.stack-layer .num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.stack-layer .name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.stack-layer .name .sub {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
}
.stack-layer .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  transition: all 0.2s ease;
}
.stack-layer:hover .dot { opacity: 1; box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }

/* =========================================================
   KBlazor showcase
   ========================================================= */
.pkg-head {
  display: flex; justify-content: space-between; align-items: end; gap: 32px;
  margin-bottom: 48px;
}
.pkg-head h2 { max-width: 18ch; }
.pkg-head .meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-2);
  text-align: right;
  letter-spacing: 0.02em;
  line-height: 1.7;
  white-space: nowrap;
}
.pkg-head .meta .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--bg-2);
}
.pkg-head .meta .badge.amber { border-color: var(--accent); color: var(--accent); }

/* KBlazor framing — lede explains the architecture, install line gives
   credibility (the package is real and you can copy/paste it). */
.kb-lede {
  font-size: 16px;
  line-height: 1.55;
  max-width: 68ch;
  color: var(--text-2);
  margin: -16px 0 24px;
}
.kb-lede code {
  font-family: var(--f-mono);
  font-size: 13.5px;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--accent);
}
.kb-install {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 32px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: 13px;
}
.kb-install-prompt { color: var(--muted); }
.kb-install code {
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 0;
}
.kb-install-link {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-left: 8px;
  border-left: 1px solid var(--line-soft);
}
.kb-install-link:hover { text-decoration: underline; }

.kb-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 980px) { .kb-grid { grid-template-columns: 1fr; } }

.code-card, .demo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cc-head, .dc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--bg-2);
}
.cc-head .lights { display: flex; gap: 5px; }
.cc-head .lights i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.cc-head .lights i:nth-child(2) { background: var(--line); }
.cc-head .name { margin-left: auto; }

.cc-body {
  flex: 1;
  padding: 18px 20px;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.65;
  overflow: auto;
}
.cc-body .ln {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
}
.cc-body .ln .ix { color: var(--muted); text-align: right; user-select: none; }
.cc-body .tk-key  { color: var(--accent); }
.cc-body .tk-tag  { color: var(--signal-grn); }
.cc-body .tk-attr { color: oklch(0.78 0.12 200); }
.cc-body .tk-str  { color: oklch(0.82 0.10 100); }
.cc-body .tk-cmt  { color: var(--muted); font-style: italic; }
.cc-body .tk-typ  { color: oklch(0.82 0.10 280); }
.cc-body .tk-fn   { color: oklch(0.80 0.12 220); }

/* Demo: table */
.dc-body { flex: 1; padding: 0; display: flex; flex-direction: column; }

/* Screenshot frame for the KBlazor preview card */
.kb-shot-wrap {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  min-height: 0;
}
.kb-shot {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}
.dc-toolbar a.chip { text-decoration: none; }
.dc-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.dc-toolbar input {
  flex: 1; min-width: 100px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.dc-toolbar input:focus { border-color: var(--accent); }
.dc-toolbar .chip {
  font-family: var(--f-mono); font-size: 11px;
  padding: 7px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text-2);
  background: var(--bg-2); cursor: pointer;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: all 0.15s;
}
.dc-toolbar .chip:hover, .dc-toolbar .chip.on {
  border-color: var(--accent); color: var(--accent);
}
.dc-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.dc-table thead th {
  text-align: left; font-weight: 500; font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  user-select: none; cursor: pointer;
}
.dc-table thead th .sort { color: var(--accent); margin-left: 4px; }
.dc-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px dashed var(--line-soft);
  color: var(--text-2);
}
.dc-table tbody tr:hover td { background: var(--bg-2); color: var(--text); }
.dc-table .status {
  font-family: var(--f-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 100px;
  border: 1px solid currentColor;
  display: inline-flex; align-items: center; gap: 6px;
}
.dc-table .status.ok  { color: var(--signal-grn); }
.dc-table .status.warn { color: var(--accent); }
.dc-table .status.err { color: var(--signal-red); }
.dc-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 0.04em;
  background: var(--bg-2);
}

/* Systems-engineering capability cards (sits under the stack diagram) */
.sys-caps {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sys-caps .it {
  background: var(--bg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--motion-base) var(--ease-premium);
}
.sys-caps .it:hover { background: var(--bg-2); }
.sys-caps .it:hover .lab { color: color-mix(in oklab, var(--accent) 70%, var(--text)); }
.sys-caps .it .lab {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.sys-caps .it h4 {
  font-size: 17px;
  letter-spacing: -0.012em;
  margin: 0;
}
.sys-caps .it p {
  font-size: 13.5px;
  line-height: 1.55;
  margin: 4px 0 0;
}
@media (max-width: 880px) {
  .sys-caps { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }
}
@media (max-width: 480px) {
  .sys-caps { grid-template-columns: 1fr; }
}

/* KBlazor feature row */
.kb-features {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 880px) { .kb-features { grid-template-columns: repeat(2, 1fr); } }
.kb-features .it {
  background: var(--bg);
  padding: 22px;
  transition: background var(--motion-base) var(--ease-premium);
}
.kb-features .it:hover { background: var(--bg-2); }
.kb-features .it .lab {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.kb-features .it h4 { font-size: 18px; letter-spacing: -0.01em; margin-bottom: 6px; }
.kb-features .it p { font-size: 13px; }

/* =========================================================
   SyntheticPen showcase — reuses .pkg-head / .kb-lede /
   .kb-install / .phil-list / .kb-features. Only the tip line
   and the pipeline + debug-story framing need scoped rules.
   ========================================================= */
.sp-tip {
  margin: 14px 0 0;
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.sp-tip a { color: var(--accent); text-decoration: none; }
.sp-tip a:hover { text-decoration: underline; }

.sp-pipeline { margin-top: 48px; }
.sp-h {
  font-family: var(--f-display);
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 6px;
}
.sp-pipeline .phil-list { margin-top: 20px; }
.sp-pipeline .phil-list .it .tx strong { color: var(--text); }

.sp-debug {
  margin-top: 44px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px clamp(22px, 3vw, 36px);
}
.sp-debug .lab {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.sp-debug .sp-h { margin-bottom: 14px; }
.sp-debug p {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text-2);
  max-width: 78ch;
  margin: 0 0 14px;
}
.sp-debug p:last-child { margin-bottom: 0; }
.sp-debug code {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}
.sp-debug strong { color: var(--text); }

@media (max-width: 720px) {
  .sp-pipeline { margin-top: 36px; }
  .sp-debug { margin-top: 32px; padding: 22px 18px; }
  .sp-debug p { font-size: 14.5px; }
}

/* =========================================================
   Augmented software engineering — compact band under the hero.
   Reuses .sec-label; .aug overrides the default section padding
   so it reads as a band, not a full section.
   ========================================================= */
.aug { padding-top: 34px; padding-bottom: 38px; }
.aug-body {
  margin-top: 18px;
  max-width: 64ch;
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 1.62;
  color: var(--text-2);
}
.aug-body .serif {
  font-family: var(--f-serif);
  font-style: italic;
  color: var(--accent);
}
.aug-kicker {
  margin-top: 18px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(21px, 2vw, 27px);
  letter-spacing: -0.01em;
  color: var(--text);
}
@media (max-width: 720px) {
  .aug { padding-top: 24px; padding-bottom: 28px; }
  .aug-body { font-size: 16px; }
}

/* =========================================================
   Projects
   ========================================================= */
.proj-list { display: flex; flex-direction: column; }
.proj {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  display: grid;
  grid-template-columns: 80px 1.8fr 1.2fr auto;
  gap: 28px;
  align-items: start;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.proj:last-child { border-bottom: 1px solid var(--line); }
.proj:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.proj:hover .num,
.proj:hover .toggle { color: var(--accent); }
@media (max-width: 880px) {
  .proj { grid-template-columns: 1fr; gap: 12px; }
}
.proj .num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding-top: 6px;
}
.proj .title h3 {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.025em;
  font-weight: 500;
  margin-bottom: 6px;
}
.proj .title .tagline {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.proj .lede { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.proj .toggle {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 6px;
  white-space: nowrap;
}
.proj-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.65, 0, 0.35, 1);
  grid-column: 1 / -1;
}
.proj[data-open="1"] .proj-expand { grid-template-rows: 1fr; }
.proj-expand > div { overflow: hidden; }
.proj-expand-inner {
  margin-top: 28px;
  padding: 28px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}
@media (max-width: 880px) { .proj-expand-inner { grid-template-columns: 1fr; } }
.proj-expand-inner h4 {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.proj-expand-inner ul {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.proj-expand-inner ul li {
  padding-left: 18px; position: relative;
}
.proj-expand-inner ul li::before {
  content: "→"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-family: var(--f-mono);
}
.proj-stack {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.proj-visit {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 9px 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 100px;
  transition: background 0.15s ease, color 0.15s ease;
}
.proj-visit:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.proj-stack .tg {
  font-family: var(--f-mono); font-size: 11px;
  padding: 4px 9px; border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--text-2);
}

/* =========================================================
   Skills matrix
   ========================================================= */
.skills-head {
  display: flex; align-items: end; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; margin-bottom: 36px;
}
.skills-filter {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.skills-filter button {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s;
}
.skills-filter button:hover { border-color: var(--text); color: var(--text); }
.skills-filter button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skill {
  background: var(--bg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 130px;
  transition: all 0.25s ease;
  position: relative;
}
.skill.hidden {
  opacity: 0.15;
  filter: grayscale(1);
}
.skill .cat {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.skill .nm {
  font-size: 19px;
  letter-spacing: -0.018em;
  font-weight: 500;
  color: var(--text);
}
.skill .ix {
  position: absolute; bottom: 14px; right: 16px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.5;
}
/* Skill chips that link to an external explanation — chase the arrow. */
.skill-link { color: inherit; text-decoration: none; }
.skill-arr {
  color: var(--accent);
  margin-left: 4px;
  font-family: var(--f-mono);
  font-size: 0.82em;
  transition: transform 0.18s ease;
  display: inline-block;
}
.skill-link:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.skill-link:hover .nm { color: var(--accent); }
.skill-link:hover .skill-arr { transform: translateX(3px); }

/* =========================================================
   Services
   ========================================================= */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 880px) { .svc-grid { grid-template-columns: 1fr; } }
.svc {
  background: var(--bg);
  padding: 28px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px;
  transition: background 0.2s;
  position: relative;
}
.svc:hover { background: var(--bg-2); }
.svc .ix {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.svc h4 { font-size: 21px; letter-spacing: -0.015em; }
.svc p { font-size: 14px; }

/* =========================================================
   About + Philosophy
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid p { font-size: 17px; line-height: 1.6; margin-bottom: 18px; }
.about-grid h2 .serif { color: var(--accent); }

.phil-list {
  margin-top: 24px;
  display: grid; gap: 12px;
}
.phil-list .it {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px;
  padding: 14px 0;
  border-top: 1px dashed var(--line-soft);
  align-items: baseline;
}
.phil-list .it:first-child { border-top: 0; }
.phil-list .it .ix {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.08em;
}
.phil-list .it .tx { font-size: 16px; color: var(--text); }

/* About aside — black-and-white photo + one-line caption with a
   visible slash separator between label and body text. Photo
   full-bleed within .wrap, caption inline below. */
.about-aside {
  margin: clamp(56px, 6vw, 96px) 0 0;
  padding: 0;
}
.about-aside img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.about-aside-cap {
  margin-top: 18px;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--text);
}
/* Label inherits the body font/size — only the colour distinguishes
   it from the body text, so the caption reads as one continuous line. */
.about-aside-lab {
  color: var(--text-2);
  margin-right: 4px;
}
.about-aside-sep {
  color: var(--muted);
  margin: 0 10px 0 4px;
  font-weight: 400;
}
.about-aside-tx { color: var(--text); }
.about-aside-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}
.about-aside-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.about-aside-grind {
  font-size: 1.45em;
  color: var(--accent);
  letter-spacing: -0.02em;
  vertical-align: -0.04em;
  padding: 0 2px;
}

@media (max-width: 720px) {
  .about-aside-cap { font-size: 14px; }
  .about-aside-lab { display: block; margin: 0 0 4px; }
  .about-aside-sep { display: none; }
}

/* =========================================================
   Focus / current research
   ========================================================= */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 880px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  display: grid; gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform var(--motion-base) var(--ease-premium),
              border-color var(--motion-base) var(--ease-premium),
              box-shadow var(--motion-base) var(--ease-premium);
}
.focus-card:hover {
  transform: translate3d(0, -2px, 0);
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  box-shadow: 0 6px 24px -10px color-mix(in oklab, var(--accent) 30%, transparent);
}
.focus-card .lab {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.focus-card h4 { font-size: 19px; letter-spacing: -0.015em; }

/* =========================================================
   Contact
   ========================================================= */
.contact {
  text-align: left;
}
.contact h2 {
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}
/* Brand signature — sits above the CTA headline, sets the worldview
   before the call-to-action. Bigger than tag text, smaller than h2. */
.contact-sig {
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 28px;
  max-width: 28ch;
  font-weight: 400;
}
.contact-sig .serif { color: var(--accent); }
.contact h2 .serif { color: var(--accent); display: inline-block; }
.contact-row {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: end;
}
@media (max-width: 880px) { .contact-row { grid-template-columns: 1fr; } }
.contact-links {
  display: grid; gap: 0;
  border-top: 1px solid var(--line);
}
.contact-links a {
  display: grid; grid-template-columns: 100px 1fr auto;
  gap: 16px; align-items: center;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.2s ease, color 0.2s ease;
}
.contact-links a:hover { padding-left: 16px; color: var(--accent); }
.contact-links a .k {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase;
}
.contact-links a .v {
  font-family: var(--f-mono); font-size: 16px;
  color: var(--text);
}
.contact-links a:hover .v { color: var(--accent); }
.contact-links a .arr { color: var(--muted); }
.contact-links a:hover .arr { color: var(--accent); transform: translateX(4px); transition: all 0.18s; }

/* =========================================================
   Footer
   ========================================================= */
footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  background: var(--bg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h5 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 400;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid ul a { color: var(--text-2); font-size: 13px; font-family: var(--f-mono); }
.footer-grid ul a:hover { color: var(--accent); }
.footer-mark {
  font-family: var(--f-display);
  font-size: 56px;
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.footer-mark .serif { color: var(--accent); }
.footer-mark .sub {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 14px;
  font-weight: 400;
}
.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.footer-bottom .sig { color: var(--text-2); font-style: italic; font-family: var(--f-serif); font-size: 14px; letter-spacing: -0.01em; }

/* =========================================================
   Misc
   ========================================================= */
.kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-2);
  background: var(--bg-2);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* Schematic dot grid (used inside focus cards) */
.dotgrid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.4;
  pointer-events: none;
  mask-image: linear-gradient(to bottom right, black, transparent 80%);
}

/* =========================================================
   Responsive — tablet (< 880px) supplements
   The base CSS already collapses most grids at 880px;
   this section tightens spacing for that breakpoint.
   ========================================================= */
@media (max-width: 880px) {
  .pkg-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .pkg-head .meta {
    text-align: left;
    white-space: normal;
  }
  .skills-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .topnav-row { gap: 16px; flex-wrap: wrap; }
}

/* =========================================================
   Responsive — phone (< 720px)
   ========================================================= */
@media (max-width: 720px) {
  /* Tighter section rhythm so the page doesn't feel like a tower */
  section { padding: 64px 0; }
  .sec-label { margin-bottom: 20px; }

  /* Top nav — drop the slash detail and the numeric idx prefixes, wrap */
  .topnav-row { padding: 12px 0; }
  .brand .slash, .brand .slash + span { display: none; }
  .nav-links { font-size: 11px; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-links a { padding: 6px 8px; }
  .nav-links a .idx { display: none; }

  /* Hero — let h1 breathe but not blow up at 360px */
  h1 { font-size: clamp(36px, 9.5vw, 60px); line-height: 0.98; word-break: break-word; }
  .hero { padding-top: 40px; padding-bottom: 56px; }
  .hero-status { gap: 8px; margin-bottom: 32px; }
  .hero-status .pill { padding: 4px 9px; font-size: 10px; }
  .hero-tag { margin-top: 24px; font-size: 16px; }
  .hero-actions { margin-top: 28px; gap: 10px; }
  .btn { padding: 11px 14px; font-size: 11px; }

  /* Hero portrait card — make it less dominant */
  .hero-card { padding: 14px; }

  /* Ticker — gentler */
  .ticker { padding: 14px 0; }
  .ticker-row { gap: 36px; font-size: 12px; animation-duration: 45s; }

  /* Stack diagram — shrink the L0X column */
  .stack-layer {
    grid-template-columns: 48px 1fr auto;
    padding: 14px 14px;
    gap: 10px;
  }
  .stack-layer .name { font-size: 15px; }
  .stack-copy p { font-size: 15px; }

  /* KBlazor showcase */
  .cc-body {
    font-size: 11px; padding: 14px 12px; line-height: 1.55;
    overflow-x: auto;
  }
  .cc-body .ln { grid-template-columns: 22px 1fr; gap: 6px; }
  /* Demo table can scroll inside the card rather than blow the page */
  .dc-body { overflow-x: auto; }
  .dc-table { font-size: 12px; min-width: 480px; }
  .dc-table thead th { padding: 8px 10px; font-size: 10px; }
  .dc-table tbody td { padding: 9px 10px; }
  .dc-toolbar { padding: 10px 10px; gap: 6px; }
  .dc-toolbar .chip { padding: 6px 8px; font-size: 10px; }
  .kb-features { grid-template-columns: 1fr; }
  .kb-features .it { padding: 18px; }

  /* Projects */
  .proj { gap: 10px; padding: 22px 0; }
  .proj .title h3 { font-size: clamp(24px, 7vw, 34px); }
  .proj .num { padding-top: 0; }
  .proj .toggle { padding-top: 0; }
  .proj-expand-inner { padding: 20px; gap: 20px; }

  /* Skills — let the browser fit as many cards as the row allows
     instead of hard-coding column counts that leave dead space. */
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .skill { padding: 14px; min-height: 92px; }
  .skill .nm { font-size: 16px; }
  .skill .ix { bottom: 10px; right: 12px; }
  .skills-filter { font-size: 10px; }

  /* Services */
  .svc { padding: 22px; min-height: 160px; }
  .svc h4 { font-size: 19px; }

  /* About / Philosophy */
  .about-grid p { font-size: 16px; }
  .phil-list .it { grid-template-columns: 28px 1fr; gap: 10px; }
  .phil-list .it .tx { font-size: 15px; }

  /* Focus */
  .focus-card { padding: 20px; }
  .focus-card h4 { font-size: 17px; }

  /* Contact */
  .contact h2 { font-size: clamp(40px, 14vw, 80px); }
  .contact-row { margin-top: 28px; gap: 24px; }
  .contact-links a {
    grid-template-columns: 78px 1fr auto;
    padding: 14px 4px;
    gap: 10px;
  }
  .contact-links a:hover { padding-left: 8px; }
  .contact-links a .v { font-size: 13px; }
  .contact-links a .k { font-size: 10px; }

  /* Footer */
  footer { padding: 40px 0 28px; }
  .footer-mark { font-size: 40px; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 32px;
  }
}

/* =========================================================
   Responsive — small phone (< 480px)
   ========================================================= */
@media (max-width: 480px) {
  /* Skills can drop further if the viewport really is tiny. */
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .nav-links { font-size: 10px; }
  /* Demo body scrolls horizontally so the table and kanban don't squash */
  .dc-table thead th { padding: 7px 8px; }
  .dc-table tbody td { padding: 8px 8px; font-size: 11px; }
  /* Hero corners pull in so they don't visually clip on small viewports */
  .hero-card .corner.tl, .hero-card .corner.bl { left: 4px; }
  .hero-card .corner.tr, .hero-card .corner.br { right: 4px; }
}

/* Reduce motion for users who prefer it. Kills:
   - ticker scroll, grid drift, reveal-on-scroll
   - hero load-in stagger (elements jump straight to final state)
   - all hover transforms and box-shadow transitions
   Disables hover-lift transforms in particular so vestibular users
   don't get nudged when the cursor crosses cards. */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
  .ticker-row { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .hero-status,
  .hero h1,
  .hero-tag,
  .hero-actions,
  .hero-card { animation: none !important; opacity: 1; transform: none; }
  .focus-card:hover,
  .btn:hover,
  .btn:active { transform: none !important; box-shadow: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
