/* SAM website. Tokens mirror the SAM app (web/src/styles.css); the rules are in BRAND.md. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-hover: #eef0f3;
  --border: #e2e2e2;
  --border-input: #8c8c8c; /* 3:1 against the surface, so form fields stay visible */
  --fg: #1a1a1a;
  --muted: #666666;
  --accent: #2563eb; /* text, links, the wordmark */
  --accent-fill: #2563eb; /* button fills: the light accent in both themes, so white text keeps AA contrast */
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --ok: #16a34a;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 16px 40px -16px rgb(16 24 40 / 0.22);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --pill: 999px;
  --wrap: 72rem;
  --gutter: 16px;
  --section: clamp(3rem, 2rem + 5vw, 6rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1216;
    --surface: #1d222b;
    --surface-2: #171b22;
    --surface-hover: #242b36;
    --border: #2b313c;
    --border-input: #6b7586;
    --fg: #e6e9ee;
    --muted: #98a2b3;
    --accent: #4b8bf5;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216;
  --surface: #1d222b;
  --surface-2: #171b22;
  --surface-hover: #242b36;
  --border: #2b313c;
  --border-input: #6b7586;
  --fg: #e6e9ee;
  --muted: #98a2b3;
  --accent: #4b8bf5;
  --ok: #4ade80;
  --danger: #f87171;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font: 400 1rem/1.6 var(--font); color: var(--fg); background: var(--bg); overflow-wrap: break-word; }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 1.25rem + 1.3vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 48rem) { :root { --gutter: 24px; } }
.section { padding-block: var(--section); }
.band { background: var(--surface-2); border-block: 1px solid var(--border); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.lead { font-size: clamp(1.075rem, 1rem + 0.35vw, 1.25rem); color: var(--muted); max-width: 42rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { display: block; margin-bottom: 0.75rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.5rem 1rem; background: var(--accent-fill); color: #fff; border-radius: var(--radius-sm); }
.skip:focus { top: 1rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-height: 4rem; }
.brand { display: flex; flex-direction: column; margin-right: auto; padding-block: 0.6rem; line-height: 1.04; text-decoration: none; }
.brand-name { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.03em; color: var(--accent); }
.brand-tag { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.nav { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.nav a { display: block; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); color: var(--fg); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--surface-hover); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 650; }
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--fg); cursor: pointer; }
.icon-btn:hover { background: var(--surface-hover); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }
.icon-btn[hidden] { display: none; }
.theme-toggle .i-sun, .theme-toggle[aria-pressed="true"] .i-moon { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }
@media (max-width: 40rem) {
  .site-header { position: static; }
  .site-header .header-inner { gap: 0 0.5rem; }
  .site-header .header-cta { padding-inline: 0.7rem; }
  .site-nav { order: 3; width: 100%; margin-left: -0.5rem; padding-bottom: 0.4rem; }
  .nav a { padding-inline: 0.5rem; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.6rem 1.15rem; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent-fill); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 86%, #000); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--fg); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-sm { min-height: 2.25rem; padding: 0.35rem 0.85rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.center .actions, .hero .actions { justify-content: center; }

/* Hero */
.hero { padding-top: clamp(3rem, 2rem + 5vw, 5.5rem); text-align: center; background: linear-gradient(var(--bg) 62%, var(--surface-2) 62%); border-bottom: 1px solid var(--border); }
.hero h1 span { display: block; }
.hero .lead { margin-inline: auto; }
.hero-note { margin: 1rem 0 0; font-size: 0.875rem; color: var(--muted); }
.hero h1 { max-width: 52rem; margin-inline: auto; }
.proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; margin: 0; padding: 0 0 clamp(2rem, 1.5rem + 2vw, 3rem); list-style: none; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.proof li::before { content: ""; display: inline-block; width: 0.6rem; height: 0.33rem; margin: 0 0.5rem 0.2rem 0; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.hero .shot { max-width: 60rem; margin: clamp(1.75rem, 1rem + 3vw, 2.75rem) auto 0; padding-bottom: 1.5rem; }

/* Screenshots and clips */
.shot { margin: 0; }
.shot img, .shot video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); box-shadow: var(--shadow); }
.shot a { display: block; cursor: zoom-in; }
.shot figcaption { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.center .shot figcaption, .hero .shot figcaption { text-align: center; }

/* Text beside a picture; .flip puts the picture first on wide screens only, so the
   reading order (text, then picture) never changes. */
.split { display: grid; gap: 2rem; align-items: center; }
.split + .split { margin-top: var(--section); }
@media (min-width: 56rem) {
  .split { grid-template-columns: 5fr 7fr; gap: 3.5rem; }
  .split.flip { grid-template-columns: 7fr 5fr; }
  .split.flip > :first-child { order: 2; }
}
.split h2, .split h3 { margin-top: 0; }
.more { font-weight: 600; }

/* Lists */
.ticks, .minus { display: grid; gap: 0.5rem; margin: 1rem 0 1.25rem; padding: 0; list-style: none; }
.ticks li, .minus li { position: relative; padding-left: 1.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0.15rem; top: 0.42em; width: 0.7rem; height: 0.38rem; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.minus li::before { content: ""; position: absolute; left: 0.15rem; top: 0.78em; width: 0.7rem; height: 2px; background: var(--muted); }

/* How it works */
.steps { display: grid; gap: 1rem; margin: 2.5rem 0 0; padding: 0; list-style: none; counter-reset: step; text-align: left; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: 1rem; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.steps p { margin: 0; color: var(--muted); }

/* Feature cards */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin: 2.5rem 0 0; padding: 0; list-style: none; text-align: left; }
.card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card h3 { margin-bottom: 0.35rem; font-size: 1rem; }
.card p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.tag { display: block; margin-bottom: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* Infrastructure diagram (plain HTML boxes) */
.infra { margin: 0; display: grid; gap: 1rem; }
.infra-account { padding: 1.25rem; border: 2px dashed var(--border-input); border-radius: var(--radius); display: grid; gap: 0.75rem; }
.infra-label { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.infra-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.infra-box { display: grid; gap: 0.15rem; padding: 0.85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.infra-box strong { font-size: 0.95rem; }
.infra-box span { font-size: 0.85rem; color: var(--muted); }
.infra-vault { border-left: 4px solid var(--accent); }
.infra-opt { border-style: dashed; background: transparent; }

/* Pricing */
.pricing { display: grid; gap: 1.5rem; align-items: start; margin-top: 2.5rem; text-align: left; }
@media (min-width: 56rem) { .pricing { grid-template-columns: 3fr 2fr; } }
.price-card { padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.price-card.main { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.price-card h2, .price-card h3 { margin-top: 0; }
.price-card h3 { margin-top: 1.5rem; font-size: 1rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin: 0.25rem 0 0.25rem; }
.amount { font-size: clamp(2.4rem, 2rem + 1.5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.per { color: var(--muted); font-weight: 600; }
.teaser { display: grid; gap: 1.5rem 3rem; align-items: center; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: left; }
@media (min-width: 56rem) { .teaser { grid-template-columns: 1fr 1fr; } }
.teaser .ticks { margin-bottom: 0; }

/* Running costs and the three-year comparison */
.cost-table { width: 100%; margin: 1.5rem 0 0.75rem; border-collapse: collapse; text-align: left; }
.cost-table th, .cost-table td { padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.cost-table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cost-table tbody th { font-weight: 600; }
.bars { display: grid; gap: 0.9rem; margin: 1.5rem 0; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: 0.2rem 1rem; }
.bar { height: 1.75rem; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--accent-fill) var(--w), transparent var(--w)); }
.bar-sam { --w: 40%; }
.bar-range { --w: 62%; --w2: 100%; background: linear-gradient(90deg, var(--muted) var(--w), color-mix(in srgb, var(--muted) 35%, transparent) var(--w) var(--w2), transparent var(--w2)); }
.bar-label { font-weight: 600; }
.bar-value { grid-column: 2; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
@media (min-width: 56rem) { .steps-4 { grid-template-columns: repeat(4, 1fr); } }

/* FAQ */
.faq { max-width: 48rem; margin: 2rem auto 0; text-align: left; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { position: relative; padding: 1.1rem 2.25rem 1.1rem 0; font-weight: 600; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding-bottom: 1.1rem; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Page heads and in-page navigation */
.page-head { padding-block: clamp(2.5rem, 2rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 0.4rem 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); color: var(--fg); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.module-head { max-width: 46rem; margin-bottom: 2.5rem; }
.gallery { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); margin-top: var(--section); }
.gallery h3 { margin-bottom: 0.35rem; }
.gallery p { color: var(--muted); }
.gallery .shot { margin-top: 1rem; }

/* Forms */
.form-layout { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) { .form-layout { grid-template-columns: 7fr 4fr; gap: 4rem; } }
.form { display: grid; gap: 1.15rem; }
.form-row { display: grid; gap: 1.15rem; }
@media (min-width: 40rem) { .form-row { grid-template-columns: 1fr 1fr; } }
.field label, .field legend { display: block; margin-bottom: 0.35rem; padding: 0; font-size: 0.9rem; font-weight: 600; }
.field .hint { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 2.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border-input); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); font: inherit; }
.field textarea { min-height: 9rem; resize: vertical; }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.field label.check, .check { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; font-weight: 400; font-size: 1rem; }
.field .check input, .check input { flex: none; width: 1.15rem; height: 1.15rem; min-height: 0; margin: 0.2rem 0 0; padding: 0; accent-color: var(--accent-fill); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status:empty { display: none; }
.form-status, .notice { margin: 0; padding: 0.85rem 1rem; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--surface-2); }
.is-ok, #sent { border-left-color: var(--ok); }
.is-error, #error { border-left-color: var(--danger); }
.notice { display: none; margin-bottom: 1.5rem; }
.notice:target { display: block; }
.aside-box { padding: 1.5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.next-steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.aside-box h2 { font-size: 1.15rem; }

/* Legal pages */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.25rem; font-size: 1.35rem; }
.prose address { font-style: normal; }
mark.ph { padding: 0 0.25em; border-radius: 3px; background: var(--accent-soft); color: var(--fg); outline: 1px dashed var(--accent); font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

/* Closing band */
.cta-band h2 { margin-bottom: 0.4rem; }

/* Footer */
.site-footer { padding-block: 2.5rem; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem 2rem; }
.footer-inner .brand { margin-right: 0; padding: 0; }
.footer-inner .brand-name { font-size: 1.15rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--fg); }
