/* Switchly Crew – mobile first. Brand blue #2b4bf2 (pkg/brandcolor). */
:root {
  --blue: #2b4bf2;
  --blue-dark: #1f38c4;
  --ink: #141628;
  --ink-2: #4a4d66;
  --muted: #7a7d96;
  --line: #e4e6f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 16px;
  --max: 720px;
}
/* Dark: the system setting unless the viewer picked one with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink: #f1f2fa;
  --ink-2: #c3c6da;
  --muted: #8d90a8;
  --line: #2a2d44;
  --bg: #0f1020;
  --card: #181a30;
  }
}
:root[data-theme="dark"] {
  --ink: #f1f2fa;
  --ink-2: #c3c6da;
  --muted: #8d90a8;
  --line: #2a2d44;
  --bg: #0f1020;
  --card: #181a30;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 750; margin-bottom: 12px; }
h3 { font-size: 1.05rem; font-weight: 700; }
p + p { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

main { max-width: var(--max); margin: 0 auto; padding: 0 16px 48px; }
main.narrow { padding-top: 24px; }
section { margin-top: 40px; }

/* header */
.top {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand b { color: var(--blue); }
.logo { width: 28px; height: 22px; fill: var(--blue); flex: none; }
.top-right { display: flex; align-items: center; gap: 8px; }
.theme { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: none; } :root:not([data-theme="light"]) .theme .moon { display: block; } }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.1rem; width: 100%; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.95rem; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* hero */
.hero { margin-top: 16px; }
.eyebrow { color: var(--blue); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.lead { color: var(--ink-2); font-size: 1.1rem; margin-top: 16px; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 24px; }
.facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.facts b { font-size: 1.15rem; color: var(--blue); }
.facts span { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }

/* steps */
.steps { list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 800;
  display: grid; place-items: center;
}
.steps p { color: var(--ink-2); margin-top: 4px; }

/* rewards */
.tiers { display: grid; gap: 12px; margin-top: 16px; }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tier .amount { display: block; font-size: 1.6rem; font-weight: 800; color: var(--blue); margin-bottom: 4px; }
.tier p { color: var(--ink-2); margin-top: 4px; font-size: 0.95rem; }
.tier-main { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.example { margin-top: 16px; }
.example table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.example td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.example td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.example .total td { border-bottom: 0; font-weight: 800; font-size: 1.1rem; padding-top: 12px; }
.example .small { margin-top: 12px; }

/* who */
.checks { list-style: none; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; color: var(--ink-2); }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--blue); font-weight: 800; }

/* faq */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-top: 8px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-weight: 800; font-size: 1.3rem; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); padding: 0 0 16px; }

/* final */
.final { text-align: center; }
.final .btn { margin-top: 14px; }

footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
footer a { color: inherit; }

@media (min-width: 640px) {
  body { font-size: 18px; }
  section { margin-top: 56px; }
  .hero { margin-top: 40px; text-align: center; }
  .cta { flex-direction: row; justify-content: center; }
  .btn-lg { width: auto; }
  .tiers { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: 1fr 1fr; gap: 24px; }
  .card { padding: 28px 26px; }
}

/* ---- app: nav, forms, lessons, admin ---- */
.tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--line); color: var(--ink-2); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.nav { max-width: var(--max); margin: 0 auto; display: flex; gap: 4px; padding: 0 12px 8px; overflow-x: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 650; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a.on { background: var(--blue); color: #fff; }
.nav a.dim { margin-left: auto; color: var(--muted); }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero-sm { margin-top: 12px; }
.hero-sm h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: 10px; }
.hero-sm .btn-lg { margin-top: 16px; }
main.narrow h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: 6px; }

.form { display: grid; gap: 16px; margin-top: 20px; }
.form label { display: grid; gap: 6px; font-weight: 650; font-size: 0.95rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
.form textarea { min-height: 120px; line-height: 1.45; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.form input:disabled { color: var(--muted); }
.form .btn { margin-top: 6px; }
.form h2 { margin-top: 10px; margin-bottom: 0; }
.check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 500 !important; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.hint code { background: var(--line); padding: 1px 5px; border-radius: 4px; font-size: 0.8rem; }
.err { color: #d33; font-weight: 600; font-size: 0.85rem; }
.flash { background: var(--card); border: 1px solid var(--blue); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.flash-err { border-color: #d33; }
.flash-ok { border-color: #2a9d5c; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 18px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { width: 100%; background: var(--card); color: var(--ink); border: 1px solid var(--line); margin-top: 16px; }
.btn-google:hover { background: var(--line); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line); }

.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .3s; }
.lessons { list-style: none; counter-reset: l; display: grid; gap: 8px; }
.lessons li { counter-increment: l; }
.lessons li a { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.lessons li a::before { content: counter(l); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; color: var(--muted); }
.lessons li.done a::before { content: "✓"; background: var(--blue); border-color: var(--blue); color: #fff; }
.lessons li a span { grid-column: 2; color: var(--muted); font-size: 0.85rem; }
.lessons.plain li a::before { content: "→"; border: 0; }
.lessons li.draft a { opacity: .6; border-style: dashed; }
.soon { margin-top: 16px; }
.soon h2 { margin-bottom: 8px; }

.lesson .lead { margin-top: 8px; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 20px 0; border-radius: 12px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.body { margin-top: 20px; }
.body h2 { margin-top: 28px; }
.body p { margin: 12px 0; }
.body ul { margin: 12px 0 12px 22px; }
.body li { margin: 6px 0; }
.body blockquote { border-left: 4px solid var(--blue); background: var(--card); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 14px 0; font-style: italic; }
.body figure { margin: 18px 0; }
.body img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.body figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; text-align: center; }
.lesson-actions { margin-top: 28px; display: grid; gap: 10px; }

.quiz fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--card); }
.quiz legend { font-weight: 700; padding: 0 6px; }
.checks.wrong li::before { content: "?"; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 650; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tr.dim td { opacity: .55; }
.grid2 { display: grid; gap: 16px; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .btn-google { width: auto; }
}
main.narrow h2 { margin-top: 24px; }
.verify { margin-top: 16px; }
.verify.ok { border-color: #2a9d5c; }
.verify h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.form.code { margin-top: 10px; }
.form.code input { font-size: 1.4rem; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.resend { margin-top: 10px; }
.resend button, button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
