:root {
  color-scheme: dark;
  --bg: #080d19;
  --bg-deep: #060a14;
  --panel: #101a2b;
  --ink: #f3f7f8;
  --muted: #aab9c9;
  --wind: #8df4db;
  --line: #91b7d336;
  --serif: "Noto Serif CJK SC", "Songti SC", SimSun, Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --header: 74px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.75 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--wind); outline-offset: 5px; }
::selection { background: var(--wind); color: var(--bg); }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: 12px; left: 16px; transform: translateY(-150%); z-index: 10; background: var(--wind); color: var(--bg); padding: .65rem 1rem; }
.skip:focus { transform: none; }
.wrap { width: min(100% - 112px, 1216px); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 5; background: #080d19f2; border-bottom: 1px solid var(--line); }
.header-inner { width: min(100% - 112px, 1280px); height: calc(var(--header) - 1px); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.75rem; }
.brand { display: flex; width: max-content; align-items: center; gap: .75rem; font: 700 1.13rem/1.35 var(--serif); letter-spacing: .1em; }
.brand small { display: block; color: var(--muted); font: 400 .75rem/1.5 var(--sans); letter-spacing: .12em; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #81edda66; border-radius: 13px; color: var(--wind); background: #12252c; }
.brand-icon svg { width: 26px; height: 26px; }
#nav { align-self: stretch; display: flex; align-items: stretch; gap: clamp(.85rem, 2.45vw, 2.15rem); }
#nav a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: .9375rem; white-space: nowrap; letter-spacing: .1em; }
#nav a:hover, #nav a[aria-current] { color: var(--wind); }
#nav a[aria-current]::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--wind); box-shadow: 0 0 11px #8df4db99; }
.header-actions { justify-self: end; display: flex; gap: .5rem; }
.menu, .icon-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .45rem; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #0e1728; }
.menu svg { height: 18px; width: 18px; }
.menu:hover, .icon-button:hover { color: var(--wind); border-color: #8df4db88; }
.menu { display: none; min-width: 42px; }

.hero { isolation: isolate; position: relative; overflow: hidden; display: grid; background: var(--bg); }
.hero-sky, .hero-sky::after, #wind-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-sky { z-index: -3; background: #0b1624 url("valley.webp") center 54% / cover no-repeat; }
.hero-sky::after { content: ""; background: linear-gradient(0deg, #080d19 1%, #080d1900 36%, #080d1900 78%, #080d1933), linear-gradient(90deg, #080d19f7, #080d19be 30%, #080d193f 63%, #080d1940 100%); }
#wind-field { z-index: 2; }
.hero-inner { min-height: clamp(650px, calc(100svh - var(--header)), 900px); display: grid; align-items: center; position: relative; padding-block: 50px 100px; }
.hero-copy { position: relative; z-index: 3; width: max-content; max-width: 100%; }
.kicker { margin: 0 0 .95rem; display: flex; align-items: center; gap: .7rem; color: var(--wind); font-size: .875rem; font-weight: 600; letter-spacing: .27em; }
.kicker > span { width: 25px; height: 1px; background: var(--wind); position: relative; }
.kicker > span::before { content: ""; position: absolute; width: 5px; height: 5px; background: var(--wind); left: 0; top: -2px; transform: rotate(45deg); }
h1, h2, h3, blockquote { font-family: var(--serif); }
h1 { margin: 0; font-size: clamp(5rem, 9.2vw, 9.25rem); font-weight: 700; letter-spacing: .05em; line-height: 1.16; text-shadow: 0 4px 24px #080d1970; }
h1 span { display: block; margin: .2rem 0 0 .36em; font: 400 clamp(.83rem, 1.45vw, 1.15rem)/1.4 Georgia, serif; letter-spacing: .58em; color: #b8d5d6; }
.hero-lede { color: #d4dfe9; margin: 1.65rem 0 1.8rem; line-height: 1.9; font-size: clamp(1rem, 1.6vw, 1.125rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { min-height: 47px; display: inline-flex; justify-content: center; align-items: center; gap: .3rem; padding: .55rem 1.3rem; border: 1px solid transparent; border-radius: 7px; font-weight: 650; font-size: .9375rem; line-height: 1.5; transition: background .2s, border-color .2s, box-shadow .2s; }
.button svg { width: 20px; height: 20px; }
.button-primary { background: #8aebd7; color: #092620; }
.button-primary:hover { background: #b0ffe8; box-shadow: 0 0 30px #71f0cd38; }
.button-ghost { color: #e5f4f4; background: #101d2aa8; border-color: #a6ccd266; }
.button-ghost:hover { background: #1b3547; border-color: var(--wind); }

.hero-art { position: absolute; inset: 0 -4% 0 38%; pointer-events: none; }
.portrait-layer { position: absolute; inset: 8% 2% 4% 2%; display: flex; justify-content: center; transform: translate(var(--portrait-x, 0px), var(--portrait-y, 0px)); transition: transform .45s ease-out; }
.portrait-layer img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 26px #050b19cf) drop-shadow(0 0 24px #73f5e646); }
.orbital { position: absolute; inset: 5% 2%; display: grid; place-items: center; }
.orbital::before { content: ""; position: absolute; width: min(87%, 600px); aspect-ratio: 1; border-radius: 50%; border: 1px solid #a7ffed3b; box-shadow: inset 0 0 56px #63e8cf12, 0 0 45px #63e8cf20; background: radial-gradient(circle at 55% 52%, #87f6e034, transparent 64%); }
.orbital i { position: absolute; border-radius: 50%; width: min(104%, 760px); aspect-ratio: 2.5; border: 1px solid #a7ffed59; transform: rotate(-28deg); box-shadow: 0 4px 15px #80e4d022; }
.orbital i:nth-child(2) { width: min(95%, 674px); transform: rotate(-33deg); border-color: #a7ffed36; }
.hero-foot { z-index: 3; position: absolute; bottom: 0; left: 0; right: 0; min-height: 68px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: #bccbd5; }
.hero-meta, .scroll-link { display: flex; align-items: center; gap: .75rem; font-size: .875rem; letter-spacing: .1em; }
.hero-meta svg { color: var(--wind); }
.hero-meta i { width: 3px; height: 3px; background: #a4bec5; transform: rotate(45deg); }
.scroll-link span { height: 19px; width: 1px; background: var(--wind); }
.scroll-link:hover { color: var(--wind); }

.section { padding-block: clamp(4rem, 8.1vw, 7rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: .7rem 2rem; margin-bottom: 2.25rem; }
.section-head p:not(.kicker) { margin: 0 0 .25rem; color: var(--muted); }
h2 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.27; letter-spacing: .065em; }
h3 { margin: 0; font-size: 1.42rem; line-height: 1.5; }
.story { background: radial-gradient(ellipse at 20% 65%, #101e32 0%, transparent 52%), var(--bg); }
details { border: 1px solid var(--line); border-radius: 8px; background: #101a2a; }
summary { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; padding: .85rem 1.1rem; cursor: pointer; list-style: none; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: auto; font: 500 1.25rem/1 monospace; color: var(--wind); }
details[open] > summary::after { content: "−"; }
summary:hover { color: var(--wind); }
summary small { color: var(--muted); font-size: .8rem; font-weight: 400; }
.text-link { color: var(--wind); text-decoration: underline; text-underline-offset: .3em; font-size: .9375rem; }

.talents { border-block: 1px solid var(--line); background: #0a1120; }

.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.film { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #101b2b; transition: border-color .2s; }
.film-image { position: relative; overflow: hidden; background: #182134; }
.film img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: scale .35s; }
.film-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #080d196b, transparent 70%); pointer-events: none; }
.film:hover { border-color: #8df4db88; }
.film:hover img { scale: 1.035; }
.play-icon { z-index: 1; position: absolute; bottom: .9rem; left: 1rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #e4f3f6a0; color: #efffff; background: #0a1423cc; }
.film-copy { padding: 1rem 1.25rem 1.15rem; }
.film-copy small { color: var(--wind); }
.film-copy p { color: var(--muted); margin: .25rem 0 0; }

.letter { padding-block: clamp(4rem, 9vw, 7rem); text-align: center; background: linear-gradient(0deg, #080d19c9, #080d1966 56%, #080d19cf), #14283a url("valley.webp") center 56% / cover; border-block: 1px solid var(--line); }
.letter-inner > svg { width: 31px; height: 31px; color: var(--wind); margin-bottom: .7rem; }
.letter p { margin: .85rem 0 1.25rem; color: #e4edee; }
.site-footer { background: var(--bg-deep); }
.footer-inner { padding-block: 1.8rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.footer-brand { font: 700 1.05rem/1.5 var(--serif); letter-spacing: .12em; }
.footer-inner p { margin: .25rem 0 0; font-size: .875rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.15rem; font-size: .875rem; white-space: nowrap; }
.footer-links a:hover { color: var(--wind); }

dialog { width: min(540px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid #8df4db70; border-radius: 14px; padding: clamp(1rem, 4vw, 1.65rem); color: var(--ink); background: #101a2a; }
dialog::backdrop { background: #030711df; }
.dialog-top, .dialog-actions, .letter-info { display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.dialog-top h2 { font-size: 1.85rem; }
.dialog-actions { justify-content: end; flex-wrap: wrap; margin-top: .85rem; }
.dialog-actions button:disabled { opacity: .5; cursor: default; }
dialog p { color: var(--muted); margin: .65rem 0 .85rem; }
textarea { display: block; width: 100%; min-height: 120px; resize: vertical; padding: .85rem; border: 1px solid #91b7d366; border-radius: 8px; background: #080f1c; }
.letter-info { margin-top: .35rem; align-items: baseline; font-size: .875rem; color: var(--muted); }
#letter-status { color: var(--wind); }
#letter-count { white-space: nowrap; }
.visually-hidden { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

@media (max-width: 880px) {
  .wrap, .header-inner { width: calc(100% - 64px); }
  .hero-inner { min-height: clamp(600px, calc(100svh - var(--header)), 800px); }
  .hero-art { left: 35%; right: -9%; }
  .portrait-layer { inset-inline: 0; }
  .section-head { align-items: start; flex-direction: column; }
}
@media (max-width: 640px) {
  :root { --header: 62px; }
  .wrap, .header-inner { width: calc(100% - 36px); }
  .hero-inner { min-height: 0; padding-block: 0; grid-template-rows: clamp(300px, 88vw, 470px) auto auto; }
  .hero-art { grid-row: 1; position: relative; inset: auto; margin-inline: -18px; height: 100%; }
  .portrait-layer { inset: 5% 1% 7%; }
  .orbital { inset: 4% 5%; }
  .orbital::before { width: min(70%, 360px); }
  .hero-sky { background-position: 60% top; background-size: auto max(520px, 133vw); }
  .hero-sky::after { background: linear-gradient(0deg, #080d19 3%, #080d19 23%, #080d1900 64%, #080d1930); }
  .hero-copy { margin: -1.4rem 0 1.5rem; }
  h1 { font-size: clamp(3.45rem, 13vw, 5.5rem); }
  .hero-lede { margin-block: .95rem 1.1rem; }
  .hero-copy .kicker { margin-bottom: .35rem; }
  .hero-foot { position: static; min-height: 56px; gap: .5rem; }
  .hero-meta, .scroll-link { gap: .42rem; font-size: .8125rem; letter-spacing: .04em; }
  .hero-meta svg { width: 19px; height: 19px; }
  .section-head { margin-bottom: 1.35rem; }
  .footer-inner { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.media-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.media-bar:has(.film-filters[hidden]) { display: none; }
.media-bar p { margin: 0; color: var(--muted); font-size: .875rem; }
.film-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.film-filters button { min-height: 40px; padding: .35rem .8rem; background: #101a2b; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .875rem; }
.film-filters button:hover, .film-filters button[aria-pressed="true"] { border-color: #8df4db91; color: var(--wind); }
.film-filters button[aria-pressed="true"] { background: #152e35; }
.media-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.media-grid > .film { grid-column: span 2; }
.media-grid[data-view="all"] > .film:is(:nth-child(-n+2), :nth-last-child(-n+2)),
.media-grid:is([data-view="character"], [data-view="cutscene"]) > .film { grid-column: span 3; }
.film-copy small { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .5rem; }
.film-copy small span { color: var(--muted); }
.film-copy h3 { margin: .2rem 0; }

.letter { padding-bottom: clamp(3.2rem, 7vw, 6rem); background: linear-gradient(0deg, #080d19 9%, #080d19ce 50%, #080d1975 78%, #080d19d9), #14283a url("valley.webp") center top / cover; }
.letter-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; }
.letter-board { margin-top: clamp(2.4rem, 6vw, 4.5rem); text-align: left; }
.board-head { display: flex; align-items: end; justify-content: space-between; gap: .8rem 1rem; margin-bottom: 1rem; }
.board-head h3 { font-size: clamp(1.35rem, 2.7vw, 1.9rem); }
.letter .board-head p { margin: .2rem 0 0; color: #bbcdd4; font-size: .875rem; }
.mail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.mail-card { display: flex; flex-direction: column; min-width: 0; min-height: 190px; padding: 1.2rem; border-radius: 9px; border: 1px solid #97c8c346; background: linear-gradient(135deg, #182b38, #101a29 68%); }
.mail-card > header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; color: var(--wind); }
.mail-card header svg { width: 21px; height: 21px; }
.mail-card time, .mail-card small { color: #b9cbcf; font-size: .8125rem; }
.letter .mail-body { margin: 1rem 0; color: #e2ebee; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-card footer { margin-top: auto; color: #a8d5cf; font-size: .875rem; overflow-wrap: anywhere; }
#public-form > label { display: block; margin: .75rem 0 .3rem; }
#public-form small { color: var(--muted); }
#public-name { display: block; width: 100%; padding: .55rem .75rem; border: 1px solid #91b7d366; border-radius: 8px; background: #080f1c; color: var(--ink); font: inherit; }
#public-form .letter-consent { display: flex; align-items: baseline; gap: .5rem; font-size: .9375rem; }
.letter-consent input { accent-color: var(--wind); }
#public-count { white-space: nowrap; }
@media (max-width: 880px) {
  .media-grid, .mail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-grid[data-view] > .film { grid-column: auto; }
}
@media (max-width: 640px) {
  .media-grid, .mail-grid { grid-template-columns: minmax(0, 1fr); }
  .mail-card { min-height: 0; }
  .board-head { align-items: center; }
  .board-head .button { flex: 0 0 auto; }
}

/* Character archive */
.section-links { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; margin-top: 1rem; }
.story-people { display: flex; flex-wrap: wrap; gap: .15rem .65rem; color: #e4f4f5; font-size: .875rem; }
.story-people span { color: #a4d7cd; }

.people { background: radial-gradient(ellipse at 20% 27%, #13273b, transparent 55%), var(--bg); border-block: 1px solid var(--line); }
.constellation { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: .7rem 1.25rem; align-items: stretch; }
.constellation:not(:has(.graph-stage:not([hidden]))) { display: block; }
.graph-stage, .constellation-details { min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.graph-stage { position: relative; aspect-ratio: 1.3; min-height: 365px; background: radial-gradient(circle at 50% 50%, #193f48 1%, #111e30 44%, #0a1220 82%); }
.graph-lines { position: absolute; inset: 0; width: 100%; height: 100%; color: #87b4bd70; pointer-events: none; overflow: visible; }
.graph-lines line, .graph-lines ellipse { vector-effect: non-scaling-stroke; stroke-width: 1; }
.graph-orbit { stroke: #92d9e32e; stroke-dasharray: 2 5; }
.graph-lines line.active { stroke: var(--wind); stroke-width: 2; filter: drop-shadow(0 0 3px #80ffdcca); }
.person-node, .graph-legend span { --node: var(--wind); }
.person-node.inazuma, .graph-legend .inazuma { --node: #d8bafa; }
.person-node.fatui, .graph-legend .fatui { --node: #f0c596; }
.person-node.sumeru, .graph-legend .sumeru { --node: #8df4db; }
.person-node.travel, .graph-legend .travel { --node: #a7d7ff; }
.person-node { position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%); min-height: 41px; min-width: 48px; padding: .3rem .65rem; border: 1px solid color-mix(in srgb, var(--node), transparent 55%); color: var(--node); border-radius: 99px; background: #10192c; white-space: nowrap; font-size: .875rem; line-height: 1.2; }
.person-node:is(:hover, [aria-pressed="true"]) { color: #0a1422; background: var(--node); border-color: var(--node); box-shadow: 0 0 20px color-mix(in srgb, var(--node), transparent 64%); z-index: 2; }
.graph-center { --x: 50%; --y: 50%; width: clamp(85px, 11vw, 142px); aspect-ratio: 1; padding: 0; display: grid; place-items: stretch; overflow: hidden; border: 2px solid #91e7d6aa; background: #24434f; }
.graph-center img { width: 100%; height: 100%; object-fit: cover; object-position: center 5%; }
.graph-center span { position: absolute; bottom: 0; inset-inline: 0; padding: .35rem; background: #111d30dc; color: #eafff7; font-weight: 700; }
.graph-legend { display: flex; flex-wrap: wrap; grid-row: 2; gap: .25rem .9rem; margin-left: .3rem; }
.graph-legend span { font-size: .8125rem; color: var(--muted); }
.graph-legend span::before { content: ""; display: inline-block; vertical-align: .14em; width: 7px; height: 7px; margin-right: .4rem; border-radius: 50%; background: var(--node); }
.constellation-details { padding: clamp(1rem, 2.3vw, 1.65rem); background: #101b2c; }
.person-card + .person-card:not([hidden]) { margin-top: .75rem; }
.constellation:has(.graph-stage:not([hidden])) .person-card { margin-top: 0; }
.person-card h3 { font-size: 1.8rem; }
.person-card p { color: #d9e6ef; margin: .4rem 0 1rem; }
.person-card .relation-label { color: var(--wind); margin: 0 0 .1rem; font-size: .875rem; }
.voice-clip { display: grid; gap: .35rem; margin: 0 0 .9rem; padding: .6rem .7rem; border-radius: 8px; background: #0a1421; }
.voice-clip > span { display: flex; gap: .3rem .7rem; flex-wrap: wrap; font-size: .875rem; color: #e1f1ec; }
.voice-clip small { color: var(--muted); font-size: .8125rem; }
.voice-clip audio { width: 100%; max-width: 360px; height: 42px; }
.extra-voices, .personal-stories { margin-top: 1.5rem; }
.minor-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between; align-items: baseline; margin-bottom: .75rem; }
.voice-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.voice-roster { padding: 0 .65rem .65rem; }
.voice-roster > article { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem; }
.voice-roster h4 { margin: 0; color: #e5f4f1; }
.voice-roster p { color: var(--muted); margin: .3rem 0 .7rem; }
.voice-roster .voice-clip { margin-bottom: 0; }
.compact-talents { padding-block: clamp(2.5rem, 5vw, 4rem); }
.compact-talents .section-head { margin-bottom: 1.1rem; }
.talent-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.talent-summary div { border-top: 1px solid var(--line); padding: .75rem 0 0; }
.talent-summary dt { font: 700 1.12rem/1.5 var(--serif); }
.talent-summary dt span { display: block; color: var(--wind); margin-bottom: .25rem; font: 500 .875rem/1.5 var(--sans); }
.talent-summary dd { color: var(--muted); margin: .25rem 0 0; }

.wallpapers { background: #0a111e; border-top: 1px solid var(--line); }
.wallpaper-view { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #070c15; }
.wallpaper-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #608b91 #0d1929; }
.wallpaper-slide { position: relative; margin: 0; scroll-snap-align: center; min-width: 0; }
.wallpaper-slide > a { display: block; background: radial-gradient(ellipse at center, #163044, #090f1a 80%); }
.wallpaper-slide > a:focus-visible { outline-offset: -3px; }
.wallpaper-slide img { width: 100%; height: clamp(235px, 45vw, 540px); object-fit: contain; }
.wallpaper-slide figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.wallpaper-slide figcaption h3 { font-size: 1.15rem; }
.wallpaper-meta { color: var(--muted); font-size: .875rem; }
.wallpaper-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem .9rem; padding: .65rem 1rem; border-top: 1px solid var(--line); }
.wallpaper-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; }
.wallpaper-picker button { min-width: 40px; min-height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #101b2c; }
.wallpaper-picker button[aria-current="true"] { border-color: #8df4db88; color: var(--wind); background: #153039; }
.wallpaper-controls .button { min-height: 40px; }
@media (max-width: 880px) {
  .header-inner { gap: .65rem; }
  #nav { gap: clamp(.75rem, 2vw, 1.2rem); }
  .constellation { grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr); }
}
@media (max-width: 720px) {
  .constellation { grid-template-columns: minmax(0, 1fr); }
  .graph-stage { min-height: 0; max-height: 460px; }
  .graph-legend { grid-row: auto; }
}
@media (max-width: 640px) {
  .graph-stage { aspect-ratio: 1.05; }
  .person-node { font-size: .8125rem; padding-inline: .38rem; min-height: 37px; min-width: 44px; }
  .graph-center { padding: 0; }
  .talent-summary, .voice-roster { grid-template-columns: minmax(0, 1fr); }
  .wallpaper-slide img { height: clamp(195px, 61vw, 310px); }
  .wallpaper-controls .wallpaper-picker { order: 1; flex-basis: 100%; }
}

@media (max-width: 780px) {
  .header-inner { grid-template-columns: 1fr auto; gap: .6rem; }
  .brand { font-size: 1rem; }
  .brand-icon { width: 36px; height: 36px; }
  .menu:not([hidden]) { display: inline-flex; }
  .site-header:has(.menu[hidden]) .header-inner { height: auto; padding-top: 8px; }
  #nav { display: grid; grid-column: 1/-1; grid-row: 2; grid-template-columns: repeat(4, 1fr); gap: 0 .3rem; }
  #nav a { min-height: 46px; justify-content: center; }
  .menu-ready #nav { display: none; position: absolute; inset: 100% 0 auto; padding: .35rem max(.8rem, calc((100% - 640px) / 2)); background: #0c1423; border-bottom: 1px solid var(--line); }
  .menu-ready #nav.open { display: grid; }
}

body:not(.page-home) { min-height: 100svh; display: flex; flex-direction: column; }
body:not(.page-home) main { flex: 1; }
body:not(.page-home) main h1 { font-size: clamp(2.15rem, 5vw, 4.2rem); line-height: 1.24; letter-spacing: .065em; }
body:not(.page-home) .section { padding-top: clamp(2.7rem, 6vw, 5rem); }
.page-letters .letter { min-height: 70svh; }
.chapter-links { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 2.2rem; }
.chapter-links a { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 7px; background: #101b2d; color: #c2d5df; font-size: .875rem; }
.chapter-links a:hover { color: var(--wind); border-color: #8df4db88; }

.biography .section-head { align-items: end; }
.story-timeline { padding: 0; margin: 0; list-style: none; position: relative; }
.story-timeline::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px; background: linear-gradient(#8df4db25, #8df4db9c 4%, #7cb6bb68 96%, #8df4db25); }
.timeline-row { display: grid; grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr); position: relative; padding: .68rem 0; align-items: start; scroll-margin-top: 18px; }
.timeline-row::before { content: ""; position: absolute; left: 50%; top: 2.1rem; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); border: 1px solid #9df4df; background: #193942; }
.timeline-row:hover::before, .timeline-row:target::before, .timeline-row:focus-within::before { background: var(--wind); box-shadow: 0 0 16px #9df4df8c; }
.event-card { position: relative; grid-column: 1; grid-row: 1; padding: clamp(1rem, 2.5vw, 1.7rem); border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(ellipse at top right, #15314870, transparent 72%), #0c1625; }
.timeline-row:nth-child(even) .event-card { grid-column: 3; background: radial-gradient(ellipse at top left, #15314870, transparent 72%), #0c1625; }
.event-card::after { content: ""; position: absolute; left: 100%; top: 1.4rem; width: 27px; height: 1px; background: #8df4db5c; }
.timeline-row:nth-child(even) .event-card::after { left: auto; right: 100%; }
.timeline-row:target .event-card { border-color: #8df4db97; }
.event-era, .personal-label { margin: 0 0 .45rem; color: var(--wind); font-size: .875rem; }
.event-card h2 { font-size: clamp(1.3rem, 2.5vw, 2rem); letter-spacing: .035em; margin: 0 0 1rem; }
.event-card p { color: #d9e6ef; margin: 0 0 .75rem; line-height: 1.9; }
.event-card .story-people { margin-top: .9rem; }
.event-art { grid-column: 3; grid-row: 1; min-width: 0; margin: .1rem 0 0; border: 1px solid var(--line); border-radius: 10px; background: #101a2b; overflow: hidden; }
.timeline-row:nth-child(even) .event-art { grid-column: 1; }
.event-art img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; }
.event-art figcaption { padding: .5rem .85rem; color: #bcd4dc; font-size: .875rem; }

.story-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-items: start; }
.story-reading { margin-top: clamp(2.6rem, 7vw, 5rem); }
.story-reading .minor-head { margin-bottom: 1.1rem; }
.story-reading .minor-head h2 { font-size: clamp(1.7rem, 3.3vw, 2.55rem); }
.personal-card { background: #101a2b; border: 1px solid var(--line); border-radius: 8px; }
.personal-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) 1rem; gap: .85rem; align-items: start; padding: .8rem .95rem; font-weight: 400; }
.personal-card > summary:focus-visible { outline-offset: -3px; }
.personal-card > summary::after { margin: .2rem 0 0; text-align: right; }
.personal-summary { display: grid; gap: .22rem; }
.personal-summary .personal-label { margin: 0; }
.personal-title { font: 700 1.13rem/1.5 var(--serif); color: var(--ink); }
.personal-expanded { border-top: 1px solid var(--line); padding: .75rem .95rem .55rem; background: #0d1727; border-radius: 0 0 8px 8px; }
.personal-expanded p { margin: 0 0 .55rem; color: #cad7e5; }
@media (min-width: 761px) {
  .page-story .wrap, .page-story .header-inner { width: min(calc(100% - clamp(48px, 6vw, 128px)), 1920px); }
  .page-story main h1 { font-size: clamp(2.25rem, 3.5vw, 3.2rem); }
  .biography .event-art img { max-height: 425px; }
  .biography .event-card { padding: clamp(.85rem, 1.65vw, 1.35rem); }
  .biography .event-card h2 { font-size: clamp(1.17rem, 1.64vw, 1.55rem); margin-bottom: .75rem; }
  .biography .event-card p, .biography .personal-expanded { font-size: .9375rem; line-height: 1.8; }
  .biography .story-people, .biography .event-era { font-size: .8125rem; }
}

.gallery-section + .gallery-section { margin-top: clamp(2.4rem, 6vw, 4rem); }
.gallery-section h2 { margin: 0 0 1rem; font-size: clamp(1.4rem, 2.9vw, 2.1rem); }
#birthday-art .wallpaper-slide > a { background: radial-gradient(ellipse at center, #213747, #090f1a 76%); }
#birthday-art .wallpaper-picker button { min-width: 53px; }
.about { background: radial-gradient(ellipse at 85% 40%, #162c3d, transparent 55%), var(--bg); }
.about-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 3.25rem); align-items: start; }
.about-copy h2 { font-size: 1.45rem; margin: 0 0 .55rem; }
.about-copy h2:not(:first-child) { margin-top: 1.6rem; }
.about-copy p { margin: 0 0 .55rem; max-width: 55ch; color: #c6d7e0; }
.about-art { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #101a2b; }
.about-art figcaption { padding: .55rem .85rem; color: var(--muted); font-size: .875rem; }
@media (max-width: 760px) {
  .biography .section-head { align-items: start; }
  .story-timeline::before { left: 6px; }
  .timeline-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .55rem; padding-left: 1.35rem; }
  .timeline-row::before { left: 6px; }
  .timeline-row:nth-child(n) .event-card { grid-column: 1; }
  .timeline-row:nth-child(n) .event-card::after { left: auto; right: 100%; width: 11px; }
  .timeline-row:nth-child(n) .event-art { grid-column: 1; grid-row: 2; margin: 0; }
  .story-shelf, .about-layout { grid-template-columns: minmax(0, 1fr); }
}
