:root {
  color-scheme: light dark;
  --bg: #fbf7f1;
  --surface: #ffffff;
  --text: #211c17;
  --muted: #6a6258;
  --accent: #d9480f;
  --accent-text: #ffffff;
  --border: #e6ddd0;
  --track: #efe7db;
  --glow: rgba(217, 72, 15, 0.12);
  --error: #c92a2a;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 12px 32px rgba(60, 40, 20, 0.08);
  --roll: 450ms cubic-bezier(0.7, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1b18;
    --surface: #2a2521;
    --text: #f6f1ea;
    --muted: #b9afa3;
    --accent: #ff8a4c;
    --accent-text: #1f1b18;
    --border: #40382f;
    --track: #3a322b;
    --glow: rgba(255, 138, 76, 0.16);
    --error: #ff8787;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(70rem 30rem at 50% -8rem, var(--glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  container-type: inline-size;
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1rem 3rem;
}

/* Author display rules (like form { display: grid }) would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

a { color: inherit; }
h1, h2 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Homepage ---------- */

.hero { text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.85rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 0.5rem transparent; }
}

@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* One line at every width: sized so the longest rotating word still fits the column. */
.hero h1 {
  font-size: min(3rem, 6.2cqw);
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

/* Slot-machine word: a one-line window over a vertical stack of words. */
.rotator {
  display: inline-block;
  height: 1.4em;
  overflow: hidden;
  vertical-align: top;
  color: var(--accent);
  transition: width var(--roll);
}

.rotator-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform var(--roll);
}

/* Taller than the glyphs so a descender (the p in "Experience") never reaches the next slot. */
.rotator-word { height: 1.4em; }

.lede { margin: 0.25rem auto 2rem; max-width: 30rem; color: var(--muted); font-size: 1.2rem; }

.card {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 { font-size: 1.35rem; }
.subtitle { margin: 0.25rem 0 1.25rem; color: var(--muted); }

form { display: grid; gap: 0.6rem; }
label { font-weight: 600; font-size: 0.9rem; }

.signup-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
@media (max-width: 30rem) { .signup-row { grid-template-columns: 1fr; } }

input {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

input::placeholder { color: var(--muted); opacity: 0.8; }

button {
  padding: 0.85rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 0.7rem;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }
button:disabled { opacity: 0.6; cursor: progress; }
button.secondary { color: var(--text); background: var(--track); }

input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

details { color: var(--muted); font-size: 0.95rem; }
summary { cursor: pointer; margin: 0.25rem 0 0.5rem; }

#status { margin: 0; min-height: 1.4em; color: var(--error); font-size: 0.95rem; }
.fine { margin: 0; color: var(--muted); font-size: 0.85rem; }

.success { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.35rem; font-weight: 700; }
.check {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 50%;
  font-size: 1rem;
}

.progress { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.bar { height: 0.55rem; overflow: hidden; background: var(--track); border-radius: 999px; }
.bar > span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width 600ms ease; }
.progress .fine { margin-top: 0.5rem; }

.steps { margin-top: 3rem; }
.steps h2 { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.steps ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; color: var(--muted); font-size: 0.95rem; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.6rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 50%;
  font-weight: 700;
}
@media (max-width: 36rem) { .steps ol { grid-template-columns: 1fr; } }

footer { padding: 1.5rem 1rem 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
footer p { margin: 0.25rem 0; }

/* ---------- Article pages (features, privacy) ---------- */

.prose h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; margin: 1rem 0 0.5rem; }
.prose h2 { font-size: 1.15rem; margin: 2rem 0 0.25rem; }
.prose p { margin: 0.5rem 0; }
.prose h1 + p { color: var(--muted); font-size: 1.2rem; }
