/* ─────────────────────────────────────────────────────────────────────────
   tokens
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* type */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;

  /* color — light (pure white base, near-black ink, green accent) */
  --bg:        #ffffff;
  --bg-soft:   #f5f5f3;
  --bg-card:   #fbfbf9;
  --fg:        #18181a;
  --fg-soft:   #5a5a5e;
  --fg-mute:   #9a9a9d;
  --fg-faint:  #c7c7c9;
  --rule:      #ececea;
  --rule-soft: #f3f3f1;

  --accent:        #2f9e44;
  --accent-soft:   #dbf5e1;
  --accent-line:   #b3e1bf;
  --accent-faint:  #ebf9ee;
  --accent-ink:    #1f7a2f;

  /* spacing */
  --pad: 16px;
  --gap: 24px;
  --row-h: 44px;
  --page-pad: 32px;

  /* radii */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;

  /* density modifiers (overridden by [data-density]) */
  --d-y: 1;        /* multiplier for vertical pad */
}

[data-density="compact"]  { --d-y: 0.72; }
[data-density="comfortable"] { --d-y: 1.0; }

[data-theme="dark"] {
  --bg:        #0e0f12;
  --bg-soft:   #15171b;
  --bg-card:   #16181c;
  --fg:        #ededec;
  --fg-soft:   #a8a9ad;
  --fg-mute:   #6a6c72;
  --fg-faint:  #3a3c42;
  --rule:      #24262b;
  --rule-soft: #1c1e22;

  --accent-soft:  #0f2b16;
  --accent-line:  #21532b;
  --accent-faint: #0a1d10;
  --accent-ink:   #7cd592;
}

/* Smooth theme transitions for the high-traffic surfaces. Keep targeted —
   transitioning everything makes the page feel rubbery. */
