/* Disney Discovery — a handwritten discovery notebook. */
@font-face {
  font-family: "Yomogi"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("../fonts/yomogi-notebook.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("../fonts/caveat-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #eeeae1;
  --bg-soft: #f4f0e6;
  --surface: #fffdf6;
  --surface-2: #f6f2e8;
  --ink: #293f4c;
  --ink-2: #485760;
  --muted: #686b65;
  --line: #dedbcf;
  --line-strong: #b9b9aa;
  --accent: #3e697b;
  --accent-strong: #2d596c;
  --link: #2d596c;
  --violet: #837797;
  --cyan: #739789;
  --grad: linear-gradient(100deg, #3e697b, #6a8b81);
  --grad-btn: linear-gradient(#365e70, #365e70);
  --hue: var(--accent);
  --radius-s: 3px;
  --radius: 4px;
  --radius-l: 5px;
  --shadow-s: 1px 3px 0 #d8d3c64d, 0 6px 16px #534b3510;
  --shadow-m: 2px 7px 0 #ddd8cc70, 0 12px 26px #534b3510;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, "Noto Sans CJK JP", sans-serif;
  --hand: "Yomogi", "Hiragino Maru Gothic ProN", sans-serif;
  --script: "Caveat", "Yomogi", cursive;
  --page-width: 1100px;
  --reading: 700px;
  --toc: 228px;
  --layout: 984px;
  --gutter: clamp(22px, 5vw, 72px);
}
[data-theme="beginner"]  { --hue: #3e697b; --tab: #dce7e9; }
[data-theme="trivia"]    { --hue: #486f61; --tab: #e0e9da; }
[data-theme="character"] { --hue: #775d78; --tab: #ece0e8; }
[data-theme="movie"]     { --hue: #5e708c; --tab: #e1e6ed; }
[data-theme="parade"]    { --hue: #86623f; --tab: #f0e2c7; }
[data-theme="tips"]      { --hue: #576f43; --tab: #e5e9d5; }
[data-theme="tool"]      { --hue: #3b7476; --tab: #dce8e3; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.85; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; line-break: strict;
}
main {
  position: relative; flex: 1 0 auto;
  width: min(1260px, calc(100% - 64px)); margin: 18px auto 0; padding-bottom: 64px;
  border: 1px solid #ddd7ca; border-radius: 3px;
  background: linear-gradient(90deg, transparent 35px, #c28b7c40 35px, #c28b7c40 36px, transparent 36px), var(--surface);
  box-shadow: 4px 5px 0 -1px #f9f6ed, 5px 6px 0 #d8d3c6, 8px 9px 0 -1px #f9f6ed, 9px 10px 0 #d8d3c6, 0 18px 50px #4f483310;
}
main::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 8px; width: 14px;
  background: radial-gradient(circle at center, #c4bfb2 0 3px, #e5e0d5 3.5px 4.5px, transparent 5px) 0 19px / 14px 88px repeat-y;
  pointer-events: none;
}
img { display: block; max-width: 100%; height: auto; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
a { color: var(--link); text-underline-offset: .22em; text-decoration-thickness: .07em; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); transition: color .18s, background-color .18s, border-color .18s, box-shadow .18s, transform .18s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0 0 .6em; color: var(--ink); font-family: var(--hand); font-weight: 400; line-height: 1.6; letter-spacing: .015em; text-wrap: balance; word-break: auto-phrase; font-feature-settings: "palt"; }
p { margin: 0 0 1.15em; text-wrap: pretty; }
.container { width: min(var(--page-width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.nobr { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 400; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); }
.skip-link:focus { top: 12px; color: var(--bg); }
.eyebrow { margin: 0 0 10px; color: var(--accent-strong); font-family: var(--script); font-size: 1.15rem; font-weight: 600; letter-spacing: .035em; line-height: 1.5; }
.lead { color: var(--ink-2); font-size: 1rem; line-height: 2.05; word-break: auto-phrase; }
.grad-text { color: var(--ink); background: linear-gradient(transparent 66%, #edcd6b80 66%, #edcd6b80 90%, transparent 90%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (min-width: 1600px) { :root { --page-width: 1140px; } }

/* ---------- Header: small ink mark and index tabs ---------- */
.masthead { position: sticky; top: 0; z-index: 100; }
.masthead::before { content: ""; position: absolute; inset: 0; z-index: -1; border-bottom: 1px solid #d6d0c4; background: #eeeae1f5; }
.masthead-bar { display: flex; align-items: center; gap: 10px; min-height: 82px; }
.masthead-title { display: inline-flex; align-items: center; gap: 9px; margin-right: auto; color: var(--ink); font-family: var(--script); font-size: 1.9rem; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; }
.masthead-title em { color: var(--accent); font-style: normal; font-weight: inherit; }
.brand-mark { display: grid; place-items: center; flex: none; width: 33px; height: 36px; border: 1.5px solid var(--accent); border-radius: 42% 54% 48% 45%; background: transparent; color: var(--accent); transform: rotate(-9deg); }
.brand-mark svg { width: 72%; height: 72%; fill: currentColor; }
.site-nav-inline, .header-actions { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 2px; background: transparent; color: var(--ink-2); font-size: .72rem; text-decoration: none; white-space: nowrap; }
.pill:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--surface); }
.menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 3px 6px 3px 5px; background: var(--surface); color: var(--ink); cursor: pointer; list-style: none; }
.menu-toggle::-webkit-details-marker { display: none; }
.menu-toggle-lines { display: grid; gap: 4px; width: 18px; }
.menu-toggle-lines i { display: block; height: 1.5px; background: currentColor; transition: transform .2s, opacity .2s; }
.nav-disclosure[open] .menu-toggle-lines i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-disclosure[open] .menu-toggle-lines i:nth-child(2) { opacity: 0; }
.nav-disclosure[open] .menu-toggle-lines i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.nav-disclosure .site-nav { position: absolute; top: 100%; left: 0; right: 0; display: grid; gap: 4px; max-height: calc(100dvh - 74px); overflow-y: auto; padding: 16px max(var(--gutter), calc((100% - var(--page-width)) / 2)) 24px; border-bottom: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 14px 20px #534b3514; }
.nav-disclosure .site-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 14px; color: var(--ink); font-size: .9rem; text-decoration: none; }
.nav-disclosure .site-nav a::after { content: "→"; color: var(--accent); }
.nav-disclosure .site-nav a:hover, .nav-disclosure .site-nav a[aria-current="page"] { background: #efe6c5; }
.nav-extra { flex-wrap: wrap; row-gap: 0; border: 1px dashed var(--line); }
.nav-extra small { order: 3; flex-basis: 100%; color: var(--muted); font-size: .76rem; }
.nav-extra::after { content: "↗" !important; }
.nav-sep { height: 1px; margin: 8px 0; background: var(--line); }
@media (min-width: 1200px) {
  .nav-disclosure { display: none; }
  .site-nav-inline { display: flex; gap: 4px; }
  .site-nav-inline a { position: relative; padding: 12px 10px; color: var(--ink-2); font-size: .78rem; text-decoration: none; }
  .site-nav-inline a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 7px; height: 5px; background: #d6b75680; border-radius: 30% 20% 50% 20%; transform: rotate(-2deg) scaleX(0); transition: transform .18s; }
  .site-nav-inline a:hover::after, .site-nav-inline a[aria-current="page"]::after { transform: rotate(-2deg) scaleX(1); }
  .site-nav-inline a[aria-current="page"] { color: var(--ink); }
  .header-actions { display: flex; gap: 7px; margin-left: 10px; }
}

/* ---------- Buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 49px; padding: 9px 22px; border: 1px solid #365e70; border-radius: 3px 6px 4px 5px; background: var(--grad-btn); color: #fffdf6; font-size: .86rem; font-weight: 650; text-decoration: none; box-shadow: 3px 3px 0 #365e7024; }
.button::after { content: "↗"; font-size: 1.1rem; font-weight: 400; }
.button:hover { color: #fffdf6; transform: translateY(-2px); box-shadow: 4px 5px 0 #365e7024; }
.button-secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); box-shadow: none; }
.button-secondary:hover { color: var(--ink); border-color: var(--accent); background: var(--surface-2); box-shadow: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- Cover: ruled paper, marker and an original pen sketch ---------- */
.hero { padding: 0; }
.hero-grid { position: relative; isolation: isolate; display: grid; gap: 38px; padding: 50px 0 0; color: var(--ink); }
.hero-sky { display: none; }
.hero-art { position: relative; justify-self: center; width: min(100%, 350px); height: auto; aspect-ratio: 1; background: url("../img/notebook-sketch.svg") center / contain no-repeat; pointer-events: none; }
.hero-art > * { display: none; }
.hero-copy { min-width: 0; }
.hero .eyebrow { display: inline-block; padding: 2px 12px; margin-bottom: 20px; background: #f0e7c9; color: #655c44; font-size: 1.2rem; transform: rotate(-2deg); }
.hero h1 { position: relative; margin-bottom: 22px; color: var(--ink); font-size: clamp(2rem, 3.9vw, 3.2rem); line-height: 1.65; letter-spacing: .02em; text-wrap: initial; }
.hero .lead { max-width: 37em; margin: 0; color: var(--ink-2); font-size: .9rem; }
.hero-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 23px 0 24px; border-top: 1px dashed var(--line-strong); border-bottom: 1px solid var(--line); }
.hero-chips-label { margin-right: 10px; color: var(--muted); font-family: var(--script); font-size: 1.15rem; }
.hero-chips a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 15px; border: 1px solid #c2cfcf; border-radius: 2px 5px 0 0; background: #e1eaeb; color: #354f5b; font-size: .77rem; text-decoration: none; box-shadow: 1px 2px 0 #d8d3c655; }
.hero-chips a:nth-of-type(2) { background: #e3eadb; border-color: #c7d0ba; }
.hero-chips a:nth-of-type(3) { background: #f2e5bd; border-color: #d9cba4; }
.hero-chips a:nth-of-type(4) { background: #eae0e7; border-color: #d4c6d1; }
.hero-chips a:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--accent); }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 24px; row-gap: 40px; padding-top: 60px; }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: center; }
  .hero-art { grid-column: 2; grid-row: 1; width: 100%; max-width: 380px; align-self: center; }
}
@media (max-width: 899px) {
  .hero-copy { grid-row: 1; }
  .hero-art { grid-row: 2; width: 250px; margin-block: -10px; }
  .hero-chips { grid-row: 3; }
}

/* ---------- Notebook chapters and index cards ---------- */
.section { padding: clamp(40px, 6vw, 68px) 0 0; }
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 25px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { flex-basis: 100%; margin: 0; }
.section-heading h2 { position: relative; margin: 0; font-size: clamp(1.45rem, 3.2vw, 1.95rem); }
.section-heading h2 a { color: inherit; text-decoration: none; }
.section-heading > p:not(.eyebrow) { max-width: 42em; margin: 0; color: var(--muted); font-size: .84rem; }
.topic-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.topic { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; padding: 28px 24px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); transition: transform .2s, box-shadow .2s, border-color .2s; }
.topic > div { min-width: 0; width: 100%; }
.topic-no { display: grid; place-items: center; min-width: 36px; height: 34px; border: 1px solid var(--hue); border-radius: 48% 42% 45% 40%; color: var(--hue); font-family: var(--script); font-size: 1.2rem; line-height: 1; transform: rotate(-7deg); }
.topic h3, .topic h2 { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.65; }
.topic h3 a, .topic h2 a { color: var(--ink); text-decoration: none; }
.topic h3 a::before, .topic h2 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.topic h3 a::after, .topic h2 a::after { content: " ↗"; color: var(--hue); }
.topic:has(h3 a):hover, .topic:has(h2 a):hover { transform: translateY(-3px); border-color: var(--hue); box-shadow: var(--shadow-m); }
.topic:focus-within { border-color: var(--hue); }
.topic p { margin: 0 0 8px; color: var(--ink-2); font-size: .86rem; line-height: 1.95; }
.topic p:last-child { margin-bottom: 0; }
.topic .topic-meta { color: var(--hue); font-size: .76rem; }
.topic p.topic-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0; }
.topic-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 5px 0; color: var(--link); font-size: .8rem; line-height: 1.6; text-decoration: underline; text-decoration-color: #adb8b6; }
.topic-links a:hover { color: var(--ink); text-decoration-color: currentColor; }
.topic-featured { background: #f9f2db; border-color: #dfd2ac; }
.latest-section .topic { border-top: 3px solid var(--hue); }
.latest-section .topic-no { border: 0; font-size: 1.5rem; justify-content: start; }
.latest-section .topic-featured::after { content: ""; position: absolute; top: -13px; right: 24px; width: 72px; height: 25px; background: repeating-linear-gradient(90deg, #ddc78188 0 3px, #e4d59a88 3px 6px); transform: rotate(7deg); pointer-events: none; }
.topic-featured h3, .topic-featured h2 { font-size: 1.35rem; }
.section:not(.latest-section) .topic::after { content: ""; position: absolute; right: 22px; top: -10px; width: 48px; height: 20px; background: var(--tab, #e4e9df); border: 1px solid #c3c7ba; border-bottom: 0; transform: rotate(2deg); }
@media (min-width: 700px) {
  .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-section .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .latest-section .topic-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .latest-section .topic { padding: 24px; }
  .section:not(.latest-section) .topic-list:has(> .topic:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
#tools .topic-list { grid-template-columns: minmax(0, 1fr); }
.section > .container > p { margin-top: 22px; color: var(--ink-2); font-size: .86rem; }

/* ---------- Editor's endnote ---------- */
.closing { padding: clamp(40px, 6vw, 68px) 0 0; }
.about-band { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 24px; padding: clamp(24px, 4vw, 40px); border: 1px solid #d9cfad; border-radius: 3px; color: var(--ink); background: #f3eddb; box-shadow: 3px 4px 0 #e3dcc955; }
.about-band::before { content: ""; position: absolute; width: 86px; height: 24px; top: -12px; left: 28px; background: #d6dfd2aa; transform: rotate(-5deg); }
.about-band h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
.about-band p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: .86rem; line-height: 2; }
.about-band .button { justify-self: start; }
@media (min-width: 1000px) { .about-band { grid-template-columns: minmax(0, 1fr) auto; gap: 40px; } }

/* ---------- Page hero & breadcrumb ---------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(28px, 5vw, 58px) 0 clamp(26px, 4vw, 46px); }
.page-hero::before, .page-hero::after { content: none; }
.page-hero h1 { margin-bottom: 14px; font-size: clamp(1.8rem, 4.8vw, 3rem); line-height: 1.38; letter-spacing: -.02em; }
.page-hero .lead { max-width: 44em; margin: 0; }
.article-page .page-hero .container { width: min(var(--layout), calc(100% - var(--gutter) * 2)); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px 9px; margin: 0 0 18px; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-strong); text-decoration: underline; }
.breadcrumb [aria-hidden] { opacity: .6; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink-2); font-size: .76rem; font-weight: 650; line-height: 1.5; }
.chip-gold { border-color: color-mix(in oklab, var(--hue) 35%, var(--line)); background: var(--tab, var(--surface-2)); color: var(--hue); }
.last-edited { margin: 18px 0 0; color: var(--muted); font-size: .78rem; }

/* ---------- Article index ---------- */
.article-section { padding: 8px 0 0; }
.filter-bar { display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1) 22px; padding: 4px var(--gutter); overflow-x: auto; scrollbar-width: thin; }
[hidden] { display: none !important; }
.filter-chip { flex: none; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 650; }
.filter-chip:hover { border-color: var(--accent); }
.filter-chip[aria-pressed="true"] { border-color: transparent; background: var(--grad-btn); color: #fff; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.article-grid > li { min-width: 0; }
.article-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; height: 100%; padding: 24px 22px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.article-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--hue); }
.article-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--hue) 45%, var(--line)); box-shadow: var(--shadow-m); color: var(--ink); }
.article-card .tag { display: inline-flex; padding: 4px 11px; border-radius: 3px; background: var(--tab, var(--surface-2)); color: var(--hue); font-size: .72rem; font-weight: 750; line-height: 1.5; }
.article-card h3 { margin: 12px 0 8px; font-size: 1.06rem; line-height: 1.6; }
.article-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; margin: 0; overflow: hidden; color: var(--muted); font-size: .88rem; line-height: 1.75; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; width: 100%; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: .74rem; }
.more { color: var(--hue); font-size: .82rem; font-weight: 800; transition: transform .2s; }
.article-card:hover .more { transform: translateX(3px); }
@media (min-width: 700px) { .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }

/* ---------- Article reading ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; width: min(var(--layout), calc(100% - var(--gutter) * 2)); }
.article-layout > article { min-width: 0; }
.toc-col { order: -1; min-width: 0; }
.toc h2 { display: none; }
.toc ol { display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scrollbar-width: thin; }
.toc li { flex: none; scroll-snap-align: start; }
.toc a { display: block; padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.toc a:hover { border-color: var(--accent); color: var(--accent-strong); }
@media (min-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, var(--reading)) var(--toc); align-items: start; gap: 56px; }
  .toc-col { order: 0; position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; }
  .toc { padding: 20px 20px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
  .toc h2 { display: block; margin: 0 0 8px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
  .toc ol { display: block; margin: 0; padding: 0; overflow: visible; counter-reset: toc; }
  .toc li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); counter-increment: toc; font-size: .86rem; line-height: 1.6; }
  .toc li:first-child { border-top: 0; }
  .toc li::before { content: counter(toc, decimal-leading-zero); min-width: 1.7em; padding-top: .18em; color: var(--accent); font-size: .72rem; font-weight: 800; }
  .toc a { display: inline; padding: 0; border: 0; border-radius: 0; background: none; font-weight: 500; white-space: normal; }
  .toc a:hover { text-decoration: underline; }
}
.prose { min-width: 0; color: var(--ink); font-size: 1.02rem; line-height: 2; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h2 { position: relative; margin: 2.7em 0 .9em; padding-left: 18px; font-size: clamp(1.3rem, 3vw, 1.62rem); line-height: 1.5; }
.prose h2::before { content: ""; position: absolute; left: 0; top: .28em; bottom: .28em; width: 5px; border-radius: 5px; background: var(--grad); }
.prose h3 { margin: 2em 0 .6em; color: var(--accent-strong); font-size: 1.12rem; }
.prose ul, .prose ol { margin: 0 0 1.5em; padding-left: 1.5em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 800; }
.prose blockquote { margin: 1.8em 0; padding: 14px 20px; border-left: 4px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--surface-2); color: var(--ink-2); }
.prose dl { margin: 0 0 1.4em; }
.prose dt { margin-top: 1em; color: var(--accent-strong); font-weight: 800; }
.prose dd { margin: 0 0 0 1em; }
.prose figure { margin: 2em 0; }
.prose figure img { width: auto; max-width: 100%; max-height: min(78vh, 720px); margin-inline: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); box-shadow: var(--shadow-s); }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: .8rem; line-height: 1.8; text-align: center; }
.table-wrap { max-width: 100%; margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.75; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose tr:last-child > * { border-bottom: 0; }
.prose thead th { background: color-mix(in oklab, var(--accent) 10%, var(--surface)); color: var(--accent-strong); font-weight: 800; }
.prose tbody th { color: var(--ink); font-weight: 750; }
.prose tbody tr:nth-child(even) > * { background: var(--surface-2); }
.table-note { margin: -.8em 0 1.6em; color: var(--muted); font-size: .8rem; }
.answer-box, .callout { margin: 0 0 2.2em; padding: 22px 24px 20px; border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--line)); border-radius: var(--radius); background: #f6efd9; border-color: #d9cc9f; border-left: 3px solid #b49a47; }
.answer-label { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--accent-strong); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.answer-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.answer-box > :last-child, .callout > :last-child { margin-bottom: 0; }
.checklist { padding: 0 !important; list-style: none; }
.checklist li { position: relative; padding-left: 1.9em; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .6em; width: 1.05em; height: 1.05em; border: 2px solid var(--accent); border-radius: 2px; transform: rotate(-4deg); }
.timeline { margin: 1.6em 0; padding-left: 22px; border-left: 2px solid var(--line-strong); }
.timeline > * { position: relative; }
.timeline > *::before { content: ""; position: absolute; left: -29px; top: .75em; width: 12px; height: 12px; border: 3px solid var(--accent); border-radius: 50%; background: var(--bg); }
.when { color: var(--accent-strong); font-size: .8rem; font-weight: 800; }
.wide { width: 100%; }
.sources { margin-top: 3em; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: .94rem; line-height: 1.9; }
.sources h2 { margin: 0 0 .6em; padding: 0; font-size: 1.1rem; }
.sources h2::before { content: none; }
.sources ul { margin-bottom: 0; }
.prose ul.related { display: grid; gap: 10px; padding: 0; list-style: none; }
.prose .related li { margin: 0; }
.related a { position: relative; display: block; padding: 16px 48px 16px 20px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font-weight: 750; line-height: 1.6; text-decoration: none; }
.related a::after { content: "→"; position: absolute; right: 20px; top: 50%; translate: 0 -50%; color: var(--accent); transition: transform .2s; }
.related a:hover { border-color: var(--accent); box-shadow: var(--shadow-s); }
.related a:hover::after { transform: translateX(3px); }
.related small { display: block; margin-top: 4px; color: var(--muted); font-size: .84rem; font-weight: 400; line-height: 1.7; }
.cross-site-promo { margin: 2.5em 0; padding: 24px; border: 1px solid color-mix(in oklab, var(--violet) 30%, var(--line)); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in oklab, var(--violet) 10%, var(--surface)), var(--surface)); }
.cross-site-promo h2 { margin-top: 0; padding: 0; }
.cross-site-promo h2::before { content: none; }
.cross-site-promo p:last-child { margin-bottom: 0; }
@media (max-width: 699px) { .prose { font-size: 1rem; } .table-wrap table { min-width: 540px; } }

/* ---------- Profile / plain pages ---------- */
.about-heading { position: relative; isolation: isolate; overflow: hidden; padding: clamp(30px, 5vw, 56px) 0; }
.about-heading::before { content: none; }
.about-heading h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 4.6vw, 2.8rem); }
.about-heading p:not(.eyebrow) { margin: 0; color: var(--ink-2); }
.about-minimal > .container:first-child { padding-top: 22px; }
.about-minimal .breadcrumb { margin: 0; }
.about-editorial { padding: clamp(28px, 5vw, 48px) 0 0; }
.about-editorial .container > :not(.editor-profile-photo), .about-sites .container > * { max-width: 760px; }
.about-editorial h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.editor-profile-photo { position: relative; width: 148px; height: 160px; margin: 0 0 30px; padding: 8px 8px 20px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-m); transform: rotate(-3deg); }
.editor-profile-photo::after { content: ""; position: absolute; width: 70px; height: 22px; top: -10px; left: 37px; background: #d8e2d2b3; transform: rotate(7deg); }
.editor-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.editor-profile { display: grid; grid-template-columns: minmax(110px, .6fr) minmax(0, 1.6fr); margin: 24px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editor-profile dt, .editor-profile dd { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.editor-profile dt { background: var(--surface-2); color: var(--muted); font-size: .84rem; font-weight: 700; }
.editor-profile dd { color: var(--ink-2); font-size: .94rem; }
.editor-profile dt:last-of-type, .editor-profile dd:last-of-type { border-bottom: 0; }
.editor-social-links { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-social-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink-2); font-size: .86rem; font-weight: 650; text-decoration: none; }
.editor-social-links a:hover { border-color: var(--accent); color: var(--accent-strong); }
.about-sites { padding-top: clamp(28px, 5vw, 48px); }
.about-sites .container { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.about-site-link { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); color: var(--ink); text-decoration: none; }
.about-site-link:hover { border-color: var(--accent); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.about-site-label { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; font-size: .74rem; font-weight: 800; }
.about-site-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; font-size: .95rem; }
.about-site-copy small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.about-site-arrow { color: var(--accent); font-size: 1.2rem; }
.plain-page { max-width: 760px; margin-inline: 0; }
body.not-found .page-hero .container { text-align: center; }
body.not-found .page-hero .lead { margin-inline: auto; }
body.not-found .page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }

/* ---------- English pages ---------- */
main.section > .container, main.section > article.container { width: min(800px, calc(100% - var(--gutter) * 2)); padding-bottom: 8px; }
main.section h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.3; letter-spacing: -.02em; }
main.section h2:not(.topic h2) { position: relative; margin: 2.2em 0 .7em; padding-left: 18px; font-size: clamp(1.25rem, 3vw, 1.5rem); line-height: 1.5; }
main.section h2:not(.topic h2)::before { content: ""; position: absolute; left: 0; top: .28em; bottom: .28em; width: 5px; border-radius: 5px; background: var(--grad); }
main.section p, main.section li { line-height: 1.95; }
main.section .topic-list { margin: 28px 0; }

/* ---------- Colophon ---------- */
.site-footer { margin-top: 42px; padding: 26px 0 30px; color: var(--ink-2); }
.footer-inner { display: flex; flex-direction: column; gap: 24px; padding-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-name { color: var(--ink); font-family: var(--script); font-size: 1.8rem; font-weight: 600; }
.brand-caption { display: block; color: var(--muted); font-size: .7rem; }
.footer-copy { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer-links a { padding: 8px 0; color: var(--ink-2); font-size: .78rem; text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.disclaimer { margin: 0 0 12px; padding-top: 20px; border-top: 1px dashed #bcb7a8; color: var(--muted); font-size: .72rem; line-height: 1.9; }
.copyright { margin: 0; color: var(--muted); font-family: var(--script); font-size: 1rem; }
.site-footer .copyright a { color: var(--link); }
.site-footer .container > p:not([class]) { margin: 0 0 .7em; color: var(--muted); font-size: .78rem; }
@media (min-width: 760px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; gap: 32px; } .footer-links { justify-content: flex-end; max-width: 540px; } }

/* ---------- Motion, progress & misc ---------- */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
@supports (animation-timeline: scroll()) {
  .article-page::before { content: ""; position: fixed; z-index: 300; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; animation: read-progress linear both; animation-timeline: scroll(root); }
  @keyframes read-progress { to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) { .grad-text { background: none; color: CanvasText; } }
@media print {
  .masthead, .site-footer, .toc-col, .hero-sky, .hero-art { display: none !important; }
  body { background: #fff; color: #000; }
}
/* 画像の保存操作を抑制（完全な取得防止ではありません） */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---------- Small screens: retain the notebook, give the text room ---------- */
@media (max-width: 699px) {
  :root { --gutter: 24px; }
  main { width: calc(100% - 20px); margin-top: 10px; padding-bottom: 36px; background: var(--surface); }
  main::before { display: none; }
  .masthead-bar { min-height: 68px; }
  .masthead-title { font-size: 1.6rem; gap: 7px; }
  .brand-mark { width: 28px; height: 31px; }
  .hero-grid { padding-top: 34px; gap: 22px; }
  .hero .eyebrow { font-size: 1.05rem; padding-inline: 8px; }
  .hero h1 { font-size: clamp(1.6rem, 6.5vw, 2.5rem); line-height: 1.7; }
  .hero .lead { font-size: .84rem; line-height: 2; }
  .hero-art { width: 205px; margin-block: 0; }
  .hero-actions { gap: 10px; margin-top: 22px; }
  .hero-actions .button { padding-inline: 14px; font-size: .78rem; }
  .hero-chips { gap: 8px; padding-block: 18px; }
  .hero-chips-label { flex-basis: 100%; }
  .hero-chips a { flex: 1 1 42%; justify-content: center; padding-inline: 8px; font-size: .72rem; }
  .section-heading { gap: 6px; padding-bottom: 14px; }
  .section-heading h2 { font-size: 1.45rem; }
  .topic { padding: 24px 20px; }
  .topic h3 { font-size: 1.18rem; }
  .section:not(.latest-section) .topic-list { gap: 28px; }
  .page-hero h1, .about-heading h1 { font-size: 1.7rem; line-height: 1.65; }
  .article-card { padding: 22px 20px 18px; }
  .editor-profile { grid-template-columns: minmax(88px, .6fr) minmax(0, 1.4fr); }
  .editor-profile dt, .editor-profile dd { padding: 12px 10px; }
  .site-footer { margin-top: 28px; }
}

/* Article discovery and keyboard-accessible scrolling. */
.article-controls { margin-bottom: 24px; }
.article-search { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.article-search label { display: grid; flex: 1 1 240px; gap: 6px; max-width: 640px; color: var(--ink-2); font-weight: 700; }
.article-search input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; }
.article-reset { min-height: 48px; padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--link); font: inherit; cursor: pointer; }
.article-reset:disabled { color: var(--muted); cursor: default; }
.article-status, .scroll-hint { color: var(--muted); font-size: .84rem; }
.article-status { margin: 10px 0; }
.article-controls .filter-bar { margin-bottom: 12px; }
.article-empty { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.toc-scroll-hint { margin-bottom: 8px; }
.table-scroll-hint { margin-bottom: 8px; }
@media (min-width: 960px) { .toc-scroll-hint { display: none; } }
@media print { .article-controls, .scroll-hint { display: none !important; } }
@media print { .grad-text { background: none; color: #243047; } }


/* The existing Journal photo, mounted on a lightly ruled scrapbook page. */
.home-journal-preview { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-items: center; padding: 32px 24px; border: 1px solid #d8cfb8; background: repeating-linear-gradient(transparent 0 31px, #858f7220 31px 32px), #f5f1e1; }
.home-journal-preview::before { content: ""; position: absolute; width: 86px; height: 26px; top: -12px; left: 36px; background: #cddbcaaa; transform: rotate(-5deg); }
.home-journal-preview img { width: min(100%, 230px); height: auto; justify-self: center; padding: 10px 10px 24px; border: 1px solid #d7d2c3; background: #fffef9; box-shadow: 2px 5px 10px #574b3420; transform: rotate(-3deg); }
.home-journal-preview > div { min-width: 0; }
.home-journal-preview h3 { font-size: 1.4rem; }
.home-journal-preview h3 a { color: var(--ink); text-decoration-color: #c1b587; }
.home-journal-preview p { font-size: .86rem; }
.home-journal-preview .topic-meta { font-family: var(--hand); color: var(--ink-2); font-size: .85rem; }
@media (min-width: 700px) { .home-journal-preview { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 40px; padding: 40px; } }
@media (forced-colors: active) {
  main, .hero-chips a, .topic, .article-card, .button, .about-band { border: 1px solid CanvasText; }
  .grad-text { background: none; color: CanvasText; }
  .hero-art, main::before, .home-journal-preview::before, .topic::after { display: none; }
  .site-nav-inline a[aria-current="page"] { text-decoration: underline; }
}
@media print {
  main { width: 100%; margin: 0; padding: 0; border: 0; background: #fff; box-shadow: none; }
  main::before, .home-journal-preview::before, .about-band::before, .topic::after { display: none; }
  .hero-grid { display: block; }
  .hero-chips { display: none; }
  .grad-text { color: #000; background: none; }
  .home-journal-preview, .answer-box, .callout { background: #fff; }
}
