/* No Gyaan · design language v2
   Ground is the brand cream, ink is near-black, the brand vermilion does one job:
   it marks the thing you can act on. Lato throughout, weight carries the hierarchy. */

:root {
  --cream: #FFF8EE;
  --panel: #F8EEDC;
  --rule: #E7DAC4;
  --rule-strong: #1B1A17;
  --ink: #1B1A17;
  --body: #3A3733;
  --muted: #6F685C;
  --red: #D9473F;
  --red-dark: #B7362F;
  --red-tint: #FBE6E3;
  --green: #2E7D4F;
  --green-tint: #E6F1EA;
  --amber: #B9771E;
  --amber-tint: #FBF0DF;

  --font-head: "Lato", Helvetica, Arial, sans-serif;
  --font-body: "Lato", Helvetica, Arial, sans-serif;

  --container: 880px;
  --measure: 640px;
  --gutter: clamp(20px, 4vw, 36px);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #F6D3CF; }
a { color: var(--ink); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 700; line-height: 1.04; letter-spacing: -0.03em; }
h2 { font-size: clamp(25px, 3.6vw, 34px); font-weight: 700; line-height: 1.14; }
h3 { font-size: 20px; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
.dek { font-size: clamp(18px, 2.3vw, 21px); line-height: 1.55; color: var(--body); max-width: var(--measure); text-wrap: pretty; }
.small { font-size: 14px; color: var(--muted); }

/* Eyebrow: red, bold, tracked. The one recurring red text on the page. */
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }

/* Masthead */
.mast {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 248, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.mast .wrap {
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand span { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 400; }
.nav a { color: var(--body); border-bottom: 2px solid transparent; padding: 2px 0; transition: border-color .18s, color .18s; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--red); }
.nav a.ext::after { content: " ↗"; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .nav { gap: 14px; font-size: 14px; }
  .nav .hide-sm { display: none; }
}

/* Section: a strong 2px rule opens each one, eyebrow sits on it */
.section { padding: clamp(48px, 7vw, 84px) 0 0; }
.section-head {
  border-top: 2px solid var(--rule-strong);
  padding-top: 18px;
  display: grid; gap: 14px;
  margin-bottom: 28px;
}
.section-head .lede { color: var(--muted); font-size: 16px; max-width: 520px; }

/* Hero */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 64px); }
.hero .eyebrow { margin-bottom: 22px; }
.hero h1 { max-width: 760px; }
.hero .dek { margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 32px; align-items: center; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-weight: 700; font-size: 16px; line-height: 1;
  border: 1.5px solid var(--ink);
  transition: background .18s, color .18s, border-color .18s;
}
.btn-primary { background: var(--red); border-color: var(--red); color: var(--cream); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--cream); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.link { color: var(--red); font-weight: 700; border-bottom: 1.5px solid transparent; transition: border-color .18s; }
.link:hover { border-bottom-color: var(--red); color: var(--red); }

