/* Theme tokens. Dark is the default; light is opt-in through the toggle. */
:root,
:root[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-alt: #0e131d;
  --surface: #121925;
  --surface-2: #18212f;
  --border: #1f2a3a;
  --border-strong: #2d3b51;
  --text: #e8edf5;
  --text-2: #bcc7d6;
  --muted: #8a98ad;
  --accent: #38bdf8;
  --accent-2: #34d399;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-line: rgba(56, 189, 248, 0.4);
  --green-soft: rgba(52, 211, 153, 0.12);
  --on-accent: #04131d;
  --grid-line: rgba(148, 163, 184, 0.055);
  --glow: rgba(56, 189, 248, 0.16);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
  --term-bg: #070a10;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-alt: #edf1f6;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --border: #dbe2ec;
  --border-strong: #c3cedc;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6b80;
  --accent: #0369a1;
  --accent-2: #047857;
  --accent-soft: rgba(3, 105, 161, 0.08);
  --accent-line: rgba(3, 105, 161, 0.35);
  --green-soft: rgba(4, 120, 87, 0.08);
  --on-accent: #ffffff;
  --grid-line: rgba(15, 23, 42, 0.05);
  --glow: rgba(3, 105, 161, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --term-bg: #0f1624;
  color-scheme: light;
}

:root {
  --radius: 14px;
  --maxw: 1140px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
kbd {
  font-family: var(--mono); font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  background: var(--surface-2); color: var(--muted);
}
.mono { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px;
}
.skip:focus { left: 0; }

/* Reading progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--text); text-decoration: none;
}
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.brand-name { font-family: var(--mono); font-size: 14px; color: var(--text-2); }

.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: flex; align-items: baseline; gap: 6px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-links .num { font-family: var(--mono); font-size: 11px; color: var(--accent); opacity: 0.7; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="true"] { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="true"] .num { opacity: 1; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  background: transparent; color: var(--muted); border: 1px solid var(--border); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg, .palette-btn svg, .btn svg, .copy-btn svg, .search svg, .palette-search svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav-toggle { display: none; }

.palette-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font: 500 14px var(--font); cursor: pointer;
}
.palette-btn:hover { color: var(--text); border-color: var(--border-strong); }
.kbds { display: inline-flex; gap: 3px; }

.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* Hero */
.hero { position: relative; padding: 88px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 120%;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13.5px; color: var(--text-2);
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 22px;
}
.eyebrow .prompt { color: var(--accent-2); font-weight: 600; }

.hero h1 { font-size: clamp(42px, 6.4vw, 72px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.tagline { font-family: var(--mono); font-size: clamp(14px, 1.6vw, 16px); color: var(--accent); margin: 16px 0 22px; }
.tagline span { color: var(--muted); margin: 0 6px; }
.lead { font-size: 19px; line-height: 1.65; max-width: 58ch; color: var(--text-2); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15.5px; text-decoration: none; border: 1px solid transparent;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px var(--glow); }
.btn-primary:hover { color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--text); }

/* Terminal */
.terminal {
  background: var(--term-bg); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(56, 189, 248, 0.05), 0 30px 60px -30px var(--glow);
  overflow: hidden; color: #d6e2f0;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.02);
}
.terminal .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #f87171; } .dot.y { background: #fbbf24; } .dot.g { background: #34d399; }
.terminal-title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: #7b8ba3; }
.terminal-body {
  padding: 18px 20px 22px; min-height: 300px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75;
}
.terminal .line { margin: 0; white-space: pre-wrap; word-break: break-word; }
.terminal .line.cmd::before { content: "$ "; color: #34d399; font-weight: 600; }
.terminal .line.out { color: #9fb0c6; margin-bottom: 8px; }
.terminal .t-dir { color: #7dd3fc; margin-right: 10px; display: inline-block; }
.terminal .line.pending { display: none; }
.cursor {
  display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px;
  background: #38bdf8; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 56px 0 0; padding: 0;
}
.stat {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.stat dd {
  margin: 0; font-family: var(--mono); font-size: 34px; font-weight: 600; color: var(--text);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat dt { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Sections */
.section { padding: 96px 0; position: relative; }
.section-alt { background: color-mix(in srgb, var(--bg-alt) 88%, transparent); border-block: 1px solid var(--border); }

.sec-head { margin-bottom: 36px; max-width: 70ch; }
.sec-num { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 0 0 8px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 700; }
.sec-sub { color: var(--muted); margin: 10px 0 0; font-size: 16px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.prose { max-width: 64ch; font-size: 18px; color: var(--text-2); }
.prose p:last-child { margin-bottom: 0; }
.sectors {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
}
.mono-label {
  font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 14px;
}
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li {
  font-size: 14px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}

.sub-head { font-size: 22px; font-weight: 650; margin: 64px 0 20px; }
.principles {
  list-style: none; counter-reset: p; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.principles li {
  counter-increment: p; position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 20px; transition: border-color 0.2s, transform 0.2s;
}
.principles li:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.principles li::before {
  content: counter(p, decimal-leading-zero); display: block;
  font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 10px;
}
.principles h4 { font-size: 18px; font-weight: 650; margin-bottom: 10px; line-height: 1.3; }
.principles p { margin: 0 0 16px; color: var(--text-2); font-size: 15.5px; line-height: 1.6; }
.principles .eg {
  margin: auto 0 0; padding-top: 14px; border-top: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 14.5px;
}
.principles .eg span {
  display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-2); margin-bottom: 4px;
}

/* Work filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filter, .tier-filter button {
  font: 500 14px var(--font); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s;
}
.filter:hover, .tier-filter button:hover { border-color: var(--border-strong); color: var(--text); }
.filter[aria-pressed="true"], .tier-filter button[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent);
}
.filter-status, .skill-status { font-family: var(--mono); font-size: 12.5px; color: var(--muted); min-height: 1.6em; margin: 4px 0 18px; }

.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.work-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); position: relative;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}
.work-card:hover { border-color: var(--accent-line); }
.work-card.feature { grid-column: 1 / -1; }
.work-card.feature::before {
  content: "featured"; position: absolute; top: 18px; right: 20px;
  font-family: var(--mono); font-size: 11px; color: var(--accent-2);
  padding: 2px 8px; border-radius: 999px; background: var(--green-soft);
}
.work-card.is-hidden { display: none; }

.kicker { font-family: var(--mono); font-size: 12.5px; color: var(--accent); margin-bottom: 10px; }
.kicker span { color: var(--muted); }
.work-card h3 { font-size: 21px; font-weight: 650; margin-bottom: 10px; }
.work-card.feature h3 { font-size: 26px; }
.summary { color: var(--text-2); margin-bottom: 18px; }

.metrics {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px;
}
.metrics li {
  display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.metrics b { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--text); line-height: 1.3; }
.metrics span { font-size: 13px; color: var(--muted); line-height: 1.35; }

.more { margin: 0 0 18px; border-top: 1px dashed var(--border-strong); }
.more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 0 0; font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {
  content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px;
  border-radius: 5px; border: 1px solid var(--accent-line); font-size: 13px; line-height: 1;
  transition: transform 0.2s;
}
.more[open] summary::before { content: "-"; }
.more summary:hover { color: var(--text); }
.more-body { padding-top: 14px; color: var(--text-2); font-size: 16px; }
.more-body p:last-child, .more-body ul:last-child { margin-bottom: 0; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checks li {
  position: relative; padding: 10px 12px 10px 36px; border-radius: 10px;
  background: var(--green-soft); color: var(--text); font-size: 15px; font-weight: 500;
}
.checks li::before {
  content: ""; position: absolute; left: 14px; top: 15px; width: 11px; height: 6px;
  border-left: 2px solid var(--accent-2); border-bottom: 2px solid var(--accent-2); transform: rotate(-45deg);
}

.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: 10px; padding-left: 4px; }
.bullets li:last-child { margin-bottom: 0; }
.bullets li::marker { color: var(--accent); content: "▹ "; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: auto 0 0; }
.tags li {
  font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

/* Tabs */
.tabs { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.tab-list { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 88px; }
.tab-list button {
  text-align: left; font: 500 15px var(--font); color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 11px 14px 11px 16px; cursor: pointer; position: relative; transition: all 0.15s;
}
.tab-list button:hover { color: var(--text); background: var(--surface); }
.tab-list button[aria-selected="true"] { color: var(--text); background: var(--surface); border-color: var(--border); }
.tab-list button[aria-selected="true"]::before {
  content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--accent);
}
.tab-panels { min-width: 0; }
.tab-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 30px; box-shadow: var(--shadow);
}
.tab-panel + .tab-panel { margin-top: 16px; }
.tab-panel h3 { font-size: 20px; font-weight: 650; margin-bottom: 18px; }
.tab-panel .bullets { max-width: 72ch; color: var(--text-2); }
.tab-panel .bullets li { margin-bottom: 14px; }
.js .tabs .tab-panel + .tab-panel { margin-top: 0; }
.js .tab-panel[hidden] { display: none; }
.tab-panel.fade-in { animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* No-JS: tabs list stays hidden, all panels stack. */
html:not(.js) .tabs { grid-template-columns: 1fr; }

/* Experience */
.timeline { display: grid; gap: 12px; max-width: 900px; }
.role {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.role[open] { border-color: var(--accent-line); }
.role summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 8px 24px; padding: 20px 56px 20px 24px; position: relative; flex-wrap: wrap;
}
.role summary::-webkit-details-marker { display: none; }
.role summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s;
}
.role[open] summary::after { transform: translateY(-30%) rotate(-135deg); border-color: var(--accent); }
.role-main { display: flex; flex-direction: column; gap: 2px; }
.role-company { font-size: 19px; font-weight: 650; }
.role-title { color: var(--text-2); font-size: 15.5px; }
.role-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.role-dates { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.role-loc { font-size: 13.5px; color: var(--muted); }
.role-body { padding: 0 24px 24px; border-top: 1px solid var(--border); margin: 0 0 0; }
.titles { list-style: none; padding: 16px 0 12px; margin: 0 0 14px; border-bottom: 1px dashed var(--border); }
.titles li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; padding: 3px 0; font-weight: 600; }
.titles .mono { font-size: 13px; color: var(--muted); font-weight: 400; }
.role-body .bullets { color: var(--text-2); padding-top: 16px; }
.role-body .titles + .bullets { padding-top: 0; }

/* Skills */
.skill-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px;
  color: var(--muted); transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 15px var(--font); padding: 11px 0;
}
.search input::placeholder { color: var(--muted); }
.tier-filter { display: flex; flex-wrap: wrap; gap: 6px; }

.legend { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-expert { background: var(--accent); }
.legend-working { border: 1.5px solid var(--text-2); }
.legend-familiar { border: 1.5px dashed var(--muted); }

.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.skill-card.is-hidden, .tier.is-hidden, .skill-card .tags li.is-hidden { display: none; }
.skill-card h3 { font-size: 17px; font-weight: 650; margin-bottom: 16px; }
.tier + .tier { margin-top: 16px; }
.tier-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.skill-card .tags li { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--surface-2); padding: 4px 10px; }
.skill-card .tags-expert li { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.skill-card .tags-familiar li { background: transparent; border-style: dashed; color: var(--muted); }
.skill-card .tags li mark { background: var(--accent); color: var(--on-accent); border-radius: 3px; padding: 0 1px; }
.skill-note { color: var(--muted); font-size: 14px; margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); }
.skill-empty { color: var(--muted); font-family: var(--mono); font-size: 14px; }

/* Certifications */
.certs { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 18px; }
.cert-group {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.cert-vendor { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px; }
.cert-group ul { list-style: none; padding: 0; margin: 0; }
.cert-group li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--border); font-weight: 500;
}
.cert-group li:first-child { border-top: 0; padding-top: 0; }
.code {
  font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); flex: none;
}

/* Contact */
.contact-card {
  max-width: 640px; background: var(--term-bg); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 8px 0; box-shadow: var(--shadow);
}
.contact-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 15px;
}
.contact-row + .contact-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.contact-label { color: #34d399; min-width: 76px; }
.contact-label::before { content: "$ "; color: #7b8ba3; }
.contact-value { color: #7dd3fc; text-decoration: none; overflow-wrap: anywhere; }
.contact-value:hover { text-decoration: underline; }
.copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font: 500 13px var(--mono); color: #bcc7d6; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 6px 10px;
}
.copy-btn:hover { color: #fff; border-color: rgba(56, 189, 248, 0.5); }
.copy-btn svg { width: 15px; height: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.hint { font-size: 12.5px; }

/* Command menu */
.palette {
  width: min(560px, calc(100vw - 32px)); padding: 0; margin: 12vh auto auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.palette::backdrop { background: rgba(3, 6, 12, 0.6); backdrop-filter: blur(3px); }
.palette-search {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.palette-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 16px var(--font);
}
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 15px; color: var(--text-2);
}
.palette-list li .group { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.palette-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.palette-list li[aria-selected="true"] .group { color: var(--accent); }
.palette-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 70;
  font-family: var(--mono); font-size: 13.5px; padding: 10px 16px; border-radius: 10px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--accent-line);
  box-shadow: var(--shadow); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll (only when JS is on and motion is OK) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    display: none; position: absolute; right: 0; top: calc(100% + 12px);
    flex-direction: column; min-width: 220px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav { position: relative; order: 3; }
  .principles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .terminal-body { min-height: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .tabs { grid-template-columns: 1fr; }
  .tab-list {
    position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .tab-list button { white-space: nowrap; border-color: var(--border); background: var(--surface); flex: none; }
  .tab-list button[aria-selected="true"] { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
  .tab-list button[aria-selected="true"]::before { display: none; }
  .certs { grid-template-columns: 1fr 1fr; }
  .cert-group:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .brand-name, .palette-btn-text, .palette-btn .kbds { display: none; }
  .palette-btn { width: 38px; padding: 0; justify-content: center; }
  .work-grid, .skill-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .work-card.feature::before { display: none; }
  .hint { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 48px; }
  .lead { font-size: 17px; }
  .prose { font-size: 17px; }
  .section { padding: 68px 0; }
  .work-card, .tab-panel, .skill-card { padding: 20px; }
  .checks { grid-template-columns: 1fr; }
  .certs { grid-template-columns: 1fr; }
  .stat { padding: 16px; }
  .stat dd { font-size: 28px; }
  .terminal-body { font-size: 12.5px; padding: 14px 16px 18px; }
  .role summary { padding: 16px 48px 16px 18px; }
  .role summary::after { right: 18px; }
  .role-side { align-items: flex-start; text-align: left; }
  .role-body { padding: 0 18px 20px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
}
