/* =====================================================================
   Edureify study guide: domains hub + domain page
   Layout concept: an exam blueprint. The weight bar is the signature;
   its tone ramp (heaviest = deepest) carries through every domain card.
   ===================================================================== */

:root {
  /* color */
  --paper: #f5f7f6;          /* page ground, green-biased neutral */
  --surface: #ffffff;        /* cards, tables */
  --sunk: #eaefec;           /* inset areas */
  --ink: #13201c;            /* text */
  --muted: #56655f;          /* secondary text */
  --line: #d9e1dd;           /* hairlines */
  --accent: #0d6b58;         /* deep teal: links, primary, deepest blueprint tone */
  --accent-strong: #09503f;
  --accent-soft: #dcefe8;    /* lightest blueprint tone */
  --on-accent: #ffffff;
  --trap: #9a4a12;           /* traps and warnings, burnt amber */
  --trap-soft: #fbeee2;
  --ok: #1d7444;
  --ok-soft: #e3f3e8;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --band: #10241e;           /* dark conversion band */
  --on-band: #e8f2ee;

  /* type */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.7vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.6vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.75rem + 2.6vw, 3.9rem);

  /* shape */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(16 36 30 / 0.06), 0 6px 24px -12px rgb(16 36 30 / 0.18);
  --shell: 1200px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1412;
    --surface: #151d1a;
    --sunk: #1b2521;
    --ink: #e5eeea;
    --muted: #9bada6;
    --line: #27332f;
    --accent: #4cc7a6;
    --accent-strong: #7fdcc2;
    --accent-soft: #1a332c;
    --on-accent: #06221a;
    --trap: #eda46a;
    --trap-soft: #2c2018;
    --ok: #6fd39a;
    --ok-soft: #16291f;
    --bad: #f08b83;
    --bad-soft: #2e1a19;
    --band: #172c25;
    --on-band: #e5eeea;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 28px -14px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1412;
  --surface: #151d1a;
  --sunk: #1b2521;
  --ink: #e5eeea;
  --muted: #9bada6;
  --line: #27332f;
  --accent: #4cc7a6;
  --accent-strong: #7fdcc2;
  --accent-soft: #1a332c;
  --on-accent: #06221a;
  --trap: #eda46a;
  --trap-soft: #2c2018;
  --ok: #6fd39a;
  --ok-soft: #16291f;
  --bad: #f08b83;
  --bad-soft: #2e1a19;
  --band: #172c25;
  --on-band: #e5eeea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 28px -14px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 0; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: var(--gutter-l); }

.shell {
  max-width: calc(var(--shell) + 32px);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 0 72px;
}

/* type roles */
.display {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
}
.display--domain { font-size: var(--step-3); line-height: 1.06; max-width: 22ch; }
.h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.h-label, .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow { color: var(--accent); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 60ch; }
.prose { max-width: 68ch; display: grid; gap: 1em; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  font: 600 0.95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn--line { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--line:hover { border-color: var(--accent); color: var(--accent); }
.btn--quiet { background: transparent; color: var(--accent); border-color: transparent; padding-inline: 10px; }
.btn--quiet:hover { background: var(--accent-soft); }
.btn--sm { min-height: 36px; font-size: 0.86rem; padding-block: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font: 600 0.8rem/1.3 var(--font-mono); font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap;
}

/* ---------------------------------------------------------------- site bar */

.site-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-bar__inner {
  max-width: calc(var(--shell) + 32px); margin-inline: auto;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 750 1.1rem/1 var(--font-display); }
.brand__mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent) 0 46%, color-mix(in oklab, var(--accent) 55%, var(--accent-soft)) 46% 74%, var(--accent-soft) 74%);
}
.site-bar__nav { display: flex; align-items: center; gap: 4px; }
.site-bar__nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.93rem; padding: 8px 10px; border-radius: 8px; }
.site-bar__nav a:hover, .site-bar__nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.site-bar__nav .site-bar__cta { background: var(--ink); color: var(--paper); margin-left: 6px; }
.site-bar__nav .site-bar__cta:hover { background: var(--accent); color: var(--on-accent); }
@media (max-width: 520px) {
  .site-bar__nav a:not(.site-bar__cta):first-child { display: none; }
}

