/* Shared look for the student page and the tutor page. Mobile first.
   "Paper and ink": warm cream paper, warm-white cards, deep navy ink, one blue for the thing to tap.
   Always light: the page never follows a device's dark setting and has no dark theme. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght.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;
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-wght.woff2") format("woff2-variations"), url("../fonts/fraunces-latin-wght.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;
}

:root {
  /* surfaces */
  --bg: #F6F1E6; --card: #FFFDF8; --ink: #172038; --dim: #5A6275;
  --line: #E7E0D0;   /* hairlines and quiet fills */
  --edge: #7F8496;   /* the border of anything you can tap or type in */
  --sunk: #F5F0E5;   /* a quiet well inside a card */
  /* the one loud colour: the next thing to tap */
  --accent: #2449C6; --accent-hover: #1C3BA8; --accent-ink: #FFFFFF; --accent-soft: #E5EBFA;
  /* meaning */
  --good: #1E6B46; --good-soft: #E2F0E2;
  --bad: #AE3A26; --bad-soft: #FAE6DF; --warn: #855600; --warn-soft: #F7EAC6;
  /* levels: Not started, Needs work, Familiar, Proficient, Mastered */
  --lv0: #CEC6B4; --lv1: #D4573F; --lv2: #C28A12; --lv3: #3A9A72; --lv4: #12603F;
  --radius: 20px; --r-sm: 10px; --r-md: 14px; --tap: 48px;
  --shadow: 0 1px 1px rgb(23 32 56 / 0.04), 0 4px 16px rgb(23 32 56 / 0.06);
  --shadow-lift: 0 1px 2px rgb(23 32 56 / 0.06), 0 8px 24px rgb(23 32 56 / 0.09);
  --glass: rgb(255 253 248 / 0.82);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-family: var(--sans);
  font-feature-settings: "cv05" 1; /* Inter: lowercase l with a tail, so l, I and 1 never look alike */
  color-scheme: only light; /* "only" also opts out of a browser's forced dark mode */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
main { max-width: 680px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
main.wide { max-width: 1120px; }
h1, h2 { font-family: var(--serif); font-weight: 580; letter-spacing: -0.012em; font-optical-sizing: auto; }
h1 { font-size: 1.6rem; margin: 8px 0 12px; line-height: 1.18; }
h2 { font-size: 1.22rem; margin: 22px 0 8px; line-height: 1.25; }
h3 { font-size: 1rem; margin: 14px 0 4px; font-weight: 650; }
p { margin: 8px 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--accent-soft); }
.dim { color: var(--dim); }
.small { font-size: 0.875rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack > * + * { margin-top: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }

/* The one focal card: deep ink with cream type and a cream button. Its children read these local colours. */
.card.hero {
  --card: #172038; --ink: #F6F1E6; --dim: #BEC3D2; --line: rgb(246 241 230 / 0.14); --edge: rgb(246 241 230 / 0.5);
  --sunk: rgb(246 241 230 / 0.07); --bg: rgb(246 241 230 / 0.07);
  --accent: #F6F1E6; --accent-hover: #FFFFFF; --accent-ink: #172038; --accent-soft: rgb(246 241 230 / 0.12);
  --good: #8ED3AC; --good-soft: rgb(142 211 172 / 0.14); --bad: #F4A08C; --bad-soft: rgb(244 160 140 / 0.14);
  --warn: #EBC877; --warn-soft: rgb(235 200 119 / 0.14);
  --lv0: rgb(246 241 230 / 0.25);
  background: var(--card); color: var(--ink); border-color: #172038;
  box-shadow: 0 1px 2px rgb(23 32 56 / 0.12), 0 10px 30px rgb(23 32 56 / 0.18);
}
.card.hero .eyebrow { color: #A9BBFF; }
/* Two focal cards on one page is none: only the last one stays ink, the ones above it go back to paper. */
.card.hero:has(~ .card.hero) {
  --card: inherit; --ink: inherit; --dim: inherit; --line: inherit; --edge: inherit; --sunk: inherit; --bg: inherit;
  --accent: inherit; --accent-hover: inherit; --accent-ink: inherit; --accent-soft: inherit; --good: inherit; --good-soft: inherit;
  --bad: inherit; --bad-soft: inherit; --warn: inherit; --warn-soft: inherit; --lv0: inherit;
  border-color: var(--line); box-shadow: var(--shadow);
}
.card.hero:has(~ .card.hero) .eyebrow { color: var(--accent); }

/* The wordmark: a blue rounded square with a cream A, then the name in the serif. */
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--accent); color: #FFFDF8; display: grid; place-items: center;
  font-family: var(--serif); font-size: 0.95rem; font-weight: 650; line-height: 1; box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: var(--r-md); border: 1px solid var(--edge); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; letter-spacing: -0.005em; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(23 32 56 / 0.12); }
