/* QuantEcon Translation Manual: theme.
   Layout: a field manual. One quiet reading column (about 70 characters wide) sits
   between a contents rail on the left and an on-page outline on the right. A single
   blue-teal ink carries links, the current page and every flow line in the diagrams.
   Numbered markers appear only where order matters (procedures).
   Content pages use plain semantic HTML, so that they convert cleanly to MyST
   when the manual moves to manual.quantecon.org. */

/* ---------- Fonts (self-hosted: Google Fonts is unreachable from mainland China) ---------- */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-next-latin-normal-200-800.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-next-latin-ext-normal-200-800.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-next-latin-italic-200-800.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-next-latin-ext-italic-200-800.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-mono-latin-normal-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-mono-latin-ext-normal-400.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/plex-mono-latin-normal-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/plex-mono-latin-ext-normal-500.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Noto Sans Malayalam"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/noto-sans-malayalam-malayalam-normal-100-900.woff2) format("woff2");
  unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; }

/* ---------- Tokens ---------- */
:root {
  /* colour: light */
  --bg: #fbfcfd;
  --surface: #f1f4f7;
  --surface-2: #e5eaef;
  --fg: #16202a;
  --muted: #55616f;
  --rule: #d8dfe6;
  --accent: #0a6a89;
  --accent-strong: #07526a;
  --accent-soft: #e1eff5;
  --caution: #7a4a00;
  --caution-soft: #fcf1da;
  --caution-rule: #e0ad55;
  --code-bg: #edf1f5;
  --header-bg: rgb(251 252 253 / 0.9);
  --shadow: 0 1px 2px rgb(16 32 42 / 0.06), 0 6px 20px rgb(16 32 42 / 0.07);

  /* type */
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --font-zh: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-ml: "Noto Sans Malayalam", "Malayalam Sangam MN", "Nirmala UI", Kartika, sans-serif;
  --font-fa: Vazirmatn, Tahoma, "Segoe UI", "Noto Naskh Arabic", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2.125rem;

  /* layout */
  --measure: 70ch;
  --header-h: 3.5rem;
  --radius: 10px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141a;
    --surface: #151d25;
    --surface-2: #1d2731;
    --fg: #e3e9ef;
    --muted: #9ba8b5;
    --rule: #28333e;
    --accent: #5dc0de;
    --accent-strong: #8fd5ec;
    --accent-soft: #0f2d38;
    --caution: #f0c06a;
    --caution-soft: #2a2211;
    --caution-rule: #7a5f27;
    --code-bg: #17212b;
    --header-bg: rgb(14 20 26 / 0.88);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141a;
  --surface: #151d25;
  --surface-2: #1d2731;
  --fg: #e3e9ef;
  --muted: #9ba8b5;
  --rule: #28333e;
  --accent: #5dc0de;
  --accent-strong: #8fd5ec;
  --accent-soft: #0f2d38;
  --caution: #f0c06a;
  --caution-soft: #2a2211;
  --caution-rule: #7a5f27;
  --code-bg: #17212b;
  --header-bg: rgb(14 20 26 / 0.88);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

:lang(ja) { font-family: "Atkinson Hyperlegible Next", var(--font-ja); }
:lang(zh-CN), :lang(zh-Hans), :lang(zh) { font-family: "Atkinson Hyperlegible Next", var(--font-zh); }
:lang(ml) { font-family: "Noto Sans Malayalam", "Atkinson Hyperlegible Next", var(--font-ml); }
:lang(fa) { font-family: var(--font-fa); }
:lang(en) :lang(ja), :lang(en) :lang(zh-CN), :lang(en) :lang(ml) { font-weight: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0.5rem; z-index: 100;
  background: var(--bg); color: var(--accent); padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule); border-radius: 8px;
}
.skip-link:focus { left: var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; gap: 0.75rem;
  height: var(--header-h); max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg); text-decoration: none; min-width: 0; }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--accent); }
.brand-text { display: flex; align-items: baseline; gap: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-org { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.brand-name { font-weight: 750; letter-spacing: -0.01em; }
.status-chip {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--caution); background: var(--caution-soft); border: 1px solid var(--caution-rule);
  border-radius: 999px; padding: 0.05rem 0.6rem; white-space: nowrap;
}
.header-spacer { flex: 1; }
.header-button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-size: var(--step--1); font-weight: 600; color: var(--fg);
  background: transparent; border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.3rem 0.65rem; cursor: pointer;
}
.header-button:hover { background: var(--surface); }
.header-button svg { width: 16px; height: 16px; }
.menu-button { display: none; }

