/* ==============================================
   hireadev.tech — Mayur Champaneria
   Brutalist / Terminal / Senior-engineered
   ============================================== */

:root {
  /* Dark (default) */
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-panel: #0e0e0e;
  --grid-line: rgba(255, 255, 255, 0.06);
  --grid-line-strong: rgba(255, 255, 255, 0.12);
  --fg: #e8e6df;
  --fg-dim: #8a877e;
  --fg-mute: #4d4a42;
  --rule: rgba(232, 230, 223, 0.14);
  --rule-strong: rgba(232, 230, 223, 0.32);
  --accent: oklch(0.88 0.18 130);  /* acid lime */
  --accent-ink: #0a0a0a;
  --warn: oklch(0.78 0.16 60);
  --err: oklch(0.7 0.18 25);

  --mono: "JetBrains Mono", "Berkeley Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Geist", "Inter Tight", -apple-system, system-ui, sans-serif;

  --col-w: 80px;
  --col-gap: 0px;
  --pad-x: 24px;

  --t-fast: 120ms cubic-bezier(.2,.8,.2,1);
  --t-med: 240ms cubic-bezier(.2,.8,.2,1);
}

[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-elev: #ece8df;
  --bg-panel: #efebe2;
  --grid-line: rgba(0, 0, 0, 0.06);
  --grid-line-strong: rgba(0, 0, 0, 0.14);
  --fg: #15140f;
  --fg-dim: #6c6a60;
  --fg-mute: #aeaa9d;
  --rule: rgba(21, 20, 15, 0.16);
  --rule-strong: rgba(21, 20, 15, 0.34);
  --accent: oklch(0.62 0.18 145);
  --accent-ink: #f4f1ea;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "zero";
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  position: relative;
}

/* The ambient background grid — visible structural lines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 95%);
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ==================== Layout ==================== */

.shell {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 20%, transparent);
}
.logo-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-transform: lowercase;
  line-height: 1;
}
.logo-text .logo-tld {
  color: var(--accent);
}

/* Topbar — fixed system chrome */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 24px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar-left,
.topbar-right {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--fg-dim);
}
.topbar-right { justify-content: flex-end; }
.topbar-center { color: var(--fg); display: flex; align-items: center; gap: 10px; font-weight: 500; }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 60%, transparent);
}
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; transform: scale(0.8); } }

.tb-link { transition: color var(--t-fast); }
.tb-link:hover { color: var(--fg); }

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--bg-elev);
}

/* Bottom statusbar */
.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  padding: 8px 24px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  color: var(--fg-dim);
}
.statusbar .sb-mid { display: flex; gap: 18px; justify-content: center; }
.statusbar .sb-right { display: flex; gap: 18px; }
.statusbar .seg { display: inline-flex; align-items: center; gap: 6px; }
.seg b { color: var(--fg); font-weight: 500; }

/* ==================== Sections (terminal-prompt headers) ==================== */

.section {
  position: relative;
  padding: 80px 0 100px;
  border-bottom: 1px solid var(--rule);
}
.section:first-of-type { padding-top: 64px; }

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 1px dashed var(--rule);
  align-items: end;
}
.prompt {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}
.prompt .p-tilde { color: var(--accent); }
.prompt .p-cmd { color: var(--fg); }

.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 6px;
}

.section-meta {
  text-align: right;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.section-meta b { color: var(--fg); font-weight: 500; }

/* ==================== HERO ==================== */

.hero {
  padding-top: 120px;
  padding-bottom: 60px;
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: end;
}

.hero-eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 32px;
}
.hero-eyebrow .tag {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 2px;
  font-size: 10px;
}

.hero-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(56px, 9.5vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: var(--fg);
}
.hero-name .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.hero-name .slash {
  color: var(--fg-mute);
  font-weight: 300;
}