body, .topbar, .cmdk-panel, .anno-card, .project,
.contact-cell, .resume-row, .skill-list span, .project-tag, .btn, .kbd {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ────────────────────────────────────────────────────────────────────────
   animations
   ──────────────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes drawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

/* Scroll-reveal helper. Sections add .reveal in their markup; the
   IntersectionObserver in app.jsx flips .seen when they enter the viewport. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.seen {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-stagger.seen > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.seen > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.seen > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger.seen > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.seen > *:nth-child(4) { transition-delay: 0.20s; }
.reveal-stagger.seen > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.seen > *:nth-child(6) { transition-delay: 0.30s; }
.reveal-stagger.seen > *:nth-child(7) { transition-delay: 0.35s; }
.reveal-stagger.seen > *:nth-child(8) { transition-delay: 0.40s; }

/* Route transition cross-fade. Wrapper gets .route-in on mount. */
.route-fade {
  animation: fadeUp 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Hero name letter-stagger — each char in .hero-name span[data-char] */
.char-stagger > span[data-char] {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: fadeUp 0.6s cubic-bezier(0.25, 0.6, 0.3, 1) both;
}

/* Caret used in the typed-boot / static terminal blocks */
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: currentColor;
  vertical-align: -0.12em;
  margin-left: 1px;
  animation: blink 1.05s steps(1, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > *, .route-fade, .char-stagger > span[data-char] {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .caret { animation: none; opacity: 1; }
}

/* base */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

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

/* mono utility */
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss02"; }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-mute); }

/* page chrome */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ─────────────────────────────────────────────────────────────────────────
   topbar
   ───────────────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg), transparent 18%);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
  display: inline-block;
}
.nav {
  display: flex; gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav a {
  padding: 6px 10px;
  border-radius: var(--r-2);
  color: var(--fg-soft);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--rule-soft); color: var(--fg); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

.topbar-right {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
}

/* ─────────────────────────────────────────────────────────────────────────
   buttons + kbd
   ───────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-ink); color: #fff; border-color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-soft); }
.btn.ghost:hover { background: var(--rule-soft); color: var(--fg); border-color: transparent; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-soft);
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────────
   annotation system
   ───────────────────────────────────────────────────────────────────────── */

/* outer wrapper that lays out anno-card next to spec-frame */
.spec-frame {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 980px) {
  .spec-frame { grid-template-columns: 1fr; gap: 24px; }
}

/* dashed measurement frame around an artboard */
.spec-artboard {
  position: relative;
  border: 1px dashed transparent;
  transition: border-color 0.4s ease;
}
[data-annotations="1"] .spec-artboard {
  border-color: var(--accent-line);
}

/* dimension label hanging off the bottom of an artboard */
.dim-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  background: var(--bg);
  padding: 0 6px;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
[data-annotations="1"] .dim-label { opacity: 1; }
.dim-label.bottom { bottom: -7px; left: 50%; transform: translateX(-50%); }
.dim-label.top    { top: -7px; left: 50%; transform: translateX(-50%); }
.dim-label.left   { left: -7px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; padding: 0 4px; }
.dim-label.right  { right: -7px; top: 50%; transform: translateY(-50%) rotate(90deg); padding: 0 4px; }

/* center-line indicator (dashed horizontal across the artboard with "center" label) */
.dim-centerline {
  position: absolute;
  left: -32px; right: -32px;
  top: 0;
  height: 0;
  border-top: 1px dashed var(--accent-line);
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
[data-annotations="1"] .dim-centerline { opacity: 1; }
.dim-centerline span {
  background: var(--bg);
  padding: 0 8px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}

/* right-rail annotation card column */
.anno-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--font-mono);
}
.anno-card {
  border-left: 1px solid var(--rule);
  padding: 2px 0 2px 14px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.anno-card.in {
  opacity: 1;
  transform: translateX(0);
}
[data-annotations="0"] .anno-card { opacity: 0.18; transform: none; }
.anno-card .h {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.anno-card .b {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
  line-height: 1.55;
}
.anno-card .b ul { margin: 0; padding-left: 14px; }
.anno-card .b li { margin: 2px 0; }
.anno-card.accent { border-left-color: var(--accent); }

/* leader-line (dashed) from annotated element to its label */
.leader {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
[data-annotations="1"] .leader { opacity: 1; }
.leader .line {
  position: absolute;
  border-top: 1px dashed var(--accent-line);
}
.leader .tag {
  position: absolute;
  background: var(--bg);
  padding: 0 4px;
  white-space: nowrap;
}

/* grid-paper background for the artboard when annotations on */
[data-annotations="1"] .spec-artboard.gridpaper {
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ─────────────────────────────────────────────────────────────────────────
   hero
   ───────────────────────────────────────────────────────────────────────── */
.hero {
  padding: calc(56px * var(--d-y)) var(--page-pad) calc(72px * var(--d-y));
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.hero-meta b { color: var(--fg); font-weight: 500; }

.hero-name {
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.96;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero-name .accent { color: var(--accent); }
.hero-name .slash { color: var(--fg-faint); font-weight: 300; }

.hero-tagline {
  font-size: 21px;
  color: var(--fg-soft);
  line-height: 1.45;
  max-width: 56ch;
  margin: 0 0 36px;
  text-wrap: pretty;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
}
.hero-stat {
  min-width: 0;
  padding: 18px 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.hero-stat:first-child { padding-left: 0; }
.hero-stat:last-child { border-right: 0; padding-right: 0; }
.hero-stat .v {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0;
  line-height: 1;
}
.hero-stat .l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  margin-top: 10px;
  max-width: none;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-stat {
    padding: 16px 14px;
  }
  .hero-stat:nth-child(odd) { padding-left: 0; }
  .hero-stat:nth-child(even) {
    border-right: 0;
    padding-right: 0;
    padding-left: 16px;
  }
}

.hero-cta {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────────────────
   page surfaces
   ───────────────────────────────────────────────────────────────────────── */
.page-hero {
  padding-top: calc(64px * var(--d-y));
  padding-bottom: calc(56px * var(--d-y));
  border-bottom: 1px solid var(--rule);
}
.page-title {
  font-family: var(--font-display);
  font-size: 84px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0 0 22px;
}
.page-title .accent { color: var(--accent); }
.page-lede {
  font-size: 21px;
  line-height: 1.45;
  color: var(--fg-soft);
  max-width: 62ch;
  margin: 0 0 28px;
}
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0 24px;
    border-top: 1px solid var(--rule);
  }
.writing-row-teaser {
  grid-template-columns: 130px 1fr 96px;
}
.writing-row-archive {
  grid-template-columns: 150px minmax(0, 1fr) 96px;
}
.writing-row-large p {
  color: var(--fg-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 10px;
  max-width: 68ch;
}
.article-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 760px);
  gap: 56px;
  align-items: start;
  padding-top: calc(56px * var(--d-y));
  padding-bottom: calc(72px * var(--d-y));
}
.article-rail {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--font-mono);
}
.article-back {
  width: max-content;
  margin-bottom: 6px;
}
.article-header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.article-title {
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.03;
  margin: 0 0 20px;
}
.article-excerpt {
  color: var(--fg-soft);
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
}
.article-prose {
  max-width: 68ch;
  padding-top: 32px;
}
.article-prose h2,
.article-prose h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--fg);
}
.article-prose h2 {
  font-size: 30px;
  margin: 42px 0 14px;
}
.article-prose h3 {
  font-size: 22px;
  margin: 28px 0 12px;
}
.article-prose p {
  color: var(--fg-soft);
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 18px;
}
.article-prose .article-bullet {
  position: relative;
  padding-left: 18px;
}
.article-prose .article-bullet::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}
.article-prose pre {
  overflow-x: auto;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 16px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.now-cards {
  margin-bottom: 48px;
}

/* dimension markers around hero — only shown when annotations on */
.hero-dim-left {
  position: absolute;
  left: -28px; top: 0; bottom: 0;
  width: 1px;
  background: var(--accent-line);
  opacity: 0;
  transition: opacity 0.5s;
}
[data-annotations="1"] .hero-dim-left { opacity: 1; }
.hero-dim-left::before, .hero-dim-left::after {
  content: ""; position: absolute; left: -3px; width: 7px; height: 1px; background: var(--accent-line);
}
.hero-dim-left::before { top: 0; }
.hero-dim-left::after { bottom: 0; }
.hero-dim-left span {
  position: absolute; left: -22px; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: var(--bg);
  padding: 0 4px;
}

/* ─────────────────────────────────────────────────────────────────────────
   section
   ───────────────────────────────────────────────────────────────────────── */
.section {
  padding: calc(72px * var(--d-y)) var(--page-pad);
  border-top: 1px solid var(--rule);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: calc(40px * var(--d-y));
  gap: 24px;
  flex-wrap: wrap;
}
.section-head .h-left {
  display: flex; align-items: baseline; gap: 14px;
}
.section-head .h-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0;
}
.section-head .h-aside {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* ─────────────────────────────────────────────────────────────────────────
   project cards
   ───────────────────────────────────────────────────────────────────────── */
.projects {
  display: flex;
  flex-direction: column;
}
.project {
  display: grid;
  grid-template-columns: 100px 1fr 340px;
  gap: 32px;
  padding: calc(28px * var(--d-y)) 0;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: background 0.15s;
}
.project:last-child { border-bottom: 1px solid var(--rule); }
.project.is-linked { cursor: pointer; }
.project.is-linked:hover { background: var(--rule-soft); }
.project.is-linked:hover .project-arrow { transform: translateX(4px); color: var(--accent); }

.project-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-id .yr { color: var(--accent); }

.project-body h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0 8px;
  line-height: 1.15;
}
.project-body p {
  font-size: 14.5px;
  color: var(--fg-soft);
  line-height: 1.55;
  margin: 0 0 12px;
  max-width: 60ch;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.project-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  padding: 2px 6px;
  letter-spacing: 0.03em;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.project-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.project-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
}
.project-stat .k { color: var(--fg-mute); letter-spacing: 0.04em; text-transform: uppercase; font-size: 10px; }
.project-stat .v { color: var(--fg); font-size: 12px; }
.project-stat .v.accent { color: var(--accent); }

.project-arrow {
  position: absolute;
  right: 0; top: calc(28px * var(--d-y));
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-faint);
  transition: transform 0.15s, color 0.15s;
}

