/* Beagel.ai — site styles
   Identity: black / white / green. Green is reserved for active distribution and return paths. */

:root {
  --bg: #000000;
  --surface: #050505;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --muted-2: rgba(255, 255, 255, 0.55);
  --live: #00ff00;
  --live-dim: rgba(0, 255, 0, 0.35);
  --max: 1200px;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 16px;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--mono); }
.live { color: var(--live); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { font-size: 16px; font-weight: 500; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.site-nav a { font-size: 14px; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: 0 1px 0 var(--text); }
.header-cta { border: 1px solid var(--text); padding: 7px 14px; font-size: 14px; font-weight: 500; }
.header-cta:hover { background: var(--text); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 2px;
  font-size: 15px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn-secondary { border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.btn-secondary:hover { border-color: var(--text); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Section scaffolding */
.section { padding: 96px 0; border-top: 1px solid var(--line); }

.hero { padding: 72px 0 88px; }

.hero-title { max-width: 920px; font-size: 60px; font-weight: 600; line-height: 1.04; letter-spacing: -0.03em; }
.hero-copy { margin-top: 22px; max-width: 720px; font-size: 21px; line-height: 1.6; color: var(--muted); }

.section-title { max-width: 900px; margin-bottom: 0; font-size: 44px; font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; }
.section-copy { margin-top: 18px; max-width: 720px; font-size: 19px; line-height: 1.65; color: var(--muted); }

.text-link { display: inline-flex; gap: 8px; margin-top: 28px; font-size: 16px; font-weight: 500; color: var(--muted); box-shadow: 0 1px 0 var(--line-strong); padding-bottom: 2px; }
.text-link:hover { color: var(--text); }

/* Network schematic */
.schematic { margin: 56px 0 0; border: 1px solid var(--line); background: var(--surface); }
.schematic-bar {
  display: flex; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding: 10px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2);
}
.legend { display: flex; gap: 20px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 1px solid var(--line-strong); }
.legend i.is-live { border-top: 2px solid var(--live); }
.schematic-canvas { padding: 24px 16px; }
.schematic svg { width: 100%; height: auto; }
.schematic .wide { display: block; }
.schematic .narrow { display: none; max-width: 420px; margin: 0 auto; }

.net-node { fill: #000; stroke: var(--line-strong); stroke-width: 1; }
.net-node.hub { fill: #fff; stroke: #fff; }
.net-node.net-buyer { stroke: var(--live); }
.net-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; fill: rgba(255, 255, 255, 0.55); text-transform: uppercase; }
.net-title { font-family: var(--sans); font-size: 17px; font-weight: 500; fill: #fff; }
.net-hub-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; fill: rgba(0, 0, 0, 0.6); }
.net-hub-title { font-family: var(--sans); font-size: 19px; font-weight: 600; fill: #000; }
.net-wire { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.net-wire-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; fill: rgba(255, 255, 255, 0.55); }
.net-live { fill: none; stroke: var(--live); stroke-width: 1.5; }
.net-live-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; fill: var(--live); }
.net-flow { fill: none; stroke: var(--live); stroke-width: 2; stroke-dasharray: 3 14; animation: flow 1.6s linear infinite; }
.net-flow.reverse { animation-direction: reverse; }
.net-dot { fill: var(--live); }
.net-port { fill: #000; stroke: var(--live); stroke-width: 1.5; }

@keyframes flow { to { stroke-dashoffset: -17; } }

@media (prefers-reduced-motion: reduce) {
  .net-flow { animation: none; }
  html { scroll-behavior: auto; }
}

/* Hairline grids (replace cards) */
.matrix { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.matrix.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.matrix.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.matrix.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.matrix > li, .matrix > div { background: var(--bg); padding: 30px 26px 34px; }
.cell-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 36px; }
.cell-meta .sig { color: var(--muted-2); }
.cell-meta .sig.live { color: var(--live); }
.cell-art { display: block; width: 176px; height: 68px; margin-bottom: 24px; overflow: visible; }
.cell-title { font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.cell-copy { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--muted); }

.label-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.label-grid li { background: var(--bg); padding: 26px 24px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }

/* Open layout: columns without boxes */
.matrix.open { background: none; border: 0; gap: 56px 48px; }
.matrix.open > li { background: none; padding: 0; }
.label-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; align-content: start; }
.label-list li { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }

/* API / RESO / MCP as typography with connecting lines */
.tflow-wide { display: block; width: 100%; height: auto; overflow: visible; }
.tf-term { font-family: var(--sans); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; fill: var(--text); }
.tf-hub { font-family: var(--sans); font-size: 56px; font-weight: 700; letter-spacing: -0.03em; fill: var(--text); }
.tf-live { fill: var(--live); }
.tf-note { font-family: var(--sans); font-size: 16px; fill: var(--muted); }
.tflow-narrow { display: none; list-style: none; margin: 0; padding: 0; }
.tflow-narrow li { position: relative; padding: 0 0 40px 22px; border-left: 1px solid var(--line-strong); display: grid; gap: 6px; }
.tflow-narrow li:last-child { padding-bottom: 0; }
.tflow-narrow li.is-dashed { border-left-style: dashed; }
.tflow-narrow li.is-hub { border-left-color: var(--live); }
.tflow-narrow li.is-live { border-left-color: transparent; }
.tflow-narrow .tf-term { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.tflow-narrow .tf-hub { font-size: 40px; font-weight: 700; color: var(--text); }
.tflow-narrow li.is-live .tf-term { color: var(--live); }
.tflow-narrow .tf-note { font-size: 16px; color: var(--muted); }

/* Data tables */
.data-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); }
.data-table th, .data-table td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); font-weight: 400; background: var(--surface); }
.data-table tbody th { font-weight: 500; font-size: 17px; }
.data-table td { color: var(--muted); font-size: 15px; line-height: 1.55; }
.data-table td.mono { font-family: var(--mono); font-size: 13px; color: var(--text); }
.table-scroll { overflow-x: auto; }

.split-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }

/* Sequence (getting started) */
.sequence { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sequence li { position: relative; padding: 36px 28px 0 0; }
.sequence li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 1px; background: var(--line-strong); }
.sequence li::after { content: ""; position: absolute; top: 0; left: 0; width: 9px; height: 9px; background: #000; border: 1px solid var(--text); }
.sequence li.is-live::before { background: var(--live); height: 2px; top: 4px; }
.sequence li.is-live::after { background: var(--live); border-color: var(--live); }
.sequence.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.body-copy { display: grid; gap: 18px; font-size: 19px; line-height: 1.7; color: var(--muted); max-width: 720px; }
.body-copy a { color: var(--text); box-shadow: 0 1px 0 var(--line-strong); }

/* Closing */
.closing { padding: 112px 0; border-top: 1px solid var(--line); }

/* Contact */
.form-frame { border: 1px solid var(--line); background: var(--surface); }
.form-frame iframe { display: block; width: 100%; height: 520px; border: 0; background: #000; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .container { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; font-size: 13px; color: var(--muted-2); line-height: 1.6; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Responsive */
@media (max-width: 1100px) {
  .hero-title { font-size: 50px; }
  .section-title { font-size: 38px; }
  .matrix.cols-4, .sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sequence { row-gap: 32px; }
}

@media (max-width: 860px) {
  .schematic .wide { display: none; }
  .schematic .schematic-bar { display: none; }
  .tflow-wide { display: none; }
  .tflow-narrow { display: grid; }
  .label-list li { font-size: 20px; }
  .schematic .narrow { display: block; }
  .split-grid, .matrix.cols-2, .matrix.cols-3 { grid-template-columns: 1fr; }
  .split-grid { gap: 28px; }
  .hero-title { font-size: 40px; }
  .section-title { font-size: 32px; }
  .hero-copy { font-size: 19px; }
  .section-copy, .body-copy { font-size: 17px; }
  .section, .closing { padding: 64px 0; }
  .hero { padding-bottom: 64px; }
}

@media (max-width: 560px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 48px; }
  .hero-title { font-size: 34px; }
  .section-title { font-size: 28px; }
  .matrix.cols-4, .sequence, .sequence.cols-3 { grid-template-columns: 1fr; }
  .button-row { flex-direction: column; align-items: stretch; }
  .header-cta { display: none; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; width: 100%; }
  .data-table tr { border-bottom: 1px solid var(--line); padding: 14px 0; }
  .data-table th, .data-table td { border: 0; padding: 4px 16px; }
  .data-table td[data-label]::before { content: attr(data-label) "  "; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
  .form-frame iframe { height: 700px; }
  .schematic-canvas { padding: 16px 8px; }
  .schematic-bar, .cell-meta, .data-table thead th { font-size: 12px; }
  .schematic-bar { padding: 12px 14px; }
  .schematic .narrow .net-label, .schematic .narrow .net-hub-label { font-size: 12px; }
  .schematic .narrow .net-wire-label, .schematic .narrow .net-live-label { font-size: 11px; }
  .data-table td[data-label]::before { font-size: 12px; }
}
.data-table td.mono.live { color: var(--live); }

/* Spacing utilities (last, so they win over component margins) */
.mt-0 { margin-top: 0; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 40px; }
