/* Guide pages (/quiz-tools/, /high-yield-quizzes/, /study-library/, /study-planner/).
   Same desk, type and accent as the homepage (home/proto.css); an article layout instead of
   the hero plates. Every page here is static HTML and must read well on phones too. */

:root {
  --desk: #141210;
  --panel: #1a1815;
  --panel-2: #1f1c19;
  --line: rgba(239, 233, 222, 0.09);
  --line-2: rgba(239, 233, 222, 0.18);
  --ivory: #efe9de;
  --text: #d6cec1;
  --muted: #a39b8e;
  --faint: #7d766b;
  --accent: #d97757;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 720px;
  --wide: 1120px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
  background: var(--desk);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--grain) repeat, var(--desk);
  background-size: 180px 180px, auto;
  color: var(--text);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--desk);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- masthead ---------- */
.mast {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px var(--gutter);
}

.brand {
  font: 600 22px/1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ivory);
  text-decoration: none;
}

.mast nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
}

.mast nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.mast nav a:hover, .mast nav a[aria-current="page"] { color: var(--ivory); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--ivory); color: #161412; }
.btn-primary:hover { background: #ffffff; }
.btn-line { background: transparent; color: var(--ivory); border-color: rgba(239, 233, 222, 0.32); }
.btn-line:hover { background: rgba(239, 233, 222, 0.06); border-color: var(--ivory); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }

/* ---------- article ---------- */
.crumbs {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
  font-size: 14px;
  color: var(--faint);
}

.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ivory); }

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(28px, 5vh, 48px);
  text-align: center;
}

.kicker {
  margin: 0 0 16px;
  font: 400 17px/1.2 var(--serif);
  color: var(--accent);
}

.hero h1 {
  font: 400 clamp(40px, 5.6vw, 72px)/1.04 var(--serif);
  letter-spacing: -0.024em;
  color: var(--ivory);
  text-wrap: balance;
}

.lede {
  max-width: 640px;
  margin: 24px auto 0;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.65;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-top: 32px;
}

.fine {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--faint);
}

.section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(64px, 11vh, 112px) var(--gutter) 0;
}

.section-head { max-width: var(--measure); margin: 0 0 clamp(28px, 4vh, 40px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section h2 {
  font: 400 clamp(30px, 3.4vw, 46px)/1.1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ivory);
  text-wrap: balance;
}

.section-head p { margin: 16px 0 0; color: var(--text); }

.prose { max-width: var(--measure); }
.prose p { color: var(--text); }
.prose strong { color: var(--ivory); font-weight: 600; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--accent); }

/* Two columns: copy beside a figure. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.split.flip > :first-child { order: 2; }
.prose > h3, .split h3 {
  margin: 0 0 12px;
  font: 400 clamp(24px, 2.4vw, 30px)/1.15 var(--serif);
  letter-spacing: -0.015em;
  color: var(--ivory);
}

/* ---------- figures ---------- */
.fig { margin: 0; }
.fig-frame {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: #1a1816;
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, 0.9);
}

.fig-frame img, .fig-frame video { width: 100%; }
.fig figcaption {
  margin-top: 14px;
  font: 400 15px/1.5 var(--serif);
  color: var(--muted);
}

.fig figcaption b {
  margin-right: 8px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.fig-hero { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.fig-wide { margin-top: clamp(28px, 4vh, 44px); }
.split .fig-narrow { max-width: 460px; justify-self: center; }

/* ---------- tool cards ---------- */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tools.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tool {
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.tool h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font: 400 23px/1.2 var(--serif);
  color: var(--ivory);
}

.tool p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text); }
.tool p + p { margin-top: 10px; color: var(--muted); }
.tool .when { color: var(--muted); }
.tool .when::before { content: "Use it when "; color: var(--accent); font-family: var(--serif); font-size: 15px; }

kbd, .key {
  display: inline-block;
  min-width: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(239, 233, 222, 0.04);
  font: 500 12.5px/1.2 var(--mono);
  color: var(--ivory);
  text-align: center;
  white-space: nowrap;
}

