/* USAgentic — site styles. No framework, no external fonts. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #0e1525;
  --ink-2: #2b3445;
  --muted: #5b6475;
  --line: #e4e1da;
  --line-strong: #cfcbc2;
  --red: #b42318;
  --blue: #1d3a8a;
  --link: #1d3a8a;
  --ok: #17663a;
  --ok-bg: #e7f4ec;
  --soon: #6b4f00;
  --soon-bg: #fbf1d6;
  --pipe: #9aa1ad;
  --pipe-on: #b42318;
  --tile: #ffffff;
  --shadow: 0 1px 2px rgba(14, 21, 37, .05), 0 8px 24px -12px rgba(14, 21, 37, .12);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --surface: #121826;
    --surface-2: #171f30;
    --ink: #eceef3;
    --ink-2: #cfd4de;
    --muted: #98a1b1;
    --line: #232c3e;
    --line-strong: #33405a;
    --red: #f0675c;
    --blue: #8fb0ff;
    --link: #a9c1ff;
    --ok: #7fd6a0;
    --ok-bg: #12301f;
    --soon: #f2cf74;
    --soon-bg: #33290f;
    --pipe: #4a5568;
    --pipe-on: #f0675c;
    --tile: #141b2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .9em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem .9rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .02em; font-size: 1.05rem; }
.brand b { color: var(--red); font-weight: 700; }
.mark { width: 22px; height: 20px; }
.mark-r { fill: var(--red); }
.mark-w { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.2; }
.mark-b { fill: var(--blue); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; padding-top: 12px; }
  .site-nav { overflow-x: auto; margin: 6px -20px 0; padding: 0 14px 8px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

/* Sections */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { font: 600 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46em; }
.muted { color: var(--muted); }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.more::after { content: " \2192"; }

