/* Shared visual system. Paper stays light inside document illustrations. */
:root {
  color-scheme: light;
  --canvas: #f7f5f0;
  --surface: #fffdf8;
  --soft: #e8edf6;
  --paper-warm: #eee8dd;
  --line: #d2dbe7;
  --ink: #17253a;
  --muted: #485b71;
  --brand-blue: #234b83;
  --brand-hover: #193965;
  --accent-ink: #214d84;
  --accent-fill: #ffc16b;
  --accent-fill-ink: #35220e;
  --focus: #386fb2;
  --accent-backdrop: #ecd2ad;
  --accent-paper: #f1e2ca;
  --accent-paper-ink: #694018;
  --accent-rule: var(--accent-fill);
  --accent-chart: #8b4e17;
  --folder-blue: #234b83;
  --folder-back: #ccd9ec;
  --oral-backdrop: #285489;
  --paper: var(--canvas);
  --catalog-paper: var(--canvas);
  --catalog-navy: var(--ink);
  --catalog-muted: var(--muted);
  --catalog-line: var(--line);
  --blue: var(--accent-ink);
  --edition-blue: var(--brand-blue);
  --edge: clamp(16px, 5.2vw, 72px);
}

body { background: var(--canvas); color: var(--ink); }
.wrap { max-width: 1344px; }
:focus-visible { outline-color: var(--focus) !important; }
::selection { background: var(--accent-fill); color: var(--accent-fill-ink); }

.mast {
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.headrow { min-height: 72px; }
.brand .brandmark {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  border-radius: 0;
  background: url(assets/channel-feather.webp) center / 168% no-repeat;
  box-shadow: none;
  filter: contrast(2);
  mix-blend-mode: multiply;
}
.brand .brandmark::before { content: none; }
.catalog-footer .brandmark { filter: invert(1) contrast(2); mix-blend-mode: screen; }
.mast #navigation { gap: clamp(4px, .7vw, 10px); }
.mast #navigation a {
  min-height: 44px;
  padding: 8px clamp(8px, .85vw, 14px);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 560 15px/1.3 system-ui, sans-serif;
  letter-spacing: normal;
  text-decoration: none;
}
.mast #navigation a[aria-current] {
  background: var(--soft);
  color: var(--accent-ink);
}
.mast #navigation a:hover:not([aria-current]) {
  background: transparent;
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.mast .header-buy, .ink-button, .exam-action, .written-card .exam-action, .primary {
  background: var(--brand-blue);
  border-radius: 999px;
  color: #fff;
}
.mast .header-buy:hover, .ink-button:hover, .exam-action:hover, .written-card .exam-action:hover, .primary:hover {
  background: var(--brand-hover);
  color: #fff;
}
.mast .header-buy { box-shadow: none; }
.mast .readline { background: var(--brand-blue); }

.review-ribbon {
  background: var(--soft);
  color: var(--accent-ink);
}
.ribbon-inner { min-height: 45px; }
.ribbon-heading, .ribbon-years a { color: var(--accent-ink); }
.ribbon-heading strong {
  color: var(--ink);
  font: 650 clamp(14px, 1.6vw, 18px)/1.25 system-ui, sans-serif;
  letter-spacing: normal;
}
.ribbon-years a::before {
  border-color: var(--line);
  border-radius: 999px;
}
.ribbon-years a:hover::before {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-ink) 10%, var(--soft));
}
@media (prefers-reduced-motion: no-preference) {
  .mast #navigation a { transition: color 140ms ease-out; }
  .ribbon-years a::before { transition: background-color 140ms ease-out, border-color 140ms ease-out; }
}
.review-ribbon a:focus-visible { outline-color: var(--focus) !important; }

.exam-shell { padding-block: clamp(36px, 5.4vw, 86px) clamp(42px, 6vw, 94px); }
.exam-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  align-items: center;
  gap: clamp(26px, 5vw, 78px);
  margin: 0 0 clamp(58px, 8vw, 116px);
}
.exam-intro h1 {
  font-size: clamp(46px, 6.5vw, 94px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .99;
}
.exam-intro h1 span {
  position: relative;
  isolation: isolate;
  display: table;
  margin-top: .22em;
  color: var(--accent-ink);
  font-size: .73em;
  font-weight: 720;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.exam-intro h1 span::after {
  position: absolute;
  z-index: -1;
  inset: auto -.035em .01em -.035em;
  height: .15em;
  border-radius: .045em;
  background: var(--accent-rule);
  transform: rotate(-1.5deg);
  content: "";
}
.catalog .vip-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 345px);
  align-items: end;
  gap: clamp(24px, 4vw, 60px);
}
.vip-free {
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.vip-free h2 { font-size: 19px; line-height: 1.3; }
.catalog .section-title .vip-free p { margin: 8px 0 12px; font-size: 15px; }
.vip-free .line-link { font-size: 15px; }
.exam-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(19px, 2.6vw, 32px);
}
.exam-intro-actions a { min-height: 48px; }
.free-channel, .free-channel:hover, .free-channel:focus-visible {
  border-radius: 999px;
  border-color: var(--brand-blue);
  background: transparent;
  color: var(--accent-ink);
}
.free-channel:hover, .free-channel:focus-visible { background: var(--soft); }
.free-channel svg { color: inherit; }

