/* Dark is the default theme; main.js sets data-theme="light" when the visitor picks it. */
:root {
  color-scheme: dark;
  --bg: #09090B;
  --surface: #111114;
  --surface2: #16161A;
  --border: #232329;
  --border-strong: #34343C;
  --text: #EDEDEF;
  --muted: #A1A1AA;
  --faint: #82828C;
  --grid: rgba(255, 255, 255, 0.055);
  --track: #1E1E24;
  --bar-muted: #4A4A55;
  --ok: #4ADE80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --accent: #A78BFA;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --glow: rgba(167, 139, 250, 0.22);
  --shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.85);

  --font: 'Geist', 'Inter', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 32px);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface2: #F4F4F5;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --text: #09090B;
  --muted: #52525B;
  --faint: #6B6B74;
  --grid: rgba(9, 9, 11, 0.05);
  --track: #EEEEF0;
  --bar-muted: #B4B4BC;
  --ok: #15803D;
  --ok-soft: rgba(21, 128, 61, 0.10);
  --warn: #B45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --accent: #6D28D9;
  --accent-soft: rgba(109, 40, 217, 0.09);
  --glow: rgba(109, 40, 217, 0.16);
  --shadow: 0 40px 80px -40px rgba(9, 9, 11, 0.28);
}

/* ---------- Base ---------- */

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3, p, figure, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }
a:hover { opacity: 0.82; }

[hidden] { display: none !important; }