/* Fact strip: plain tiles, hairline between them */
.facts {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.fact { padding: 18px 18px 18px 0; border-right: 1px solid var(--rule); }
.fact:last-child { border-right: 0; }
.fact + .fact { padding-left: 18px; }
.fact b { display: block; font-family: var(--font-head); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact { padding: 14px 12px 14px 0; }
  .fact:nth-child(2n) { border-right: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .fact + .fact { padding-left: 12px; }
  .fact:nth-child(3) { padding-left: 0; }
}

/* Subject tracks: three cells in one frame, the live one gets the red pill */
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1.5px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.track { display: grid; align-content: start; gap: 10px; padding: 22px 20px 20px; border-right: 1.5px solid var(--rule); background: var(--cream); color: var(--body); transition: background .18s; }
.track:last-child { border-right: 0; }
a.track:hover { background: var(--panel); }
a.track:hover h3 { color: var(--red); }
.track h3 { font-size: 19px; }
.track p { font-size: 15px; }
.track .status { justify-self: start; margin-top: 4px; }
@media (max-width: 760px) {
  .tracks { grid-template-columns: 1fr; }
  .track { border-right: 0; border-bottom: 1.5px solid var(--rule); }
  .track:last-child { border-bottom: 0; }
}
.series-head { margin-top: clamp(40px, 6vw, 64px); }

/* Lesson list: numbered rows */
.lessons { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.lesson-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px 18px; align-items: start;
  padding: 20px 0; border-bottom: 1px solid var(--rule);
  transition: background .18s;
}
.lesson-row .num { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--muted); line-height: 1.2; font-variant-numeric: tabular-nums; }
.lesson-row h3 { font-size: 19px; }
.lesson-row h3 a { color: var(--ink); }
.lesson-row .row-dek { margin-top: 4px; color: var(--muted); font-size: 15px; max-width: 520px; }
.lesson-row:hover h3 a { color: var(--red); }
.status {
  align-self: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid var(--rule); color: var(--muted); background: transparent;
}
.status.next { border-color: var(--red); color: var(--red); }
.status.live { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.status-wrap { display: flex; align-items: center; gap: 6px; align-self: center; }
@media (max-width: 560px) {
  .lesson-row { grid-template-columns: 36px 1fr; }
  .lesson-row .status-wrap { grid-column: 2; justify-self: start; }
}

/* Steps: how a lesson works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border: 1.5px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.step { padding: 22px 20px; border-right: 1.5px solid var(--rule); background: var(--cream); }
.step:last-child { border-right: 0; }
.step .k { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; color: var(--red); }
.step h3 { margin-top: 10px; font-size: 19px; }
.step p { margin-top: 8px; font-size: 15px; color: var(--body); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1.5px solid var(--rule); }
  .step:last-child { border-bottom: 0; }
}

/* Why: three plain claims with a figure or a position */
.why { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.why-item { padding: 24px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 10px 32px; }
.why-item h3 { font-size: 19px; }
.why-item p { font-size: 16px; }
.why-item .src { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) { .why-item { grid-template-columns: 1fr; } }

.funnel { display: grid; gap: 6px; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.funnel div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline; }
.funnel b { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); text-align: right; letter-spacing: -0.02em; }
.funnel span { font-size: 15px; color: var(--body); }
.funnel .out b { color: var(--red); }

/* Cross-link card */
.card {
  border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 24px;
  display: grid; gap: 10px; background: var(--panel);
}
.card h3 { font-size: 21px; }
.card p { font-size: 16px; }

/* Footer */
.foot { margin-top: clamp(64px, 9vw, 96px); border-top: 2px solid var(--rule-strong); padding: 36px 0 56px; }
.foot .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: start; }
.foot .brand span { font-size: 17px; }
.foot p { font-size: 14.5px; color: var(--muted); max-width: 440px; margin-top: 12px; }
.foot .links { display: grid; gap: 8px; font-size: 14.5px; }
.foot .links a { color: var(--body); }
.foot .links a:hover { color: var(--red); }
.foot .legal { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 18px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (max-width: 560px) { .foot .wrap { grid-template-columns: 1fr; } }

/* ---------- Lesson page ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--red); z-index: 30; transition: width .1s linear; }

.lesson-head { padding: clamp(44px, 7vw, 80px) 0 clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--rule); }
.lesson-head .eyebrow { margin-bottom: 18px; }
.lesson-head h1 { font-size: clamp(32px, 5.4vw, 52px); max-width: 720px; }
.lesson-head .dek {
  margin-top: 18px;
  text-align: justify; text-justify: inter-word;
  hyphens: none; -webkit-hyphens: none; -ms-hyphens: none;
  overflow-wrap: normal; word-break: normal;
}
.meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 700; }

.lesson-body { padding-top: 8px; }
.lesson-body h2 {
  margin-top: clamp(40px, 6vw, 60px);
  padding-top: 16px; border-top: 2px solid var(--rule-strong);
  font-size: clamp(23px, 3vw, 28px);
  max-width: var(--measure);
}
.lesson-body h2 .n { color: var(--red); font-weight: 700; margin-right: 10px; }
.lesson-body p {
  margin-top: 18px; max-width: var(--measure); font-size: 17.5px;
  text-align: justify; text-justify: inter-word;
  hyphens: none; -webkit-hyphens: none; -ms-hyphens: none;
  overflow-wrap: normal; word-break: normal;
}
.lesson-body p.first { margin-top: 22px; }
.lesson-body ul, .lesson-body ol { margin: 14px 0 0; padding-left: 22px; max-width: var(--measure); }
.lesson-body li {
  margin-top: 6px;
  text-align: justify; text-justify: inter-word;
  hyphens: none; -webkit-hyphens: none; -ms-hyphens: none;
  overflow-wrap: normal; word-break: normal;
}
/* Below this width the fixed measure leaves too few words per line for
   justify to look even, so drop back to ragged-right on phones. */
@media (max-width: 480px) {
  .lesson-body p, .lesson-body li, .lesson-head .dek { text-align: left; }
}
/* Justify never applies to the last line of a paragraph or list item,
   so the final line stays naturally ragged-left, never stretched. */
.term { font-weight: 700; color: var(--ink); }

/* Exhibit: a plain framed figure. Timeline is the first kind. */
.exhibit { margin: 28px 0 8px; border: 1.5px solid var(--rule); border-radius: var(--radius); overflow: hidden; max-width: 720px; }
.exhibit .cap { padding: 12px 18px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.exhibit .cap b { color: var(--ink); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12.5px; }
.timeline { padding: 18px 18px 8px; }
.tl { display: grid; grid-template-columns: 64px 1fr; gap: 0 16px; padding: 10px 0; border-bottom: 1px dashed var(--rule); align-items: baseline; }
.tl:last-child { border-bottom: 0; }
.tl b { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--red); font-variant-numeric: tabular-nums; }
.tl span { font-size: 15.5px; }

/* Decide: the interactive block. Ink bar on the left, red eyebrow, options as buttons. */
.decide {
  margin: 32px 0 8px; max-width: 720px;
  background: var(--panel); border-left: 4px solid var(--ink); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 22px 22px 20px;
}
.decide .eyebrow { display: block; margin-bottom: 8px; }
.decide .q { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--ink); letter-spacing: -0.01em; }
.opts { display: grid; gap: 8px; margin-top: 16px; }
.opt {
  text-align: left; width: 100%;
  background: var(--cream); border: 1.5px solid var(--rule); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; font-size: 16px; line-height: 1.45;
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  transition: border-color .18s, background .18s;
}
.opt .l { font-family: var(--font-head); font-weight: 700; color: var(--muted); }
.opt:hover { border-color: var(--ink); }
.opt[disabled] { cursor: default; }
.opt.is-right { border-color: var(--green); background: var(--green-tint); }
.opt.is-right .l { color: var(--green); }
.opt.is-wrong { border-color: var(--amber); background: var(--amber-tint); }
.opt.is-wrong .l { color: var(--amber); }
.opt.is-dim { opacity: .55; }
.why-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15.5px; display: none; }
.why-box.show { display: block; }
.why-box p { margin-top: 8px; max-width: none; font-size: 15.5px; }
.why-box .tag { font-weight: 700; color: var(--ink); }
.why-box .tag.ok { color: var(--green); }
.why-box .tag.no { color: var(--amber); }
.decide .again { margin-top: 12px; font-size: 14px; }