.hero-folder {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1.23;
  width: 100%;
  max-width: 475px;
  justify-self: center;
}
.hero-folder-back, .hero-folder-cover, .hero-document { position: absolute; }
.hero-folder-back {
  inset: 18% 5% 10% 3%;
  border-radius: 5% 8% 8% 8%;
  transform: rotate(-9deg);
  background: var(--folder-back);
}
.hero-folder-back::before {
  position: absolute;
  inset: -8% 53% 82% 0;
  border-radius: 14px 22px 0 0;
  background: inherit;
  content: "";
}
.hero-document {
  overflow: hidden;
  padding: 2.5%;
  border: 1px solid #e8dfd4;
  border-radius: 4px;
  background: #fffcf6;
  box-shadow: 0 6px 18px #162b4826;
}
.hero-document img { display: block; width: 100%; height: auto; }
.hero-document-oral { inset: 6% 52% 22% 12%; transform: rotate(-14deg); }
.hero-document-oge { inset: 13% 13% 20% 39%; transform: rotate(10deg); }
.hero-folder-cover {
  inset: 48% 3% 3% 10%;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: .35em;
  padding-inline: 8%;
  border-radius: 7% 9% 9% 8% / 15%;
  background: var(--folder-blue);
  color: #fff;
  box-shadow: 0 18px 34px #172e512f;
  transform: rotate(-5deg);
}
.hero-folder-cover span { font-size: clamp(12px, 1.1vw, 16px); }
.hero-folder-cover strong { font-size: clamp(26px, 3.7vw, 54px); line-height: 1; letter-spacing: -.035em; }
.hero-folder-cover small {
  margin-top: .25em;
  padding: .24em .65em;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--accent-fill-ink);
  font-size: clamp(14px, 1.6vw, 22px);
  font-weight: 700;
  line-height: 1.1;
}

.exam-catalog h2#exams-heading {
  margin: 0 0 clamp(18px, 2.5vw, 34px);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.045em;
  font-weight: 760;
}
.exam-card {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 24px;
  box-shadow: none;
}
.oral-visual { background: var(--oral-backdrop); }
.written-visual { background: var(--accent-backdrop); }
.exam-visual::before { display: none; }
.exam-info { padding: clamp(17px, 2.6vw, 35px); }
.exam-info h2 { font-weight: 710; }
.exam-facts, .exam-facts > div + div { border-color: var(--line); }
.exam-facts dt { color: var(--muted); }
.zone-link, .archive-region-link, .line-link, .schedule-source a, .reading-body a:not(.primary) {
  color: var(--accent-ink);
}

[data-design="classic"] .exam-reference { background: var(--paper-warm); }
[data-design="classic"] .home-archive,
[data-design="classic"] .archive-entry { color: var(--ink); }
[data-design="classic"] .archive-copy .archive-date { color: var(--muted); }
[data-design="classic"] .exam-schedule summary,
[data-design="classic"] .schedule-content { background: var(--surface); }
[data-design="classic"] .exam-schedule summary:is(:hover, :focus-visible) { background: var(--soft); }
.exam-schedule summary::after { border-color: var(--muted); }
.schedule-tables th, .schedule-tables td { border-color: var(--line); }
.schedule-source { color: var(--muted); }
.home-seasons { background: var(--soft); color: var(--ink); }
.home-seasons h2 { font-weight: 740; }

