/* gawk project site — shared styles for index.html and docs.html.
   Palette and type follow the gawk design language (gawk-app/src/styles/global.css). */

:root {
  --bg: #0a0b0d;
  --bg-1: #0d0e11;
  --bg-2: #121317;
  --bg-3: #171920;
  --bg-4: #1b1e26;
  --line: #1c2028;
  --line-2: #262a33;
  --line-3: #3a4150;
  --fg: #e8eaed;
  --fg-2: #9aa1ad;
  --fg-3: #626873;
  --accent: #6b8afe;
  --accent-2: #47bfff;
  --accent-3: #863bff;
  --ok: #30a46c;
  --bad: #e5484d;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #86a0ff; }
::selection { background: rgba(107, 138, 254, 0.3); }
h1, h2, h3 { font-weight: 700; }
h2 { font-size: 34px; letter-spacing: -0.02em; margin: 0; }
h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
strong { color: var(--fg); font-weight: 500; }

@keyframes drift { from { transform: translate3d(-3%, -2%, 0) scale(1.05); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } }
@keyframes flow { 0% { transform: translateX(0); opacity: 0; } 6% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(var(--run, 760px)); opacity: 0; } }
@keyframes flowWire { 0% { left: 0; opacity: 0; } 6% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 32px); }
.section { padding: 96px 0 0; }
.section-lead { margin: 14px 0 0; color: var(--fg-2); font-size: 16.5px; line-height: 1.6; max-width: 70ch; }
.section-note { margin: 18px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--fg-3); max-width: 80ch; }

/* Glow backdrop */
.glow { position: relative; overflow: hidden; }
.glow::before {
  content: ""; position: absolute; inset: -30% -20%; z-index: 0; pointer-events: none;
  background: radial-gradient(38% 42% at 26% 34%, rgba(107, 138, 254, 0.20), transparent 70%),
              radial-gradient(34% 40% at 74% 66%, rgba(134, 59, 255, 0.16), transparent 70%),
              radial-gradient(30% 36% at 58% 16%, rgba(71, 191, 255, 0.11), transparent 70%);
  filter: blur(30px); animation: drift 26s ease-in-out infinite alternate;
}
.glow > * { position: relative; z-index: 1; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; position: relative; z-index: 3; }
.nav-brand { font-weight: 700; font-size: 19px; letter-spacing: 0.04em; color: var(--fg); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--fg-2); }
.nav-links a { color: var(--fg-2); }
.nav-links a:hover { color: var(--fg); }
.btn-outline-sm { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--fg) !important; font-weight: 500; }
.btn-outline-sm:hover { border-color: var(--line-3); color: #fff !important; }
@media (max-width: 640px) { .nav-links { gap: 16px; } .nav-links .hide-sm { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; padding: 13px 22px; border-radius: 8px; }
.btn-primary { background: var(--fg); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: #fff; color: var(--bg); }
.btn-outline { border: 1px solid var(--line-2); color: var(--fg); font-weight: 500; }
.btn-outline:hover { border-color: var(--line-3); background: var(--bg-2); color: var(--fg); }

/* Hero */
.hero { padding: 0 0 104px; }
.hero-grid { max-width: 1180px; margin: 0 auto; padding: 40px clamp(18px, 4vw, 32px) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 56px; align-items: center; min-height: min(72vh, 700px); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); border: 1px solid var(--line-2); background: rgba(18, 19, 23, 0.6); padding: 7px 12px; border-radius: 100px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); animation: pulse 2.2s ease-in-out infinite; }
.hero h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -0.03em; margin: 26px 0 0; text-wrap: balance; }
.hero-lead { font-size: 19px; line-height: 1.6; color: var(--fg-2); margin: 24px 0 0; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-tags { font-family: var(--mono); font-size: 12px; color: var(--fg-3); margin: 26px 0 0; letter-spacing: 0.02em; }

/* Join card (recreation of the app's landing card) */
.join-wrap { display: flex; justify-content: center; }
.join-card { width: min(92vw, 400px); padding: 36px 32px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; background: rgba(18, 19, 23, 0.62); backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
.join-brand { font-weight: 700; font-size: 17.6px; letter-spacing: 0.04em; margin-bottom: 28px; }
.join-title { margin: 0 0 24px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-2); }
.code { position: relative; display: flex; gap: 8px; }
.code-ring { position: absolute; top: 0; left: 0; width: 44px; height: 56px; border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 3px rgba(107, 138, 254, 0.14); transition: left 160ms cubic-bezier(0.2, 0, 0, 1); }
.code-box { width: 44px; height: 56px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--fg); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 10px; }
.join-hint { margin: 14px 0 0; font-size: 11.5px; color: var(--fg-3); }
.join-btn { margin-top: 24px; width: 100%; padding: 11px 16px; border-radius: 6px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 15px; text-align: center; }
.join-or { width: 100%; display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--fg-3); font-size: 11.5px; }
.join-or span { flex: 1; height: 1px; background: var(--line-2); }
.join-start { font-size: 13px; color: var(--fg-2); padding: 6px 10px; }