@keyframes flowY { from { background-position: 0 0; } to { background-position: 0 8px; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.eyebrow { margin-bottom: 14px; font-family: var(--mono); font-size: 13px; color: var(--accent); }

.section-title { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; font-weight: 600; letter-spacing: -0.035em; }

.section-lead { margin-top: 14px; max-width: 660px; font-size: 17px; color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-secondary { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.checks { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.checks li { display: flex; gap: 10px; }
.checks li::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: var(--accent);
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}

.dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 3px; }
.dot--backend { background: var(--text); }
.dot--ai { background: var(--accent); }
.dot--data { background: var(--ok); }
.dot--cloud { background: var(--warn); }
.dot--edge { background: var(--faint); }

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 2; border-bottom: 1px solid var(--border); background: var(--bg); }

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}

.logo { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}
.lang > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border-radius: 8px;
}
.lang a { color: var(--muted); text-decoration: none; }
.lang [aria-current] { background: var(--bg); box-shadow: 0 0 0 1px var(--border-strong); color: var(--text); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
/* Shows the theme the button switches to. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  margin-left: 8px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; }

.hero-grid,
.contact-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
}
.hero-grid {
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 45% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 45% at 50% 0%, #000 30%, transparent 78%);
}

.hero-glow,
.contact-glow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.hero-glow { top: -340px; width: 1200px; height: 680px; }

.hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter) clamp(64px, 8vw, 104px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-kicker { font-size: 16px; line-height: 1.5; letter-spacing: -0.005em; color: var(--muted); }
.hero-name { color: var(--text); font-weight: 500; }
.hero-sep { margin: 0 10px; color: var(--border-strong); }

.hero-title {
  margin-top: 28px;
  max-width: 1000px;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.hero-title span { color: var(--faint); }

.hero-lead { margin-top: 24px; max-width: 640px; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.55; color: var(--muted); }

.hero-meta { margin-top: 20px; font-family: var(--mono); font-size: 13px; color: var(--faint); }

.how { width: 100%; max-width: 1060px; margin-top: clamp(56px, 7vw, 88px); text-align: left; }
.how h2 { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); }
.how-lead { margin-top: 12px; max-width: 780px; font-size: 17px; line-height: 1.6; }
.how-note { margin-top: 8px; max-width: 780px; font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- "How I work" graph ---------- */

.graph {
  width: 100%;
  max-width: 1060px;
  margin-top: 24px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.graph-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.graph-dots { display: flex; gap: 6px; }
.graph-dots span { width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong); }

.graph-file {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}
.graph-status-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.graph[data-status="running"] .graph-status { background: var(--accent-soft); color: var(--accent); }
.graph[data-status="running"] .graph-status-dot { animation: pulse 1s ease-in-out infinite; }
.graph[data-status="paused"] .graph-status { background: var(--warn-soft); color: var(--warn); }

.graph-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 88px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.graph[data-status="running"] .graph-play .icon-play,
.graph:not([data-status="running"]) .graph-play .icon-stop { display: none; }

.graph-body { display: flex; flex-wrap: wrap; }

.graph-steps {
  flex: 1 1 340px;
  min-width: 0;
  padding: 26px 16px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease;
}
.graph-fan .node { padding: 0 12px; }
.node-num { font-size: 10px; color: var(--faint); }
.node-badge { min-width: 10px; color: var(--faint); }

.node[data-state="done"] .node-badge { color: var(--ok); }
.node[data-state="done"] .node-badge::before { content: "✓"; }
.node[data-state="run"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.node[data-state="run"] .node-badge { color: var(--accent); animation: pulse 1s ease-in-out infinite; }
.node[data-state="run"] .node-badge::before { content: "●"; }
.node[data-state="fail"] { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.node[data-state="fail"] .node-badge { color: var(--warn); }
.node[data-state="fail"] .node-badge::before { content: "↻"; }
.node[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--accent-soft); }
.node[aria-pressed="true"]:not([data-state="run"]):not([data-state="fail"]) { border-color: var(--accent); }

.edge { width: 2px; height: 18px; background: var(--border-strong); }
.edge--short { height: 14px; }
.edge.is-on {
  background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 8px);
  animation: flowY 0.5s linear infinite;
}

.bracket { width: 50%; height: 12px; border: 2px solid var(--border-strong); transition: border-color 200ms ease; }
.bracket--top { border-bottom: 0; border-radius: 8px 8px 0 0; }
.bracket--bottom { border-top: 0; border-radius: 0 0 8px 8px; }
.bracket.is-on { border-color: var(--accent); }

.graph-fan { display: flex; width: 100%; }
.graph-fan > div { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }

.graph-verify { position: relative; width: 100%; display: flex; justify-content: center; }

.graph-chip {
  padding: 2px 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  transition: all 200ms ease;
}
.graph-chip--retry { position: absolute; left: calc(50% + 66px); top: 50%; transform: translateY(-50%); }
.graph-chip--retry.is-on { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.graph-chip--loop { margin-top: 12px; }
.graph-chip--loop.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.graph-detail {
  flex: 999 1 440px;
  min-width: 0;
  min-height: 600px;
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
}

.step { flex: 1 1 auto; display: flex; flex-direction: column; gap: 16px; }
.step-meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.step h3 { margin-top: -6px; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; }
.step-desc { font-size: 16px; line-height: 1.55; color: var(--muted); }

.code {
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.graph-log {
  height: 132px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
}
.log-empty { color: var(--faint); }
.log-line { white-space: pre; color: var(--muted); }
.log-time { color: var(--faint); }
.log-fail { color: var(--warn); }
.log-ok { color: var(--ok); }
.log-done { color: var(--accent); }
.log-run { color: var(--faint); }

/* ---------- About ---------- */

.about { border-top: 1px solid var(--border); }
.about-inner { max-width: 1200px; margin: 0 auto; padding: clamp(80px, 10vw, 128px) var(--gutter) 0; }

.about-intro { display: flex; flex-wrap: wrap; gap: 24px 72px; }
.about-intro > :first-child { flex: 1 1 320px; min-width: 0; }
.about-text { flex: 999 1 560px; min-width: 0; }
.about-text p { font-size: 18px; line-height: 1.65; color: var(--muted); }
.about-text p + p { margin-top: 16px; }
.about-text strong { font-weight: inherit; color: var(--text); }

.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 56px; }
.card { flex: 1 1 300px; min-width: 0; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
}
.card-icon--ai { background: var(--accent-soft); color: var(--accent); }
.card-tag { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.card h3 { margin-top: 18px; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
.card p { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- Sections below the fold ---------- */

.section { max-width: 1200px; margin: 0 auto; padding: clamp(80px, 10vw, 128px) var(--gutter) 0; }

/* ---------- Work ---------- */

.work .section-title { max-width: 760px; }

.projects { display: flex; flex-direction: column; gap: 24px; margin-top: 48px; }

.project { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.project--reverse { flex-direction: row-reverse; }

.project-body { flex: 1 1 440px; min-width: 0; padding: clamp(24px, 3.5vw, 44px); }
.project-eyebrow { margin-bottom: 14px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.project h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; }
.project-desc { margin-top: 14px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.project-subhead { margin-top: 22px; font-size: 15px; font-weight: 500; }
.project .checks { margin-top: 12px; gap: 12px; line-height: 1.55; }
.project-desc + .checks { margin-top: 24px; }
.project .checks li { gap: 12px; }
.project .checks li::before { width: 18px; height: 18px; margin-top: 2px; }
.project .tags { margin-top: 28px; }

.project-visual { flex: 1 1 440px; min-width: 0; display: flex; align-items: center; padding: clamp(20px, 3vw, 40px); background: var(--surface2); }
.project-visual--stack { flex-direction: column; align-items: stretch; justify-content: center; gap: 16px; }

.terminal { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.terminal-head > :first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-ok { flex: 0 0 auto; padding: 1px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); font-size: 11px; }
.terminal-body {
  padding: 14px 16px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.95;
  white-space: nowrap;
  color: var(--muted);
}
.t-key { color: var(--faint); }
.t-event { color: var(--text); }
.t-warn { color: var(--warn); }
.t-ok { color: var(--ok); }
.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 6px;
  vertical-align: -2px;
  background: var(--accent);
  animation: pulse 1.2s steps(1) infinite;
}

.panel { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 18px 20px; }
.panel-label {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.bars-panel .panel-label { margin-bottom: 14px; }

.pipeline { margin-left: 13px; border-left: 1px dashed var(--border-strong); }
.pipeline li { display: flex; align-items: center; gap: 14px; margin-left: -13px; padding: 6px 0; }
.pipeline-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.pipeline li:last-child .pipeline-num { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pipeline-text { font-size: 14px; line-height: 1.4; }
.pipeline-text strong { font-weight: 500; }
.pipeline-text span { color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.bar-label { flex: 0 0 190px; font-size: 14px; color: var(--muted); }
.bar-label--strong { font-weight: 500; color: inherit; }
.bar { position: relative; flex: 1 1 120px; height: 10px; border-radius: 999px; background: var(--bar-muted); }
.bar--track { background: var(--track); }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; border-radius: 999px; background: var(--accent); }
.bar-value { flex: 0 0 56px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bar-value--accent { color: var(--accent); }

/* ---------- Stack ---------- */

.stack-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.stack-head > :first-child { flex: 1 1 480px; min-width: 0; }
.stack .section-title { max-width: 720px; }
.stack .section-lead { max-width: 640px; }
.stack-note { margin-top: 8px; max-width: 640px; font-size: 15px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.filter[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }

.stack-board { margin-top: 40px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.lanes { padding: 8px clamp(16px, 3vw, 32px); }
.lane { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.lane:last-child { border-bottom: 0; }
.lane-label {
  flex: 0 0 160px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.lane-label span + span { color: var(--muted); }
.lane-items { flex: 1 1 420px; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.tech {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.3;
  transition: opacity 200ms ease, background-color 200ms ease, border-color 200ms ease;
}
.tech-note { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* main.js sets data-filter on #stack; matching tools light up in the category colour, the rest fade. */
.stack[data-filter="backend"] { --hl: var(--text); --hl-soft: var(--surface2); }
.stack[data-filter="ai"] { --hl: var(--accent); --hl-soft: var(--accent-soft); }
.stack[data-filter="data"] { --hl: var(--ok); --hl-soft: var(--ok-soft); }
.stack[data-filter="cloud"] { --hl: var(--warn); --hl-soft: var(--warn-soft); }
.stack:not([data-filter="all"]) .tech { opacity: 0.4; }
.stack[data-filter="backend"] .tech[data-cats~="backend"],
.stack[data-filter="ai"] .tech[data-cats~="ai"],
.stack[data-filter="data"] .tech[data-cats~="data"],
.stack[data-filter="cloud"] .tech[data-cats~="cloud"] { opacity: 1; border-color: var(--hl); background: var(--hl-soft); }

.stack-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
  padding: 18px clamp(16px, 3vw, 32px);
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.stack-detail-label { flex: 0 0 160px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.stack-detail[data-for="backend"] .stack-detail-label { color: var(--text); }
.stack-detail[data-for="data"] .stack-detail-label { color: var(--ok); }
.stack-detail[data-for="cloud"] .stack-detail-label { color: var(--warn); }
.stack-detail-text { flex: 1 1 420px; min-width: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- Contact ---------- */

.contact { padding-bottom: clamp(80px, 10vw, 128px); }

.contact-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 48px);
  text-align: center;
}
.contact-grid {
  background-size: 40px 40px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 75%);
}
.contact-glow { bottom: -260px; width: 900px; height: 420px; }
.contact-inner { position: relative; }

.contact h2 { margin: 0 auto; max-width: 720px; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.04em; }
.contact-text { margin: 18px auto 0; max-width: 620px; font-size: 17px; color: var(--muted); }
.contact-text + .contact-text { margin-top: 12px; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 20px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
}
.contact-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.contact-links span { color: var(--border-strong); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  font-size: 14px;
  color: var(--faint);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }

/* ---------- English page ---------- */
/* The English copy is shorter, so its layout uses a bigger headline and slightly narrower text columns. */

.hero-title:lang(en) { font-size: clamp(38px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -0.045em; }
.hero-lead:lang(en) { max-width: 620px; }
.how-lead:lang(en),
.how-note:lang(en) { max-width: 760px; }
.graph-detail:lang(en) { min-height: 580px; }
.work .section-lead:lang(en) { max-width: 640px; }
.stack .section-lead:lang(en),
.stack-note:lang(en) { max-width: 620px; }
.bar-label:lang(en) { flex-basis: 112px; }
.bar:lang(en) { flex-basis: 160px; }
.contact-text:lang(en) { max-width: 580px; }
