:root {
  color-scheme: dark;
  --surface: #0b213a;
  --paper: #edf5f8;
  --muted: #c2d4e2;
  --accent: #e5ce88;
  --border: #2e4656;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --gutter: clamp(24px, 4.8vw, 80px);
  --space: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--surface); scroll-behavior: smooth; }
body { margin: 0; color: var(--paper); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 7px; }
::selection { color: var(--surface); background: var(--accent); }
.skip-link { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 16px 24px; color: var(--surface); background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.atmosphere { position: fixed; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 73% 31%, #284b70 0, #132e50 48%, #0a2039 90%); }
.ambient-light { position: absolute; inset: -20%; background: radial-gradient(ellipse at 75% 18%, #6089b540 0, transparent 55%), linear-gradient(0deg, #0b213a40, transparent 60%); }
#ocean-scene, #light-scene, #katana-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.vignette { position: absolute; inset: 0; background: linear-gradient(90deg, #081c2d55, transparent 65%), linear-gradient(180deg, #0b233b80 0%, #0b233b80 12%, transparent 30%, transparent 72%, #0b233b88 100%); }
.grain { position: absolute; inset: 0; opacity: .028; background-image: url("./grain.svg"); }
.site-frame { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-height: 100svh; padding: 0 var(--gutter); }
.site-header { min-height: 116px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 48px; align-items: center; }
.wordmark { justify-self: start; padding: 8px 0; font-size: 30px; font-weight: 650; letter-spacing: -2px; }
.wordmark > span:first-child { font-weight: 350; }
.wordmark-period { color: var(--accent); }
.main-navigation { display: flex; gap: 36px; }
.main-navigation a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: #d1dee7; font-size: 13px; }
.main-navigation a::after { position: absolute; content: ""; inset: auto 0 7px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.main-navigation a:hover::after { transform: scaleX(1); }
.main-navigation a[aria-current="page"] { color: var(--paper); }
.main-navigation a[aria-current="page"]::after { transform: scaleX(1); }
.language-switch { display: flex; justify-self: end; gap: 5px; }
.language-switch button { position: relative; min-height: 44px; min-width: 44px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.language-switch button[aria-pressed="true"] { color: var(--paper); }
.language-switch button[aria-pressed="true"]::after { position: absolute; content: ""; right: 14px; bottom: 6px; left: 14px; height: 1px; background: var(--accent); }
.language-switch button:hover { color: var(--paper); background: #91b4d00a; }
.hero { position: relative; display: flex; align-items: center; min-height: 560px; padding: 36px 0 60px clamp(0px, 4vw, 72px); outline: none; }
.hero-copy { position: relative; z-index: 1; max-width: 500px; }
.eyebrow { display: flex; align-items: center; gap: 16px; margin: 0 0 30px; color: #cfdeea; font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow-line { display: block; width: 30px; height: 1px; background: var(--accent); }
h1 { margin: 0 0 30px -5px; font-family: var(--font-display); font-size: clamp(80px, 9vw, 145px); line-height: .94; font-weight: 400; letter-spacing: -.065em; }
h1 > span, h1 > em { display: block; }
h1 > em { margin-top: 6px; font-weight: 400; color: var(--paper); }
.hero-statement { margin: 0; color: #e0eaf2; font-size: clamp(14px, 1.12vw, 17px); line-height: 1.8; font-weight: 350; letter-spacing: .01em; }
.hero-statement > span { display: block; }
.primary-link { display: inline-flex; gap: 28px; align-items: center; min-height: 52px; margin-top: 32px; border-bottom: 1px solid #7d9aaf; font-size: 12px; letter-spacing: .025em; }
.primary-link svg { width: 37px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1; transition: transform .25s ease; }
.primary-link:hover svg { transform: translateX(5px); }
.site-footer { min-height: 100px; display: flex; gap: 24px; justify-content: space-between; align-items: center; }
.book-link { display: inline-flex; flex-wrap: wrap; align-items: center; min-height: 44px; column-gap: 12px; row-gap: 2px; font-size: 11px; }
.book-symbol { display: inline-flex; color: var(--accent); }
.book-symbol svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1; }
.book-description { color: var(--muted); margin-left: 10px; }
.reading-room { width: min(1100px, calc(100% - 64px)); max-height: calc(100svh - 72px); margin: auto; padding: 0; overflow: auto; outline: none; color: var(--paper); background: radial-gradient(ellipse at 100% 0, #24496c55, transparent 58%), linear-gradient(145deg, #102d49f5, #091e35f5); border: 1px solid #7595ad66; border-radius: 2px; box-shadow: 0 32px 90px #030d1a80, inset 0 1px 0 #d5e8f212; overscroll-behavior: contain; }
.reading-room[open] { animation: reading-arrive .28s ease-out; }
.reading-room::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, #c0d7e666 55%, #e5ce8870 85%, transparent); z-index: 3; }
.reading-room::backdrop { background: #081a2b8f; backdrop-filter: blur(8px) saturate(.8); }
.reading-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 2; min-height: 88px; padding: 16px 28px; border-bottom: 1px solid #7d9aaf33; background: #0c2640ed; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.reading-location, .reading-breadcrumb { display: flex; align-items: center; gap: 20px; min-width: 0; }
.reading-brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 25px; font-weight: 650; letter-spacing: -1.8px; color: var(--paper); }
.reading-brand > span:first-child { font-weight: 350; }
.reading-slash { color: var(--accent); opacity: .7; }
.reading-tools { display: flex; align-items: center; gap: 18px; }
.reading-tools .language-switch { padding-right: 16px; border-right: 1px solid #7d9aaf33; }
.close-dialog { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #7d9aaf55; border-radius: 2px; background: #15375040; transition: border-color .2s ease, background .2s ease; }
.close-dialog svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.close-dialog:hover { border-color: var(--accent); background: #254966; }
.reading-content { padding: clamp(32px, 5.6vw, 64px); }
.reading-layout { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.6fr); gap: clamp(36px, 5.5vw, 72px); }
.reading-intro, .reading-body { min-width: 0; }
.reading-kicker { display: flex; align-items: center; gap: 14px; margin: 0 0 32px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.section-index { padding-right: 14px; border-right: 1px solid #7d9aaf55; color: var(--accent); font-size: 9px; letter-spacing: .02em; }
h2 { margin: 0; max-width: 560px; font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4.5vw, 58px); line-height: 1.15; letter-spacing: -.025em; }
.reading-title-period { color: var(--accent); }
.reading-paragraph { margin: 0; color: #d4e2ec; font-size: 16px; line-height: 1.95; }
.reading-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 82px; padding: 16px clamp(32px, 5.6vw, 64px); border-top: 1px solid #7d9aaf33; }
.reading-next { display: inline-flex; align-items: center; gap: 24px; min-height: 48px; font-size: 12px; transition: color .2s ease; }
.reading-next svg { width: 35px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1; transition: transform .25s ease; }
.reading-next:hover { color: var(--accent); }
.reading-next:hover svg { transform: translateX(4px); }
.reading-next-back svg { transform: rotate(180deg); }
.reading-next-back:hover svg { transform: translateX(-4px) rotate(180deg); }
.reading-footer-mark { color: var(--muted); opacity: .65; font-size: 9px; letter-spacing: .06em; }
.works-content { min-height: 420px; align-items: center; }
.works-empty { display: flex; flex-direction: column; justify-content: center; min-height: 260px; }
.empty-horizon { display: block; width: 100%; max-width: 540px; height: 150px; margin-bottom: 28px; overflow: visible; }
.horizon-current { fill: none; stroke: #6f92ae; stroke-opacity: .22; stroke-width: .7; }
.horizon-edge { fill: none; stroke: #b3cddc; stroke-opacity: .45; stroke-width: .9; }
.horizon-light { fill: none; stroke: var(--accent); stroke-opacity: .8; stroke-width: 1.3; }
.empty-copy { max-width: 380px; }
.book-room { width: min(1240px, calc(100% - 64px)); max-width: none; height: calc(100svh - 72px); scrollbar-color: #597d98 #0c2640; scrollbar-width: thin; }
.book-room .reading-header { background: #0c2640; }
.book-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.book-sidebar { position: sticky; top: 88px; max-height: calc(100svh - 162px); overflow: auto; padding: 32px 22px 40px; border-right: 1px solid #7d9aaf33; scrollbar-width: thin; scrollbar-color: #597d98 transparent; }
.book-identity { padding: 0 10px 24px; }
.book-identity h2 { font-size: 35px; letter-spacing: -.04em; }
.book-identity p { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.book-menu summary { display: none; }
.book-chapters ol, .book-sections ol { list-style: none; margin: 0; padding: 0; }
.book-chapters a { display: flex; align-items: center; gap: 14px; min-height: 38px; padding: 7px 10px; border-left: 1px solid transparent; color: var(--muted); font-size: 12px; transition: color .2s ease, background .2s ease; }
.book-chapters a > span:first-child { width: 16px; color: #8ba8be; font-size: 9px; }
.book-chapters a:hover, .book-sections a:hover { color: var(--paper); background: #8aafcc0a; }
.book-chapters a[aria-current="page"] { border-left-color: var(--accent); color: var(--paper); background: #9bbfd411; }
.book-chapters a[aria-current="page"] > span:first-child { color: var(--accent); }
.book-sections { margin: 28px 10px 0; padding-top: 24px; border-top: 1px solid #7d9aaf33; }
.book-sections p { margin: 0 0 12px; color: #a5bed0; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.book-sections a { display: block; padding: 7px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.book-sections a[aria-current="location"] { color: var(--accent); }
.book-main { min-width: 0; padding: 44px clamp(28px, 5vw, 68px) 0; }
.book-position { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; color: #a5bed0; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.book-position > span:last-child { color: var(--accent); }
.book-prose { max-width: 720px; outline: none; color: #d4e2ec; font-size: 16px; line-height: 1.95; overflow-wrap: break-word; }
.book-prose h2, .book-prose h3, .book-prose h4 { color: var(--paper); font-family: var(--font-display); font-weight: 400; outline: none; scroll-margin-top: 116px; }
.book-prose h2 { margin: 0 0 24px; font-size: clamp(42px, 4.7vw, 62px); line-height: 1.14; letter-spacing: -.03em; text-transform: capitalize; scroll-margin-top: 280px; }
.book-prose h3 { margin: 56px 0 24px; padding-top: 28px; border-top: 1px solid #7d9aaf33; font-size: 30px; line-height: 1.4; letter-spacing: -.02em; }
.book-prose h4 { margin: 36px 0 18px; font-size: 23px; line-height: 1.5; }
.book-prose p { margin: 0 0 24px; }
.book-prose > h2 + p { margin-bottom: 32px; color: var(--paper); font-family: var(--font-display); font-size: 24px; line-height: 1.6; }
.book-prose > h2 + p strong { font-weight: 400; }
.book-prose strong { color: #edf5f8; font-weight: 600; }
.book-prose a { color: #e5cebb; text-decoration: underline; text-decoration-color: #e5ce8859; text-underline-offset: 4px; }
.book-prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.book-prose ul, .book-prose ol { margin: 0 0 28px; padding-left: 24px; }
.book-prose li { padding-left: 5px; margin-bottom: 14px; }
.book-prose li::marker { color: var(--accent); }
.book-prose code { padding: 2px 5px; background: #8aafcc0d; border: 1px solid #7d9aaf22; border-radius: 2px; color: #dceaf4; font-family: ui-monospace, monospace; font-size: .84em; white-space: break-spaces; overflow-wrap: anywhere; }
.book-table { max-width: 100%; margin: 28px 0 36px; overflow: auto; scrollbar-width: thin; scrollbar-color: #597d98 transparent; }
.book-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.book-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; line-height: 1.85; }
.book-table th { padding: 13px 16px; background: #8aafcc0d; color: var(--paper); font-size: 11px; font-weight: 500; text-align: left; vertical-align: top; }
.book-table td { padding: 18px 16px; border-bottom: 1px solid #7d9aaf33; vertical-align: top; }
.book-table th:first-child, .book-table td:first-child { padding-left: 0; min-width: 140px; }
.book-table th:last-child, .book-table td:last-child { padding-right: 0; }
.book-pagination { display: flex; justify-content: space-between; gap: 28px; margin-top: 56px; padding: 28px 0 36px; border-top: 1px solid #7d9aaf33; }
.book-page-link { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 52px; min-width: 0; gap: 8px; }
.book-page-link > span { color: var(--muted); font-size: 10px; }
.book-page-link strong { font-family: var(--font-display); font-size: 23px; font-weight: 400; }
.book-page-link:hover strong { color: var(--accent); }
.book-next { margin-left: auto; padding-right: 56px; text-align: right; }
.book-next svg { position: absolute; right: 0; bottom: 6px; width: 35px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1; }
.book-prose:lang(ja) { line-height: 2.1; }
html:has(dialog[open]) { overflow: hidden; }
html[lang="ja"] h1 { font-size: clamp(74px, 8.7vw, 140px); letter-spacing: -.045em; line-height: 1.1; }
html[lang="ja"] h1 > em { font-family: Georgia, serif; }
html[lang="ja"] .hero-statement { line-height: 2; }
html[lang="ja"] .eyebrow { letter-spacing: .1em; }

@keyframes reading-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1600px) {
  .site-frame { padding-right: max(var(--gutter), calc((100vw - 1500px) / 2)); padding-left: max(var(--gutter), calc((100vw - 1500px) / 2)); }
}

@media (max-width: 860px) {
  .reading-layout { grid-template-columns: 1fr; gap: 36px; }
  .book-shell { grid-template-columns: minmax(0, 1fr); }
  .book-sidebar { position: static; max-height: none; padding: 24px 28px 0; border-right: none; }
  .book-identity { display: none; }
  .book-menu { border-top: 1px solid #7d9aaf33; border-bottom: 1px solid #7d9aaf33; }
  .book-menu summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 10px 0; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
  .book-menu summary::-webkit-details-marker { display: none; }
  .book-menu summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 300; }
  .book-menu[open] summary::after { content: "−"; }
  .book-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .book-chapters ol { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 0 16px; }
  .book-chapters a { min-height: 44px; }
  .book-sections { margin: 0; padding: 16px 0 20px; }
  .book-sections ol { display: flex; flex-wrap: wrap; column-gap: 24px; }
  .book-sections a { min-height: 44px; }
  .book-main { padding: 28px 28px 0; }
}

@media (max-width: 760px) {
  .site-header { min-height: 110px; grid-template-columns: 1fr auto; gap: 0 12px; padding: 12px 0; }
  .wordmark { font-size: 27px; }
  .main-navigation { grid-row: 2; grid-column: 1 / -1; gap: 28px; }
  .main-navigation a { font-size: 11px; min-height: 36px; }
  .language-switch { grid-row: 1; grid-column: 2; }
  .hero { min-height: 490px; padding: 32px 0 48px; }
  h1 { font-size: clamp(88px, 17vw, 128px); }
  .hero-copy { max-width: 100%; }
  .hero-statement { font-size: 14px; }
  .eyebrow { margin-bottom: 28px; font-size: 9px; }
  .site-footer { min-height: 90px; gap: 10px; }
  .book-link { max-width: 220px; }
  .book-description { width: 100%; margin-left: 25px; font-size: 10px; }
  .reading-room { width: calc(100% - 24px); max-height: calc(100svh - 24px); }
  .reading-header { padding: 12px 16px; min-height: 78px; }
  .reading-brand { font-size: 24px; }
  .reading-breadcrumb { display: none; }
  .reading-tools { gap: 8px; }
  .reading-tools .language-switch { gap: 0; padding-right: 8px; }
  .reading-tools .language-switch button { min-width: 44px; padding: 6px; font-size: 10px; }
  .reading-content { padding: 32px 24px 36px; }
  .reading-layout { gap: 32px; }
  .reading-kicker { margin-bottom: 20px; }
  .reading-content h2 { font-size: 42px; }
  .reading-paragraph { font-size: 15px; }
  .reading-footer { min-height: 78px; padding: 12px 24px; }
  .works-content { min-height: 360px; align-items: start; }
  .works-empty { min-height: 160px; }
  .empty-horizon { height: 100px; margin-bottom: 12px; }
  .book-room { width: calc(100% - 24px); height: calc(100svh - 24px); }
  .book-sidebar { padding: 22px 24px 0; }
  .book-main { padding: 28px 24px 0; }
  .book-prose { font-size: 15px; }
  .book-prose h2 { font-size: 42px; }
  .book-prose h3 { margin-top: 42px; font-size: 26px; }
  .book-prose h4 { font-size: 21px; }
  .book-prose > h2 + p { font-size: 22px; }
  .book-prose p { margin-bottom: 22px; }
  .book-table table { font-size: 12px; }
  .book-pagination { margin-top: 40px; gap: 16px; }
  .book-page-link strong { font-size: 21px; }
  .book-next { padding-right: 40px; }
  .book-next svg { width: 28px; }
  .vignette { background: linear-gradient(90deg, #081c2d66, #102c4310 78%), linear-gradient(180deg, #0b233b80 0%, #0b233b80 14%, transparent 32%, transparent 70%, #0b233b88 100%); }
  html[lang="ja"] h1 { font-size: clamp(68px, 14vw, 105px); }
}

@media (max-width: 380px) {
  :root { --gutter: 20px; }
  .book-link { max-width: 160px; }
  .book-description { font-size: 9px; }
  .hero-statement { font-size: 13px; }
}

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