@media (max-width: 980px) {
  .project { grid-template-columns: 70px 1fr; }
  .project-side { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--rule); }
  .project-arrow { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────
   resume / two-col content
   ───────────────────────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; gap: 16px; }
}
.tc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  padding-top: 2px;
}
.tc-body { display: flex; flex-direction: column; gap: 32px; }

.resume-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.resume-row:last-child { border-bottom: 0; }
.resume-row .yr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}
.resume-row h4 {
  font-size: 16px; font-weight: 500; margin: 0 0 4px;
}
.resume-row .co { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.resume-row p { margin: 6px 0 0; color: var(--fg-soft); font-size: 14px; line-height: 1.55; max-width: 60ch; }

.skill-cluster {
  border-top: 1px solid var(--rule);
  padding: 18px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}
.skill-cluster:last-child { border-bottom: 1px solid var(--rule); }
.skill-cluster h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0;
  padding-top: 2px;
}
.skill-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.skill-list span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: var(--bg-card);
}

/* writing list */
.writing-row {
  display: grid;
  grid-template-columns: 110px 1fr 80px;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  cursor: pointer;
  transition: background 0.15s, padding-left 0.15s;
}
.writing-row:hover { background: var(--rule-soft); padding-left: 8px; padding-right: 8px; }
.writing-row:hover h4 { color: var(--accent); }
.writing-row:first-child { border-top: 1px solid var(--rule); }
.writing-row-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.writing-row .date,
.writing-row .min,
.writing-row-cta {
  font-family: var(--font-mono);
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}
.writing-row .date {
  font-size: 11.5px;
}
.writing-row-body {
  min-width: 0;
}
.writing-row h4 {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 6px;
  transition: color 0.15s;
  overflow-wrap: anywhere;
}
.writing-row p {
  color: var(--fg-soft);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 8px;
  max-width: 62ch;
}
.writing-row .min {
  font-size: 11px;
}
.writing-row-cta {
  justify-self: end;
  font-size: 11px;
  white-space: nowrap;
}

