/* styles.css — layout and components. All colour/type values come from tokens.css. */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: var(--leading-tight); text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: var(--step-3); letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }
.section { padding-block: var(--section-gap); }
.muted { color: var(--text-muted); }
.small { font-size: var(--step--1); }
.center { text-align: center; }
.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;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.wordmark {
  font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.wordmark::after { content: "."; color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: clamp(0.75rem, 3vw, 1.5rem); }
.header-nav a { color: var(--text-muted); text-decoration: none; font-size: var(--step--1); }
.header-nav a:hover { color: var(--text); text-decoration: underline; }

.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius); padding: 0.35rem 0.6rem; cursor: pointer;
  font: inherit; font-size: var(--step--1); line-height: 1;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3rem); }
.eyebrow {
  display: inline-block; font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.75rem;
}
.hero p.lede { font-size: var(--step-1); color: var(--text-muted); max-width: var(--measure); }

/* ---------- Signup form ---------- */
.signup { margin-top: 1.75rem; max-width: 30rem; }
.signup-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 15rem; min-width: 0;
  padding: 0.7rem 0.85rem;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.signup input[type="email"]::placeholder { color: var(--text-faint); }
.signup input[type="email"]:focus-visible { border-color: var(--brand); }

.btn {
  display: inline-block; padding: 0.7rem 1.25rem;
  font: inherit; font-weight: 600; line-height: inherit;
  color: var(--brand-contrast); background: var(--brand);
  border: 1px solid var(--brand); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-contrast); }
.btn-secondary {
  color: var(--brand); background: transparent; border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-sunken); color: var(--brand-hover); }

.form-note { margin-top: 0.6rem; font-size: var(--step--1); color: var(--text-faint); }

.setup-warning {
  margin-top: 0.75rem; padding: 0.6rem 0.8rem;
  border: 1px dashed var(--warn); border-radius: var(--radius);
  color: var(--warn); font-size: var(--step--1);
}

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.35rem;
}
.card h3 { margin-bottom: 0.35rem; font-size: var(--step-0); }
.card p { margin: 0; color: var(--text-muted); font-size: var(--step--1); }
.card .num {
  display: block; font-family: var(--font-mono); font-size: var(--step--1);
  color: var(--accent); margin-bottom: 0.4rem;
}

.alt { background: var(--surface-sunken); border-block: 1px solid var(--border); }

/* ---------- Lists ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding-left: 1.6rem; margin-bottom: 0.6rem; }
.checklist li::before {
  content: "→"; position: absolute; left: 0; color: var(--brand); font-weight: 700;
}

/* ---------- Sample issue ---------- */
.sample {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2rem); margin-top: 1.5rem;
}
.sample-chrome {
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.85rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--step--1); color: var(--text-faint); font-family: var(--font-mono);
}
.sample h3 { font-family: var(--font-serif); }
.sample .issue-section { margin-bottom: 1.5rem; }
.sample .issue-section:last-child { margin-bottom: 0; }
.sample .label {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.3rem;
}
.sample ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); }
.sample li { margin-bottom: 0.4rem; }

/* ---------- FAQ ---------- */
details {
  border-bottom: 1px solid var(--border); padding-block: 0.9rem;
}
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--brand); font-weight: 700; flex: none; }
details[open] summary::after { content: "–"; }
details p { margin: 0.7rem 0 0; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding-block: 2rem 3rem;
  color: var(--text-faint); font-size: var(--step--1);
}
.site-footer a { color: var(--text-muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }

/* ---------- Scrollable overflow ---------- */
.scroll-x { overflow-x: auto; max-width: 100%; }
