/* =========================================================
   SITEGEN v3 — "the page builds itself"
   dark engineering canvas · blueprint guides · agent swarm
   grid 12 · 4pt spacing · Geist / Geist Mono
   ========================================================= */
:root {
  /* ---- colour system (OKLCH, hex fallback) ----------------------------
     60  cool graphite ground   hue 265, chroma ~0.01, L 15-24%
     30  warm paper ink         hue 85 on a cool ground = temperature contrast
     10  two accents, one job each (near-complementary, 214 deg apart):
         signal blue  = the machine: guides, selection, focus, progress
         ember orange = the human: the one primary action per screen
     red is reserved for the measuring guide, as in design tools
     ------------------------------------------------------------------- */
  --bg: #0b0c10;          /* oklch(15.5% 0.008 265) */
  --bg-2: #131519;        /* oklch(19.5% 0.009 265) */
  --raised: #1c1e23;      /* oklch(23.5% 0.010 265) */
  --line: rgba(246, 243, 236, 0.09);
  --line-2: rgba(246, 243, 236, 0.16);
  --ink: #f6f3ec;         /* oklch(96.5% 0.010 85)  17.6:1 on bg */
  --mute: #b4b7bf;        /* oklch(78% 0.012 265)   9.7:1 */
  --dim: #8f929a;         /* oklch(66% 0.012 265)   6.3:1 */
  --blue: #3075fe;        /* oklch(60% 0.215 262)   4.75:1, UI only */
  --blue-text: #76a6ff;   /* oklch(73% 0.14 262)    8.1:1, small text */
  --blue-soft: rgba(48, 117, 254, 0.16);
  --orange: #ff7716;      /* oklch(72% 0.19 48)     7.4:1 */
  --orange-hi: #ff9845;   /* oklch(78% 0.16 55) */
  --red: #f53c41;         /* oklch(64% 0.22 25) */
  --on-accent: #0b0c10;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px; --s10: 160px;
  --pad: clamp(16px, 5vw, 96px);
  --gut: clamp(12px, 1.6vw, 24px);
  --max: 1440px;
  --header: 64px;

  --f: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.35, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* faint construction grid — the page is a drawing board */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 85%);
  z-index: 0;
}
main, .top, .foot { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow--accent { color: var(--orange); }
.h1 {
  font-size: clamp(48px, 6.2vw, 104px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
}
.h2 {
  font-size: clamp(38px, 4.8vw, 76px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.h3 {
  font-size: clamp(40px, 5vw, 80px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.dim { color: var(--dim); }
.lead { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.45; color: var(--mute); max-width: 44ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 var(--s5);
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { background: var(--blue); color: #fff; }
.btn--sm { height: 36px; padding: 0 var(--s4); font-size: 13px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header);
  padding-inline: var(--pad);
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; min-height: 44px; gap: var(--s2); font-weight: 600; font-size: 17px; letter-spacing: -0.04em; }
.logo-sq { width: 18px; height: 18px; border-radius: 5px; background: var(--ink); position: relative; }
.logo-sq::after { content: ""; position: absolute; left: 5px; top: 4px; border-left: 8px solid var(--bg); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transform: rotate(-30deg); }
.nav { display: flex; gap: var(--s1); }
.nav a { padding: 8px 12px; border-radius: 6px; font-size: 14px; color: var(--mute); transition: color 0.25s, background 0.25s; }
.nav a:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.top .btn { justify-self: end; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gut);
  min-height: calc(100svh - var(--header));
  padding-top: var(--s8);
  padding-bottom: var(--s5);
  align-content: space-between;
}
.hero-copy { grid-column: 1 / span 6; grid-row: 1; display: grid; gap: var(--s5); align-content: start; }
.hero .lead { margin-top: var(--s2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.hero .plan--hero { grid-column: 9 / -1; grid-row: 1; align-self: center; }
.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gut);
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin-top: var(--s3); font-size: clamp(32px, 3.4vw, 52px); font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.work { padding-block: var(--s10) var(--s8); }
.sec-head { display: grid; gap: var(--s5); max-width: 720px; margin-bottom: var(--s9); }
.sec-note { color: var(--mute); max-width: 52ch; }

.case {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gut);
  align-items: center;
  padding-block: var(--s8);
  border-top: 1px solid var(--line);
}
.case-copy { grid-column: 1 / span 5; display: grid; gap: var(--s4); }
.case-copy > p:not(.eyebrow) { color: var(--mute); max-width: 42ch; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.tags li { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; padding: 6px 10px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--mute); }

/* blueprint of a generated site */
.plan {
  grid-column: 7 / -1;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background:
    linear-gradient(to right, rgba(47,107,255,0.08) 1px, transparent 1px) 0 0 / 8.333% 100%,
    var(--bg-2);
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, 0.35);
  overflow: hidden;
}
.plan i { position: absolute; border: 1px solid rgba(47, 107, 255, 0.75); background: rgba(47, 107, 255, 0.07); border-radius: 3px; transition: transform 0.9s var(--ease); }
.pl-nav { left: 4%; right: 4%; top: 5%; height: 6%; }
.pl-hero { left: 4%; top: 18%; width: 44%; height: 36%; }
.pl-hero--right { left: auto; right: 4%; }
.pl-obj { right: 8%; top: 20%; width: 34%; height: 52%; border-radius: 50% !important; }
.pl-obj--quiet { width: 18%; height: 28%; right: 18%; top: 30%; }
.pl-row { left: 4%; right: 4%; bottom: 7%; height: 14%; }
.pl-grid { left: 4%; right: 50%; bottom: 7%; height: 26%; background-image: linear-gradient(to right, rgba(47,107,255,.7) 1px, transparent 1px) !important; background-size: 25% 100% !important; }
.pl-depth { left: 10%; top: 22%; width: 52%; height: 50%; }
.pl-depth--2 { left: 22%; top: 30%; opacity: 0.7; }
.pl-depth--3 { left: 34%; top: 38%; opacity: 0.45; }
.pl-bar { left: 4%; top: 60%; width: 28%; height: 5%; }
.pl-bar--accent { border-color: var(--orange) !important; background: rgba(255, 107, 26, 0.85) !important; }
.pl-bar--low { top: auto; bottom: 38%; left: 54%; width: 22%; }
.pl-bar--mid { top: 80%; left: 62%; width: 30%; }
.case:hover .plan i { transform: translate(var(--dx, 0), var(--dy, 0)); }
.case:hover .pl-depth--2 { --dx: 10px; --dy: 6px; }
.case:hover .pl-depth--3 { --dx: 20px; --dy: 12px; }
.case:hover .pl-obj { --dy: -6px; }

.how { padding-block: var(--s9); border-top: 1px solid var(--line); }
.how .h2 { max-width: 15ch; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gut); margin-top: var(--s8); }
.cols > div { display: grid; gap: var(--s3); align-content: start; padding-top: var(--s5); border-top: 1px solid var(--line-2); }
.cols h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.cols p { color: var(--mute); max-width: 36ch; }
.num { font-family: var(--mono); font-size: 11px; color: #6f97ff; letter-spacing: 0.06em; }

.brief {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s6) var(--gut);
  align-items: end;
  padding-block: var(--s9);
  border-top: 1px solid var(--line);
}
.brief-copy { grid-column: 1 / span 7; display: grid; gap: var(--s5); }
.brief-form { grid-column: 8 / -1; display: grid; grid-template-columns: 1fr auto; gap: var(--s2); }
.brief-form input {
  height: 52px;
  padding: 0 var(--s4);
  border: 0;
  border-radius: 8px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 15px;
  min-width: 0;
  transition: box-shadow 0.3s var(--ease);
}
.brief-form input::placeholder { color: var(--dim); }
.brief-form input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 4px var(--blue-soft); }
.brief-form .btn { height: 52px; }
.brief-out { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.brief-out a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }

.foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s6) var(--gut);
  padding-block: var(--s8) calc(var(--s10) - var(--s4));
  border-top: 1px solid var(--line);
}
.foot > div { grid-column: span 2; display: grid; gap: var(--s2); align-content: start; font-size: 14px; }
.foot .foot-brand { grid-column: 1 / span 5; }
.foot-brand p { color: var(--mute); max-width: 32ch; margin-top: var(--s2); }
.foot h4 { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-bottom: var(--s2); }
.foot a:not(.logo) { color: var(--mute); transition: color 0.2s; justify-self: start; }
.foot a:not(.logo):hover { color: var(--ink); }
.foot-legal { grid-column: 1 / -1; font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* =========================================================
   build-state: elements start as wireframe, agents build them
   ========================================================= */
/* nothing exists until an agent drags its frame out; content shows only inside the frame */
.js [data-scan].is-wire { opacity: 0; clip-path: inset(0 100% 100% 0); }
.js [data-scan].is-building { opacity: 1; }
.js [data-scan].is-pop { animation: pop 0.5s var(--ease); }
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }

#agents { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.marks { position: absolute; left: 0; top: 0; width: 100%; height: 0; pointer-events: none; z-index: 39; }
.mk {
  position: absolute;
  border: 1px solid var(--blue);
  background: rgba(47, 107, 255, 0.06);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.mk.is-on { opacity: 1; }
.mk i { position: absolute; width: 6px; height: 6px; background: var(--bg); border: 1px solid var(--blue); }
.mk i:nth-child(1) { left: -4px; top: -4px; }
.mk i:nth-child(2) { right: -4px; top: -4px; }
.mk i:nth-child(3) { left: -4px; bottom: -4px; }
.mk i:nth-child(4) { right: -4px; bottom: -4px; }
.mk b {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 4px);
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font: 500 10px/1.4 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s3);
  height: 40px;
  padding: 0 6px 0 14px;
  border-radius: 10px;
  background: rgba(20, 20, 23, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px -20px rgba(0,0,0,.8);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
}
.hud b { color: var(--ink); font-weight: 500; }
.hud-dots { display: inline-flex; gap: 3px; }
.hud-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.hud-dots i:nth-child(2) { background: var(--blue); }
.hud-dots i:nth-child(3) { background: #3ddc97; }
.hud-state { color: #6f97ff; min-width: 9ch; }
.hud button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}
.hud button:hover { background: var(--blue); }

/* ---------- boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.boot-mark { width: 40px; height: 40px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg-2); position: relative; }
.boot-mark::after { content: ""; position: absolute; inset: 12px; border-radius: 3px; background: var(--ink); clip-path: polygon(0 0, 100% 60%, 55% 70%, 35% 100%); }
.is-booted .boot { opacity: 0; visibility: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .top { grid-template-columns: 1fr auto; }
  .hero-copy { grid-column: 1 / -1; grid-row: 2; }
  .hero .plan--hero { grid-column: 1 / -1; grid-row: 1; margin-bottom: var(--s6); }
  .hero { padding-top: var(--s5); }
  .stats { grid-row: 3; grid-template-columns: repeat(2, 1fr); row-gap: var(--s5); }
  .case-copy, .plan { grid-column: 1 / -1; }
  .cols { grid-template-columns: 1fr; }
  .brief-copy, .brief-form { grid-column: 1 / -1; }
  .foot > div { grid-column: span 6; }
  .foot .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .hud .hud-state, .hud #hud-pause { display: none; }
  .brief-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- team ---------- */
.team { padding-block: var(--s9); border-top: 1px solid var(--line); }
.team-head { display: grid; gap: var(--s5); max-width: 760px; margin-bottom: var(--s8); }
.crew { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.crew li {
  display: grid;
  grid-template-columns: 48px minmax(0, 4fr) minmax(0, 3fr) minmax(0, 5fr);
  gap: var(--gut);
  align-items: baseline;
  padding-block: var(--s5);
  border-bottom: 1px solid var(--line);
}
.crew a { font-size: clamp(24px, 2.4vw, 36px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; transition: color 0.25s; }
.crew a:hover { color: var(--blue); }
.crew .role { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); }
.crew p { color: var(--mute); max-width: 44ch; }
.team-note { margin-top: var(--s5); font-family: var(--mono); font-size: 11px; color: var(--dim); }
@media (max-width: 760px) {
  .crew li { grid-template-columns: 32px 1fr; row-gap: var(--s2); }
  .crew .role, .crew p { grid-column: 2; }
}


/* ---------- review fixes (taste-skill checker) ---------- */
/* one vertical rhythm between sections */
.work, .how, .proto, .team, .brief { padding-block: var(--s9); }
.foot { padding-top: var(--s5); }
/* visible label for the brief field */
.brief-label { grid-column: 1 / -1; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
/* keyboard focus inside clipped windows must stay visible */
.appwin :focus-visible, .shot :focus-visible { outline-offset: -3px; }
@media (max-width: 760px) {
  .top .btn--sm { min-height: 44px; }
  .hud button { height: 36px; min-width: 44px; }
  .hud { height: 48px; }
  .nav a, .foot a:not(.logo), .crew a { min-height: 44px; display: inline-flex; align-items: center; }
}