.catalog .section-title h1 { font-weight: 790; }
.catalog .crumb, .spec-list dt, .offer .spec-list dt, .plan-dialog .spec-list dt,
.term, .match-row dt, .match-status, .foliofoot > span { color: var(--muted); }
.toc a, .chapter-link i { color: var(--accent-ink); }
#region {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 9px;
}
.zone-tabs button { color: var(--muted); border-color: var(--line); }
.zone-tabs button:hover { background: var(--surface); }
.zone-tabs button[aria-selected="true"] { background: var(--brand-blue); border-color: var(--brand-blue); }
.archive-sleeve, .folder-tab { background: var(--brand-blue); }
.archive-sleeve { box-shadow: inset 0 -3px var(--brand-hover); }
.archive .paper {
  color-scheme: light;
  --ink: #253247;
  --blue: #214d84;
  --muted: #485b71;
  color: var(--ink);
}
.toc, .reading-body, .subject-index, .season-note, .chapter-link,
.match-stats, .oral-spread, .exam-offer-sheet, .past-offer, .plan-dialog,
.material-preview, .preview-heading button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.catalog .archive, .evidence-aside, .specimen, .reference-band,
.vip-index, .exam-switch, .match-years {
  background: var(--soft);
  border-color: var(--line);
  color: var(--ink);
}
.exam-offer-sheet:nth-child(2), .exam-offer-sheet:nth-child(3) {
  background: var(--soft);
  border-color: var(--line);
}
.exam-switch a, .match-years a { color: var(--accent-ink); }
.exam-switch a[aria-current="true"], .match-years a[aria-current] {
  background: var(--surface);
  color: var(--accent-ink);
}
.match-summary { background: var(--soft); color: var(--accent-ink); }
.match-legend { color: var(--muted); }
.match-rows > .match-row, .spec-list > div { border-color: var(--line); }
.season-list .telegram-review, .telegram-review { border-radius: 999px; }
.catalog-footer { background: #16263e; color: #f3f6fb; }
.footer-layout .brandmark { color: #b4cde7; }
.footer-layout > div:last-child a[href^="https://t.me"] {
  background: var(--accent-fill);
  color: var(--accent-fill-ink);
}

@media (max-width: 930px) {
  .mast nav.shown { background: var(--surface); }
}
@media (max-width: 740px) {
  .headrow { min-height: 60px; }
  .mast #navigation.shown { gap: 4px; }
  .mast #navigation.shown a { border: 0; }
  .catalog .vip-intro { grid-template-columns: minmax(0, 1fr); }
  .exam-intro { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 28px; }
  .exam-intro h1 { font-size: clamp(42px, 10vw, 72px); }
  .hero-folder { width: min(100%, 370px); }
  .hero-folder-cover strong { font-size: clamp(29px, 6.5vw, 44px); }
  .exam-card { border-radius: 18px; }
}
@media (max-width: 480px) {
  .catalog .document-title h1 {
    font-size: clamp(26px, 8vw, 36px);
    overflow-wrap: anywhere;
  }
  .exam-intro-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .exam-intro-actions a { justify-content: center; }
  .exam-action { padding-inline: 15px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #131d2b;
    --surface: #1c293c;
    --soft: #26364c;
    --paper-warm: #1b2635;
    --line: #3e516b;
    --ink: #eef3fa;
    --muted: #b6c5d8;
    --brand-blue: #35639e;
    --brand-hover: #295184;
    --accent-ink: #b6d5f8;
    --focus: #a4caf7;
    --accent-rule: #8a531f;
    --accent-chart: #ffd099;
    --folder-back: #476286;
  }

  .catalog-footer { background: #0e1724; }
  .mast .brandmark { filter: invert(1) contrast(2); mix-blend-mode: screen; }
  .look { background: #fffdf8; color: #1e3049; }
  .match-row.missing .match-value { color: var(--muted); }
  .match-track { background: var(--line); }
}

.catalog .archive {
  background: var(--surface);
  border-radius: 22px;
}
.catalog .archive .samplegrid { align-items: start; }
.catalog .archive .selector {
  padding: clamp(16px, 2.25vw, 30px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.catalog .archive .selector .intro, .catalog .archive .region-label { color: var(--muted); }
.catalog .archive .next-season { border-color: var(--line); }
.catalog .archive .archive-sleeve, .catalog .archive .folder-tab { background: #25466f; }
.catalog .archive .archive-sleeve { box-shadow: inset 0 -3px #193452; }
.catalog .archive .zone-code { background: var(--accent-paper); color: var(--accent-paper-ink); }
.catalog .archive .flipbuttons button { border-color: var(--line); }
.match-rows > .match-row { --bar-color: var(--accent-chart); }
.match-rows > .match-row.below-ninety { --bar-color: #285990; }
.match-legend span::before { background: var(--accent-chart); }
.match-legend span:last-child::before { background: #285990; }
@media (max-width: 480px) {
  .catalog .archive .samplegrid { padding: 14px; }
  .catalog .archive .selector { padding: 14px; }
}
@media (prefers-color-scheme: dark) {
  .match-rows > .match-row.below-ninety { --bar-color: #a7cef8; }
  .match-legend span:last-child::before { background: #a7cef8; }
}