/* ---------- Shell: contents rail, reading column, outline ---------- */
.shell {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr) 13.5rem;
  gap: 0 3rem;
  max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter);
}
.sidebar {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding-block: 1.75rem 3rem;
}
.main { min-width: 0; padding-block: 2.75rem 4rem; }
.doc { max-width: var(--measure); }
.toc {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); align-self: start;
  padding-block: 2.9rem 2rem; font-size: var(--step--1);
}

/* contents rail */
.nav-section + .nav-section { margin-top: 1.4rem; }
.nav-section-title {
  margin: 0 0 0.35rem; padding-inline: 0.6rem;
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  padding: 0.32rem 0.6rem; border-radius: 6px;
  color: var(--fg); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
}
.nav-list a:hover { background: var(--surface); }
.nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.nav-native { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

/* on-page outline */
.toc-title { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; border-left: 1px solid var(--rule); }
.toc a {
  display: block; margin-left: -1px; padding: 0.2rem 0 0.2rem 0.85rem;
  border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35;
}
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--accent-strong); border-left-color: var(--accent); }

@media (max-width: 1199px) {
  .shell { grid-template-columns: 15.5rem minmax(0, 1fr); gap: 0 2.5rem; }
  .toc { display: none; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: inline-flex; }
  .status-chip { display: none; }
  .sidebar {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    max-height: none; padding: 1.25rem var(--gutter) 3rem;
    background: var(--bg); border-top: 1px solid var(--rule);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.2s ease; }
  .main { padding-block: 1.75rem 3rem; }
}
@media (max-width: 479px) {
  .brand-org { display: none; }
  .theme-toggle > span { display: none; }
  .theme-toggle { padding-inline: 0.5rem; }
}

/* ---------- Document ---------- */
.doc-header { padding-bottom: 1.4rem; margin-bottom: 1.9rem; border-bottom: 1px solid var(--rule); }
.eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.76rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent);
}
h1, h2, h3 { color: var(--fg); text-wrap: balance; }
h1 { margin: 0 0 0.8rem; font-size: var(--step-3); line-height: 1.15; font-weight: 780; letter-spacing: -0.018em; }
.lede { margin: 0 0 1rem; font-size: var(--step-1); line-height: 1.5; color: var(--muted); }
.page-meta { margin: 0; font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }

.doc-body > * { margin-block: 0; }
.doc-body > * + * { margin-top: 1.1rem; }
.doc-body > h2 { margin-top: 2.75rem; }
.doc-body > h3 { margin-top: 1.9rem; }
.doc-body > h2 + *, .doc-body > h3 + * { margin-top: 0.7rem; }
h2 { font-size: var(--step-2); line-height: 1.25; font-weight: 740; letter-spacing: -0.012em; scroll-margin-top: calc(var(--header-h) + 1.25rem); }
h3 { font-size: var(--step-1); line-height: 1.3; font-weight: 720; scroll-margin-top: calc(var(--header-h) + 1.25rem); }
.heading-anchor { margin-left: 0.4rem; color: var(--muted); font-weight: 400; text-decoration: none; opacity: 0; }
h2:hover .heading-anchor, h3:hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
strong { font-weight: 720; }
.doc-body ul, .doc-body ol { padding-left: 1.35rem; }
.doc-body li + li { margin-top: 0.4rem; }
.doc-body li > ul, .doc-body li > ol { margin-top: 0.4rem; }
.doc-body li > p { margin: 0; }
.doc-body li > p + p { margin-top: 0.5rem; }

code {
  font-family: var(--font-mono); font-size: 0.86em; font-weight: 400;
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 5px; padding: 0.04em 0.34em;
  overflow-wrap: anywhere;
}
pre {
  font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.55;
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.95rem 1.1rem; overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
kbd {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--surface); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.35em;
}
blockquote { margin-inline: 0; padding: 0.1rem 0 0.1rem 1rem; border-left: 3px solid var(--rule); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2rem; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--rule); }
thead th {
  background: var(--surface); color: var(--muted);
  font-size: 0.78rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
tbody tr:last-child > * { border-bottom: 0; }
td code { white-space: nowrap; }

/* definition lists (vocabulary) */
dl { margin: 0; }
dt { font-weight: 720; }
dt:not(:first-child) { margin-top: 1.1rem; }
dd { margin: 0.2rem 0 0; }

/* callouts: the label encodes the kind */
.callout {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); padding: 0.9rem 1.1rem;
}
.callout > * { margin: 0; }
.callout > * + * { margin-top: 0.5rem; }
.callout-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; font-weight: 720; }
.callout-title::before {
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px; padding: 0 0.5rem; line-height: 1.6;
}
.callout.note { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); }
.callout.note .callout-title::before { content: "Note"; color: var(--accent-strong); }
.callout.tip .callout-title::before { content: "Tip"; color: var(--muted); }
.callout.rule { background: var(--caution-soft); border-color: var(--caution-rule); }
.callout.rule .callout-title { color: var(--caution); }
.callout.rule .callout-title::before { content: "Rule"; }
.callout ul, .callout ol { padding-left: 1.25rem; }