/* ---------- comparisons, steps and lists ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.level {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.level .count { display: block; margin-bottom: 10px; font: 500 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.level h3 { margin: 0 0 10px; font: 400 30px/1.1 var(--serif); color: var(--ivory); }
.level p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.level ul { margin: 12px 0 0; padding-left: 1.1em; font-size: 15px; color: var(--muted); }
.level li::marker { color: var(--accent); }

.steps { counter-reset: step; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li {
  position: relative;
  padding: 20px 22px 20px 64px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, upper-roman);
  position: absolute;
  left: 22px;
  top: 19px;
  font: 400 19px/1.4 var(--serif);
  color: var(--accent);
}

.steps strong { display: block; margin-bottom: 4px; font: 400 21px/1.3 var(--serif); color: var(--ivory); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font: 400 15px/1.3 var(--serif); color: var(--muted); }
td:first-child { white-space: nowrap; }

.audiences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.audience {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.audience h3 { margin: 0 0 8px; font: 400 21px/1.25 var(--serif); color: var(--ivory); }
.audience p { margin: 0; font-size: 15.5px; line-height: 1.6; }

.note {
  max-width: var(--measure);
  padding: 18px 22px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(217, 119, 87, 0.06);
  font-size: 15.5px;
}

.note p:last-child { margin-bottom: 0; }

/* Coverage stats: one tile per study tool, with a meter scaled to the measured share. */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.stat-kind { margin-bottom: 14px; font: 500 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.stat-value { font: 400 clamp(44px, 5vw, 60px)/1 var(--serif); letter-spacing: -0.02em; color: var(--ivory); }
.stat-value small { margin-left: 2px; font-size: 0.42em; letter-spacing: 0; color: var(--muted); }
.stat-meter { display: block; height: 6px; margin: 18px 0 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stat-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stat-meter.is-pending i { width: 100%; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 14px); }
.stat p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.stats-fine { margin-top: 18px; }

/* Two features shown side by side, such as Lecture Finder beside the file viewer. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pair-card {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.pair-card .kicker { margin-bottom: 10px; }
.pair-card h3 { margin: 0 0 10px; font: 400 30px/1.1 var(--serif); color: var(--ivory); }
.pair-card p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.pair-card ul { margin: 14px 0 0; padding-left: 1.1em; font-size: 15px; line-height: 1.55; color: var(--muted); }
.pair-card li { margin: 0.4em 0; }
.pair-card li::marker { color: var(--accent); }
.pair-card strong { color: var(--ivory); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 22px 44px 22px 0;
  list-style: none;
  font: 400 21px/1.3 var(--serif);
  color: var(--ivory);
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font: 400 24px/1 var(--sans);
  color: var(--muted);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { max-width: 64ch; margin: -4px 0 24px; }

/* ---------- related guides and closing call to action ---------- */
.related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related a {
  display: block;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.related a:hover { border-color: var(--line-2); background: var(--panel-2); }
.related .kicker { margin-bottom: 10px; font-size: 15px; }
.related strong { display: block; margin-bottom: 8px; font: 400 23px/1.2 var(--serif); color: var(--ivory); }
.related span { font-size: 15px; line-height: 1.55; color: var(--muted); }

.final {
  margin-top: clamp(80px, 13vh, 140px);
  padding: clamp(80px, 13vh, 140px) var(--gutter);
  border-top: 1px solid var(--line);
  text-align: center;
}

.final h2 {
  font: 400 clamp(40px, 5vw, 70px)/1.04 var(--serif);
  letter-spacing: -0.024em;
  color: var(--ivory);
}

.final p { margin: 18px auto 0; max-width: 560px; color: var(--muted); }

/* ---------- footer ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px var(--gutter) 36px;
  border-top: 1px solid var(--line);
}

.foot-brand p { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot h4 { margin: 0 0 14px; font: 400 15px/1 var(--serif); color: var(--muted); }
.foot-cols a { display: block; padding: 6px 0; font-size: 14.5px; color: var(--text); text-decoration: none; }
.foot-cols a:hover { color: var(--ivory); }
.foot-meta { grid-column: 1 / -1; margin: 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }

/* ---------- narrow screens ---------- */
@media (max-width: 980px) {
  .mast nav { gap: 16px; }
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 0; }
  .levels, .related, .stats { grid-template-columns: 1fr; }
  .tools.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .mast { flex-wrap: wrap; gap: 12px 16px; }
  .mast .btn { margin-left: auto; }
  .mast nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .mast nav::-webkit-scrollbar { display: none; }
  .audiences, .foot, .foot-cols, .tools.two, .tools.three, .pair { grid-template-columns: 1fr; }
  .fig-frame { border-radius: 14px; }
  .faq summary { font-size: 19px; }
  .steps li { padding-left: 54px; }
  .steps li::before { left: 18px; }
  td:first-child { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01s !important; scroll-behavior: auto !important; }
}