/* Pipeline */
.section-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--fg-3); font-family: var(--mono); font-size: 12.5px; }
.pipeline { margin-top: 40px; padding: 36px 32px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); overflow-x: auto; overflow-y: hidden; }
.pipeline-inner { min-width: min-content; }
.wire { position: relative; height: 2px; background: var(--line-2); }
.wire .pkt { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; animation: flowWire 3.4s linear infinite; }
.pkt-a { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.pkt-b { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.pkt-c { background: var(--accent-3); box-shadow: 0 0 12px var(--accent-3); }
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 26px; }
.stage { padding-top: 2px; min-width: 120px; }
.stage-n { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.1em; }
.stage-t { font-weight: 600; font-size: 14.5px; margin-top: 8px; }
.stage-d { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; margin-top: 5px; }

/* Cards */
.cards { display: grid; gap: 20px; margin-top: 20px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); margin-top: 32px; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); margin-top: 32px; }
.card { padding: 26px 26px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.card h3 { font-size: 17px; }
.card p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.card-sm { padding: 24px; }
.card-sm h3 { font-size: 16px; }
.card-sm p { margin: 9px 0 0; font-size: 14px; }
.mode { padding: 28px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-2); }
.mode-hl { background: linear-gradient(180deg, rgba(107, 138, 254, 0.07), var(--bg-2)); }
.mode-tag { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); }
.mode-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.mode-hl .mode-tag { color: var(--accent); }
.mode-hl .mode-tag .dot { background: var(--accent); }
.mode h3 { margin: 14px 0 0; font-size: 20px; }
.mode p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }

