.eg-sitehead-inner { gap: 1rem; }
.eg-local-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.eg-local-controls a, .return a { font-weight: 700; }
.catalog, .reader { padding-block: clamp(2rem, 6vw, 5rem); }
.catalog h1, .opening h1, .volume h2 { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; line-height: 1.45; text-wrap: balance; }
.catalog h1 { margin: 0 0 .65em; font-size: clamp(2.8rem, 7vw, 5rem); }
.entrance { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.entrance h1 { margin: 0; font-size: clamp(1.6rem, 4.2vw, 3.75rem); }
.subtitle { margin: .4em 0 1em; color: var(--eg-accent); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(1.15rem, 2.5vw, 1.65rem); }
.intro, .series-intro { line-height: 1.8; text-wrap: pretty; }
.intro { margin: 0; }
.series-intro { margin: 0 0 1rem; }
.volumes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.5rem); }
.volume { overflow: hidden; border: 1px solid var(--eg-line); background: var(--eg-surface); }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.volume-body { padding: clamp(1.1rem, 3vw, 2rem); }
.volume h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); margin: 0 0 .6em; }
.volume ol { list-style: none; padding: 0; margin: 0; }
.volume li { border-top: 1px solid var(--eg-line); }
.volume a { padding: .75rem .1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-decoration: none; }
.volume a:hover { color: var(--eg-accent); text-decoration: underline; }
.volume a span { color: var(--eg-accent); }
.volume a .marked-title { color: inherit; }
.flag-mark { color: var(--eg-accent); font-size: .85rem; margin-inline-start: .45em; }
.reading-margin { max-width: 44rem; margin: 1rem auto; text-align: end; }
.reader { max-width: 57rem; }
.opening, .prose, .return, .story-links, .next-episode { max-width: 40rem; margin-inline: auto; }
.opening h1 { font-size: clamp(1.65rem, 4vw, 2.7rem); margin: 0 0 .55em; }
.opening p { color: var(--eg-muted); margin: 0; white-space: pre-wrap; }
.story-art { margin: clamp(1.4rem, 4vw, 2.5rem) 0; }
.story-art img { display: block; width: auto; max-width: 100%; height: auto; max-height: 70vh; margin-inline: auto; }
.prose { font: 1.12rem/2.05 "Yu Mincho", "Hiragino Mincho ProN", serif; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.35em; white-space: pre-wrap; }
.next-episode { margin-block: 2rem; text-align: center; color: var(--eg-muted); }
.next-episode a { font-weight: 700; text-underline-offset: .2em; }
.return, .story-links { padding-block: 1rem; border-top: 1px solid var(--eg-line); }
.story-links ul { margin: 0; padding: 0; list-style: none; }
.story-links .cross-series { display: inline-block; padding: .4em 0; color: var(--eg-muted); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; text-decoration: none; }
.story-links .cross-series:hover, .story-links .cross-series:focus-visible { color: var(--eg-accent); text-decoration: underline; }
@media (max-width: 680px) {
  .volumes { grid-template-columns: 1fr; }
  .eg-wrap { width: calc(100% - 2rem); }
  .eg-local-controls { gap: .6rem; font-size: .8rem; }
  .prose { font-size: 1.04rem; }
}