.hero-role {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  max-width: 60ch;
  margin-bottom: 32px;
}
.hero-role .hl { color: var(--accent); }
.hero-role .dim { color: var(--fg-dim); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 8px;
}
.hero-meta .cell {
  border-right: 1px dashed var(--rule);
  padding: 6px 16px 6px 0;
}
.hero-meta .cell:last-child { border-right: none; }
.hero-meta .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.hero-meta .value { font-size: 13px; color: var(--fg); }

/* terminal column on the right */
.hero-term {
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12px;
}
.term-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-panel);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.term-head .tdots { display: flex; gap: 5px; }
.term-head .tdot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg-mute); }
.term-head .tdot:nth-child(1){ background: oklch(0.7 0.16 25); }
.term-head .tdot:nth-child(2){ background: oklch(0.78 0.14 60); }
.term-head .tdot:nth-child(3){ background: oklch(0.78 0.16 145); }
.term-body {
  padding: 14px 14px 16px;
  line-height: 1.6;
}
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line .pp { color: var(--accent); }
.term-line .ar { color: var(--fg-dim); }
.term-line .ok { color: var(--accent); }
.term-line .key { color: var(--fg-dim); }
.term-line .val { color: var(--fg); }
.cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); transform: translateY(2px); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ==================== About ==================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.about-prose {
  font-size: 16px;
  line-height: 1.7;
  max-width: 60ch;
  color: var(--fg);
}
.about-prose p + p { margin-top: 18px; }
.about-prose .em { color: var(--accent); }
.about-prose .dim { color: var(--fg-dim); }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  align-self: start;
}
.about-stats .cell {
  padding: 22px 22px 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.about-stats .cell:nth-child(2n) { border-right: none; }
.about-stats .cell:nth-last-child(-n+2) { border-bottom: none; }
.about-stats .num {
  font-family: var(--display);
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.about-stats .num .accent { color: var(--accent); }
.about-stats .lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
}

/* ==================== Projects ==================== */

.proj-list {
  border-top: 1px solid var(--rule);
}
.proj {
  display: grid;
  grid-template-columns: 60px 1.3fr 1fr 100px 80px;
  gap: 24px;
  align-items: center;
  padding: 22px 8px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background var(--t-fast), padding var(--t-fast);
  position: relative;
}
.proj:hover {
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  padding-left: 16px;
}
.proj:hover .proj-arr { transform: translateX(4px); color: var(--accent); }
.proj-idx { color: var(--fg-mute); font-size: 12px; }
.proj-name {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.proj-name .star { color: var(--accent); margin-left: 8px; font-size: 12px; }
.proj-desc { color: var(--fg-dim); font-size: 13px; line-height: 1.5; }
.proj-tags { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.proj-arr { font-size: 18px; color: var(--fg-mute); transition: all var(--t-fast); justify-self: end; }

.proj.featured .proj-name { color: var(--fg); }
.proj.featured .proj-name::before {
  content: "★";
  color: var(--accent);
  margin-right: 10px;
  font-size: 12px;
  vertical-align: middle;
}

/* ==================== Case study ==================== */

.case {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}
.case-side {
  padding: 36px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 24px;
}
.case-side:last-child { border-right: none; }
.case-tag {
  display: inline-flex;
  width: fit-content;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.case-name {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1.1;
}
.case-pitch { color: var(--fg-dim); font-size: 14px; line-height: 1.6; max-width: 50ch; }
.case-bullets { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.case-bullets li { display: grid; grid-template-columns: 24px 1fr; align-items: start; }
.case-bullets li::before {
  content: "▹"; color: var(--accent);
  margin-top: 1px;
}
.case-bullets li.bullet::before { content: "▹"; }

.case-arch {
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-dim);
  white-space: pre;
  font-family: var(--mono);
}
.case-arch .acc { color: var(--accent); }
.case-arch .fg { color: var(--fg); }

/* ==================== Arch diagram (CSS flow) ==================== */
.arch-diagram {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
}
.arch-node {
  border: 1px solid var(--rule);
  padding: 10px 14px;
  background: var(--bg);
}
.arch-node--core {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, var(--bg));
}
.arch-node--output {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 7%, var(--bg));
}
.arch-nd-tag {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 3px;
}
.arch-node--core .arch-nd-tag,
.arch-node--output .arch-nd-tag { color: var(--accent); opacity: 0.8; }
.arch-nd-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 3px;
}
.arch-node--core .arch-nd-name { color: var(--accent); }
.arch-node--output .arch-nd-name { color: var(--accent); }
.arch-nd-tech {
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.03em;
}
.arch-nd-note {
  font-size: 10px;
  color: var(--fg-mute);
  margin-top: 4px;
  font-style: italic;
}

/* single vertical connector */
.arch-vconn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0;
  gap: 1px;
}
.arch-vconn-line {
  display: block;
  width: 1px;
  height: 10px;
  background: var(--rule-strong);
}
.arch-vconn-lbl {
  font-size: 9px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.arch-vconn-arr {
  display: block;
  font-size: 8px;
  color: var(--accent);
  line-height: 1;
}

/* fan-out: orchestrator → 4 sources */
.arch-fanout,
.arch-fanin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 18px;
  position: relative;
}
.arch-fanout::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: var(--rule-strong);
}
.arch-fanin::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: var(--rule-strong);
}
.arch-fanout-leg,
.arch-fanin-leg {
  display: flex;
  justify-content: center;
}
.arch-fanout-leg::before,
.arch-fanin-leg::before {
  content: "";
  display: block;
  width: 1px;
  height: 100%;
  background: var(--rule-strong);
}

