/* Reading, practice, and the studio share the established NoLimits tokens. */
.wiki-intro,
.reading-layout,
.course-cover,
.course-shell,
.lab-layout,
.studio-hero,
.studio-edition,
.studio-shelf,
.studio-map {
  --reading-width: 68ch;
  --reading-ease: cubic-bezier(.16, 1, .3, 1);
  min-width: 0;
  caret-color: var(--accent);
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

:is(.wiki-intro, .reading-layout, .course-cover, .course-shell, .lab-layout, .studio-hero, .studio-edition, .studio-shelf, .studio-map) ::selection {
  background: var(--action);
  color: var(--action-text);
}

:is(.wiki-intro, .reading-layout, .course-cover, .course-shell, .lab-layout, .studio-hero, .studio-edition, .studio-shelf, .studio-map) :is(h1, h2, h3, h4) {
  letter-spacing: -.035em;
  text-wrap: balance;
}

:is(.wiki-layout, .reading-layout, .course-shell, .lab-layout, .studio-hero, .studio-edition, .studio-map) > * { min-width: 0; }

:is(.wiki-filters, .wiki-index, .reading-nav, .reading-related, .course-outline, .lab-scenario, .studio-map) :is(a, button) {
  min-height: 44px;
}

:is(.wiki-intro, .wiki-layout, .reading-layout, .course-cover, .course-shell, .lab-layout, .studio-hero, .studio-edition, .studio-shelf, .studio-map) :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

/* Encyclopedia: a quiet, searchable index with real editorial hierarchy. */
.wiki-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: end;
  gap: 32px 64px;
  padding-block: 52px 32px;
}
.wiki-intro h1 { max-width: 14ch; font-size: clamp(42px, 5.5vw, 76px); line-height: 1.04; }
.wiki-intro p { max-width: 52ch; margin-top: 20px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.wiki-search { position: relative; display: grid; gap: 9px; align-self: end; }
.wiki-search label { font-size: 13px; color: var(--text); }
.wiki-search input { min-height: 56px; padding: 14px 17px; border-radius: 10px; background: var(--panel); font-size: 15px; }
.wiki-search input::placeholder { color: var(--muted); opacity: 1; }
.wiki-search > svg { position: absolute; right: 17px; bottom: 18px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.wiki-search:has(> svg) input { padding-right: 50px; }
.wiki-search small { color: var(--muted); font-size: 12px; }
.wiki-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-block: 0 30px; border-bottom: 1px solid var(--line); }
.wiki-filters :is(a, button) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 24px; background: transparent; color: var(--muted); font-size: 13px; line-height: 1.4; }
.wiki-filters :is(a, button):hover { color: var(--text); border-color: var(--muted); }
.wiki-filters :is(.active, .selected, [aria-pressed="true"], [aria-current="page"]) { color: var(--action-text); background: var(--action); border-color: var(--action); }
.wiki-filters small { font-size: 11px; font-variant-numeric: tabular-nums; }
.wiki-layout { display: grid; grid-template-columns: 195px minmax(0, 1fr); gap: clamp(32px, 5vw, 78px); padding-top: 28px; }
.wiki-index { position: sticky; top: 24px; align-self: start; display: grid; gap: 2px; padding-top: 5px; }
.wiki-index h2 { margin-bottom: 14px; font-size: 14px; letter-spacing: -.01em; }
.wiki-index a { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 7px; padding: 9px 11px; margin-left: -11px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.wiki-index :is(a:hover, a.active, [aria-current]) { background: var(--soft); color: var(--accent); }
.wiki-index small { font-size: 11px; font-variant-numeric: tabular-nums; }
.term-list { min-width: 0; }
.term-list > h2 { margin-block: 20px 8px; font-size: 30px; }
.term-list > h2:first-child { margin-top: 0; }
.term-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.3fr) 24px; align-items: center; gap: 26px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.term-row:first-of-type { border-top: 1px solid var(--line); }
.term-row .term-title h3 { font-size: clamp(21px, 2vw, 27px); letter-spacing: -.025em; line-height: 1.2; }
.term-title small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.term-row p { max-width: 59ch; color: var(--muted); font-size: 14px; line-height: 1.65; }
.term-row > svg { width: 20px; height: 20px; color: var(--muted); }
.term-row:hover h3, .term-row:hover > svg { color: var(--accent); }
.term-row[hidden] { display: none; }
.term-list .empty-state { margin-top: 16px; border-radius: 12px; }

