/* Commonplace site. No web fonts, no third-party anything. */

:root {
  --bg: #0b0c0b;
  --surface: #161816;
  --surface-2: #202320;
  --ink: #e8e9e5;
  --muted: #a3a69c;
  --accent: #f7941d;
  --accent-ink: #0b0c0b;
  --paper: #d9dbd6;
  --paper-ink: #0b0c0b;
  --ok: #7fd18b;
  --wait: #5a5e57;

  /* Look B is monospace by decision (PRODUCT-DESIGN §16). taste-skill-ignore */
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;

  --step-small: 0.9375rem;
  --step-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-head: clamp(2rem, 1.2rem + 3vw, 4rem);
  --step-display: clamp(3rem, 7vw, 8rem);

  --m: 20px;
  --gap: 8px;
  --pad: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 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: 400 var(--step-body)/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ul, ol, pre, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
pre, code { font-family: var(--mono); }

h1, h2 { font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.board { display: grid; gap: var(--gap); padding: 0 var(--m); }
.tile { background: var(--surface); padding: var(--pad); min-width: 0; }
.section { margin-top: 144px; }

/* Buttons: square, one fill. */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  background: var(--accent); color: var(--accent-ink);
  font: 700 var(--step-body)/1 var(--mono);
  padding: 16px 20px; border: 0; cursor: pointer; text-decoration: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.btn:hover { background: #ffa83f; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.on-accent { background: var(--accent-ink); color: var(--accent); }
.btn.on-accent:hover { background: #262926; }

/* ---------- Top row ---------- */
.top {
  grid-template-columns: 60px 1fr auto;
  padding-top: var(--m);
  height: calc(60px + var(--m));
}
.top > * { padding: 0; display: flex; align-items: center; }
.mark { background: var(--accent); justify-content: center; }
.mark svg { width: 28px; height: 28px; }
.nav { gap: 28px; padding: 0 24px; padding-left: calc(50% - 68px); }
.nav a { text-decoration: none; color: var(--ink); font-size: var(--step-small); }
.nav a:hover { color: var(--accent); }
.top .act { background: var(--ink); color: var(--bg); padding: 0 24px; font-weight: 700; text-decoration: none; font-size: var(--step-small); transition: background-color 160ms; }
.top .act:hover { background: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  padding-top: var(--gap);
  min-height: calc(100svh - 60px - var(--m) - var(--gap));
}
.name { display: flex; flex-direction: column; justify-content: flex-end; gap: 32px; background: var(--surface); }
.name h1 { font-size: var(--step-display); letter-spacing: -0.06em; line-height: 0.9; }
.name p { font-size: var(--step-lead); line-height: 1.3; max-width: 26ch; }
.hero .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.hero .pair .tile { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; font-size: var(--step-lead); line-height: 1.25; }
.hero .first { background: var(--surface-2); }
.hero .go { background: var(--accent); color: var(--accent-ink); }
.hero .go p { font-weight: 700; }

/* Terminal: the live thing. */
.term { grid-row: 1 / 3; grid-column: 2; background: #050605; padding: 0; display: flex; flex-direction: column; min-height: 560px; }
.term [role="tablist"] { display: flex; gap: 4px; padding: 8px; background: var(--surface); flex-wrap: wrap; }
.term [role="tab"] {
  font: 500 var(--step-small)/1 var(--mono); color: var(--muted);
  background: transparent; border: 0; padding: 12px 14px; cursor: pointer;
  transition: background-color 140ms, color 140ms;
}
.term [role="tab"]:hover { color: var(--ink); background: var(--surface-2); }
.term [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); }
.term .screen { flex: 1; overflow: hidden; padding: 32px 32px 36px; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.65; }
.term pre { white-space: pre-wrap; word-break: break-word; }
.term [hidden] { display: none; }
.term .p { color: var(--accent); }
.term .dim { color: var(--muted); }
.term .ok { color: var(--ok); }
.term .you { color: var(--ink); font-weight: 700; }
.term .hit { display: block; background: var(--surface); color: var(--ink); padding: 14px 16px; margin: 6px 0 4px; }
.term .stamp { display: block; color: var(--accent); }
.term .line { display: block; }
.js .term .line { opacity: 0; transform: translateY(4px); }
.js .term .line.shown { opacity: 1; transform: none; transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.term .cursor { display: inline-block; width: 0.6em; height: 1.1em; background: var(--accent); vertical-align: -0.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Steps bar ---------- */
.steps h2 { margin: 0 var(--m) 64px; }
.bar { display: flex; gap: 6px; padding: 0 var(--m); }
.bar li { display: flex; flex-direction: column; gap: 14px; min-width: 12%; }
.bar .seg { min-height: 22vh; padding: 20px; font-size: clamp(20px, 2vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.bar li:nth-child(1) { flex: 1; }
.bar li:nth-child(2) { flex: 1.6; }
.bar li:nth-child(3) { flex: 4; }
.bar li:nth-child(1) .seg { background: var(--paper); color: var(--paper-ink); }
.bar li:nth-child(2) .seg { background: var(--surface-2); }
.bar li:nth-child(3) .seg { background: var(--accent); color: var(--accent-ink); }
.bar li > p { max-width: 34ch; }
.bar code { display: block; margin-top: 6px; color: var(--muted); font-size: var(--step-small); word-break: break-all; }

/* ---------- Close-ups board ---------- */
.close { grid-template-columns: repeat(12, 1fr); grid-auto-rows: 104px; grid-auto-flow: dense; }
.close .tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; }
.close .t64 { grid-column: span 6; grid-row: span 4; }
.close .t62 { grid-column: span 6; grid-row: span 2; }
.close .t34 { grid-column: span 3; grid-row: span 4; }
.close .t32 { grid-column: span 3; grid-row: span 2; }
.close .head { justify-content: flex-start; background: var(--bg); padding-left: 0; }
.close .cap { position: relative; z-index: 1; background: inherit; padding-top: 10px; }
.close .cap b { display: block; font-size: 18px; font-weight: 700; }
.close .cap span { display: block; font-size: 16px; color: var(--muted); }
.close .acc .cap span, .close .lite .cap span { color: inherit; opacity: 0.75; }
.close .acc { background: var(--accent); color: var(--accent-ink); }
.close .lite { background: var(--paper); color: var(--paper-ink); }
.close .alt { background: var(--surface-2); }
.zoom { position: absolute; font-size: var(--z, 2.4em); line-height: 1.25; white-space: nowrap; }
.chip { display: inline-block; padding: 0.15em 0.45em; margin: 0 0.15em 0.2em 0; background: var(--bg); color: var(--ink); }
.chip.off { background: transparent; color: var(--wait); text-decoration: line-through; }
.lite .chip { background: var(--paper-ink); color: var(--paper); }
.toggle { display: inline-block; width: 2.2em; height: 1.2em; background: var(--wait); position: relative; vertical-align: -0.2em; margin-right: 0.4em; }
.toggle::after { content: ""; position: absolute; top: 0.15em; left: 0.15em; width: 0.9em; height: 0.9em; background: var(--ink); }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 1.15em; background: var(--bg); }
.tier { display: block; padding: 0.2em 0.5em; margin-bottom: 0.18em; }

/* ---------- Agent board ---------- */
.agents h2 { margin: 0 var(--m) 48px; }
.rows { padding: 0 var(--m); display: flex; flex-direction: column; gap: 4px; }
.row {
  display: grid; grid-template-columns: 5fr 2fr 3fr 2fr; align-items: center; gap: 16px;
  width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink);
  font: 500 clamp(18px, 1.9vw, 28px)/1.1 var(--mono); letter-spacing: -0.02em;
  min-height: 72px; padding: 0 0 0 20px;
  transition: background-color 160ms;
}
.row:hover { background: var(--surface-2); }
.row .f { font-size: var(--step-small); color: var(--muted); letter-spacing: 0; }
.row .s { align-self: stretch; display: flex; align-items: center; padding: 0 20px; font-size: var(--step-small); font-weight: 700; letter-spacing: 0; background: var(--ok); color: var(--bg); }
.row .s.later { background: var(--wait); color: var(--ink); }
.row[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); min-height: 216px; align-items: start; padding-top: 24px; }
.row[aria-expanded="true"] .f { color: var(--accent-ink); }
.row[aria-expanded="true"] .s { align-self: start; margin-top: -24px; height: 72px; }
.row .more { display: none; grid-column: 1 / -1; font-size: 17px; line-height: 1.5; letter-spacing: 0; font-weight: 400; max-width: 70ch; padding-bottom: 24px; }
.row[aria-expanded="true"] .more { display: block; }

/* ---------- Modules ---------- */
.modules .headrow { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 var(--m) 56px; }
.modules h2 .soft { color: var(--muted); display: block; }
.mods { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 0 var(--m); }
.mods [role="tablist"] { display: flex; flex-direction: column; gap: 6px; }
.mods [role="tab"] {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 72px; padding: 0 16px;
  text-align: left; border: 0; cursor: pointer; background: var(--surface); color: var(--ink);
  font: 700 16px/1.1 var(--mono); transition: background-color 140ms;
}
.mods [role="tab"] span { font-size: 14px; font-weight: 400; color: var(--muted); }
.mods [role="tab"]:hover { background: var(--surface-2); }
.mods [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); }
.mods [role="tab"][aria-selected="true"] span { color: var(--bg); opacity: 0.7; }
.mods [role="tabpanel"] { display: flex; flex-direction: column; gap: 4px; }
.mods [role="tabpanel"][hidden] { display: none; }
.band { display: grid; grid-template-columns: minmax(180px, 26%) 1fr; gap: 20px; align-items: center; min-height: 76px; padding: 14px 20px; background: var(--surface); }
.band:nth-child(even) { background: var(--surface-2); }
.band code { font-size: 17px; font-weight: 700; color: var(--accent); }

/* ---------- Action row ---------- */
.cta { grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding: 0; }
.cta > div { min-height: 360px; }
.cta .l, .cta .r { overflow: hidden; padding: 28px 0 0; font-size: clamp(22px, 2.2vw, 34px); font-weight: 700; line-height: 1.25; letter-spacing: -0.03em; }
.cta .l { grid-column: 1 / 3; background: var(--surface-2); color: var(--muted); text-align: right; padding-right: 20px; }
.cta .r { grid-column: 11 / 13; background: var(--paper); color: var(--paper-ink); padding-left: 20px; }
.cta .c { grid-column: 3 / 11; background: var(--accent); color: var(--accent-ink); padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.cta h2 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); }
.cmd { display: flex; align-items: stretch; background: var(--accent-ink); color: var(--ink); max-width: 100%; }
.cmd code { flex: 1; padding: 16px 18px; font-size: 15px; overflow-x: auto; white-space: nowrap; }
.cmd .btn { flex: none; }
.cta .c > p { max-width: 60ch; }
.cta .links { display: flex; gap: 28px; flex-wrap: wrap; font-weight: 700; }

/* ---------- Footer ---------- */
.foot { margin-top: 144px; background: var(--surface); padding: 48px var(--m) var(--m); }
.blocks { display: flex; gap: 4px; align-items: flex-end; height: 30svh; min-height: 200px; }
.blocks span {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  font-weight: 700; font-size: clamp(28px, 6vw, 96px); line-height: 0.8; padding-top: 0.16em;
  background: var(--paper); color: var(--surface);
}
.blocks span::after { content: attr(data-l); }
.blocks span:nth-child(3n+2) { background: var(--accent); }
.blocks span:nth-child(4n+3) { background: var(--surface-2); color: var(--ink); }
.foot .cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: 56px; font-size: 16px; }
.foot .cols ul { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; }
.foot .cols .contact { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 10px; }
.foot .cols a { text-decoration: none; }
.foot .cols a:hover { color: var(--accent); }
.foot .last { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
.foot .last .btn { padding: 12px 16px; font-size: var(--step-small); }

/* ---------- Connect page ---------- */
.guide-head { grid-template-columns: 1fr 1fr; padding-top: var(--gap); }
.guide-head .tile { min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.guide-head h1 { font-size: var(--step-head); }
.guide-head .jump { background: var(--surface-2); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
.guide-head .jump a { background: var(--surface); display: flex; align-items: flex-end; padding: 16px; font-weight: 700; text-decoration: none; transition: background-color 140ms; }
.guide-head .jump a:hover { background: var(--accent); color: var(--accent-ink); }
.client { display: grid; grid-template-columns: 4fr 8fr; gap: var(--gap); padding: 0 var(--m); margin-top: 120px; scroll-margin-top: 24px; }
.client .tile { display: flex; flex-direction: column; gap: 20px; }
.client .tile:first-child { justify-content: space-between; }
.client .how { background: var(--surface-2); }
.client pre { background: #050605; padding: 20px; font-size: 14px; line-height: 1.6; overflow-x: auto; }
.client pre + p { margin-top: -4px; }
.client .tile > p { max-width: 62ch; }

/* ---------- Entrances ---------- */
.js .rise { opacity: 0; transform: translateY(24px); }
.js .rise.in { opacity: 1; transform: none; transition: opacity 600ms var(--ease), transform 600ms var(--ease); transition-delay: var(--d, 0ms); }
.js .shutter { clip-path: inset(0 0 100% 0); }
.js .shutter.in { clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease); }
.js .shutter .screen { transform: scale(1.06); transform-origin: top left; }
.js .shutter.in .screen { transform: none; transition: transform 1.1s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise, .js .shutter, .js .shutter .screen, .js .term .line { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .term .cursor { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; }
  .term { grid-row: auto; grid-column: auto; min-height: 520px; }
  .name { min-height: 46svh; }
  .close { grid-template-columns: repeat(6, 1fr); }
  .close .t64 { grid-column: span 6; }
  .close .t62 { grid-column: span 6; }
  .close .t34, .close .t32 { grid-column: span 3; }
  .nav { padding-left: 24px; }
  .row { grid-template-columns: 4fr 3fr 2fr; }
  .row .f.conn { display: none; }
  .client { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
@media (max-width: 700px) {
  :root { --m: 16px; --gap: 6px; --pad: 20px; }
  .section { margin-top: 112px; }
  .top { grid-template-columns: 52px 1fr; height: calc(52px + var(--m)); }
  .nav { display: none; }
  .top .act { justify-content: flex-end; }
  .name { min-height: 34svh; }
  .name h1 { font-size: 12.5vw; }
  .hero .pair .tile { min-height: 180px; font-size: 18px; }
  .term .screen { padding: 20px 16px; font-size: 13px; }
  .term [role="tab"] { padding: 12px 10px; }
  .steps h2, .agents h2 { margin-bottom: 40px; }
  .bar { flex-direction: column; }
  .bar li { min-width: 0; }
  .bar .seg { min-height: 0; font-size: 22px; }
  .bar li:nth-child(1) .seg { height: 96px; }
  .bar li:nth-child(2) .seg { height: 140px; }
  .bar li:nth-child(3) .seg { height: 200px; }
  .bar li > p { margin-bottom: 18px; }
  .close { grid-template-columns: 1fr 1fr; grid-auto-rows: 28vw; }
  .close .t64, .close .t62 { grid-column: span 2; grid-row: span 3; }
  .close .t34, .close .t32 { grid-column: span 1; grid-row: span 3; }
  .close .head { grid-column: span 2; grid-row: span 1; }
  .close .wide-phone { grid-column: span 2; grid-row: span 2; }
  .close .cap b { font-size: 16px; }
  .close .cap span { font-size: 15px; }
  .zoom { font-size: calc(var(--z, 2.4em) * 0.6); }
  .rows { padding: 0 var(--m); }
  .row { grid-template-columns: 1fr auto; min-height: 64px; font-size: 20px; }
  .row .f { display: none; }
  .row[aria-expanded="true"] { min-height: 200px; }
  .row > span:first-child { grid-column: 1; grid-row: 1; }
  .row .s { grid-column: 2; grid-row: 1; }
  .row[aria-expanded="true"] .s { margin-top: -24px; height: 64px; }
  .row[aria-expanded="true"] .f { display: block; grid-column: 1 / -1; font-size: 16px; }
  .modules .headrow { flex-direction: column; align-items: stretch; }
  .modules .headrow .btn { justify-content: center; }
  .mods { grid-template-columns: 1fr; gap: 20px; }
  .mods [role="tablist"] { flex-direction: row; position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 6px 0; }
  .mods [role="tab"] { flex: 1; padding: 0 10px; min-height: 64px; }
  .band { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .cta { grid-template-columns: 1fr 1fr; gap: var(--gap); padding: 0 var(--m); }
  .cta .c { grid-column: 1 / 3; order: -1; min-height: 300px; padding: 24px; }
  .cta .l, .cta .r { grid-column: auto; min-height: 0; height: 160px; font-size: 20px; padding-top: 16px; }
  .cmd { flex-direction: column; }
  .blocks { height: auto; min-height: 0; flex-wrap: wrap; }
  .blocks span { flex: 1 0 calc((100% - 20px) / 6); height: 72px !important; font-size: 9vw; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .foot .cols ul, .foot .cols .contact { grid-column: auto; }
  .foot .cols .contact { grid-column: 1 / 3; }
  .guide-head, .client { grid-template-columns: 1fr; }
  .client { margin-top: 80px; }
  .client pre, .guide-head .env { white-space: pre-wrap; word-break: break-all; }
  .guide-head .tile { min-height: 220px; }
}

.guide-head .env { margin-top: 28px; background: #050605; padding: 18px 20px; font-size: 15px; line-height: 1.6; overflow-x: auto; }

/* Without script: every module and agent detail shows; the terminal shows its first pane. */
html:not(.js) .mods [role="tabpanel"][hidden] { display: flex; }
html:not(.js) .mods [role="tablist"] { display: none; }
html:not(.js) .row .more { display: block; }
html:not(.js) .term [role="tab"]:not(:first-child) { display: none; }