/* contact panel */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  overflow: hidden;
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-cell {
  padding: 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.contact-cell:hover { background: var(--accent-faint); }
.contact-cell:hover .v { color: var(--accent); }
.contact-cell:nth-child(2n) { border-right: 0; }
.contact-cell:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 720px) {
  .contact-cell { border-right: 0; }
  .contact-cell:not(:last-child) { border-bottom: 1px solid var(--rule); }
}
.contact-cell .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.contact-cell .v {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--fg);
  letter-spacing: 0;
  transition: color 0.15s;
}

/* footer */
.footer {
  border-top: 1px solid var(--rule);
  padding: 40px 0 64px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer .sig { color: var(--fg-soft); }

/* ─────────────────────────────────────────────────────────────────────────
   command palette
   ───────────────────────────────────────────────────────────────────────── */
.cmdk-backdrop {
  position: fixed; inset: 0;
  /* Always darken regardless of theme — backdrop is a dim, not a re-coloring. */
  background: rgba(8, 9, 12, 0.42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 16vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.cmdk-backdrop.open { opacity: 1; pointer-events: auto; }
.cmdk-panel {
  width: 480px;
  max-width: calc(100vw - 32px);
  background: var(--bg);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-3);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  transform: translateY(-8px);
  transition: transform 0.18s cubic-bezier(0.3,0.7,0.4,1);
  font-family: var(--font-mono);
}
.cmdk-backdrop.open .cmdk-panel { transform: translateY(0); }
.cmdk-input-row {
  display: flex; align-items: center;
  padding: 0 16px;
  border-bottom: 1px dashed var(--rule);
  gap: 10px;
}
.cmdk-input-row svg { color: var(--accent); flex: 0 0 14px; }
.cmdk-input {
  flex: 1;
  height: 48px;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  outline: none;
}
.cmdk-input::placeholder { color: var(--fg-mute); }
.cmdk-list { padding: 8px 8px 4px; max-height: 360px; overflow-y: auto; }
.cmdk-group {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  padding: 10px 12px 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--fg);
  position: relative;
}
.cmdk-item .ico {
  width: 16px; height: 16px; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 16px;
}
.cmdk-item .lbl { flex: 1; }
.cmdk-item .shortcut { color: var(--accent); font-size: 11.5px; }
.cmdk-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.cmdk-item.active .lbl { color: var(--accent-ink); }
.cmdk-foot {
  border-top: 1px dashed var(--rule);
  padding: 10px 16px;
  display: flex; gap: 18px;
  font-size: 10.5px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}
.cmdk-foot .row { display: flex; align-items: center; gap: 6px; }
.cmdk-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 12.5px;
}