/* numbered procedures: a vertical line ties the steps together */
ol.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1.1rem; }
ol.steps > li { position: relative; counter-increment: step; padding-left: 2.85rem; min-height: 2rem; margin: 0; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.05rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.92rem; font-weight: 750; font-variant-numeric: tabular-nums;
  color: var(--accent-strong); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(1rem - 1px); top: 2.2rem; bottom: -0.95rem;
  width: 2px; background: var(--rule);
}
ol.steps > li > strong:first-child { display: block; }

/* figures and diagrams */
figure { margin-inline: 0; }
figure.diagram {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
  padding: 1rem 1rem 0.9rem; overflow-x: auto;
}
figure.diagram svg { display: block; width: 100%; height: auto; min-width: 600px; }
figcaption { margin-top: 0.75rem; font-size: var(--step--1); line-height: 1.5; color: var(--muted); }

/* diagram vocabulary (inline SVG styled from the page tokens) */
.d-node { fill: var(--bg); stroke: var(--rule); stroke-width: 1.5; }
.d-node-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.d-node-quiet { fill: var(--surface-2); stroke: var(--rule); stroke-width: 1.5; }
.d-band { fill: var(--surface-2); }
.d-band-label { fill: var(--muted); font-family: var(--font-body); font-size: 11px; font-weight: 750; letter-spacing: 0.09em; }
.d-label { fill: var(--fg); font-family: var(--font-body); font-size: 14px; font-weight: 720; }
.d-sub { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.d-mono { fill: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.d-edge { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.d-flow { fill: none; stroke: var(--accent); stroke-width: 2; }
.d-flow-dash { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-dasharray: 5 4; }
.d-edge-label { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.d-flow-label { fill: var(--accent-strong); font-family: var(--font-body); font-size: 12px; font-weight: 650; }
.d-arrow { fill: var(--muted); }
.d-arrow-accent { fill: var(--accent); }
.d-dot { fill: var(--accent); }
.d-num { fill: var(--accent-strong); font-family: var(--font-body); font-size: 12px; font-weight: 750; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); max-width: var(--measure); }
.pager a {
  display: block; padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--fg); text-decoration: none; line-height: 1.4;
}
.pager a:hover { border-color: var(--accent); }
.pager .pager-dir { display: block; margin-bottom: 0.15rem; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.pager .pager-next { grid-column: 2; text-align: right; }
@media (max-width: 599px) {
  .pager { grid-template-columns: 1fr; }
  .pager .pager-next { grid-column: auto; }
}

/* footer */
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  max-width: 1440px; margin-inline: auto; padding: 1.4rem var(--gutter) 2.5rem;
}
.footer-inner p { margin: 0; }
.noscript { margin: 1rem var(--gutter); }

/* ---------- Home page only (not part of the portable content set) ---------- */
.home-intro { max-width: 46rem; }
.home-intro h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 2.9rem); }
.path { list-style: none; margin: 0; padding: 0; counter-reset: path; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.path li { counter-increment: path; margin: 0; }
.path a {
  display: grid; gap: 0.25rem; height: 100%;
  padding: 0.95rem 1rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg); color: var(--fg); text-decoration: none;
}
.path a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.path a::before {
  content: "Step " counter(path);
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent);
}
.path-title { font-weight: 720; line-height: 1.3; }
.path-desc { color: var(--muted); font-size: var(--step--1); line-height: 1.45; }
.lang-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lang-grid li { margin: 0; }
.lang-card {
  display: grid; gap: 0.2rem; height: 100%;
  padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg);
  color: var(--fg); text-decoration: none;
}
a.lang-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.lang-native { font-size: 1.6rem; line-height: 1.25; font-weight: 600; }
.lang-english { font-weight: 720; }
.lang-phase { color: var(--muted); font-size: var(--step--1); line-height: 1.4; }

.doc-body .path, .doc-body .lang-grid { padding-left: 0; }
@media (max-width: 1099px) { .lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .path { grid-template-columns: minmax(0, 1fr); }
  .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.doc-body .path li + li, .doc-body .lang-grid li + li { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