/* 4 source boxes */
.arch-sources {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.arch-source {
  border: 1px solid var(--rule);
  padding: 8px 6px;
  background: var(--bg-elev);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  transition: border-color var(--t-fast);
}
.arch-source:hover { border-color: var(--accent); }
.arch-src-icon {
  font-size: 13px;
  line-height: 1;
  margin-bottom: 1px;
}
.arch-src-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}
.arch-src-tech {
  font-size: 9px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

/* hypotheses list */
.arch-hypo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.arch-hypo {
  display: grid;
  grid-template-columns: 16px 40px 1fr;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--rule);
}
.arch-hypo:last-child { border-bottom: none; }
.arch-hypo-rank { color: var(--accent); font-weight: 700; font-size: 12px; }
.arch-hypo-score { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.arch-hypo-label { color: var(--fg-dim); }

/* report footer row */
.arch-report-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--fg-dim);
  padding: 8px 0 0;
  border-top: 1px dashed var(--rule);
  margin-top: 4px;
}
.arch-report-row .dot { width: 5px; height: 5px; }

.case-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  margin-top: 8px;
}
.case-metrics .m {
  background: var(--bg-elev);
  padding: 14px 16px;
}
.case-metrics .m-v {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.case-metrics .m-v.accent { color: var(--accent); }
.case-metrics .m-l {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
}

/* ==================== Skills ==================== */

.skills {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
}
.skills-cat-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.skills-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
  transition: color var(--t-fast), padding var(--t-fast);
  color: var(--fg-dim);
}
.skills-cat .num { font-size: 11px; color: var(--fg-mute); }
.skills-cat.active { color: var(--fg); padding-left: 12px; }
.skills-cat.active::before { content: "→"; color: var(--accent); margin-right: 8px; }
.skills-cat:hover { color: var(--fg); }