.btn.primary:active:not(:disabled) { background: var(--accent-hover); box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--dim); font-weight: 550; box-shadow: none; }
/* A button that cannot be pressed yet is grey, not a faded copy of the main colour. */
.btn:disabled, .btn.primary:disabled { background: var(--line); border-color: var(--line); color: var(--dim); cursor: default; box-shadow: none; }
.btn.quiet:disabled { background: transparent; border-color: transparent; opacity: 0.6; }
.btn:focus-visible, .choice:focus-visible, .bubble:focus-visible, input:focus-visible, select:focus-visible,
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* A heading is focused by script when the screen changes, for screen readers. It needs no visible box. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }

label { display: block; font-weight: 600; font-size: 0.94rem; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select {
  width: 100%; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--edge);
  background: var(--card); color: var(--ink); font: inherit;
}
input::placeholder { color: var(--dim); opacity: 0.8; }
input:focus-visible, select:focus-visible { border-color: var(--accent); outline-offset: 1px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type=date] { appearance: none; -webkit-appearance: none; display: flex; align-items: center; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.error { color: var(--bad); margin: 8px 0; font-weight: 550; }
.error:empty { margin: 0; }

/* One question on screen. Stems and choices stay in the sans: digits and letters are unambiguous. */
.stem { font-size: 1.15rem; margin: 4px 0 16px; white-space: pre-wrap; line-height: 1.55; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 10px 14px; margin-top: 10px;
  border-radius: var(--r-md); border: 1px solid var(--edge); background: var(--card); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; white-space: pre-wrap; -webkit-tap-highlight-color: transparent;
}
.choice.right, .choice.right:hover { border-color: var(--good); background: var(--good-soft); }
.choice.wrong, .choice.wrong:hover { border-color: var(--bad); background: var(--bad-soft); }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); }
.feedback.miss { background: var(--bad-soft); }

/* A rule card. */
.rule { font-size: 1.1rem; line-height: 1.55; }
.formula {
  font-size: 1.3rem; font-weight: 650; margin: 12px 0; overflow-wrap: anywhere; font-variant-numeric: lining-nums;
  padding: 12px 16px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-md); letter-spacing: 0.005em;
}
.note { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.note strong { color: var(--warn); }
.book { font-size: 0.875rem; color: var(--dim); }

/* Answer sheet for real ACT questions. */
.sheet-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-row:first-child { border-top: 0; }
.qnum { width: 2.4em; font-weight: 650; font-variant-numeric: tabular-nums; }
.bubble {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--edge); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bubble.on, .bubble.on:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bubble.key { border: 2px solid var(--good); }
.mark { font-weight: 700; }
.mark.ok { color: var(--good); }
.mark.no { color: var(--bad); }

/* Levels. */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--sunk); border: 1px solid var(--line); line-height: 1.4; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.lv0 { background: var(--lv0); } .lv1 { background: var(--lv1); } .lv2 { background: var(--lv2); }
.lv3 { background: var(--lv3); } .lv4 { background: var(--lv4); }
.chip.status-behind { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.status-on-pace, .chip.status-ahead, .chip.status-done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.status-starting, .chip.status-last-stretch, .chip.status-test-day { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.status-past { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.cells { display: flex; flex-wrap: wrap; gap: 4px; }
.cell { width: 22px; height: 22px; border-radius: 6px; border: 0; padding: 0; cursor: pointer; }

.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #172038; color: #F6F1E6; padding: 11px 18px; border-radius: 999px; z-index: 10; max-width: 90vw;
  font-weight: 550; font-size: 0.94rem; box-shadow: 0 8px 28px rgb(23 32 56 / 0.25);
}
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; color: var(--dim); font-weight: 650; border-top: 0; letter-spacing: 0.06em; text-transform: uppercase; padding-bottom: 8px; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }

/* Hover only where there is a mouse, so a tapped choice on a phone does not stay lit. */
@media (hover: hover) {
  .btn:hover:not(:disabled) { border-color: var(--ink); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn.quiet:hover:not(:disabled) { border-color: transparent; background: var(--sunk); color: var(--ink); }
  input:hover, select:hover { border-color: var(--ink); }
  .choice:hover { border-color: var(--accent); background: var(--accent-soft); }
  .choice.right:hover { border-color: var(--good); background: var(--good-soft); }
  .choice.wrong:hover { border-color: var(--bad); background: var(--bad-soft); }
  .bubble:hover { border-color: var(--accent); background: var(--accent-soft); }
  .bubble.on:hover { background: var(--accent); border-color: var(--accent); }
}
/* Motion: hover and press only, short, and never for people who ask for less. */
@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width 0.3s ease; }
  .btn, .choice, .bubble, input, select, .linkbtn, .tabbar a { transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease; }
  .btn:active:not(:disabled), .choice:active, .bubble:active { transform: scale(0.985); }
}
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #111; --dim: #444; --line: #ccc; --edge: #999; --sunk: #f4f4f4; --shadow: none; color-scheme: light; }
  .card.hero { --card: #fff; --ink: #111; --dim: #444; --line: #ccc; --bg: #f4f4f4; --accent: #111; --accent-soft: #eee; border-color: #bbb; box-shadow: none; }
  .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border-color: #bbb; break-inside: avoid; box-shadow: none; }
}