.next-card { margin-top: 44px; border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; max-width: 720px; display: grid; gap: 6px; }
.next-card .small { margin: 0; }

.template-note { background: var(--red-tint); border: 1.5px solid #F2B7B1; color: var(--red-dark); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; font-weight: 400; margin-bottom: 22px; }

/* Score card: same shape as next-card, shown once every Decide and PYQ block on the
   page has been answered at least once. Persists across visits (localStorage), so a
   returning reader sees their last result rather than an empty card. */
.score-card { border-color: var(--rule-strong); background: var(--panel); }
.score-card[hidden] { display: none; }
.score-card h3 { font-family: var(--font-head); font-size: 22px; margin: 2px 0; }
.score-card h3 b { color: var(--green); font-size: 26px; }
.score-card .small { color: var(--body); }

/* Streak badge, in the header nav on every page. One visit a day, counted in UTC. */
.streak { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--rule); font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; }
.streak[hidden] { display: none; }
.streak::before { content: "\1F525"; font-size: 13px; }

/* Done mark on a home-page lesson row: shown once that lesson's score is complete. */
.done-mark { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--green-tint); color: var(--green); font-size: 12px; font-weight: 700; }
.done-mark[hidden] { display: none; }
.done-mark::before { content: "\2713"; }

/* ---------- Lesson additions: statement lists, comparison table, Mains, PYQ ---------- */
.decide .stmts { margin: 10px 0 0; padding-left: 22px; font-size: 16px; }
.decide .stmts li { margin-top: 6px; color: var(--ink); }
.decide .q2 { margin-top: 12px; font-weight: 700; color: var(--ink); font-size: 16px; }
.decide .q + .opts { margin-top: 16px; }

