/* Shared white editorial chrome for the novel and its companion guide. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --text: #1e2c2c;
  --text-mid: #465653;
  --text-light: #66716f;
  --text-faint: #66716f;
  --bg: #fff;
  --bg-warm: #f5f8f6;
  --accent: #a7874e;
  --accent-light: #c8b68e;
  --accent-pale: #d9dfdc;
  --sage: #476e5c;
  --sage-hover: #365846;
  --serif: 'Shippori Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --display: Georgia, 'Shippori Mincho', serif;
  --ui: 'Yu Gothic UI', 'Meiryo', sans-serif;
  --reading-scale: 1;
  --reader-header-height: 64px;
}
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sage); text-underline-offset: .22em; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 5px; border-radius: 3px; }
[id] { scroll-margin-top: calc(var(--reader-header-height) + 24px); }
[hidden] { display: none !important; }
.astro-icon { display: inline-block; flex: none; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--sage); color: #fff; font-family: var(--ui); }
.skip-link:focus { top: 8px; }
.site-header { position: sticky; top: 0; z-index: 50; height: 64px; border-bottom: 1px solid var(--accent-pale); background: var(--bg); }
.header-inner { max-width: 1160px; height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-family: Georgia, 'Yu Mincho', serif; font-size: 26px; letter-spacing: .02em; color: #294c43; text-decoration: none; }
.site-brand img { width: 37px; height: 37px; }
.site-nav { display: flex; align-items: center; gap: 22px; font: 14px/1.5 var(--ui); }
.site-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--text); }
.site-nav a + a { padding-left: 22px; border-left: 1px solid var(--accent-pale); }
.site-nav a:hover { color: var(--sage); }
.hero { display: grid; grid-template-columns: .9fr 1.35fr; gap: 52px; align-items: center; max-width: 1160px; margin: 32px auto 0; padding-bottom: 36px; border-bottom: 1px solid var(--accent-pale); }
.hero h1 { margin: 0; font-size: clamp(40px, 5.25vw, 68px); font-weight: 500; letter-spacing: .025em; line-height: 1.38; }
.hero h1 > span { display: block; }
.hero .subtitle { margin: 20px 0 0; color: #94733b; font: 22px/1.5 var(--display); letter-spacing: .08em; }
.hero .epigraph { margin: 24px 0 30px; font-size: 18px; line-height: 1.95; letter-spacing: .025em; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.reader-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 56px; padding: 10px 24px; border: 1px solid var(--sage); border-radius: 6px; color: #fff; background: var(--sage); text-decoration: none; font: 18px/1.6 var(--serif); transition: background .15s; }
.reader-button:hover { background: var(--sage-hover); }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 14px/1.5 var(--ui); }
.progress { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--sage); pointer-events: none; }
.site-footer-copy, .page-footer { margin-top: 32px; color: var(--text-light); font: 12px/1.8 var(--ui); letter-spacing: .035em; text-align: center; }
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 35; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--accent-pale); border-radius: 6px; background: #fff; color: var(--sage); box-shadow: 0 3px 12px #1e2c2c0d; }
@media (max-width: 1240px) {
  .header-inner, .hero { margin-left: 40px; margin-right: 40px; }
}
@media (max-width: 960px) {
  .hero { gap: 32px; grid-template-columns: 1fr 1.1fr; }
  .hero h1 { font-size: clamp(36px, 5.1vw, 50px); }
  .hero .subtitle { font-size: 18px; }
  .hero .epigraph { font-size: 16px; }
  .hero-actions { gap: 14px; }
  .reader-button { gap: 18px; padding: 10px 18px; }
}
@media (max-width: 640px) {
  html { scrollbar-gutter: auto; }
  :root { --reader-header-height: 110px; }
  [id] { scroll-margin-top: calc(var(--reader-header-height) + 64px); }
  .header-inner { margin: 0 20px; gap: 12px; }
  .site-brand { gap: 7px; font-size: 20px; }
  .site-brand img { width: 29px; height: 29px; }
  .site-nav { gap: 12px; font-size: 13px; }
  .site-nav a { gap: 5px; }
  .site-nav a + a { padding-left: 12px; }
  .nav-long { display: none; }
  .hero { grid-template-columns: 1fr; margin: 32px 20px 0; padding-bottom: 28px; gap: 28px; }
  .hero h1 { font-size: clamp(37px, 10vw, 52px); line-height: 1.4; }
  .hero .subtitle { margin-top: 12px; font-size: 18px; }
  .hero .epigraph { font-size: 16px; margin: 18px 0 20px; line-height: 1.9; }
  .hero-actions { gap: 22px; }
  .reader-button { min-height: 48px; font-size: 16px; padding: 10px 22px; }
  .hero-art img { aspect-ratio: 3 / 2; }
  .back-to-top { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .reading-rail, .back-to-top, .skip-link, .hero-actions { display: none !important; }
  html { scrollbar-gutter: auto; }
  .hero { margin: 0; }
}

/* English edition and shared language navigation. */
.language-select {
  /* Match the app's label/caret spacing without changing the native picker. */
  box-sizing: border-box; flex: 0 0 112px; width: 112px; min-width: 112px; min-height: 40px;
  padding: 8px 30px 8px 12px; color: #476e5c; background-color: #fff;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23476e5c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px 14px;
  border: 1px solid #d9dfdc; border-radius: 5px;
  font: 14px/1.4 'Segoe UI', Meiryo, sans-serif; white-space: nowrap; text-align: left; cursor: pointer;
}
@media (max-width: 768px) {
  .language-select { min-height: 44px; font-size: 16px; }
}
html[lang='en'] { --serif: Georgia, 'Times New Roman', serif; --display: Georgia, serif; --ui: 'Segoe UI', Arial, sans-serif; }
html[lang='en'] .novel { line-height: 1.85; letter-spacing: 0; }
html[lang='en'] .hero h1 { font-size: clamp(37px, 4.6vw, 61px); letter-spacing: -.025em; }
html[lang='en'] .hero .epigraph { letter-spacing: 0; line-height: 1.75; }
html[lang='en'] .novel p { text-indent: 0; }
html[lang='en'] .chapter-break .ch-title { letter-spacing: 0; }
@media (max-width: 640px) {
  .site-header { height: auto; min-height: 64px; }
  .header-inner { flex-wrap: wrap; padding: 10px 0; row-gap: 3px; }
  .site-nav { flex-wrap: wrap; gap: 10px; }
  .site-nav a + a { padding-left: 10px; }
  html[lang='en'] .hero h1 { font-size: clamp(34px, 8vw, 45px); line-height: 1.25; }
}