/* Hero */
.hero { padding: 88px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { max-width: 13em; }
.hero .lede { margin-bottom: 28px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.hero-art figcaption { font-size: .85rem; color: var(--muted); margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 880px) {
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 420px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 8px; font: 600 .95rem/1.2 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: .88rem; }

/* Cards & grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

.product { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.product:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.product .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 18px; }
.product .icon svg { width: 24px; height: 24px; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.product h3 { margin-bottom: 6px; }
.product p { color: var(--muted); font-size: .95rem; }
.product-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; }
.price { font-weight: 600; }
.price small { color: var(--muted); font-weight: 400; }

.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 .74rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-soon { color: var(--soon); background: var(--soon-bg); }

/* Feature (game) */
.feature { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.feature .card { padding: 20px; }
@media (max-width: 880px) { .feature { grid-template-columns: 1fr; gap: 28px; } }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: 10px; color: var(--ink-2); }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }

/* News */
.post-card { padding: 22px 0; border-top: 1px solid var(--line); }
.grid .post-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.post-card h3 { margin: 8px 0; font-size: 1.25rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p:last-child { color: var(--muted); margin: 0; }
.meta { display: flex; gap: 12px; align-items: center; font-size: .85rem; color: var(--muted); margin: 0; }
.tag { font: 600 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.news-list .post-card:first-child { border-top: 0; }

/* Trust strip */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.facts div { padding: 22px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts h3 { font-family: var(--sans); font-size: 1rem; margin-bottom: 6px; }
.facts p { color: var(--muted); font-size: .92rem; margin: 0; }
@media (max-width: 880px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .facts div { border-left: 0; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
}

/* Page heads & prose */
.page-head { padding: 64px 0 32px; }
.page-head .lede { margin-top: 8px; }
.crumbs { font-size: .9rem; margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::before { content: "\2190  "; }
.prose { font-size: 1.06rem; color: var(--ink-2); }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--red); color: var(--ink); font-family: var(--serif); font-size: 1.15rem; }
.post { padding-top: 48px; padding-bottom: 72px; }
.post h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-top: 12px; }
.post .lede { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-pager a { text-decoration: none; color: var(--ink); font-weight: 600; }
.post-pager a span { display: block; font: 600 .72rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.post-pager .next { text-align: right; }

pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; overflow-x: auto; line-height: 1.5; color: var(--ink); }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; word-break: break-word; }

.spec { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec th, .spec td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.spec th { width: 34%; color: var(--muted); font-weight: 500; }
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
.spec td code { word-break: break-all; }
.table-card { padding: 0; overflow: hidden; }

.notice { border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--surface); border-radius: 8px; padding: 14px 18px; color: var(--ink-2); font-size: .95rem; }

.two-col { display: grid; grid-template-columns: 1.4fr .6fr; gap: 48px; align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }
.aside h2 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 24px; padding: 56px 0 28px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid h2 { font: 600 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 14px; }
.footer-grid a { display: block; color: var(--ink-2); text-decoration: none; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-brand p { color: var(--muted); max-width: 26em; margin-top: 14px; }
.footer-brand .brand { margin: 0; }
.footer-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-legal a { color: var(--muted); margin-left: 16px; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Mini board illustration (home) */
.mini-board .pipe { stroke: var(--pipe); }
.mini-board .on .pipe { stroke: var(--pipe-on); }
.mini-board .cell { fill: var(--tile); stroke: var(--line); }
.mini-board .node { fill: var(--surface); stroke: var(--pipe); stroke-width: 6; }
.mini-board .on .node { stroke: var(--pipe-on); }
.mini-board .hub { fill: var(--ink); }

/* Route (game) */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-bottom: 72px; }
@media (max-width: 880px) { .game { grid-template-columns: 1fr; gap: 24px; } }
.board-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); max-width: 600px; }
.board { --n: 7; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 1px; background: var(--line); border: 3px solid var(--line); border-radius: 8px; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tile { appearance: none; border: 0; margin: 0; padding: 0; background: var(--tile); aspect-ratio: 1; cursor: pointer; display: block; width: 100%; -webkit-tap-highlight-color: transparent; }
.tile:hover { background: var(--surface-2); }
.tile:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; border-radius: 0; z-index: 1; position: relative; }
.tile svg { width: 100%; height: 100%; }
.tile .spin { transform-box: view-box; transform-origin: 50% 50%; transition: transform .16s ease-out; }
.tile .pipe { stroke: var(--pipe); stroke-width: 20; }
.tile .joint { fill: var(--pipe); }
.tile .node { fill: var(--tile); stroke: var(--pipe); stroke-width: 7; }
.tile .hub { fill: var(--ink); }
.tile.on .pipe { stroke: var(--pipe-on); }
.tile.on .joint { fill: var(--pipe-on); }
.tile.on .node { stroke: var(--pipe-on); }
.board.solved .tile { cursor: default; }
.board.solved .tile:hover { background: var(--tile); }
.board.solved .tile.on .pipe, .board.solved .tile.on .joint { transition: stroke .4s, fill .4s; }
.board-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.stats div { padding: 14px 16px; border-top: 1px solid var(--line); }
.stats div:nth-child(-n+2) { border-top: 0; }
.stats div:nth-child(even) { border-left: 1px solid var(--line); }
.stats dt { font: 600 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stats dd { margin: 0; font: 600 1.35rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.segmented button { flex: 1; appearance: none; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 600 .85rem var(--sans); padding: 9px 6px; cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.controls { display: flex; gap: 8px; margin-bottom: 20px; }
.controls .btn { flex: 1; }
.result { border: 1px solid var(--line); border-left: 3px solid var(--red); background: var(--surface); border-radius: 8px; padding: 16px 18px; margin-bottom: 20px; }
.result h2 { font-size: 1.2rem; margin-bottom: 4px; }
.result p { color: var(--ink-2); margin-bottom: 12px; }
.howto { font-size: .92rem; color: var(--ink-2); }
.howto h2 { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.howto ul { padding-left: 1.1em; margin: 0; }
.howto li { margin-bottom: 6px; }
.noscript { padding: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 404 */
.lost { padding: 120px 0; text-align: center; }
.lost .actions { justify-content: center; }
.lost .code { font: 600 .9rem var(--mono); color: var(--red); letter-spacing: .1em; }

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

/* Game library */
.filters { margin: 0 0 24px; display: grid; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-label { font: 600 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 64px; }
.chip { display: inline-flex; align-items: center; font: 500 .8rem/1 var(--sans); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); }
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.game-card .chips .chip { font-size: .72rem; padding: 4px 8px; }
.game-frame-wrap { padding: 0; overflow: hidden; }
.game-frame { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; background: #0b0f17; }

/* Meet the Brew Crew */
.crew { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.crew-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.crew-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.crew-card p { color: var(--muted); font-size: .88rem; margin: 0; }
@media (max-width: 960px) { .crew { grid-template-columns: repeat(2, 1fr); } }

/* Game identity */
.game-logo { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 12px; margin-bottom: 14px; }
.game-logo-lg { max-width: 420px; margin: 6px 0 14px; }
.game-band { padding-bottom: 36px; margin-bottom: 32px; }
