:root {
  --bg: #0c0c0e;
  --bg-2: #121114;
  --panel: #151317;
  --line: rgba(216, 163, 84, 0.18);
  --line-strong: rgba(216, 163, 84, 0.4);
  --amber: #ffb000;
  --gold: #d8a354;
  --cream: #f3ead7;
  --text: #e9e2d3;
  --muted: #9c8f76;
  --green: #6fbf73;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 176, 0, 0.09), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, rgba(216, 163, 84, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
  z-index: 0;
}
a { color: inherit; }
::selection { background: rgba(255, 176, 0, .3); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--amber); color: #000; padding: 8px 12px; border-radius: 8px; }

.dim { color: var(--muted); }
.prompt, .ps { color: var(--green); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 18px 24px;
  backdrop-filter: blur(10px);
  background: linear-gradient(var(--bg), rgba(12, 12, 14, .75));
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { font: 600 15px var(--mono); text-decoration: none; color: var(--cream); }
.nav nav { display: flex; gap: 6px; }
.nav nav a {
  font: 14px var(--mono); color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav nav a:hover { color: var(--cream); background: rgba(255,255,255,.04); }
.nav .nav-cta { color: var(--amber); border: 1px solid var(--line-strong); }

main { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero > * { min-width: 0; }
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
  padding: 72px 0 96px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 13px var(--mono); color: var(--muted); letter-spacing: .02em; margin: 0 0 18px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(111, 191, 115, .6); animation: ping 2s infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(111,191,115,.55); } 100% { box-shadow: 0 0 0 10px rgba(111,191,115,0); } }

h1 {
  font: 700 clamp(44px, 7vw, 76px)/1.02 var(--sans);
  letter-spacing: -0.035em; margin: 0 0 20px; color: var(--cream);
}
.lede { font-size: clamp(17px, 2vw, 20px); color: #cfc5b0; max-width: 34em; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 14px var(--mono); text-decoration: none;
  padding: 12px 18px; border-radius: 10px;
  border: 1px solid var(--line-strong); color: var(--cream);
  transition: transform .15s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--amber); }