/* esc tag in input row */
.cmdk-esc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

/* discoverability hint button — bottom-right */
.cmdk-hint {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-soft);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.cmdk-hint:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.cmdk-hint .kbd { background: var(--bg); }

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE — global tablet + mobile coverage.
   Section-specific breakpoints live near each block above; this block is
   the page-level chrome (topbar, page padding, section spacing, type scale,
   global utilities) and the things that need to fold once column counts
   collapse.
   ───────────────────────────────────────────────────────────────────────── */

/* ── tablet (≤ 980px) ── */
@media (max-width: 980px) {
  :root { --page-pad: 24px; }
  .hero-name { font-size: 64px; }
  .hero-tagline { font-size: 18px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stat:nth-child(odd) { padding-left: 0; }
  .hero-stat:nth-child(even) {
    border-right: 0;
    padding-right: 0;
    padding-left: 18px;
  }
  .section-head h2 { font-size: 34px; }
  .project-body h3 { font-size: 23px; }
  .topbar-inner { padding: 12px 24px; gap: 16px; }
  .section { padding-top: calc(56px * var(--d-y)); padding-bottom: calc(56px * var(--d-y)); }
}

/* ── mobile (≤ 720px) ── */
@media (max-width: 720px) {
  /* page chrome */
  :root { --page-pad: 18px; }
  .section { padding-top: calc(44px * var(--d-y)); padding-bottom: calc(44px * var(--d-y)); }
  .section-head { margin-bottom: 24px; gap: 6px; }
  .section-head h2 { font-size: 24px; }
  .section-head .h-aside { font-size: 10px; letter-spacing: 0.04em; }

  /* topbar — nav becomes a horizontal scroll strip under the brand row */
  .topbar-inner {
    padding: 12px 18px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .brand { font-size: 11px; }
  .brand .dot { width: 6px; height: 6px; }
  .nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px dashed var(--rule);
    margin-top: 4px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 8px; font-size: 10.5px; white-space: nowrap; flex-shrink: 0; }
  .topbar-right { gap: 6px; }
  .topbar-right .btn span { display: none; }
  .topbar-right .btn .kbd { display: none; }
  .topbar-right .btn { padding: 0 10px; }

  /* hero — tighter spacing, smaller display type */
  .hero { padding-top: calc(36px * var(--d-y)); padding-bottom: calc(48px * var(--d-y)); }
  .hero-meta {
    font-size: 9.5px;
    gap: 8px;
    margin-bottom: 18px;
    row-gap: 6px;
  }
  .hero-name {
    font-size: 42px;
    margin-bottom: 18px;
    letter-spacing: 0;
    line-height: 1;
  }
  .hero-tagline {
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
  }
  .page-hero {
    padding-top: calc(40px * var(--d-y));
    padding-bottom: calc(36px * var(--d-y));
  }
  .page-title { font-size: 42px; line-height: 1; }
  .page-lede { font-size: 15px; line-height: 1.55; }
  .article-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: calc(34px * var(--d-y));
    padding-bottom: calc(48px * var(--d-y));
  }
  .article-rail {
    position: static;
    gap: 12px;
  }
  .article-title { font-size: 34px; line-height: 1.08; }
  .article-excerpt { font-size: 15px; }
  .article-prose { padding-top: 24px; }
  .article-prose h2 { font-size: 23px; }
  .article-prose h3 { font-size: 18px; }
  .article-prose p { font-size: 14px; line-height: 1.65; }
  .hero-cta { gap: 8px; margin-bottom: 28px; }
  .hero-cta .btn { font-size: 11px; padding: 0 10px; height: 30px; }
  .hero-stat { padding-top: 14px; padding-bottom: 14px; }
  .hero-stat .v { font-size: 18px; }
  .hero-stat .l {
    font-size: 9.5px;
    line-height: 1.35;
    max-width: none;
    margin-top: 6px;
    overflow-wrap: anywhere;
  }

  /* annotation rail — when it folds underneath, dampen visual heft */
  .spec-frame { gap: 18px; }
  .anno-stack { gap: 14px; }
  .anno-card .h { font-size: 9.5px; }
  .anno-card .b { font-size: 11.5px; }

  /* project rows — single column with reorganised id rail */
  .project {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px 0;
  }
  .project-id {
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 10.5px;
  }
  .project-body h3 { font-size: 19px; line-height: 1.2; }
  .project-body p { font-size: 13.5px; max-width: none; }
  .project-tags { gap: 5px; }
  .project-tag { font-size: 9.5px; padding: 2px 5px; }
  .project-side {
    padding-top: 14px;
    border-top: 1px dashed var(--rule);
    gap: 8px;
  }
  .project-stat { font-size: 10.5px; padding-bottom: 6px; }
  .project-stat .k { font-size: 9.5px; }
  .project-stat .v { font-size: 11px; }
  .project-arrow { display: none; }

  /* two-col / resume — labels stack above content */
  .tc-label { font-size: 10px; padding-top: 0; }
  .tc-body { gap: 22px; }
  .resume-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }
  .resume-row .yr { font-size: 11px; color: var(--accent); }
  .resume-row h4 { font-size: 15px; }
  .resume-row p { font-size: 13px; max-width: none; }

  /* skill cluster */
  .skill-cluster {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 0;
  }
  .skill-cluster h5 { font-size: 10px; }
  .skill-list { gap: 5px; }
  .skill-list span { font-size: 11px; padding: 3px 8px; }

  /* writing row */
  .writing-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 0;
    align-items: flex-start;
  }
  .writing-row:hover { padding-left: 0; padding-right: 0; }
  .writing-row-large {
    border: 1px solid var(--rule);
    border-radius: var(--r-2);
    background: var(--bg-card);
    padding: 15px;
    margin-bottom: 10px;
  }
  .writing-row-large:first-child { border-top: 1px solid var(--rule); }
  .writing-row-large:hover { background: var(--bg-card); border-color: var(--accent-line); }
  .writing-row-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .writing-row .date { font-size: 10.5px; color: var(--accent-ink); }
  .writing-row h4 { font-size: 16px; line-height: 1.28; margin-bottom: 7px; }
  .writing-row p { font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
  .writing-row .min { font-size: 10.5px; color: var(--fg-mute); white-space: nowrap; }
  .writing-row-cta {
    justify-self: start;
    color: var(--accent);
    font-size: 10.5px;
  }

  /* contact */
  .contact-cell { padding: 18px 20px; gap: 4px; }
  .contact-cell .v { font-size: 13.5px; }

  /* about long-form bio */
  .tc-body[style*="font-size: 16"] { font-size: 14.5px !important; }

  /* footer */
  .footer { padding: 28px 18px 40px; font-size: 10px; flex-direction: column; gap: 6px; align-items: flex-start; }

  /* cmd+K — narrower panel, repositioned hint pill */
  .cmdk-panel { width: calc(100vw - 24px); }
  .cmdk-list { max-height: 280px; }
  .cmdk-hint { display: none; }
  .cmdk-hint .kbd { display: none; }

  /* dimension labels and leaders are noisy at mobile — hide them */
  [data-annotations="1"] .dim-label,
  [data-annotations="1"] .dim-centerline,
  [data-annotations="1"] .leader,
  [data-annotations="1"] .hero-dim-left { display: none; }
  [data-annotations="1"] .spec-artboard { border-color: transparent; }
}

/* ── tiny phones (≤ 380px) ── */
@media (max-width: 380px) {
  :root { --page-pad: 14px; }
  .topbar-inner { padding: 10px 14px; }
  .hero-name { font-size: 30px; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stat,
  .hero-stat:nth-child(even),
  .hero-stat:nth-child(odd) {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 12px 0;
  }
  .hero-stat:last-child { border-bottom: 0; }
  .section-head h2 { font-size: 22px; }
  .nav a { padding: 6px 6px; font-size: 10px; }
  .topbar-right .btn { padding: 0 8px; }
}