.skills-pane {
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  padding: 28px 32px;
  min-height: 320px;
}
.skills-pane-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.skills-pane-head h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.skills-pane-head .meta { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
}
.skill {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.skill .lvl {
  display: flex; gap: 3px;
}
.skill .lvl span {
  width: 7px; height: 7px;
  background: var(--fg-mute);
}
.skill .lvl span.on { background: var(--accent); }

/* ==================== Experience timeline ==================== */

.timeline {
  border-left: 1px solid var(--rule);
  padding-left: 32px;
  margin-left: 12px;
  position: relative;
}
.tl-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.tl-row::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 30px;
  width: 11px; height: 11px;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
}
.tl-row.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }
.tl-year {
  font-size: 12px; color: var(--fg-dim);
  letter-spacing: 0.08em;
}
.tl-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.tl-org { font-size: 12px; color: var(--fg-dim); margin-bottom: 8px; }
.tl-desc { font-size: 13px; line-height: 1.6; color: var(--fg-dim); max-width: 70ch; }
.tl-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tl-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 8px; border: 1px solid var(--rule);
  color: var(--fg-dim);
}

/* ==================== GitHub graph ==================== */

.gh-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}
.gh-graph {
  border: 1px solid var(--rule);
  padding: 24px;
  background: var(--bg-elev);
  overflow-x: auto;
}
.gh-graph svg { display: block; }
.gh-cell { fill: var(--fg-mute); }
.gh-cell.l1 { fill: color-mix(in oklab, var(--accent) 30%, var(--fg-mute)); }
.gh-cell.l2 { fill: color-mix(in oklab, var(--accent) 55%, var(--fg-mute)); }
.gh-cell.l3 { fill: color-mix(in oklab, var(--accent) 80%, var(--fg-mute)); }
.gh-cell.l4 { fill: var(--accent); }
.gh-cell-bg { fill: rgba(255,255,255,0.03); }
[data-theme="light"] .gh-cell-bg { fill: rgba(0,0,0,0.04); }

.gh-legend {
  display: flex; gap: 8px; align-items: center; margin-top: 16px;
  font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.08em;
}
.gh-legend .scale { display: flex; gap: 3px; }
.gh-legend .scale span { width: 11px; height: 11px; }

.gh-stats {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--rule);
  min-width: 240px;
}
.gh-stats .row {
  display: flex; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.gh-stats .row:last-child { border-bottom: none; }
.gh-stats .k { color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.gh-stats .v { color: var(--fg); }
.gh-stats .v.acc { color: var(--accent); }

/* ==================== Writing ==================== */

.writing-list { border-top: 1px solid var(--rule); }
.write {
  display: grid;
  grid-template-columns: 110px 1fr 100px 30px;
  gap: 24px;
  align-items: center;
  padding: 18px 8px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background var(--t-fast), padding var(--t-fast);
}
.write:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); padding-left: 16px; }
.write:hover .write-arr { color: var(--accent); transform: translateX(4px); }
.write-date { font-size: 11px; color: var(--fg-mute); letter-spacing: 0.06em; }
.write-title {
  font-family: var(--display); font-size: 17px;
  font-weight: 500; letter-spacing: -0.005em;
}
.write-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-dim); }
.write-arr { color: var(--fg-mute); transition: all var(--t-fast); }

/* ==================== Now / Currently ==================== */

.now {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}
.now-card {
  padding: 28px;
  border-right: 1px solid var(--rule);
}
.now-card:last-child { border-right: none; }
.now-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.now-head .icon {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px color-mix(in oklab, var(--accent) 60%, transparent);
}
.now-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 8px;
  line-height: 1.25;
}
.now-desc { font-size: 13px; color: var(--fg-dim); line-height: 1.55; }

/* ==================== Contact ==================== */

.contact {
  position: relative;
  padding: 80px 0 100px;
}
.contact-line {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
}
.contact-line .accent { color: var(--accent); font-style: italic; }
.contact-line .dim { color: var(--fg-mute); }