.btn-primary { background: var(--amber); color: #120d02; border-color: var(--amber); font-weight: 700; }
.btn-primary:hover { background: #ffc233; }
.btn-accent { color: var(--amber); border-color: var(--amber); font-weight: 700; }
.btn-accent:hover { background: rgba(255, 176, 0, .1); }

/* Terminal */
.terminal {
  background: rgba(21, 19, 23, .85);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.03);
  overflow: hidden; max-width: 560px;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e0614f; opacity: .85; }
.term-bar i:nth-child(2) { background: #e2a93b; }
.term-bar i:nth-child(3) { background: var(--green); }
.term-bar span { margin-left: auto; margin-right: auto; font: 12px var(--mono); color: var(--muted); transform: translateX(-20px); }
.term-body { padding: 16px 18px 18px; font: 14px/1.75 var(--mono); }
.term-body p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd { color: var(--amber); }
.out { color: var(--cream); padding-left: 1.4ch; opacity: 0; animation: show .01s var(--d) forwards; }
.line { width: 0; animation: type .55s steps(16, end) var(--d) forwards; }
.line { --full: calc(var(--w, 10ch) + 2ch); }
@keyframes type { to { width: var(--full); } }
@keyframes show { to { opacity: 1; } }
.cursor-line { width: auto; opacity: 0; animation: show .01s var(--d) forwards; }
.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -0.2em; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Board */
.board-wrap { margin: 0; position: relative; display: grid; justify-items: center; gap: 14px; }
.board-wrap::before {
  content: ""; position: absolute; inset: -10%;
  background: radial-gradient(circle, rgba(255,176,0,.14), transparent 62%);
  z-index: -1;
}
.board { width: 100%; max-width: 420px; height: auto; border-radius: 12px; box-shadow: 0 30px 60px -25px rgba(0,0,0,.85), 0 0 0 1px rgba(216,163,84,.25); }
/* The same board as morabaraba.dev: its surface, line and piece colours, and real vertex geometry. */
.board .surface { fill: #efe6d4; }
.board .lines { fill: none; stroke: #4a3b2a; stroke-width: 6; }
.board .dots circle { fill: #4a3b2a; }
.board .p { stroke: #2c2118; stroke-width: 5; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: drop .35s cubic-bezier(.2,1.4,.4,1) var(--d) forwards; }
.board .p.r { fill: #c0392b; }
.board .p.b { fill: #2980b9; }
@keyframes drop { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: scale(1); } }
.board .mill-ring { fill: none; stroke: #f1c40f; stroke-width: 8; opacity: 0; animation: glow 1.6s ease-in-out 4.6s infinite; }
@keyframes glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.board-wrap figcaption { font: 12px var(--mono); color: var(--muted); opacity: 0; animation: show .01s 5s forwards; }
.board-wrap figcaption a { color: var(--gold); text-decoration: none; }
.board-wrap figcaption a:hover { color: var(--amber); }

/* Sections */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 36px; }
.kicker { font: 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
h2 { font: 700 clamp(30px, 4vw, 42px)/1.1 var(--sans); letter-spacing: -0.025em; margin: 0; color: var(--cream); }
h3 { font: 650 21px/1.3 var(--sans); letter-spacing: -0.01em; margin: 0; color: var(--cream); }
.section-note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Products */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product, .project {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: border-color .25s, transform .25s;
}
.product:hover, .project:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.product p { color: #cfc5b0; margin: 14px 0 0; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product .product-proof { font: 13px var(--mono); color: var(--gold); margin-top: 18px; }
.badge { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge-live { color: var(--green); border-color: rgba(111,191,115,.4); }
.badge-live::before { content: "● "; }
.arrow-link {
  display: inline-block; margin-top: 18px;
  font: 14px var(--mono); color: var(--amber); text-decoration: none;
}
.arrow-link::after { content: "→"; display: inline-block; margin-left: .45em; transition: transform .2s; }
.arrow-link:hover::after { transform: translateX(4px); }
.project-head .arrow-link { margin-top: 0; }
.product .product-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 28px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stat dd { margin: 0; font: 700 clamp(30px, 4vw, 44px)/1 var(--sans); letter-spacing: -0.03em; color: var(--amber); font-variant-numeric: tabular-nums; }
.stat dt { color: var(--muted); font-size: 14px; }

/* Projects */
.project-feature { margin-bottom: 20px; padding: 32px; }
.project-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.project p { color: #cfc5b0; margin: 14px 0 0; }
.points { margin: 18px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.points li { position: relative; padding-left: 20px; color: #cfc5b0; font-size: 15px; }
.points li::before { content: "›"; position: absolute; left: 0; color: var(--amber); font-family: var(--mono); }
.points b, .principles b { color: var(--cream); font-weight: 600; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px !important; }
.tags span { font: 12px var(--mono); color: var(--gold); padding: 4px 10px; border-radius: 6px; background: rgba(216,163,84,.08); border: 1px solid rgba(216,163,84,.15); }

/* Stack & principles */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.stack { margin: 0; display: grid; gap: 18px; }
.stack div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.stack dt { font: 13px var(--mono); color: var(--gold); padding-top: 2px; }
.stack dd { margin: 0; color: #cfc5b0; }
.principles { margin: 0; padding: 0; list-style: none; counter-reset: p; display: grid; gap: 16px; }
.principles li { counter-increment: p; position: relative; padding: 18px 18px 18px 58px; border: 1px solid var(--line); border-radius: 12px; color: #cfc5b0; background: rgba(255,255,255,.015); }
.principles li::before { content: "0" counter(p); position: absolute; left: 18px; top: 18px; font: 13px var(--mono); color: var(--amber); }

/* Contact */
.contact { text-align: center; padding: 110px 0 120px; }
.contact .lede { margin: 16px auto 32px; }
.big-mail {
  display: inline-block; font: 600 clamp(20px, 4vw, 38px) var(--mono); color: var(--amber);
  text-decoration: none; letter-spacing: -0.02em;
  background: linear-gradient(var(--amber), var(--amber)) 0 100% / 0 2px no-repeat;
  transition: background-size .35s; padding-bottom: 4px; word-break: break-all;
}
.big-mail:hover { background-size: 100% 2px; }
.contact-links { display: flex; justify-content: center; gap: 28px; margin-top: 32px; }
.contact-links a { font: 14px var(--mono); color: var(--muted); text-decoration: none; }
.contact-links a:hover { color: var(--cream); }

.footer {
  position: relative; z-index: 1;
  max-width: var(--max); margin: 0 auto; padding: 28px 24px 40px;
  display: flex; justify-content: space-between; font: 13px var(--mono); color: var(--muted);
  border-top: 1px solid var(--line);
}

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 48px 0 72px; }
  .board-wrap { order: -1; }
  .board { max-width: 260px; }
  .products, .project-grid, .split, .points { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .split { gap: 72px; }
}
@media (max-width: 560px) {
  .nav { padding: 14px 16px; }
  .nav nav a:not(.nav-cta) { display: none; }
  main { padding: 0 16px; }
  .stat { padding: 20px; }
  .product, .project, .project-feature { padding: 22px; }
  .stack div { grid-template-columns: 1fr; gap: 4px; }
  .term-body { font-size: 12.5px; padding: 14px; }
  .term-body .out { white-space: normal; }
  .footer { padding: 24px 16px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .line { width: auto; }
  .board .mill-ring { opacity: 1; }
}