/* Fleet diagram */
.fleet { margin-top: 36px; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-1); padding: 32px 28px; }
.fleet-col { display: flex; flex-direction: column; gap: 10px; flex: 1 0 200px; min-width: 0; }
.fleet-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 2px; }
.fleet-node { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-3); font-size: 13px; }
.fleet-node small { color: var(--fg-3); font-size: inherit; }
.fleet-link { position: relative; flex: 0 0 56px; width: 56px; height: 2px; background: var(--line-2); }
.fleet-link .lbl { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.fleet-link .pkt { position: absolute; top: -2.5px; left: 0; width: 7px; height: 7px; border-radius: 50%; --run: 56px; animation: flow 1.6s linear infinite; }
.fleet-link .pkt-a { box-shadow: 0 0 10px var(--accent); }
.fleet-link .pkt-b { box-shadow: 0 0 10px var(--accent-2); }
.fleet-relay { flex: 1 0 240px; padding: 16px; border: 1px dashed #2c3340; border-radius: 12px; background: rgba(107, 138, 254, 0.05); }
.fleet-relay .fleet-node { padding: 11px 14px; font-size: 12.5px; text-align: center; }
.fleet-pods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.fleet-pods .host { border-color: var(--line-3); background: var(--bg-4); }
.fleet-foot { font-family: var(--mono); font-size: 10px; color: var(--fg-3); text-align: center; }

/* Latency */
.latency { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 48px; margin-top: 36px; align-items: start; }
.big-num { display: flex; align-items: flex-end; gap: 10px; }
.big-num .n { font-family: var(--mono); font-size: clamp(58px, 7vw, 92px); line-height: 0.9; font-weight: 700; letter-spacing: -0.04em; }
.big-num .u { font-size: 22px; color: var(--fg-2); padding-bottom: 10px; }
.latency p { margin: 16px 0 0; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.latency p.small { margin-top: 14px; font-size: 13.5px; line-height: 1.6; color: var(--fg-3); }
.scale { padding: 28px 28px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.scale-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.scale-rows { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.scale-row .hd { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 7px; }
.scale-row .hd b { font-weight: 600; }
.scale-row .hd .v { font-family: var(--mono); }
.scale-row.dim .hd { color: var(--fg-2); }
.bar { height: 8px; border-radius: 100px; background: var(--bg-3); }
.bar > div { height: 100%; border-radius: 100px; }
.bar-hl { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.scale p.note { margin: 22px 0 0; font-size: 12px; line-height: 1.6; color: var(--fg-3); border-top: 1px solid var(--line); padding-top: 16px; }

/* Run it */
.run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; margin-top: 36px; }
.term { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); overflow: hidden; }
.term-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.term-hd span { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.copy { font: inherit; font-size: 11.5px; color: var(--fg-2); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.copy:hover { color: var(--fg); border-color: var(--line-3); }
.term pre { margin: 0; padding: 20px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.75; color: var(--fg); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.term pre .p { color: var(--fg-3); }
.term p { margin: 0; padding: 0 18px 20px; font-size: 13.5px; line-height: 1.65; color: var(--fg-2); }
.term p code { font-family: var(--mono); color: var(--fg); }

/* Download cards (R46). The version line, checksum and the button's target
   are filled in by site.js from the per-component release manifest; without
   it the card still works — the button goes to the releases page. */
.dl-cards { margin-top: 36px; }
.dl-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-hd h3 { font-size: 20px; }
.dl-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.dl-ver { margin: 8px 0 0 !important; font-family: var(--mono); font-size: 13px; color: var(--fg-2) !important; }
.dl-ver a { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--line-3); }
.dl-ver a:hover { color: var(--fg); }
.dl-btn { margin-top: 18px; }
.dl p code { font-family: var(--mono); color: var(--fg); }
.dl-sum { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 0 !important; font-family: var(--mono); font-size: 11.5px; color: var(--fg-3) !important; }
.dl-sum span { letter-spacing: 0.14em; text-transform: uppercase; flex: none; }
.dl-sum code { color: var(--fg-3); overflow-wrap: anywhere; }
.section-note code { font-family: var(--mono); color: var(--fg-2); }

/* Browser support table */
.table { margin-top: 32px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 2.6fr); padding: 20px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.row:last-child { border-bottom: 0; }
.row.hd { padding: 14px 22px; background: var(--bg-2); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.row .engine { font-weight: 600; font-size: 15px; }
.row .engine small { display: block; font-weight: 400; font-size: 12.5px; color: var(--fg-3); }
.row .status { font-size: 13.5px; font-weight: 500; }
.row .status.ok { color: var(--ok); }
.row .status.bad { color: var(--bad); }
.row .notes { font-size: 14px; color: var(--fg-2); line-height: 1.55; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 6px; } .row.hd { display: none; } }
.table + p { margin: 20px 0 0; font-size: 13.5px; color: var(--fg-3); line-height: 1.6; }

/* Closing CTA */
.cta { padding: 48px; border: 1px solid var(--line-2); border-radius: 18px; background: radial-gradient(120% 140% at 15% 0%, rgba(107, 138, 254, 0.14), transparent 60%), #101116; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.cta-text { max-width: 52ch; }
.cta h2 { font-size: 28px; }
.cta p { margin: 12px 0 0; font-size: 16px; line-height: 1.6; color: var(--fg-2); }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.section-last { padding-bottom: 104px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0 56px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; font-size: 13px; color: var(--fg-3); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--fg-2); }
.footer-links a:hover { color: var(--fg); }

/* Docs page */
.docs-head { border-bottom: 1px solid var(--line); }
.docs-head::before { inset: -45% -20%; }
.docs-hero { padding: 56px 0 72px; }
.docs-hero .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.docs-hero h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 18px 0 0; max-width: 24ch; text-wrap: balance; }
.docs-hero p { font-size: 18px; line-height: 1.65; color: var(--fg-2); margin: 22px 0 0; max-width: 62ch; }
.docs-section { padding: 72px 0 0; }
.docs-section.first { padding-top: 64px; }
.docs-section h2 { font-size: 15px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 24px; font-weight: 500; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.doc-card { display: block; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); color: var(--fg); }
.doc-card:hover { border-color: var(--line-3); background: var(--bg-3); color: var(--fg); }
.doc-card .ref { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.doc-card .t { display: block; font-size: 17px; font-weight: 600; margin-top: 10px; }
.doc-card .d { display: block; font-size: 14px; line-height: 1.6; color: var(--fg-2); margin-top: 8px; }
.links { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.link-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.link-row:nth-child(odd) { background: var(--bg-2); }
.link-row:last-child { border-bottom: 0; }
.link-row a { font-weight: 600; font-size: 15px; }
.link-row span { font-size: 14px; color: var(--fg-2); }
/* Party relay page: a short label beside each fact, not a half-width column. */
.facts .link-row { grid-template-columns: 160px minmax(0, 1fr); }
.facts .link-row strong { font-size: 15px; }
@media (max-width: 560px) { .facts .link-row { grid-template-columns: 1fr; } }
.components { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.component { padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.component .path { font-family: var(--mono); font-size: 13px; color: var(--fg); }
.component p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.licensing { padding-bottom: 96px; }
.licensing p { font-size: 16px; line-height: 1.7; color: var(--fg-2); max-width: 78ch; }
.licensing code { font-family: var(--mono); color: var(--fg); }
