/* =========================================================================
 * styles.css — Local AI Reality Check
 * TCB design language: bold navy + circuit trace, white nav, amber action.
 * Accessible-first (large type, high contrast) for the "AI Over 50" audience.
 * ========================================================================= */

:root {
  --navy-950: #071528;
  --navy-900: #0a1b30;
  --navy-800: #0e2a52;
  --navy-700: #163a6e;
  --circuit: #22d3ee;   /* circuit-trace cyan */
  --circuit-dim: #1a3a55;
  --amber: #ffb000;
  --amber-deep: #d98e00;
  --paper: #f6f8fb;
  --white: #ffffff;
  --ink: #0b1c30;
  --muted: #55677e;
  --line: #dfe6ef;
  --green: #1f9d66;
  --red: #c4453c;
  --green-bg: #e7f6ee;
  --red-bg: #fbeceb;
  --amber-bg: #fff3d6;
  --cyan-bg: #e3f7fb;

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(10, 27, 48, 0.06), 0 8px 24px rgba(10, 27, 48, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- nav ---------------- */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand .mark {
  width: 26px; height: 26px;
  display: inline-block;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--navy-800), var(--navy-950));
  position: relative;
}
.brand .mark::after {
  content: "";
  position: absolute; inset: 6px;
  border: 1.5px solid var(--circuit);
  border-radius: 3px;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a {
  color: var(--navy-800);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--amber-deep); text-decoration: underline; }

/* ---------------- hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900) 70%, var(--navy-800));
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 64px 24px 96px;
}
/* circuit trace motif */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--circuit-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--circuit-dim) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.25;
  mask-image: radial-gradient(700px 400px at 70% 20%, black, transparent 75%);
}
.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--circuit);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 18ch;
}
.hero p.lede {
  font-size: 1.18rem;
  color: #c7d6e6;
  max-width: 52ch;
  margin: 0 0 8px;
}
.hero .honesty {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #8fa4bc;
  margin-top: 18px;
}

/* ---------------- calculator card ---------------- */
.calc-wrap {
  max-width: 1080px;
  margin: -56px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.calc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.calc h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 4px;
}
.calc .sub {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 0.98rem;
}

.fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.fieldset legend {
  font-weight: 650;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--navy-900);
  padding: 0;
}
.field-label {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--navy-900);
}
.field-hint { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

/* segmented platform control */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 550;
  background: var(--white);
  transition: border-color .15s, background .15s;
}
.segmented input { accent-color: var(--amber-deep); width: 18px; height: 18px; }
.segmented label:has(input:checked) {
  border-color: var(--navy-800);
  background: var(--cyan-bg);
}

select, input[type="number"], input[type="email"], input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
select:focus, input:focus {
  outline: none;
  border-color: var(--amber-deep);
  box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.22);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.radio-cards label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: var(--white);
}
.radio-cards label:has(input:checked) {
  border-color: var(--navy-800);
  background: var(--cyan-bg);
}
.radio-cards .rc-title { font-weight: 600; display: block; }
.radio-cards .rc-sub { font-size: 0.82rem; color: var(--muted); display: block; margin-top: 2px; }
.radio-cards input { accent-color: var(--amber-deep); margin-top: 3px; }

.spend-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 640px) { .spend-row { grid-template-columns: 1fr; } }

.range-wrap input[type="range"] { width: 100%; accent-color: var(--amber-deep); }
.range-val { font-family: var(--font-mono); font-weight: 600; }

button.cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--navy-950);
  background: var(--amber);
  border: 0;
  border-radius: 12px;
  padding: 16px 34px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
button.cta:hover { background: #ffc53d; }
button.cta:active { transform: translateY(1px); }
button.cta:focus-visible { outline: 3px solid var(--navy-800); outline-offset: 2px; }

/* ---------------- results ---------------- */
.results { max-width: 1080px; margin: 40px auto 0; padding: 0 24px; }
.results[hidden] { display: none; }

.verdict-card {
  border-radius: var(--radius);
  padding: 30px 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.verdict-card.tone-yes { background: var(--green-bg); border-color: #bfe6d3; }
.verdict-card.tone-no { background: var(--red-bg); border-color: #f0cbc8; }
.verdict-card.tone-beyond { background: var(--cyan-bg); border-color: #bfe3ed; }
.verdict-card.tone-neutral { background: var(--paper); }

.verdict-stamp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--navy-900);
}
.verdict-card .verdict-body { font-size: 1.05rem; max-width: 70ch; }

/* readout — the memory→bandwidth derivation made visible */
.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.readout .metric {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--navy-800);
}
.readout .metric b { display: block; font-size: 1.02rem; color: var(--ink); }
.readout .metric .lbl { color: var(--muted); }

.block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-top: 20px;
}
.block h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin: 0 0 10px;
  color: var(--navy-900);
}
.block .estimate-flag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber-deep);
  background: var(--amber-bg);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.model-hero {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--navy-900);
}
.model-sub { color: var(--muted); font-size: 0.95rem; }
.model-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.model-meta .tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
  color: var(--navy-800);
}
.copy-cmd {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--navy-950);
  color: #d9e6f2;
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 8px 0 0;
  white-space: nowrap;
}

.rec-list { list-style: none; padding: 0; margin: 0; }
.rec-list li {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rec-list li:first-child { border-top: 0; }
.rec-list .rec-name { font-weight: 650; }
.rec-list .rec-cmd { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

ul.plain { padding-left: 20px; margin: 6px 0; }
ul.plain li { margin: 6px 0; }

.breakeven-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-900);
}
.breakeven-note { color: var(--muted); font-size: 0.92rem; }

.callout {
  border-left: 4px solid var(--circuit);
  background: var(--cyan-bg);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 12px 0;
  font-size: 0.98rem;
}

/* ---------------- email capture ---------------- */
.capture {
  margin-top: 28px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: var(--white);
  border-radius: var(--radius);
  padding: 34px 32px;
}
.capture h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
}
.capture p { color: #c7d6e6; margin: 0 0 20px; max-width: 60ch; }
.capture .form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.capture input[type="email"] {
  flex: 1 1 260px;
  background: var(--navy-950);
  border-color: var(--navy-700);
  color: var(--white);
}
.capture .privacy { font-size: 0.78rem; color: #8fa4bc; margin-top: 12px; }
.capture .capture-ok {
  font-weight: 600;
  color: var(--circuit);
  margin-top: 12px;
  display: none;
}
.capture .capture-err {
  font-weight: 600;
  color: #ff8a7a;
  margin-top: 12px;
  display: none;
}

/* ---------------- FAQ ---------------- */
.faq { max-width: 1080px; margin: 48px auto; padding: 0 24px; }
.faq h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--navy-900); }
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 10px 0;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* ---------------- footer ---------------- */
footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  margin-top: 48px;
  padding: 40px 24px 56px;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-inner { max-width: 1080px; margin: 0 auto; }
footer a { color: var(--navy-800); }
footer .attribution {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
footer .attribution a { font-weight: 600; }

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

/* focus visibility for keyboard users */
a:focus-visible, summary:focus-visible, label:focus-within {
  outline: 2px solid var(--amber-deep);
  outline-offset: 2px;
}

.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;
}