.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.contact-cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.contact-cta .arr { transition: transform var(--t-fast); }
.contact-cta:hover .arr { transform: translateX(4px); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  margin-top: 80px;
}
.contact-grid .cg {
  padding: 24px 24px 24px 0;
  border-right: 1px dashed var(--rule);
}
.contact-grid .cg:last-child { border-right: none; }
.contact-grid .cg-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-dim); margin-bottom: 8px; }
.contact-grid .cg-v { font-size: 14px; color: var(--fg); }
.contact-grid a.cg-v:hover { color: var(--accent); }

/* ==================== Footer ==================== */

.foot {
  padding: 28px 0 60px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.08em;
}

/* ==================== Command Palette ==================== */

.cmdk-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: fadein 120ms ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.cmdk {
  width: min(560px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  font-family: var(--mono);
}
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.cmdk-input span.pr { color: var(--accent); }
.cmdk-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--fg); font: inherit; font-size: 14px;
}
.cmdk-list { max-height: 60vh; overflow-y: auto; padding: 8px 0; }
.cmdk-item {
  display: grid; grid-template-columns: 24px 1fr auto;
  gap: 10px; padding: 8px 16px;
  font-size: 13px; cursor: pointer;
  align-items: center;
}
.cmdk-item:hover, .cmdk-item.active {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
.cmdk-item .ic { color: var(--fg-dim); }
.cmdk-item .lbl { color: var(--fg); }
.cmdk-item .sub { color: var(--fg-dim); font-size: 11px; }
.cmdk-foot {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--rule);
  font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.06em;
}

/* ==================== Misc helpers ==================== */

.scramble { display: inline-block; }
.fade-in { opacity: 0; transform: translateY(8px); transition: opacity 600ms ease, transform 600ms ease; }
.fade-in.shown { opacity: 1; transform: translateY(0); }