/* ---------------------------------------------------------------- breadcrumbs */

.crumbs { padding-block: 18px 6px; overflow-x: auto; scrollbar-width: none; }
.crumbs ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; white-space: nowrap; font-size: 0.84rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* =====================================================================
   PAGE 1: HUB
   ===================================================================== */

.hub-hero {
  display: grid; gap: 32px; align-items: end;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  padding-block: 28px 36px;
}
.hub-hero__text { display: grid; gap: 18px; min-width: 0; }
.hub-hero__text .display { max-width: 16ch; }
.facts {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 20px; box-shadow: var(--shadow); min-width: 0;
}
.facts__row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding-block: 12px; border-top: 1px solid var(--line); }
.facts__row:first-child { border-top: 0; }
.facts dt { font: 600 0.74rem/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .hub-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
@media (max-width: 420px) {
  .facts__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* blueprint: the signature element */
.blueprint { display: grid; gap: 14px; padding-block: 8px 44px; }
.blueprint__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }
.blueprint__note { font-size: 0.86rem; color: var(--muted); }
.blueprint__bar {
  display: flex; gap: 3px; height: 92px; border-radius: var(--radius); overflow: hidden;
}
.bp-seg {
  flex: var(--share) 1 0; min-width: 30px;
  --tone: color-mix(in oklab, var(--accent) calc(100% - var(--step) * 82%), var(--accent-soft));
  background: var(--tone);
  transition: flex-grow .5s cubic-bezier(.2,.7,.2,1), filter .15s;
}
.bp-seg a {
  display: flex; flex-direction: column; justify-content: space-between; height: 100%;
  padding: 10px 10px 9px; text-decoration: none; color: var(--ink);
}
.bp-seg--deep a { color: var(--on-accent); }
.bp-seg:hover { filter: brightness(1.08) saturate(1.1); }
.bp-seg__num { font: 750 1.5rem/1 var(--font-display); }
.bp-seg__w { font: 600 0.78rem/1 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.blueprint__legend {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px 20px;
  font-size: 0.88rem;
}
.blueprint__legend a { display: flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none; }
.blueprint__legend a:hover { color: var(--accent); }
.blueprint__legend .mono { color: var(--muted); font-size: 0.8rem; }
.swatch {
  flex: none; width: 10px; height: 10px; border-radius: 3px; transform: translateY(1px);
  background: color-mix(in oklab, var(--accent) calc(100% - var(--step) * 82%), var(--accent-soft));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
@media (max-width: 640px) {
  .blueprint__bar { height: 72px; }
  .bp-seg { min-width: 22px; }
  .bp-seg a { padding: 8px 6px; }
  .bp-seg__num { font-size: 1.15rem; }
  .bp-seg__w { display: none; }
}

/* section heads */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 22px; }
.section-head__aside { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.92rem; }
.section-head__aside strong { color: var(--ink); font-weight: 600; }

/* domain cards */
.domains { padding-block: 12px 56px; border-top: 1px solid var(--line); padding-top: 40px; }
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
/* On wide screens the column count comes from the domain count (set inline as --cols) so rows fill evenly. */
@media (min-width: 1000px) { .domain-grid[style*="--cols"] { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); } }
.dcard {
  --tone: color-mix(in oklab, var(--accent) calc(100% - var(--step) * 82%), var(--accent-soft));
  position: relative; height: 100%;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px;
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.dcard:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.dcard__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dcard__num { font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.dcard__title { font: 650 var(--step-1)/1.25 var(--font-display); letter-spacing: -0.01em; }
.dcard__title a { color: var(--ink); text-decoration: none; }
.dcard__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card is the link */
.dcard__title a:focus-visible { outline: none; }
.dcard:has(.dcard__title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.dcard__meter { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.dcard__meter span { display: block; height: 100%; width: calc(var(--fill) * 100%); background: var(--tone); border-radius: inherit; }
.dcard__sum { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.dcard__inside ul { margin-top: 8px; display: grid; gap: 6px; }
.dcard__inside li { position: relative; padding-left: 16px; font-size: 0.92rem; line-height: 1.4; }
.dcard__inside li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 2px; background: var(--tone); border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); }
.dcard__inside .dcard__more { color: var(--muted); }
.dcard__inside .dcard__more::before { background: transparent; }
.dcard__watch {
  margin-top: auto;
  font-size: 0.88rem; line-height: 1.45; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--trap-soft); color: var(--ink);
}
.dcard__watch span { display: block; font: 600 0.7rem/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--trap); }
.dcard__watch + .dcard__stats { margin-top: 0; }
.dcard__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.dcard__stats dt { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.dcard__stats dt abbr { text-decoration: none; }
.dcard__stats dd { font-size: 0.86rem; font-weight: 600; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.dcard__cta { font-weight: 600; font-size: 0.9rem; color: var(--accent); display: inline-flex; gap: 6px; }
.dcard__cta .arrow { transition: transform .2s; }
.dcard:hover .dcard__cta .arrow { transform: translateX(4px); }

/* study plan + quiz */
.plan {
  display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  padding-block: 44px 56px; border-top: 1px solid var(--line);
}
.plan__order { display: grid; gap: 14px; align-content: start; min-width: 0; }
.plan-list { display: grid; gap: 0; margin-top: 6px; border-top: 1px solid var(--line); }
.plan-list li { border-bottom: 1px solid var(--line); }
.plan-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 4px; color: var(--ink); text-decoration: none;
}
.plan-list a:hover { background: var(--sunk); }
.plan-list__name { min-width: 0; display: flex; gap: 12px; align-items: baseline; }
.plan-list__name .mono { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.78rem; font-weight: 600; }
.plan-list__meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.plan__quiz { display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (max-width: 900px) { .plan { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) {
  .plan-list a { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .plan-list__meta { padding-left: 38px; white-space: normal; }
}

/* traps band */
.traps-band { padding-block: 44px 56px; border-top: 1px solid var(--line); }
.trap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.trap-mini {
  display: grid; gap: 8px; align-content: start; padding: 16px 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.trap-mini__domain { font-size: 0.75rem; font-weight: 600; color: var(--trap); text-decoration: none; }
.trap-mini__domain:hover { text-decoration: underline; color: var(--trap); }
.trap-mini__title { font: 650 1.05rem/1.3 var(--font-display); }
.trap-mini__clue { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.trap-mini__clue span { font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-right: 4px; }

/* tools */
.tools-band { padding-block: 44px 24px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.tool {
  position: relative; display: grid; gap: 4px; height: 100%; padding: 16px 40px 16px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.tool:hover { border-color: var(--accent); color: var(--ink); }
.tool__label { font-weight: 600; }
.tool__desc { font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.tool__arrow { position: absolute; right: 14px; top: 16px; color: var(--accent); transition: transform .2s; }
.tool:hover .tool__arrow { transform: translateX(3px); }
.tool--practice { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tool--practice .tool__desc, .tool--practice .tool__arrow { color: color-mix(in oklab, var(--on-accent) 82%, transparent); }
.tool--practice:hover { background: var(--accent-strong); color: var(--on-accent); }

/* faq */
.faq-band { padding-block: 44px 24px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.faq { display: grid; border-top: 1px solid var(--line); max-width: 860px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 16px 2px; font-weight: 600; font-size: 1.02rem; line-height: 1.4;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: currentColor; translate: -50% -50%; transition: rotate .2s; }
.faq__icon::after { rotate: 90deg; }
.faq__item[open] .faq__icon::after { rotate: 0deg; }
.faq__item p { padding: 0 2px 18px; color: var(--muted); max-width: 70ch; }

.source-note { margin-top: 28px; font-size: 0.8rem; color: var(--muted); max-width: 80ch; display: grid; gap: 6px; line-height: 1.5; }

/* =====================================================================
   PAGE 2: DOMAIN
   ===================================================================== */

.dom-hero { display: grid; gap: 16px; padding-block: 24px 28px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; max-width: 920px; }
.stat {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px;
  padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
}
.stat dd { font-size: var(--step-1); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.stat dt { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.stat--est { background: transparent; border-style: dashed; }
.est-tag { display: inline-block; margin-left: 4px; font: 600 0.62rem/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.dom-hero__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.84rem; color: var(--muted); }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* domain switcher */
.domain-switch {
  display: flex; align-items: center; gap: 10px; padding-block: 12px; margin-bottom: 8px;
  border-block: 1px solid var(--line); min-width: 0;
}
.domain-switch__all { flex: none; font-weight: 600; font-size: 0.88rem; text-decoration: none; padding-right: 10px; border-right: 1px solid var(--line); }
.domain-switch ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-block: 2px; min-width: 0; scroll-snap-type: x proximity; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; scroll-snap-align: start;
  padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: 0.86rem;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip__num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 4px; border-radius: 999px; background: var(--sunk); font-size: 0.75rem; font-weight: 600; }
.chip--current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--current:hover { color: var(--paper); }
.chip--current .chip__num { background: var(--accent); color: var(--on-accent); }
.chip__name { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }

/* layout with sticky toc */
.dom-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 48px; padding-top: 28px; }
.toc { min-width: 0; }
.toc__inner { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); display: grid; gap: 12px; }
.toc ol { display: grid; gap: 1px; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 6px 12px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; line-height: 1.35;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc__cta { margin-top: 8px; font-size: 0.86rem; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; line-height: 1.35; }
.toc__cta:hover { background: var(--accent); color: var(--on-accent); }
@media (max-width: 980px) {
  .dom-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; }
  .toc { display: none; }
}

.dom-body { min-width: 0; display: grid; gap: 0; }
/* Long commands, identifiers and URLs in the content must wrap instead of widening the page. */
.dom-body :is(p, dd, li, figcaption, summary, h2, h3), .dcard :is(p, li, dd), .quiz__text { overflow-wrap: anywhere; }
.block { padding-block: 36px; border-bottom: 1px solid var(--line); display: grid; gap: 16px; min-width: 0; }
.block:first-child { padding-top: 0; }
.block__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.count { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding-inline: 6px; margin-left: 6px; border-radius: 8px; background: var(--sunk); font-size: 0.85rem; vertical-align: 4px; color: var(--muted); }

.why {
  margin-top: 6px; padding: 18px 20px; border-radius: var(--radius); max-width: 72ch;
  background: var(--accent-soft); display: grid; gap: 10px;
}
.why .h-label { color: var(--accent-strong); }

/* how it's tested */
.patterns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; counter-reset: pat; }
.pattern { padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 6px; align-content: start; }
.pattern__name { font: 650 1rem/1.3 var(--font-display); }
.pattern p { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }
.reasoning {
  margin: 0; padding: 18px 20px 18px 22px; border-radius: var(--radius-sm); max-width: 72ch;
  background: var(--sunk); display: grid; gap: 8px; position: relative;
}
.reasoning::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }

/* objectives */
.objectives { display: grid; gap: 8px; }
.obj { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s; }
.obj[open] { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.obj summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 20px; gap: 12px; align-items: start;
  padding: 14px 16px;
}
.obj summary::-webkit-details-marker { display: none; }
.obj__id { font-size: 0.86rem; font-weight: 600; color: var(--accent); padding-top: 2px; }
.obj__title { font-weight: 600; line-height: 1.4; min-width: 0; }
.obj__title small { display: block; font-weight: 400; font-size: 0.88rem; color: var(--muted); margin-top: 2px; }
.obj__chev { width: 10px; height: 10px; margin-top: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); rotate: 45deg; transition: rotate .2s; justify-self: center; }
.obj[open] .obj__chev { rotate: 225deg; margin-top: 11px; }
.obj__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; padding: 4px 16px 18px calc(16px + 3.4rem + 12px); }
.obj__body dt { font: 600 0.7rem/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.obj__body dd { font-size: 0.94rem; line-height: 1.55; }
.obj__confusion dt { color: var(--trap); }
@media (max-width: 680px) {
  .obj summary { grid-template-columns: 2.8rem minmax(0, 1fr) 16px; }
  .obj__body { grid-template-columns: minmax(0, 1fr); padding-left: 16px; }
}

/* high-yield */
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.concept { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.concept__term { font: 650 1.05rem/1.3 var(--font-display); }
.concept__what { font-size: 0.93rem; line-height: 1.55; }
.concept dl { display: grid; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.concept dl div { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 8px; }
.concept dt { font: 600 0.68rem/1.9 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.concept dd { font-size: 0.88rem; line-height: 1.5; }
.concept__trap dt { color: var(--trap); }

/* comparisons */
.compare { display: grid; gap: 10px; }
.compare + .compare { margin-top: 14px; }
.compare__title { font: 650 1.08rem/1.3 var(--font-display); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9rem; line-height: 1.45; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 12px 14px; border-top: 1px solid var(--line); }
.table-wrap thead th { border-top: 0; background: var(--sunk); font: 600 0.7rem/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.table-wrap tbody th { font-weight: 600; width: 20%; }
.table-wrap .td-trap { color: var(--trap); }

/* traps */
.traps { display: grid; gap: 14px; }
.trap {
  display: grid; gap: 14px; padding: 20px; border-left: 3px solid var(--trap); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.trap__title { font: 650 1.12rem/1.3 var(--font-display); }
.trap__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trap__grid dt { font: 600 0.68rem/1.7 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.trap__grid dd { font-size: 0.92rem; line-height: 1.5; }
.trap__grid div:nth-child(3) dt { color: var(--bad); }
.trap__clue { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--trap-soft); font-size: 0.93rem; line-height: 1.5; }
.trap__clue span { display: block; font: 600 0.68rem/1.7 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--trap); }
@media (max-width: 760px) { .trap__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

/* decision framework: a real sequence, so numbered */
.steps { display: grid; gap: 0; counter-reset: step; max-width: 74ch; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 18px 52px; line-height: 1.55;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 600 0.9rem/1 var(--font-mono);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 34px; bottom: 2px; width: 1px; background: var(--line); }

/* quiz */
.quiz { display: grid; gap: 14px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quiz__tag { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 600 0.72rem/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.quiz__tag a { color: var(--accent); text-decoration: none; }
.quiz__tag a:hover { text-decoration: underline; }
.quiz__q { font-size: 1.04rem; line-height: 1.55; font-weight: 500; }
.quiz__options { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.quiz__opt {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer;
  padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper);
  transition: border-color .15s, background-color .15s;
}
.quiz__opt:hover { border-color: var(--accent); }
.quiz__opt input { position: absolute; opacity: 0; pointer-events: none; }
.quiz__letter { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 600 0.82rem/1 var(--font-mono); }
.quiz__text { padding-top: 3px; line-height: 1.45; font-size: 0.95rem; }
.quiz__opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.quiz__opt:has(input:checked) .quiz__letter { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quiz__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz.is-answered .quiz__opt,
.quiz.is-answered .quiz__opt:hover { cursor: default; border-color: var(--line); background: var(--paper); }
.quiz.is-answered .quiz__opt .quiz__letter { background: var(--surface); border-color: var(--line); color: var(--ink); }
.quiz.is-answered .quiz__opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.quiz.is-answered .quiz__opt.is-correct .quiz__letter { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.quiz.is-answered .quiz__opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz.is-answered .quiz__opt.is-wrong .quiz__letter { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.quiz__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quiz__hint { font-size: 0.86rem; color: var(--bad); }
.quiz__feedback { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--sunk); }
.quiz__verdict { font-weight: 700; }
.quiz__verdict.is-ok { color: var(--ok); }
.quiz__verdict.is-bad { color: var(--bad); }
.quiz__why { font-size: 0.93rem; line-height: 1.55; }
.practice-more { font-size: 0.9rem; }

/* checklist */
.checklist__progress { font-size: 0.86rem; color: var(--muted); }
.checklist__bar { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.checklist__bar span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .3s; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 8px; }
.checklist li { position: relative; }
.checklist input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checklist label {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; height: 100%; cursor: pointer;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  font-size: 0.93rem; line-height: 1.45;
}
.checklist label::before {
  content: ""; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted); margin-top: 1px;
  background: var(--surface) no-repeat center / 12px;
}
.checklist input:checked + label { border-color: color-mix(in oklab, var(--ok) 45%, var(--line)); background: var(--ok-soft); }
.checklist input:checked + label::before {
  background-color: var(--ok); border-color: var(--ok);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.checklist input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
#checklist > .btn { justify-self: start; }

/* related */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.related__card {
  display: grid; gap: 6px; height: 100%; padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
.related__card:hover { border-color: var(--accent); color: var(--ink); }
.related__num { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.related__name { font: 650 1.05rem/1.3 var(--font-display); }
.related__why { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* other certifications (category interlinking) */
.xcerts-band { padding-block: 44px 24px; border-top: 1px solid var(--line); }
.xcerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.xcert {
  display: grid; gap: 4px; align-content: start; height: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color .15s;
}
.xcert:hover { border-color: var(--accent); color: var(--ink); }
.xcert__name { font-weight: 600; line-height: 1.35; }
.xcert__domain { font-size: 0.84rem; color: var(--muted); line-height: 1.4; }
.xcert--match { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.xcert--match .xcert__domain { color: var(--accent-strong); }

/* conversion band */
.convert {
  margin-top: 40px; padding: clamp(24px, 4vw, 40px); border-radius: calc(var(--radius) + 4px);
  background: var(--band); color: var(--on-band); display: grid; gap: 14px; position: relative; overflow: hidden;
}
.convert::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 220px; height: 120px; border-radius: 14px; opacity: .35;
  background: linear-gradient(90deg, var(--accent) 0 40%, color-mix(in oklab, var(--accent) 50%, transparent) 40% 70%, color-mix(in oklab, var(--accent) 22%, transparent) 70%);
  rotate: -8deg; pointer-events: none;
}
.convert__title { font: 700 var(--step-2)/1.15 var(--font-display); letter-spacing: -0.015em; }
.convert p { max-width: 60ch; color: color-mix(in oklab, var(--on-band) 80%, transparent); position: relative; z-index: 1; }
.convert .hero-actions { position: relative; z-index: 1; }
.btn--on-ink.btn--line { background: transparent; color: var(--on-band); border-color: color-mix(in oklab, var(--on-band) 35%, transparent); }
.btn--on-ink.btn--line:hover { border-color: var(--on-band); color: var(--on-band); }

/* pager */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.pager__link {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.pager__link:hover { border-color: var(--accent); color: var(--ink); }
.pager__link--next { text-align: right; }
.pager__dir { font: 600 0.78rem/1.4 var(--font-mono); color: var(--accent); }
.pager__name { font-weight: 600; line-height: 1.35; }
@media (max-width: 520px) { .pager { grid-template-columns: minmax(0, 1fr); } .pager__link--next { text-align: left; } }

.tools-band--compact { border-top: 0; padding-block: 32px 0; gap: 12px; }

/* ---------------------------------------------------------------- footer */

.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot__inner { padding-block: 28px 36px; display: grid; gap: 12px; font-size: 0.86rem; color: var(--muted); }
.site-foot__exam { color: var(--ink); font-weight: 600; }
.site-foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot__links a { color: var(--muted); text-decoration: none; }
.site-foot__links a:hover { color: var(--accent); }
.site-foot__legal { font-size: 0.78rem; }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .bp-seg { animation: seg-in .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--step) * 160ms); }
  @keyframes seg-in { from { flex-grow: 0.0001; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-bar, .toc, .domain-switch, .tools-band, .convert, .pager, .quiz__actions { display: none !important; }
  .obj__body { display: grid !important; }
}
