/* Sums — Signal design system, web translation of brandbook.md */

:root {
  --canvas: #0e0f12;
  --well: #131418;
  --surface: #17191d;
  --fg: #f4f5f7;
  --fg-muted: #7c818b;
  --fg-dim: #5b616b;
  --hairline: #24272c;
  --accent: #c3d46b;
  --accent-pressed: #a8b85a;
  --accent-ink: #14180a;
  --correct: #5fb2c2;
  --slow: #e3a73e;
  --wrong: #e0607e;

  --max: 1080px;
  --gap: clamp(22px, 6vw, 40px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.narrow {
  max-width: 760px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── header ─────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 15, 18, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
}

.brand:hover {
  text-decoration: none;
}

.mark {
  display: grid;
  grid-template-columns: repeat(5, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 3px;
}

.mark i {
  background: var(--hairline);
  border-radius: 1px;
}

.mark i:nth-child(2) {
  background: var(--accent);
}

.mark i:nth-child(7) {
  background: var(--fg);
}

nav.links {
  display: flex;
  gap: 22px;
  font-size: 14px;
}

nav.links a {
  color: var(--fg-muted);
}

nav.links a:hover {
  color: var(--fg);
  text-decoration: none;
}

/* ── buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  border: 1px solid var(--accent);
  transition: background 120ms ease;
}

.btn:hover {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--hairline);
}

.btn.ghost:hover {
  background: var(--surface);
  border-color: var(--fg-dim);
}

/* ── type ───────────────────────────────────────────────── */

h1 {
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 800;
}

h3 {
  font-size: 19px;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--fg-muted);
  max-width: 56ch;
  margin: 0 0 32px;
}

.muted {
  color: var(--fg-muted);
}

.dim {
  color: var(--fg-dim);
}

/* ── sections ───────────────────────────────────────────── */

section {
  padding: clamp(64px, 10vw, 120px) 0;
  border-bottom: 1px solid var(--hairline);
}

section.hero {
  padding-top: clamp(56px, 9vw, 104px);
  border-bottom: 1px solid var(--hairline);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-note {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-top: 22px;
}

/* ── the daily grid demo ────────────────────────────────── */

.demo {
  margin-top: 48px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 14px;
  padding: clamp(20px, 4vw, 32px);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  max-width: 520px;
}

.demo-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.demo-num {
  font-size: clamp(40px, 7vw, 56px);
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.demo-num .op {
  color: var(--fg-dim);
}

.demo-num .res {
  color: var(--accent);
}

.tiles {
  display: flex;
  gap: 6px;
}

.tiles span {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  background: var(--hairline);
}

.tiles .ok {
  background: var(--accent);
}

.tiles .slow {
  background: var(--slow);
}

.tiles .bad {
  background: var(--wrong);
}

.demo-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ── cards ──────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
}

.card .n {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 14px;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15.5px;
}

/* ── pricing ────────────────────────────────────────────── */

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 720px;
}

.plan {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 12px;
  padding: 26px;
}

.plan.featured {
  border-color: var(--accent);
}

.plan .name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.plan .price {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 4px;
}

.plan .price small {
  font-size: 17px;
  font-weight: 500;
  color: var(--fg-dim);
  letter-spacing: 0;
}

.plan .detail {
  color: var(--fg-muted);
  font-size: 15px;
  margin: 0;
}

.badge {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--well);
  color: var(--accent);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── faq ────────────────────────────────────────────────── */

.faq {
  display: grid;
  gap: 0;
  max-width: 760px;
}

details {
  border-bottom: 1px solid var(--hairline);
  padding: 20px 0;
}

details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin: 12px 0 0;
  color: var(--fg-muted);
  max-width: 62ch;
}

/* ── legal pages ────────────────────────────────────────── */

.legal {
  /* Vertical only — a shorthand here would wipe the horizontal padding
     that .wrap sets, and the text would sit flush against the screen edge. */
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: 96px;
}

.legal h1 {
  font-size: clamp(32px, 5vw, 48px);
  text-transform: none;
  letter-spacing: -0.025em;
}

.legal h2 {
  font-size: 22px;
  margin: 44px 0 12px;
}

.legal h3 {
  margin: 28px 0 8px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  font-size: 16.5px;
}

.legal ul {
  padding-left: 22px;
}

.legal li {
  margin-bottom: 8px;
}

.legal strong {
  color: var(--fg);
  font-weight: 600;
}

.updated {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 40px;
}

.callout {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 28px 0;
}

.callout p {
  margin: 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15.5px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--fg-muted);
}

table.data th {
  color: var(--fg);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
}

/* ── footer ─────────────────────────────────────────────── */

footer {
  padding: 48px 0 64px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
}

.foot nav a {
  color: var(--fg-muted);
}

.foot small {
  color: var(--fg-dim);
  font-size: 13px;
}

@media (max-width: 620px) {
  nav.links {
    display: none;
  }

  /* Only the page-level CTAs go full width — the header button must not. */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .bar {
    height: 60px;
  }

  .bar .btn {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  .brand {
    font-size: 18px;
  }

  /* Three columns of prose do not fit a phone — let the table scroll. */
  .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-x table.data {
    min-width: 540px;
  }

  .demo {
    padding: 18px;
  }

  .tiles span {
    width: 22px;
    height: 22px;
  }
}