/* ==================== Tablet (≤ 900px) ==================== */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .case, .gh-grid, .now, .skills { grid-template-columns: 1fr; }
  .case-side { border-right: none; border-bottom: 1px solid var(--rule); }
  .now-card { border-right: none; border-bottom: 1px solid var(--rule); }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .proj { grid-template-columns: 30px 1fr 50px; }
  .proj .proj-desc, .proj .proj-tags { display: none; }
  .write { grid-template-columns: 80px 1fr 30px; }
  .write .write-cat { display: none; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .topbar-left .hide-md, .topbar-right .hide-md { display: none; }
  .statusbar .sb-mid { display: none; }
  .hero { padding-top: 100px; }
  .section { padding: 64px 0 80px; }
  .skills { gap: 32px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
}

/* ==================== Mobile (≤ 600px) ==================== */
@media (max-width: 600px) {
  :root {
    --pad-x: 16px;
  }

  /* Base type */
  html, body { font-size: 15px; }

  /* Topbar */
  .topbar {
    padding: 9px 16px;
    font-size: 12px;
    grid-template-columns: auto 1fr auto;
    gap: 0;
  }
  .topbar-center { font-size: 11px; gap: 6px; }
  .logo-text { font-size: 12px; }
  .logo-mark { width: 26px; height: 21px; font-size: 9px; }

  /* Statusbar */
  .statusbar {
    padding: 7px 16px;
    font-size: 11px;
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .statusbar .sb-right { display: none; }

  /* Body content push */
  .hero { padding-top: 76px; padding-bottom: 48px; }

  /* Sections */
  .section { padding: 52px 0 64px; }
  .section:first-of-type { padding-top: 48px; }
  .contact { padding: 52px 0 72px; }

  /* Section header */
  .section-head {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 20px;
    margin-bottom: 28px;
  }
  .section-meta { display: none; }
  .section-title { font-size: clamp(22px, 7vw, 36px); }
  .prompt { font-size: 11px; }

  /* Hero */
  .hero-term { display: none; }
  .hero-grid { gap: 36px; }
  .hero-name { font-size: clamp(44px, 13vw, 72px); margin-bottom: 18px; }
  .hero-eyebrow { font-size: 11px; margin-bottom: 20px; }
  .hero-role { font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 0; }
  .hero-meta .cell { padding: 8px 8px 8px 0; }
  .hero-meta .label { font-size: 10px; }
  .hero-meta .value { font-size: 12px; }
  .hero-term { font-size: 11px; }
  .term-body { padding: 12px; }

  /* About */
  .about-grid { gap: 32px; }
  .about-prose { font-size: 15px; line-height: 1.7; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .about-stats .num { font-size: 36px; }
  .about-stats .cell { padding: 18px 16px 20px; }

  /* Projects */
  .proj {
    grid-template-columns: 28px 1fr 28px;
    gap: 10px;
    padding: 18px 6px;
  }
  .proj-name { font-size: 16px; }
  .proj-idx { font-size: 11px; }

  /* Case study */
  .case-side { padding: 24px 20px; gap: 18px; }
  .case-name { font-size: 24px; }
  .case-pitch { font-size: 13px; }
  .case-bullets { font-size: 13px; gap: 8px; }
  .case-metrics .m-v { font-size: 20px; }
  .arch-sources { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .arch-fanout, .arch-fanin { display: none; }
  .arch-vconn-lbl { display: none; }

  /* Skills */
  .skills { gap: 24px; }
  .skills-grid { grid-template-columns: 1fr; gap: 0; }
  .skills-pane { padding: 20px; }
  .skills-pane-head h3 { font-size: 18px; }
  .skill { font-size: 13px; padding: 8px 0; }

  /* Timeline */
  .timeline { padding-left: 20px; margin-left: 8px; }
  .tl-row { grid-template-columns: 1fr; gap: 4px; padding: 18px 0; }
  .tl-row::before { left: -26px; top: 24px; }
  .tl-year { font-size: 11px; }
  .tl-title { font-size: 16px; }
  .tl-org { font-size: 11px; }
  .tl-desc { font-size: 13px; }

  /* GitHub graph */
  .gh-graph { padding: 12px; }
  .gh-stats .row { padding: 12px 14px; font-size: 12px; }
  .gh-stats .k { font-size: 10px; }
  .gh-legend { font-size: 10px; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .gh-legend span:last-child { display: none; }

  /* Writing */
  .write {
    grid-template-columns: 72px 1fr 24px;
    gap: 10px;
    padding: 16px 6px;
  }
  .write-title { font-size: 14px; }
  .write-date { font-size: 10px; }

  /* Now */
  .now-card { padding: 22px 20px; }
  .now-title { font-size: 16px; }
  .now-desc { font-size: 13px; }
  .now-head { font-size: 10px; margin-bottom: 12px; }

  /* Contact */
  .contact-line { font-size: clamp(28px, 9vw, 52px); margin-bottom: 28px; }
  .contact-cta { padding: 14px 22px; font-size: 12px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid .cg { padding: 18px 0; border-right: none; border-bottom: 1px dashed var(--rule); }
  .contact-grid .cg:last-child { border-bottom: none; }
  .contact-grid .cg-v { font-size: 14px; }
  .foot { flex-direction: column; gap: 8px; font-size: 10px; padding-bottom: 52px; }

  /* Command palette */
  .cmdk-overlay { padding-top: 8vh; }
  .cmdk { width: 96vw; }
  .cmdk-input { padding: 12px 14px; }
  .cmdk-input input { font-size: 15px; }
  .cmdk-item { padding: 10px 14px; font-size: 14px; min-height: 44px; }
  .cmdk-item .sub { display: none; }
  .cmdk-foot { font-size: 10px; padding: 6px 14px; }
}

/* ==================== Small phones (≤ 380px) ==================== */
@media (max-width: 380px) {
  .hero-name { font-size: clamp(38px, 12vw, 56px); }
  .topbar-center { display: none; }
  .about-stats .num { font-size: 30px; }
  .case-side { padding: 18px 16px; }
  .arch-sources { grid-template-columns: repeat(2, 1fr); }
}
