/* Really Big Magnet Co. — design system
   Warm industrial: paper + steel + magnet red. Dark mode via media query. */

:root {
  --bg: #faf7f2;
  --bg-alt: #f1ece3;
  --card: #ffffff;
  --ink: #16202b;
  --ink-2: #4d5d6e;
  --line: #e4dccf;
  --red: #e23b2e;
  --red-deep: #b52a1f;
  --steel: #1e2a38;
  --silver: #b9c4d0;
  --ok: #1f8a4c;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(22 32 43 / 0.06), 0 8px 24px rgb(22 32 43 / 0.08);
  --shadow-lg: 0 2px 4px rgb(22 32 43 / 0.08), 0 16px 48px rgb(22 32 43 / 0.16);
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1620;
    --bg-alt: #131c28;
    --card: #172230;
    --ink: #e9eef4;
    --ink-2: #9aabbc;
    --line: #263447;
    --red: #f04a3c;
    --red-deep: #ff6a5d;
    --silver: #8fa0b2;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.5), 0 16px 48px rgb(0 0 0 / 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.muted { color: var(--ink-2); }
.accent { color: var(--red); }

.kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 56ch; }

/* ── Buttons, chips, badges ─────────────────────────────────────────────── */

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid var(--red);
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--red-deep); border-color: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); }
.btn-invert { background: #fff; color: var(--red); border-color: #fff; }
.btn-invert:hover { background: #ffe9e6; border-color: #ffe9e6; }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-size: 0.8rem;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--ink-2);
}
.chip-price { background: var(--red); border-color: var(--red); color: #fff; }

.badge-agent {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ── Agent surfaces ─────────────────────────────────────────────────────── */

.agent-ribbon {
  display: block;
  text-align: center;
  background: var(--steel);
  color: #dfe8f1;
  font-size: 0.9rem;
  padding: 9px 16px;
  text-decoration: none;
}
.agent-ribbon strong { color: #fff; }
.agent-ribbon:hover strong { text-decoration: underline; }

#agent-gateway {
  background: #fff7e6;
  color: #4a3a12;
  border-bottom: 2px solid #e8c96a;
  padding: 12px 24px;
  font-size: 0.95rem;
}
#agent-gateway a { color: #8a5a00; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  #agent-gateway { background: #2b2410; color: #ecd9a0; border-bottom-color: #6b581e; }
  #agent-gateway a { color: #ffd873; }
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  white-space: nowrap;
}
.logo em { color: var(--red); font-style: normal; }
.logo-mark { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-weight: 600; font-size: 0.95rem; }
.nav-links a { text-decoration: none; opacity: 0.85; }
.nav-links a:hover { opacity: 1; color: var(--red); }
.nav-links .btn { color: #fff; opacity: 1; }
.nav-links .btn:hover { color: #fff; }
.nav-agents { border: 1px dashed var(--line); padding: 5px 12px; border-radius: 999px; }

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero { padding: 72px 0 40px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

.hero-visual { position: relative; min-height: 300px; }
.hero-magnet { width: 100%; max-width: 420px; display: block; margin: 0 auto; color: var(--silver); }
.hero-magnet .pole { font: 800 34px ui-sans-serif, system-ui, sans-serif; }
.field-lines path { opacity: 0.5; animation: fieldflow 6s linear infinite; }
@keyframes fieldflow { to { stroke-dashoffset: -64; } }

.debris { position: absolute; font-size: 1.6rem; animation: float 5s ease-in-out infinite; }
.d1 { top: 6%; left: 12%; animation-delay: 0s; }
.d2 { top: 18%; right: 8%; animation-delay: 1.2s; font-size: 1.3rem; }
.d3 { bottom: 12%; left: 6%; animation-delay: 2.1s; font-size: 1.9rem; }
.d4 { bottom: 4%; right: 14%; animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.page-head { padding-top: 72px; padding-bottom: 8px; }
.cta-band {
  background: linear-gradient(120deg, var(--red) 0%, #c22619 100%);
  color: #fff;
  text-align: center;
}
.cta-band .lede, .cta-band p { color: #ffd9d4; max-width: none; }

.trustbar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.trustbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; }
.trust-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); }
.trust-logo { font-weight: 800; letter-spacing: 0.04em; opacity: 0.55; font-size: 1.02rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; padding: 26px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--red); }
.stat-label { color: var(--ink-2); font-size: 0.9rem; margin-top: 4px; }

/* ── Cards & grids ──────────────────────────────────────────────────────── */

.grid { display: grid; gap: 22px; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.usecase-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.testimonial-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
a.card { text-decoration: none; display: block; transition: transform 0.18s ease, box-shadow 0.18s ease; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-kicker { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); margin-bottom: 8px; }
.product-card p { color: var(--ink-2); font-size: 0.95rem; }

.quote blockquote { margin: 0 0 12px; font-size: 1.06rem; font-weight: 600; line-height: 1.45; }
.quote figcaption { color: var(--ink-2); font-size: 0.88rem; }

.callout-card { border-left: 5px solid var(--red); }

.warning {
  background: #fff2f0;
  border: 1px solid #f2c1bb;
  color: #7c1e14;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
}
@media (prefers-color-scheme: dark) {
  .warning { background: #33170f; border-color: #6b2a1e; color: #ffb4a8; }
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq-list { max-width: 820px; }
.faq-list details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
.faq-list summary { cursor: pointer; font-weight: 700; }
.faq-list details[open] summary { color: var(--red); margin-bottom: 8px; }
.faq-list details p { margin: 0; color: var(--ink-2); }
.faq-agent { border-left: 4px solid var(--red); }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.spec-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-table th { width: 40%; color: var(--ink-2); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Misc layout ────────────────────────────────────────────────────────── */

.two-col { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 34px; align-items: start; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 84px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.timeline strong { color: var(--red); font-size: 1.05rem; }

.surface-list li { margin-bottom: 8px; }
pre {
  background: var(--steel);
  color: #d9e4ef;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.contact-form label, .admin-login label { display: block; font-weight: 600; margin-bottom: 14px; font-size: 0.92rem; }
input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.form-thanks h3 { color: var(--ok); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 52px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 30px; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; font-size: 0.93rem; }
.footer-col a { text-decoration: none; opacity: 0.85; }
.footer-col a:hover { opacity: 1; color: var(--red); }
.footer-brand p { color: var(--ink-2); font-size: 0.9rem; margin-top: 12px; }
.footer-legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.footer-legal p { color: var(--ink-2); font-size: 0.82rem; }

/* ── Admin ──────────────────────────────────────────────────────────────── */

.admin-body { background: var(--bg); }
.admin-login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.admin-login .card { width: 380px; max-width: 100%; }
.admin-error { color: var(--red); font-weight: 700; }

.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }
.admin-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.admin-header-right { display: flex; align-items: center; gap: 12px; }
.admin-header-right form { margin: 0; }

.admin-toast {
  background: #e8f7ee; border: 1px solid #b3e2c4; color: #135c33;
  padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.92rem;
}
@media (prefers-color-scheme: dark) {
  .admin-toast { background: #10301e; border-color: #1d5c38; color: #8fe0b0; }
}

.admin-actions { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }

.flag-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 10px 20px 6px;
  margin-bottom: 18px;
}
.flag-group legend { font-weight: 800; padding: 0 8px; font-size: 1.02rem; }
.flag-row { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.flag-row:last-child { border-bottom: none; }
.flag-label { font-weight: 700; }
.flag-key { font-size: 0.72rem; color: var(--ink-2); background: var(--bg-alt); padding: 2px 7px; border-radius: 6px; }
.flag-desc { color: var(--ink-2); font-size: 0.88rem; margin: 3px 0 6px; max-width: 88ch; }
.flag-test { display: inline-block; font-size: 0.74rem; color: var(--ink-2); background: var(--bg-alt); padding: 3px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.warn-tag { font-size: 0.68rem; color: #8a5a00; background: #fff2d4; border: 1px solid #ecd08e; border-radius: 6px; padding: 1px 6px; cursor: help; }
@media (prefers-color-scheme: dark) {
  .warn-tag { color: #ffd873; background: #33290e; border-color: #6b581e; }
}

.switch { position: relative; display: inline-block; width: 46px; height: 26px; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--line); border-radius: 999px; transition: background 0.15s ease;
}
.slider::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--red); outline-offset: 2px; }

.admin-section { margin-top: 40px; }
.admin-cols { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: start; }
.admin-table { font-size: 0.82rem; }
.admin-table td, .admin-table th { padding: 7px 10px; vertical-align: top; }
.tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line);
}
.tag-discovery { background: #e5f0ff; border-color: #b9d4fa; color: #1d4f9c; }
.tag-negotiate, .tag-md-suffix { background: #e8f7ee; border-color: #b3e2c4; color: #135c33; }
.tag-outbound { background: #ffe9e6; border-color: #f5b8b0; color: #9c2417; }
.tag-guess { background: #fff2d4; border-color: #ecd08e; color: #8a5a00; }
.tag-ai-page-view, .tag-agent { background: #f1e6ff; border-color: #d3b8f5; color: #5b2a9c; }
@media (prefers-color-scheme: dark) {
  .tag-discovery { background: #14283f; border-color: #29507e; color: #9cc3f5; }
  .tag-negotiate, .tag-md-suffix { background: #10301e; border-color: #1d5c38; color: #8fe0b0; }
  .tag-outbound { background: #3a1611; border-color: #7e2c20; color: #ffb4a8; }
  .tag-guess { background: #33290e; border-color: #6b581e; color: #ffd873; }
  .tag-ai-page-view, .tag-agent { background: #291540; border-color: #55307e; color: #d0aef5; }
}
.cheatsheet { font-size: 0.8rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-grid, .two-col, .admin-cols { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 44px; }
  .hero-visual { min-height: 240px; }
  .nav-links { gap: 14px; font-size: 0.88rem; }
  .nav-links a:not(.btn):not(.nav-agents) { display: none; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section { padding: 44px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