.table-wrap { overflow-x: auto; }
.cmp { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.cmp th, .cmp td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp th { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--ink); }
.cmp td:first-child { font-weight: 700; color: var(--ink); width: 160px; }
.cmp tr:last-child td { border-bottom: 0; }

.mains { margin-top: clamp(48px, 7vw, 72px); border-top: 2px solid var(--rule-strong); padding-top: 18px; max-width: 720px; }
.mains .mains-h { border-top: 0; margin-top: 8px; padding-top: 0; }
.mq { margin-top: 16px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: var(--cream); }
.mq summary { list-style: none; cursor: pointer; padding: 16px 18px; display: grid; gap: 6px; }
.mq summary::-webkit-details-marker { display: none; }
.mq .mq-marks { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.mq .mq-q { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.35; color: var(--ink); }
.mq summary::after { content: "Open the answer frame"; font-size: 13.5px; color: var(--muted); }
.mq[open] summary::after { content: "Close"; }
.mq .mq-frame { border-top: 1px solid var(--rule); padding: 6px 18px 16px; }
.mq .mq-frame p { margin-top: 10px; font-size: 15.5px; max-width: none; }
.mq .mq-frame b { color: var(--ink); font-weight: 700; }

.pyq { margin-top: clamp(48px, 7vw, 72px); border-top: 2px solid var(--rule-strong); padding-top: 18px; max-width: 720px; }
.pyq .pyq-h { border-top: 0; margin-top: 8px; padding-top: 0; }
.pyq .note { margin-top: 10px; font-size: 15px; color: var(--body); }
.pyq .decide { margin-top: 20px; }
.pyq .yr { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1.5px solid var(--rule); border-radius: 999px; padding: 3px 9px; margin-bottom: 8px; }
.recall { margin-top: 20px; border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; max-width: 720px; }
.recall ol { margin: 10px 0 0; padding-left: 22px; }
.recall li { margin-top: 8px; font-size: 16px; }
.recall details { margin-top: 4px; }
.recall summary { cursor: pointer; font-size: 14px; color: var(--red); font-weight: 700; list-style: none; }
.recall summary::-webkit-details-marker { display: none; }
.recall .ans { margin-top: 6px; font-size: 15px; color: var(--body); }

/* Navigation and reading layout */
:focus-visible { outline: 3px solid var(--red-dark); outline-offset: 4px; }
[id] { scroll-margin-top: 140px; }
.mast .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.nav { flex-wrap: wrap; gap: 4px 16px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.nav .home-link { border: 1px solid var(--rule-strong); border-radius: 6px; padding: 6px 12px; }
.page-return { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.lesson-body > h3 { margin-top: 36px; margin-bottom: 12px; max-width: var(--measure); line-height: 1.4; }
.lesson-body > h2 + h3 { margin-top: 26px; }
.lesson-body > h3 + p { margin-top: 12px; }
.lesson-body > .table-wrap { max-width: 720px; margin-top: 20px; }
.lesson-row > *, .next-card > *, .decide > * { min-width: 0; }
a.status { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; }
a.status:hover { background: var(--red-dark); border-color: var(--red-dark); }
.status-wrap { flex-wrap: wrap; }
.lesson-body p.small { font-size: 15px; text-align: left; }
.next-card .eyebrow { margin-top: 0; }
.next-card .stmts { margin: 8px 0; }
.table-wrap:focus-visible { outline-offset: -3px; }
@media (max-width: 640px) {
  .mast .wrap { gap: 4px; }
  .mast .brand { min-height: 40px; }
  .nav { width: 100%; gap: 2px 12px; font-size: 13px; }
  .nav a { padding: 4px 0; }
  .nav .home-link { padding: 4px 10px; }
  .decide { padding: 18px 14px; }
  .next-card { padding: 18px 16px; }
  .exhibit .cap { flex-wrap: wrap; }
  .lesson-head h1 { line-height: 1.15; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
