/* MWATHS front door and landing pages. One file for all three; the <body> class picks
   the look: .home (mwaths.com), .teacher (teacher.mwaths.com), .learn (learn.mwaths.com).
   No inline styles anywhere: the Content-Security-Policy (src/worker.js) blocks them. */

@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/shared/lexend/lexend-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/shared/lexend/lexend-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------ tokens */
:root {
  --green: #0B321F;
  --gold: #DDAE43;
  --on-green: #ffffff;
  --on-green-soft: #dfe9e3;
  --font: "Lexend", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --w-text: 375; --w-semi: 500; --w-bold: 600;
}

/* Teacher: the Quizzer's board colours. */
body.teacher {
  --bg: #f4f6f8; --board: #ffffff; --ink: #13233f; --muted: #5a6883; --line: #d5dbe6;
  --btn-bg: #0B321F; --btn-ink: #ffffff; --hover: rgba(19, 35, 63, 0.06);
  --tag: #e8eef9; --tag-ink: #1f4fbf; --soon: #eef0f4;
  --lit: #f4e8f5; --lit-ink: #8a3a8f; --num: #e5eefa; --num-ink: #285fa3;
}
/* Student: warmer and rounder, green ink, gold buttons. */
body.learn {
  --bg: #fbf7ec; --board: #ffffff; --ink: #0B321F; --muted: #4d6155; --line: #e7dfc8;
  --soft: #f5ecd2; --hover: rgba(11, 50, 31, 0.06); --field: #ffffff; --field-line: #0B321F;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.teacher {
    --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
    --btn-bg: #DDAE43; --btn-ink: #0B321F; --hover: rgba(242, 240, 228, 0.08);
    --tag: rgba(143, 211, 255, 0.14); --tag-ink: #8fd3ff; --soon: rgba(242, 240, 228, 0.06);
    --lit: rgba(231, 169, 239, 0.14); --lit-ink: #e7a9ef; --num: rgba(142, 195, 255, 0.14); --num-ink: #8ec3ff;
  }
  :root:not([data-theme="light"]) body.learn {
    --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
    --soft: #1c3a31; --hover: rgba(242, 240, 228, 0.08); --field: #10231f; --field-line: #DDAE43;
  }
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] body.teacher {
  --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
  --btn-bg: #DDAE43; --btn-ink: #0B321F; --hover: rgba(242, 240, 228, 0.08);
  --tag: rgba(143, 211, 255, 0.14); --tag-ink: #8fd3ff; --soon: rgba(242, 240, 228, 0.06);
  --lit: rgba(231, 169, 239, 0.14); --lit-ink: #e7a9ef; --num: rgba(142, 195, 255, 0.14); --num-ink: #8ec3ff;
}
:root[data-theme="dark"] body.learn {
  --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
  --soft: #1c3a31; --hover: rgba(242, 240, 228, 0.08); --field: #10231f; --field-line: #DDAE43;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-weight: var(--w-text); line-height: 1.5;
  background: var(--bg); color: var(--ink);
}
h1, h2, h3 { margin: 0; font-weight: var(--w-bold); line-height: 1.15; text-wrap: balance; }
p, ul, ol { margin: 0; }
a { color: inherit; }
b, strong { font-weight: var(--w-bold); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (min-width: 640px) { .wrap { padding-left: 24px; padding-right: 24px; } }
.eyebrow { font-size: 0.82rem; font-weight: var(--w-bold); letter-spacing: 0.06em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.notfound { max-width: 640px; margin: 80px auto; padding: 0 16px; display: grid; gap: 12px; }

/* ------------------------------------------------------------ shared header bits */
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { display: block; border-radius: 10px; overflow: hidden; }
.brand-logo img { display: block; height: 48px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-weight: var(--w-semi); padding: 10px 12px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 10px; background: none; font: inherit; font-weight: var(--w-semi); cursor: pointer;
}
.theme-btn .sun { display: none; }
.theme-btn[aria-pressed="true"] .sun { display: block; }
.theme-btn[aria-pressed="true"] .moon { display: none; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ============================================================ mwaths.com: the front door */
body.home { background: var(--green); color: var(--on-green); }
.door-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 28px; }
.door-inner { width: 100%; max-width: 980px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.door-logo { width: 320px; max-width: 70%; height: auto; display: block; }
.door-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.door-head h1 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.8rem); }
.door-head p { color: var(--on-green-soft); font-size: 1.1rem; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; width: 100%; }
.door {
  display: flex; flex-direction: column; gap: 12px; padding: 32px; border-radius: 22px;
  text-decoration: none; color: var(--green); transition: transform 0.15s ease;
}
.door:hover { transform: translateY(-3px); }
.door:focus-visible { outline: 4px solid #ffffff; outline-offset: 4px; }
.door h2 { font-size: 1.9rem; }
.door-teacher { background: #ffffff; }
.door-teacher p { color: #3f5a4b; }
.door-student { background: var(--gold); }
.door-student p { color: #23361f; }
.door .go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: var(--w-bold); font-size: 1.05rem; padding-top: 4px; }
.remember { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--on-green-soft); cursor: pointer; }
.remember input { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }
.door-free { color: #a9c2b5; font-size: 0.9rem; }
@media (prefers-reduced-motion: reduce) { .door { transition: none; } .door:hover { transform: none; } }

/* ============================================================ teacher.mwaths.com */
body.teacher .top { background: var(--green); color: var(--on-green); }
body.teacher .brand-tag { font-weight: var(--w-bold); color: var(--gold); border-left: 1.5px solid rgba(255, 255, 255, 0.35); padding-left: 12px; }
body.teacher .nav-links a { color: #ffffff; }
body.teacher .nav-links a:hover { background: rgba(255, 255, 255, 0.1); }
body.teacher .nav-links a.to-students { color: var(--gold); }
body.teacher .theme-btn { color: #ffffff; border: 1.5px solid rgba(255, 255, 255, 0.5); }
body.teacher .theme-btn:hover { background: rgba(255, 255, 255, 0.1); }

.t-hero { background: var(--green); color: var(--on-green); border-bottom: 4px solid var(--gold); }
.t-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 36px; padding-bottom: 56px; flex-wrap: wrap; }
.t-hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.t-hero .eyebrow { color: var(--gold); }
.t-hero h1 { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem); }
.t-hero .lede { font-size: 1.15rem; max-width: 34em; color: var(--on-green-soft); }
.ticks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks svg { flex: none; margin-top: 2px; }
.t-hero-cta { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.btn-gold {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 26px; border-radius: 10px;
  background: var(--gold); color: var(--green); font-weight: var(--w-bold); font-size: 1.05rem; text-decoration: none;
}
.btn-gold:hover { filter: brightness(1.08); }
.t-hero-addr { color: var(--on-green-soft); font-weight: var(--w-semi); }
.t-hero-logo { flex: 0 1 420px; width: 420px; max-width: 100%; height: auto; display: block; }
@media (max-width: 760px) { .t-hero-logo { display: none; } }

.section { padding-top: 56px; padding-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; }
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; max-width: 44em; }
.strand { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1.5px solid var(--line); }
.strand-name { display: flex; flex-direction: column; gap: 4px; }
.strand-name .eyebrow { color: var(--muted); }
.strand-name h3 { font-size: 1.35rem; }
@media (max-width: 820px) { .strand { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.card { background: var(--board); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 10px; background: var(--btn-bg); color: var(--btn-ink); font-weight: var(--w-bold); text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.addr { font-weight: var(--w-semi); color: var(--muted); font-size: 0.92rem; }
.tag-yr { display: inline-flex; align-items: center; font-size: 0.8rem; font-weight: var(--w-bold); padding: 2px 10px; border-radius: 999px; background: var(--tag); color: var(--tag-ink); white-space: nowrap; }
.tag-yr.soon { background: var(--soon); color: var(--muted); }
.tag-yr.lit { background: var(--lit); color: var(--lit-ink); }
.tag-yr.num { background: var(--num); color: var(--num-ink); }

.bag-card { display: flex; flex-wrap: wrap; }
.bag-main { flex: 1 1 340px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.bag-title { display: flex; align-items: center; gap: 14px; }
.bag-title h4 { margin: 0; font-size: 1.5rem; font-weight: var(--w-bold); line-height: 1.15; }
.bag-title span { color: var(--muted); font-size: 0.95rem; }
.icon-tile { width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #ffffff; }
.icon-tile.bag { background: #1f4fbf; }
.icon-tile.quiz { background: var(--green); color: var(--gold); }
.muted { color: var(--muted); }
.bag-actions { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 6px; }
.bag-levels { flex: 1 1 360px; min-width: 0; padding: 24px; border-left: 1.5px solid var(--line); background: var(--bg); }
.bag-levels .eyebrow { color: var(--muted); padding-bottom: 6px; }
.levels { list-style: none; padding: 0; }
.levels li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.levels li:first-child { border-top: 0; }
.levels .now { font-weight: var(--w-semi); }
.levels .later { color: var(--muted); }
@media (max-width: 760px) { .bag-levels { border-left: 0; border-top: 1.5px solid var(--line); } }

.starters { padding-top: 40px; padding-bottom: 64px; }
.starters-card { display: flex; flex-wrap: wrap; align-items: stretch; }
.starters-icon { flex: 0 0 auto; width: 120px; background: #4b3f9e; color: #ffffff; display: flex; align-items: center; justify-content: center; padding: 20px; }
.starters-body { flex: 1 1 420px; min-width: 0; padding: 24px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.starters-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.starters-text h3 { font-size: 1.5rem; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
@media (max-width: 560px) { .starters-icon { width: 100%; padding: 16px; } }

.foot { border-top: 1.5px solid var(--line); }
.foot-inner { padding-top: 24px; padding-bottom: 36px; display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }

/* ============================================================ learn.mwaths.com */
body.learn { font-size: 17px; }
body.learn .top { border-bottom: 2px solid var(--line); }
body.learn .brand-logo { border-radius: 12px; }
.tag-gold { display: inline-flex; align-items: center; font-size: 0.82rem; font-weight: var(--w-bold); padding: 3px 12px; border-radius: 999px; background: var(--gold); color: var(--green); white-space: nowrap; }
body.learn .nav-links a { border-radius: 999px; padding: 10px 14px; }
body.learn .nav-links a:hover { background: var(--hover); }
body.learn .theme-btn { color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 16px; }
body.learn .theme-btn:hover { background: var(--hover); }

.l-card { background: var(--board); border: 2px solid var(--line); border-radius: 24px; overflow: hidden; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; background: var(--gold); color: var(--green); font: inherit; font-weight: var(--w-bold);
  font-size: 1.05rem; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap;
}
.pill:hover { filter: brightness(1.07); }
.pill.big { min-height: 58px; padding: 0 34px; font-size: 1.15rem; }
.tag-soft { display: inline-flex; align-items: center; font-size: 0.82rem; font-weight: var(--w-bold); padding: 3px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); white-space: nowrap; }

.practise { padding-top: 44px; padding-bottom: 44px; }
.practise-card { display: flex; flex-wrap: wrap; align-items: stretch; border-width: 2.5px; }
.practise-text { flex: 1 1 460px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.practise-text .eyebrow { color: var(--muted); }
.practise-text h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem); }
.practise-text .lede { color: var(--muted); font-size: 1.1rem; max-width: 30em; }
.practise-go { padding-top: 6px; }
.preview { flex: 0 1 400px; min-width: 0; background: var(--green); color: #ffffff; padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.qrow { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 4px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.qrow:first-child { border-top: 0; }
.qrow .n { color: #a9c2b5; font-weight: var(--w-bold); }
.qrow .a { color: var(--gold); font-weight: var(--w-bold); }
@media (max-width: 720px) {
  .practise-text { padding: 26px 22px; }
  .preview { display: none; }
}

.join { padding-top: 8px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 20px; }
.join-head { display: flex; flex-direction: column; gap: 6px; }
.join-head h2 { font-size: 1.9rem; }
.join-head p { color: var(--muted); max-width: 46em; }
.join-strand { display: flex; flex-direction: column; gap: 10px; }
.join-strand .eyebrow { color: var(--muted); }
.bag-join { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; padding: 24px; }
.bag-join .icon-tile { width: 64px; height: 64px; border-radius: 20px; }
.bag-join-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bag-join-text h3 { font-size: 1.4rem; }
.bag-join-text p { color: var(--muted); }
.code-form { flex: 0 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.code-form label { font-weight: var(--w-bold); font-size: 0.95rem; }
.code-row { display: flex; gap: 10px; flex-wrap: wrap; }
.code {
  flex: 1 1 180px; min-width: 0; font: inherit; font-size: 1.4rem; font-weight: var(--w-bold); letter-spacing: 0.25em;
  text-transform: uppercase; min-height: 56px; padding: 0 18px; border-radius: 16px;
  border: 2.5px solid var(--field-line); background: var(--field); color: var(--ink);
}
.code::placeholder { color: #8a978f; letter-spacing: 0.25em; }
.code:focus { outline: 4px solid var(--gold); outline-offset: 2px; }
.code[aria-invalid="true"] { border-color: #c0264d; }
.code-msg { min-height: 1.5em; font-size: 0.92rem; font-weight: var(--w-semi); color: #b0203f; }
:root[data-theme="dark"] .code-msg { color: #ffb4c4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code-msg { color: #ffb4c4; } }

body.learn .foot { border-top: 2px solid var(--line); }