/* Decorative artwork occupies its own strip outside the prose and link lists. */
.entrance { padding-top: .3rem; }
.entrance::after, .volume::after, .reader article::before {
  content: "";
  display: block;
  pointer-events: none;
  background-image: var(--banner, none);
  background-position: center;
  background-size: 100% auto;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent), linear-gradient(transparent, black 14%, black 86%, transparent);
  mask-composite: intersect;
}
.entrance::after { margin-top: 1.2rem; height: clamp(5.5rem, 17vw, 12rem); }
.volume::after { height: clamp(3rem, 7vw, 5rem); margin: 0 1rem 1rem; }
.reader article::before { max-width: 46rem; margin: 0 auto clamp(1.25rem, 3vw, 2rem); height: clamp(4.4rem, 13vw, 8.8rem); }
.entrance .mast-title, .entrance .mast-reading { display: block; }
.entrance .mast-title { font-size: clamp(2.6rem, 7.5vw, 5.3rem); line-height: 1.3; letter-spacing: .035em; }
.entrance .mast-reading { font-size: clamp(.92rem, 2vw, 1.25rem); font-weight: 400; letter-spacing: .12em; margin-block: .3em 1.1em; }
:root[data-theme="dark"] .entrance::after, :root[data-theme="dark"] .volume::after, :root[data-theme="dark"] .reader article::before {
  filter: invert(1) hue-rotate(175deg) saturate(.7);
  mix-blend-mode: lighten;
  opacity: .76;
}
@media print { .entrance::after, .volume::after, .reader article::before { display: none; } }

/* Both editions share a stable title area. The site preference overrides the device theme. */
.entrance .catalog-title {
  position: relative;
  max-inline-size: 54rem;
  margin-inline: auto;
}
.title-art {
  display: block;
  inline-size: 100%;
  aspect-ratio: 2.375;
  background: var(--title-field, #faf7ed) var(--title-image, url("images/title-logo-light.webp")) center / contain no-repeat;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent), linear-gradient(to bottom, transparent, black 13%, black 87%, transparent);
  mask-composite: intersect;
}
.title-words {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .catalog-title {
    --title-field: #1b1d2a;
    --title-image: url("images/title-logo-dark.webp");
  }
}
:root[data-theme="dark"] .catalog-title {
  --title-field: #1b1d2a;
  --title-image: url("images/title-logo-dark.webp");
}
.entrance .catalog-title + .intro {
  margin-block-start: clamp(.8rem, 2vw, 1.4rem);
}
@media print, (forced-colors: active) {
  .title-art { display: none; }
  .title-words { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
}

/* Manual placements occupy separate margins outside the story and its navigation. */
.manual-ad {
  clear: both;
  max-inline-size: 52rem;
  min-inline-size: 0;
  margin: clamp(2rem, 6vw, 4.5rem) auto;
  padding: 1rem 0;
  border-block: 1px solid var(--eg-line);
  text-align: center;
}
.manual-ad .ad-caption {
  display: block;
  margin: 0 0 .5rem;
  color: var(--eg-muted);
  font: 400 .75rem/1.5 system-ui, sans-serif;
}
.manual-ad .ad-surface { inline-size: 100%; min-inline-size: 0; margin-inline: auto; }
.ad-episode-bottom .ad-surface { max-inline-size: 20rem; }
.ad-episode-top { margin-block-start: 0; }
.manual-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
@media print { .manual-ad { display: none; } }

.entrance { --banner: url("images/backgrounds/03b-port-terraces.webp"); }
.volume[aria-labelledby="series-festival"] { --banner: url("images/backgrounds/01a-star-filament.webp"); }
.volume[aria-labelledby="series-boundary"] { --banner: url("images/backgrounds/01b-star-islands.webp"); }
body[data-episode="festival-03"] .reader article { --banner: url("images/backgrounds/02a-mural-rubbing.webp"); }
body[data-episode="boundary-01"] .reader article,
body[data-episode="boundary-03"] .reader article { --banner: url("images/backgrounds/04a-marker-bracket.webp"); }
body[data-episode="boundary-02"] .reader article,
body[data-episode="boundary-04"] .reader article { --banner: url("images/backgrounds/04b-marker-enamel.webp"); }
body[data-episode="festival-01"] .reader article { --banner: url("images/backgrounds/05a-ore-breath.webp"); }
body[data-episode="festival-02"] .reader article { --banner: url("images/backgrounds/06a-eve-near-lights.webp"); }
body[data-episode="festival-04"] .reader article { --banner: url("images/backgrounds/06b-eve-afterglow.webp"); }
