/* OnlineExams landing front v3 — the founder-letter treatment.
   Standalone stylesheet, loaded only by app/views/layouts/landing_v3.html.erb,
   the same way landing_v2.css is scoped to the v2 layout. Ported from the design
   artifact "Built in the Staffroom". */

/* Deliberately single-theme: this is a founder's letter on staffroom-blue paper.
   The look is committed, so there is no dark variant, but every colour is a
   token and the body ground is painted explicitly so it holds on any host. */
:root {
  --bg:      #e8f0f6;   /* cool blue-grey, the staffroom wall            */
  --panel:   #edf3f8;   /* barely lifted off the page blue, so cards do not glare */
  --ink:     #1c3a4b;   /* deep slate-blue, headings and letter body     */
  --muted:   #4a6472;   /* muted slate, labels and captions (>= 4.5:1 on --bg) */
  --line:    #c4d8e6;   /* hairline                                      */
  --mark:    #f2d544;   /* highlighter yellow, the marking pen, the one accent */
  --mark-ink:#5f4908;   /* readable text on a yellow wash                */
  --bar:     #2e6d9e;   /* accent blue, checkmarks and highlights        */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.14em; text-decoration-thickness: 0.06em; }

::selection { background: color-mix(in srgb, var(--mark) 55%, transparent); color: var(--ink); }

.util {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---- top nav ------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav .row {
  max-width: 60rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  padding: 1rem 0;
}
.nav .brand { font-weight: 600; font-size: 1.14rem; letter-spacing: -0.01em; }
.nav .links { display: flex; gap: 1.35rem; font-size: 0.84rem; }
.nav .links a { text-decoration: none; color: var(--muted); }
.nav .links a:hover { color: var(--ink); }

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

/* ---- hero ------------------------------------------------------------- */
.hero { padding: 2.6rem 0 2.2rem; }
.hero-grid {
  max-width: 60rem; margin: 0 auto; padding: 0 1.5rem;
  display: grid; gap: 1.7rem; align-items: start;
}
.hero-main { min-width: 0; max-width: 40rem; }
@media (min-width: 780px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 16.5rem; gap: 3rem; }
  .hero-main { grid-column: 1; }
  .hero-grid .signin { grid-column: 2; margin-top: 2.2rem; }
}
.byline {
  font-style: italic; font-size: 0.92rem; color: var(--muted);
  margin: 0 0 0.9rem;
}
h1 {
  font-weight: 500;
  font-size: clamp(1.9rem, 1.2rem + 2.8vw, 2.55rem);
  line-height: 1.24;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}
.lede { font-size: 1.12rem; margin: 0 0 1.6rem; }
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.btn {
  font-family: system-ui, sans-serif; font-weight: 600; font-size: 0.9rem;
  padding: 0.72rem 1.35rem; border-radius: 0.4rem;
  text-decoration: none; display: inline-block; cursor: pointer; border: none;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #24485c; }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

/* ---- sections --------------------------------------------------------- */
.section {
  display: flex; flex-direction: column; gap: 1.15rem;
  padding: 2.6rem 0;
}
.section + .section { border-top: 1px solid var(--line); }
.section h2 {
  font-weight: 600; font-size: 1.4rem; letter-spacing: -0.01em;
  margin: 0; text-wrap: balance;
}
.section p { margin: 0; }

/* ---- signal grid (aligned cards, after Marker's Desk) ------------------- */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.metric {
  border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 1.05rem 1.1rem;
  font-family: system-ui, sans-serif;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.metric h3 {
  font-family: system-ui, sans-serif; font-weight: 600;
  font-size: 0.9rem; line-height: 1.4; margin: 0; color: var(--ink);
}
.metric p { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--muted); }

/* ---- check list --------------------------------------------------------- */
ul.check { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.85rem; }
ul.check li {
  display: flex; gap: 0.7rem;
  font-family: system-ui, sans-serif; font-size: 0.93rem; line-height: 1.55;
}
ul.check li::before {
  content: "\2713"; color: var(--bar); flex-shrink: 0; margin-top: 0.1rem;
  font-weight: 700;
}
ul.check b { color: var(--ink); }

/* ---- data panel (the marker's desk) --------------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 0.6rem; padding: 1.5rem;
  font-family: system-ui, sans-serif;
}
.panel .ph {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 0.4rem;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 1.1rem;
}
.panel .ph b { color: var(--ink); font-size: 0.95rem; }
.panel .ph .mono { font-variant-numeric: tabular-nums; }

.ia-question {
  font-family: system-ui, sans-serif; font-size: 0.88rem; line-height: 1.5;
  color: var(--ink); margin: 0 0 1.1rem;
}

.ia-table-wrap, .distractor-table-wrap { overflow-x: auto; }

.ia-table, .distractor-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem; white-space: nowrap;
}
.ia-table th, .distractor-table th {
  text-align: left; font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  padding: 0 1rem 0.6rem 0; border-bottom: 1px solid var(--line);
}
.ia-table td, .distractor-table td {
  padding: 0.7rem 1rem 0.7rem 0; font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
}
.distractor-table td:first-child { white-space: normal; }
.ia-table { margin-bottom: 0.3rem; }
.distractor-table tbody tr:last-child td, .ia-table tbody tr:last-child td { border-bottom: none; }
.distractor-table { background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }

.ia-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: color-mix(in srgb, #b3261e 14%, transparent); color: #b3261e;
}

.callout {
  margin-top: 1.05rem; padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--mark) 9%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--mark) 35%, var(--line));
  border-radius: 0.4rem;
  font-size: 0.83rem; line-height: 1.5; color: var(--ink);
}

/* ---- figure (forgetting curve) ---------------------------------------- */
figure.panel { margin: 0; }
.figure svg {
  display: block; width: 100%; height: auto;
  margin: 0.3rem 0 0.9rem; color: var(--ink);
}
.figure figcaption { font-size: 0.78rem; line-height: 1.55; color: var(--muted); }
.figure figcaption cite { font-style: italic; }
.legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 0.2rem;
}
.legend .lg { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend .sw { display: inline-block; width: 1.5rem; height: 0; border-top: 2.5px solid #2e6d9e; }
.legend .sw.dash { border-top: 2px dashed var(--muted); }

/* ---- text-beside-figure split (the evidence exhibit) ------------------- */
.section.wide { max-width: 54rem; }
.split { display: grid; gap: 1.5rem; align-items: start; }
.split-text { display: flex; flex-direction: column; gap: 1.1rem; }
@media (min-width: 700px) {
  .split { grid-template-columns: 1fr 1.05fr; gap: 2.2rem; }
}

/* ---- stages ---------------------------------------------------------------- */
.stages { display: flex; flex-direction: column; }
.stage {
  padding: 1.05rem 0; border-top: 1px dashed var(--line);
  font-family: system-ui, sans-serif;
}
.stage:first-child { border-top: none; padding-top: 0.2rem; }
.stage .lbl {
  font-weight: 600; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: 0.3rem;
}
.stage h3 { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 1.06rem; margin: 0 0 0.3rem; }
.stage p { margin: 0; font-size: 0.92rem; line-height: 1.6; }

/* ---- subjects ------------------------------------------------------------- */
.subjects { display: flex; flex-direction: column; }
.subject {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.85rem 0; border-bottom: 1px dashed var(--line);
  font-family: system-ui, sans-serif;
}
.subject:last-child { border-bottom: none; }
.subject .s-name { font-family: "Newsreader", Georgia, serif; font-size: 1.04rem; }
.subject .s-tag {
  font-size: 0.78rem; color: var(--muted); white-space: nowrap;
  display: flex; align-items: center; gap: 0.45rem;
}
.subject .s-tag.live { color: var(--ink); font-weight: 600; }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--bar); flex-shrink: 0; }

.subjects-note {
  margin: 1.4rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif; font-size: 0.92rem; color: var(--muted);
}

/* ---- invite -------------------------------------------------------------- */
.invite {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 0.7rem; padding: 2rem;
  font-family: system-ui, sans-serif;
}
.invite h2 { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 1.35rem; margin: 0 0 0.6rem; }
.invite p { font-size: 0.94rem; color: var(--muted); margin: 0 0 1.35rem; }
.invite form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.invite input {
  font-family: system-ui, sans-serif; font-size: 0.9rem;
  padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 0.4rem;
  background: #fff; color: var(--ink);
}
.invite input.full { grid-column: 1 / -1; }
.invite small { display: block; font-size: 0.77rem; color: var(--muted); line-height: 1.5; }

/* ---- footer ------------------------------------------------------------- */
footer.sign {
  padding: 2.4rem 0 3.5rem;
  font-family: system-ui, sans-serif; font-size: 0.84rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
footer.sign .links { display: flex; gap: 1.2rem; margin-top: 0.6rem; flex-wrap: wrap; }
footer.sign a { color: var(--ink); text-decoration: none; }

/* ---- sign in (returning teachers) ------------------------------------- */
.nav .links a.signin-link { color: var(--ink); font-weight: 600; }
.signin {
  margin-top: 0; max-width: 26rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 1.3rem 1.4rem; font-family: system-ui, sans-serif;
}
.signin h2 {
  font-family: system-ui, sans-serif; font-weight: 600; font-size: 0.95rem;
  margin: 0 0 0.9rem; color: var(--ink);
}
.signin form { display: grid; grid-template-columns: 1fr; gap: 0.65rem; }
.signin input {
  font-family: system-ui, sans-serif; font-size: 0.9rem;
  padding: 0.62rem 0.78rem; border: 1px solid var(--line);
  border-radius: 0.4rem; background: #fff; color: var(--ink);
  caret-color: var(--ink);
  width: 100%; min-width: 0;
}
.signin input::placeholder, .invite input::placeholder { color: var(--muted); }
.signin button { width: 100%; min-width: 0; }
.signin-links {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem;
  margin-top: 0.9rem; font-size: 0.82rem; color: var(--muted);
}
.signin-links a { color: var(--ink); }

@media (max-width: 560px) {
  .invite form { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .nav .links { gap: 1rem; font-size: 0.8rem; }
}

/* ---- server-rendered flash states (cf landing_v2) --------------------- */
.signin-alert {
  background: color-mix(in srgb, #b3261e 12%, transparent);
  border: 1px solid color-mix(in srgb, #b3261e 45%, var(--line));
  border-radius: 0.4rem; color: #7a1c16;
  font-family: system-ui, sans-serif; font-size: 0.83rem; line-height: 1.5;
  padding: 0.65rem 0.85rem; margin: 0 0 0.8rem;
}
.join-success {
  background: color-mix(in srgb, var(--bar) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bar) 40%, var(--line));
  border-radius: 0.4rem; color: var(--ink);
  font-family: system-ui, sans-serif; font-size: 0.9rem; line-height: 1.55;
  padding: 0.85rem 1rem; margin: 0 0 1rem;
}
.invite form .actions { grid-column: 1 / -1; margin-top: 0.2rem; }

/* ---- layout chrome (skip link, demo banner) -------------------------- */
.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 9999;
  background: var(--mark); color: var(--ink);
  padding: 0.5rem 1rem; text-decoration: none;
  border-radius: 0 0 0.4rem 0;
}
.skip-link:focus { top: 0; }
.demo-banner {
  background: var(--mark); color: #000; text-align: center;
  padding: 8px; font-family: system-ui, sans-serif; font-size: 0.78rem;
}