/* Long-form reading: stable navigation, legible prose, useful next steps. */
.reading-layout { display: grid; grid-template-columns: 170px minmax(0, 720px) minmax(140px, 190px); gap: clamp(24px, 3.4vw, 52px); align-items: start; padding-block: 46px 32px; justify-content: space-between; }
.reading-nav { position: sticky; top: 28px; display: grid; gap: 3px; }
.reading-nav h2 { margin-bottom: 12px; font-size: 14px; letter-spacing: -.01em; }
.reading-nav a { display: flex; align-items: center; padding: 9px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.reading-nav a:hover, .reading-nav a[aria-current], .reading-nav a.active { color: var(--accent); }
.reading-article { min-width: 0; }
.reading-article > h1 { font-size: clamp(42px, 4.7vw, 66px); line-height: 1.08; margin-bottom: 22px; }
.reading-article > :is(.intro, .lead, p:first-of-type) { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--text); max-width: var(--reading-width); }
.reading-article > .meta { justify-content: flex-start; flex-wrap: wrap; gap: 10px 22px; margin-block: 24px 36px; font-size: 12px; }
:is(.reading-article, .course-body) .prose { max-width: var(--reading-width); font-size: 17px; line-height: 1.85; }
:is(.reading-article, .course-body) .prose :is(p, li) { color: var(--text); }
:is(.reading-article, .course-body) .prose p { margin-block: 0 20px; }
:is(.reading-article, .course-body) .prose :is(h2, h3) { scroll-margin-top: 28px; }
:is(.reading-article, .course-body) .prose h2 { margin: 45px 0 18px; font-size: clamp(27px, 2.8vw, 34px); line-height: 1.18; }
:is(.reading-article, .course-body) .prose h3 { margin: 30px 0 14px; font-size: 23px; line-height: 1.25; }
:is(.reading-article, .course-body) .prose :is(ul, ol) { padding-left: 24px; margin-block: 0 24px; }
:is(.reading-article, .course-body) .prose li { padding-left: 4px; margin-block: 7px; }
:is(.reading-article, .course-body) .prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
:is(.reading-article, .course-body) .prose strong { font-weight: 650; }
:is(.reading-article, .course-body) .prose blockquote { margin: 28px 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
:is(.reading-article, .course-body) .prose blockquote p:last-child { margin-bottom: 0; }
.reading-example { margin-block: 30px; padding: clamp(22px, 3vw, 34px); background: var(--soft); border-radius: 12px; }
.reading-example h3 { margin-block: 0 14px; font-size: 23px; }
.reading-example p { font-size: 16px; line-height: 1.75; }
.reading-example p + p { margin-top: 12px; }
.reading-example :is(strong, output) { font-variant-numeric: tabular-nums; }
.reading-example .source { margin-top: 18px; font-size: 12px; }
.reading-related { position: sticky; top: 28px; padding-top: 4px; }
.reading-related h2 { margin-bottom: 12px; font-size: 15px; letter-spacing: -.015em; line-height: 1.4; }
.reading-related a { display: block; padding-block: 13px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.reading-related a:hover { color: var(--accent); }
.reading-related :is(small, p) { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.reading-related .btn { margin-top: 20px; border: 1px solid var(--line); }
.reading-article > .source { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); line-height: 1.7; }
.reading-article > .actions { margin-top: 32px; }

/* The learning route remains a sequence, with progress tied to real chapters. */
.course-cover { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 34px; margin-top: 32px; }
.course-feature { display: grid; grid-template-columns: 1fr; align-content: start; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.course-feature > :is(img, svg, .formula-figure, .course-visual) { width: 100%; height: 230px; object-fit: cover; background: var(--soft); border-radius: 12px; overflow: hidden; }
.course-feature > .formula-figure { display: grid; place-items: center; padding: 20px; margin: 0; }
.course-feature h2 { max-width: 24ch; font-size: 32px; line-height: 1.16; }
.course-feature h3 { max-width: 28ch; font-size: 27px; line-height: 1.2; }
.course-feature p { color: var(--muted); max-width: 57ch; font-size: 15px; line-height: 1.7; }
.course-feature .meta { font-size: 12px; margin-top: 0; justify-content: flex-start; flex-wrap: wrap; gap: 14px; }
.course-feature .btn { justify-self: start; }
.course-feature:hover :is(h2, h3) { color: var(--accent); }
.course-shell { display: grid; grid-template-columns: 250px minmax(0, 760px); gap: clamp(32px, 6vw, 86px); align-items: start; padding-block: 42px; }
.course-outline { position: sticky; top: 26px; padding-right: 22px; border-right: 1px solid var(--line); }
.course-outline h2 { font-size: 19px; letter-spacing: -.02em; line-height: 1.3; margin-bottom: 8px; }
.course-outline > p { color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 22px; }
.course-outline ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.course-outline a { display: flex; align-items: start; gap: 12px; border-radius: 8px; padding: 11px 10px; margin-left: -10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.course-outline a > :is(span:first-child, svg) { flex-shrink: 0; }
.course-outline a > svg { width: 18px; height: 18px; margin-top: 1px; }
.course-outline a small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.course-outline a:hover { color: var(--text); background: var(--soft); }
.course-outline :is(.current > a, a.current, a[aria-current="step"], a[aria-current="page"]) { color: var(--accent); background: var(--soft); font-weight: 600; }
.course-outline :is(.completed > a, a.completed) > :is(span:first-child, svg) { color: var(--accent); }
.course-outline progress { appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 5px; margin-block: 16px 12px; background: var(--line); overflow: hidden; }
.course-outline progress::-webkit-progress-bar { background: var(--line); }
.course-outline progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.course-outline progress::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.course-body { min-width: 0; }
.chapter-head { margin-bottom: 34px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.chapter-head h1 { font-size: clamp(38px, 4.7vw, 62px); line-height: 1.1; margin-bottom: 20px; }
.chapter-head p { max-width: 60ch; color: var(--muted); font-size: 18px; line-height: 1.65; }
.chapter-head .meta { justify-content: flex-start; gap: 20px; font-size: 12px; margin-top: 20px; }
.chapter-quiz { margin-top: 44px; padding: clamp(22px, 3vw, 32px); background: var(--soft); border-radius: 12px; }
.chapter-quiz h2 { font-size: 28px; margin-bottom: 10px; }
.chapter-quiz > p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.chapter-quiz fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.chapter-quiz legend { font-size: 17px; font-weight: 600; line-height: 1.5; padding: 0 0 18px; }
.quiz-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 14px 17px; margin-block: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); text-align: left; font-size: 14px; line-height: 1.55; }
.quiz-option::before { content: ""; display: block; flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 50%; }
.quiz-option:hover { border-color: var(--accent); }
.quiz-option[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.quiz-option[aria-pressed="true"]::before { border: 5px solid var(--accent); }
.quiz-option:disabled { opacity: .65; }
.quiz-option[aria-pressed="true"]:disabled { opacity: 1; }
.quiz-feedback { margin-top: 20px; font-size: 14px; line-height: 1.7; }
.quiz-feedback:empty { display: none; }
.quiz-feedback :is(strong, b) { display: block; margin-bottom: 5px; color: var(--accent); }
.quiz-feedback p + p { margin-top: 10px; }
.chapter-quiz .actions { margin-top: 20px; }
.course-body > .actions { justify-content: space-between; margin-top: 34px; gap: 16px; }
.formula-figure { margin-block: 28px; padding: 24px; background: var(--soft); border-radius: 12px; overflow: hidden; }
.formula-figure svg { display: block; width: 100%; max-height: 340px; height: auto; color: var(--accent); }
.formula-figure figcaption { max-width: 65ch; margin-top: 15px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.formula-figure text { font-family: Onest, sans-serif; }
.formula-figure .figure-label { fill: var(--muted); }
.formula-figure .figure-value { fill: var(--text); font-variant-numeric: tabular-nums; }
.formula-figure .figure-accent { stroke: var(--accent); }

/* Order practice makes the depth and the consequence of an order visible. */
.lab-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: start; gap: clamp(24px, 4vw, 56px); margin-top: 32px; }
.order-book { padding: clamp(20px, 3vw, 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.order-book h2 { font-size: 26px; margin-bottom: 6px; }
.order-book > p { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.order-book table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums lining-nums; }
.order-book th { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); font-weight: 500; text-align: right; white-space: nowrap; }
.order-book td { position: relative; padding: 9px 8px; text-align: right; line-height: 1.5; isolation: isolate; }
.order-book :is(th, td):first-child { text-align: left; }
.order-book td > span { position: absolute; z-index: -1; inset: 3px 0 3px auto; width: var(--depth, var(--bar, 0%)); max-width: 100%; background: color-mix(in srgb, var(--accent) 13%, transparent); transition: width 480ms var(--reading-ease); pointer-events: none; }
.order-book tr.ask td > span { background: color-mix(in srgb, var(--text) 8%, transparent); }
.order-book tr.bid :is(td:first-child, .price) { color: var(--accent); }
.order-book tr.spread td { padding-block: 14px; border-block: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.order-book tr.spread strong { color: var(--text); font-size: 22px; font-weight: 550; }
.order-book .book-note { margin-top: 18px; margin-bottom: 0; font-size: 12px; }
.order-controls h2 { font-size: 30px; margin-bottom: 15px; }
.order-controls > p { color: var(--muted); font-size: 15px; margin-bottom: 25px; line-height: 1.7; }
.order-controls form { display: grid; gap: 18px; }
.order-controls label { gap: 9px; color: var(--text); font-size: 13px; }
.order-controls :is(input, select) { min-height: 50px; background: var(--panel); font-variant-numeric: tabular-nums; }
.order-controls .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.order-controls .btn { min-height: 48px; }
.order-controls input[aria-invalid="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.order-result { display: block; margin-top: 24px; padding: 24px; background: var(--soft); border-radius: 12px; }
.order-result h3 { font-size: 23px; margin-bottom: 12px; }
.order-result output { display: block; color: var(--accent); font-size: 34px; font-weight: 550; line-height: 1.3; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.order-result p { margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.order-result dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 15px; margin-block: 18px 0; font-size: 13px; }
.order-result dt { color: var(--muted); }
.order-result dd { margin: 0; text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; }
.reading-example .source, .chapter-quiz > p, .formula-figure figcaption, .order-result :is(p, dt) { color: color-mix(in srgb, var(--text) 9%, var(--muted)); }
.formula-figure .figure-label { fill: color-mix(in srgb, var(--text) 9%, var(--muted)); }
.lab-scenario { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 24px; }
.lab-scenario button { padding: 10px 15px; background: transparent; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.4; }
.lab-scenario button:hover { border-color: var(--accent); }
.lab-scenario :is(.active, [aria-pressed="true"]) { color: var(--action-text); background: var(--action); border-color: var(--action); }

/* The studio opens like an editorial spread, then offers clear routes inward. */
.studio-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 76px); align-items: center; padding-block: clamp(35px, 5vw, 68px) 50px; }
.hero-story { position: relative; overflow: hidden; border-radius: 12px; background: var(--soft); background-size: cover; background-position: center 37%; aspect-ratio: 4 / 4.5; min-height: 350px; }
.hero-story > :is(img, picture) { display: block; width: 100%; height: 100%; }
.hero-story > img, .hero-story picture img { width: 100%; height: 100%; object-fit: cover; object-position: center 37%; }
.hero-story .author-credit { position: absolute; inset: auto 18px 18px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 13px 16px; background: var(--panel); color: var(--text); border-radius: 8px; font-size: 13px; line-height: 1.5; }
.author-credit small { font-size: 11px; color: var(--muted); }
.hero-feature { padding-block: 12px; }
.hero-feature h1 { max-width: 13ch; font-size: clamp(48px, 6.3vw, 88px); line-height: 1.02; font-weight: 550; }
.hero-feature h1 em { display: block; font-style: normal; color: var(--accent); }
.hero-feature > p { max-width: 44ch; margin-top: 26px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.7; }
.hero-feature .actions { gap: 12px; margin-top: 30px; }
.hero-feature .btn { min-height: 48px; font-size: 13px; padding-inline: 18px; }
.hero-feature :is(.hero-links, .hero-topics) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-top: 26px; margin-top: 28px; border-top: 1px solid var(--line); }
:is(.hero-links, .hero-topics) a { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--accent); font-size: 13px; }
:is(.hero-links, .hero-topics) a svg { width: 16px; height: 16px; }
:is(.hero-links, .hero-topics) a:hover { text-decoration: underline; text-underline-offset: 5px; }
.studio-edition { display: grid; grid-template-columns: .75fr 1.35fr .85fr; gap: clamp(24px, 3.8vw, 54px); padding-block: 36px 40px; border-block: 1px solid var(--line); }
.studio-edition > :not(:first-child) { border-left: 1px solid var(--line); padding-left: clamp(24px, 3.8vw, 54px); }
.studio-edition h2 { max-width: 15ch; font-size: 33px; line-height: 1.16; }
.studio-edition h3 { font-size: 25px; line-height: 1.2; }
.studio-edition p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 12px; }
.studio-edition :is(.text-link, .btn) { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; }
.studio-edition nav { display: grid; align-content: start; gap: 0; }
.studio-edition nav > a { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 55px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.studio-edition nav > a:first-child { padding-top: 0; }
.studio-edition nav > a svg { width: 17px; height: 17px; color: var(--accent); }
.studio-edition nav > a:hover { color: var(--accent); }
.studio-edition nav small { color: var(--muted); font-size: 11px; }
.studio-edition > .edition-lab { padding: 26px; border: 0; border-radius: 12px; background: #132125; color: #edf7f4; }
.studio-edition .edition-lab p { color: #b6c9c8; }
.edition-lab :is(.text-link, a) { color: #9be8de; }
.edition-lab .depth-preview { margin-block: 20px 8px; }
.depth-preview svg { display: block; width: 100%; height: auto; max-height: 165px; }
.depth-preview svg text { font-family: Onest, sans-serif; font-variant-numeric: tabular-nums; }
.edition-lab .depth-preview svg { color: #9be8de; }
.edition-next { display: grid; align-content: start; }
.edition-next h3 { margin-bottom: 14px; font-size: 22px; }
.edition-next > a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 55px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.edition-next > a:hover { color: var(--accent); }
.edition-next > a svg { width: 17px; height: 17px; color: var(--accent); }
.studio-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding-block: 28px 12px; }
.shelf-card { min-width: 0; display: flex; flex-direction: column; align-items: start; }
.shelf-card > :is(img, picture, .shelf-visual) { display: block; width: 100%; height: 210px; margin-bottom: 18px; border-radius: 12px; background: var(--soft); overflow: hidden; }
.shelf-card > img, .shelf-card picture img { width: 100%; height: 210px; object-fit: cover; }
.shelf-card .shelf-visual svg { width: 100%; height: 100%; color: var(--accent); }
.shelf-card > svg { display: block; width: 100%; height: 210px; margin-bottom: 18px; background: var(--soft); border-radius: 12px; color: var(--accent); }
.shelf-card h3 { font-size: 26px; line-height: 1.22; }
.shelf-card > p { max-width: 45ch; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.shelf-card .meta { width: 100%; margin-top: auto; padding-top: 18px; font-size: 12px; }
.shelf-card:hover h3 { color: var(--accent); }
.studio-map { display: grid; grid-template-columns: 1fr 1fr; gap: 0 70px; margin-top: 30px; border-top: 1px solid var(--line); }
.studio-map > a, .studio-map > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 20px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.studio-map h3 { font-size: 25px; line-height: 1.2; }
.studio-map p { grid-column: 1; max-width: 50ch; font-size: 14px; line-height: 1.6; color: var(--muted); }
.studio-map > a > svg { grid-column: 2; grid-row: 1 / 3; width: 21px; height: 21px; color: var(--accent); }
.studio-map > a:hover h3 { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .studio-hero .hero-story > img, .studio-hero .hero-story > picture {
    animation: studio-photo-open 900ms var(--reading-ease) both;
  }
  @keyframes studio-photo-open {
    from { clip-path: inset(0 0 7% 0 round 12px); transform: scale(1.035); }
    to { clip-path: inset(0 0 0 0 round 12px); transform: scale(1); }
  }
}

@media (max-width: 1100px) {
  .reading-layout { grid-template-columns: 150px minmax(0, 1fr); gap: 35px; }
  .reading-related { position: static; grid-column: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 25px; padding-top: 22px; margin-top: 8px; border-top: 1px solid var(--line); }
  .reading-related h2 { grid-column: 1 / -1; }
  .reading-related .btn { align-self: center; justify-self: start; }
  .wiki-intro { gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); }
  .wiki-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 35px; }
  .term-row { grid-template-columns: minmax(145px, .8fr) minmax(0, 1fr) 20px; gap: 20px; }
  .studio-hero { gap: 36px; }
  .hero-story { min-height: 320px; }
  .hero-feature h1 { font-size: clamp(44px, 6vw, 68px); }
  .studio-edition { grid-template-columns: .8fr 1.2fr; }
  .studio-edition > nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .studio-edition nav > a { padding-block: 10px; }
  .studio-shelf { gap: 22px; }
  .shelf-card > :is(img, picture, svg, .shelf-visual), .shelf-card picture img { height: 180px; }
  .course-shell { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 760px) {
  .wiki-intro { grid-template-columns: 1fr; gap: 26px; padding-top: 35px; }
  .wiki-intro h1 { font-size: clamp(40px, 8vw, 58px); }
  .wiki-intro p { font-size: 16px; margin-top: 16px; }
  .wiki-search { max-width: 100%; }
  .wiki-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 22px; scrollbar-width: thin; }
  .wiki-filters :is(a, button) { flex-shrink: 0; }
  .wiki-layout { grid-template-columns: 1fr; gap: 12px; padding-top: 22px; }
  .wiki-index { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 0 10px; }
  .wiki-index h2 { width: 100%; margin-bottom: 3px; }
  .wiki-index a { margin-left: 0; padding-inline: 8px; gap: 8px; }
  .term-row { grid-template-columns: 1fr 22px; gap: 11px 16px; padding-block: 23px; }
  .term-row .term-title { grid-column: 1; }
  .term-row .term-title h3 { font-size: 26px; }
  .term-row p { grid-column: 1; font-size: 14px; }
  .term-row > svg { grid-column: 2; grid-row: 1 / 3; }
  .reading-layout { grid-template-columns: 1fr; padding-top: 30px; gap: 28px; }
  .reading-nav { position: static; display: flex; flex-wrap: wrap; gap: 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .reading-nav h2 { width: 100%; margin-bottom: 3px; }
  .reading-nav a { min-height: 44px; }
  .reading-article > h1 { font-size: 43px; }
  .reading-related { grid-column: 1; }
  :is(.reading-article, .course-body) .prose { font-size: 16px; line-height: 1.8; }
  .course-cover { gap: 27px; }
  .course-feature > :is(img, svg, .formula-figure, .course-visual) { height: 180px; }
  .course-feature h2 { font-size: 27px; }
  .course-shell { grid-template-columns: 1fr; gap: 30px; padding-top: 30px; }
  .course-outline { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; }
  .course-outline ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
  .course-outline a { margin-left: 0; }
  .course-outline > p { margin-bottom: 12px; }
  .chapter-head h1 { font-size: 42px; }
  .chapter-head p { font-size: 16px; }
  .lab-layout { grid-template-columns: 1fr; gap: 32px; }
  .lab-scenario { gap: 8px; }
  .studio-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 30px; padding-bottom: 36px; }
  .hero-story { min-height: 0; aspect-ratio: 16 / 11; max-height: 410px; }
  .hero-feature { padding-block: 0; }
  .hero-feature h1 { max-width: 15ch; font-size: clamp(46px, 8vw, 64px); }
  .hero-feature > p { margin-top: 20px; max-width: 55ch; }
  .hero-feature :is(.hero-links, .hero-topics) { margin-top: 20px; padding-top: 14px; }
  .studio-edition { grid-template-columns: 1fr; gap: 25px; padding-block: 28px; }
  .studio-edition h2 { max-width: 22ch; font-size: 31px; }
  .studio-edition > :not(:first-child) { padding: 23px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .studio-edition > .edition-lab { padding: 24px; border: 0; }
  .studio-edition > nav { grid-template-columns: 1fr; gap: 0; }
  .studio-edition nav > a { min-height: 50px; }
  .studio-shelf { grid-template-columns: 1fr; gap: 27px; }
  .shelf-card { display: grid; grid-template-columns: 165px minmax(0, 1fr); column-gap: 22px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 27px; }
  .shelf-card > :is(img, picture, svg, .shelf-visual) { grid-column: 1; grid-row: 1 / 4; margin-bottom: 0; height: 155px; }
  .shelf-card picture img { height: 155px; }
  .shelf-card h3 { font-size: 24px; }
  .shelf-card > p, .shelf-card .meta { grid-column: 2; }
  .shelf-card .meta { font-size: 11px; padding-top: 14px; }
  .studio-map { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .reading-related { grid-template-columns: 1fr; }
  .reading-article > h1 { font-size: 38px; overflow-wrap: anywhere; }
  .reading-example { padding: 21px; }
  .reading-example p { font-size: 15px; }
  .course-cover { grid-template-columns: 1fr; }
  .course-feature > :is(img, svg, .formula-figure, .course-visual) { height: 215px; }
  .course-outline ol { grid-template-columns: 1fr; }
  .chapter-head h1 { font-size: 36px; }
  .chapter-quiz { padding: 21px; }
  .formula-figure { padding: 15px 10px; }
  .order-book { padding: 20px 14px; }
  .order-book table { font-size: 12px; }
  .order-book th { font-size: 10px; }
  .order-controls .form-grid { grid-template-columns: 1fr; }
  .hero-story { aspect-ratio: 4 / 3.4; }
  .hero-story .author-credit { inset: auto 12px 12px; padding: 11px 13px; gap: 2px 10px; }
  .hero-feature h1 { font-size: 45px; }
  .hero-feature .actions { align-items: stretch; }
  .hero-feature .actions .btn { flex: 1 1 150px; }
  .hero-feature :is(.hero-links, .hero-topics) { gap: 0 20px; }
  .shelf-card { grid-template-columns: 112px minmax(0, 1fr); column-gap: 17px; }
  .shelf-card > :is(img, picture, svg, .shelf-visual), .shelf-card picture img { height: 125px; }
  .shelf-card h3 { font-size: 21px; }
  .shelf-card > p { font-size: 13px; margin-top: 7px; }
  .shelf-card .meta { grid-column: 1 / -1; margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-hero .hero-story > :is(img, picture), .order-book td > span { animation: none; transition: none; }
}
