:root {
  --bg: #f8f9f7;
  --ink: #20221f;
  --soft: rgba(25, 25, 25, 0.62);
  --dim: rgba(25, 25, 25, 0.42);
  --line: rgba(25, 25, 25, 0.18);
  --mono: "SF Mono", "Menlo", "Monaco", "Consolas", "Courier New", "PingFang SC", "Hiragino Sans GB", monospace;
  --display: "Didot", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Times New Roman", serif;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "Noto Serif CJK SC", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  line-height: 1.7;
}

body[data-theme="dark"] {
  --bg: #000;
  --ink: rgba(248, 248, 248, 0.9);
  --soft: rgba(248, 248, 248, 0.62);
  --dim: rgba(248, 248, 248, 0.42);
  --line: rgba(248, 248, 248, 0.18);
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  width: 100%;
}

.site-head {
  display: grid;
  gap: clamp(1.3rem, 4vw, 3.2rem);
  padding: clamp(1.6rem, 4.6vw, 3.2rem) clamp(1.25rem, 4vw, 3rem) 0;
}

.site-head { --title-size: clamp(3rem, 6.8vw, 5.6rem); }
.site-head h1 {
  display: flex;
  align-items: center;
  gap: .22em;
  height: calc(var(--title-size) * 1.15);
  margin: 0;
  font-family: var(--display);
  font-size: var(--title-size);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.045em;
}
.title-aima { font-style: italic; }
body[data-lang="zh"] .site-head h1 {
  font-family: "Songti SC", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: calc(var(--title-size) * .88);
  font-weight: 400;
  letter-spacing: .035em;
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  max-width: 72rem;
}

.site-head nav,
.lang-switch,
.theme-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  color: var(--soft);
  font-family: var(--display);
  font-size: clamp(0.82rem, 1.45vw, 0.98rem);
}

.switches {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem 1.4rem;
}

.lang-switch button,
.theme-switch button {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--dim);
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"],
.theme-switch button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:root { --accent: #57768b; --sans: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif; }
[hidden] { display: none !important; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
button, a { touch-action: manipulation; }
.site-head { position: relative; z-index: 1; }
.head-row { max-width: none; }
.site-head nav a { text-decoration: none; font-style: italic; }
.site-head nav a:hover { text-decoration: underline; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 10; background: var(--bg); }
.skip-link:focus { top: 1rem; }
.section { margin: 0 auto; width: min(100% - 8vw, 1280px); scroll-margin-top: 3rem; }
.opening { position: relative; min-height: 630px; height: min(78vw, 790px); margin: 2rem 4vw 5rem; }
.opening-note { position: absolute; top: 3%; left: 8%; margin: 0; font-size: clamp(1.25rem, 2.4vw, 2rem); font-style: italic; letter-spacing: .025em; }
.opening-image { position: absolute; width: 48%; left: 36%; top: 13%; text-decoration: none; }
.opening-image img { height: clamp(320px, 34vw, 500px); object-fit: cover; }
.opening-image > span { display: flex; justify-content: space-between; font-style: italic; margin-top: .7rem; font-size: 1rem; }
.opening-image:hover > span { color: var(--accent); }
.opening-side { position: absolute; top: 43%; left: 14%; writing-mode: vertical-rl; letter-spacing: .3em; font-size: .88rem; line-height: 2.5; }
.scroll-note { position: absolute; bottom: 4%; left: 0; font-size: .8rem; font-style: italic; color: var(--soft); text-decoration: none; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 3rem; }
.section-heading h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5vw, 4.4rem); letter-spacing: -.045em; }
.section-heading h2 span { font-style: italic; }
.section-heading > p { color: var(--soft); font-size: .85rem; }
.filters { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.5rem; }
.filters button { border: 0; background: transparent; padding: .4rem 0; color: var(--soft); font-family: var(--sans); font-size: .8rem; }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: .55rem; }
.episode-card { display: grid; grid-template-columns: 18% 12% 1fr 125px 25px; align-items: start; gap: 2rem; padding: 2.3rem 0; border-top: 1px solid var(--line); text-decoration: none; }
.episode-card:last-child { border-bottom: 1px solid var(--line); }
.episode-card time { font-style: italic; font-size: .93rem; }
.category, .meta { font-family: var(--mono); font-size: .72rem; color: var(--soft); }
.category { padding-top: .15rem; }
.card-copy strong { display: block; font-size: 1.6rem; line-height: 1.2; font-weight: 400; }
.card-copy small { display: block; color: var(--soft); margin-top: .65rem; font-size: .85rem; line-height: 1.8; }
.card-copy .read-more { font-size: .8rem; margin-top: 1.4rem; font-style: italic; }
.card-image { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.card-arrow { align-self: center; }

.episode-card:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
#empty-list { padding: 3rem 0 5rem; border-top: 1px solid var(--line); color: var(--soft); }
.about { margin-top: clamp(7rem, 14vw, 13rem); }
.about-layout { display: grid; grid-template-columns: 43% 1fr; gap: 12%; align-items: start; }
.about figure { margin: 0; }
.about img { height: auto; }
figcaption { color: var(--soft); font-family: var(--mono); font-size: .65rem; margin-top: .8rem; }
.about-copy { padding-top: 4rem; max-width: 30rem; }
.about-copy h3 { font-size: clamp(1.3rem,2.3vw,1.9rem); font-weight: 400; margin: 0 0 2.5rem; }
.about-copy p { font-size: 1rem; line-height: 2.25; margin: 0 0 1.8rem; }
.about-sign { display: block; margin-top: 3rem; font-style: italic; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; margin: 10rem 4vw 6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--soft); font-family: var(--mono); }
.site-footer a { text-decoration: none; }
.sound-control { position: fixed; right: 1.6rem; bottom: 1.1rem; z-index: 5; background: var(--bg); padding: .5rem .7rem; max-width: calc(100% - 2rem); }
.sound-control button { border: 0; background: transparent; font-family: var(--display); font-size: .8rem; font-style: italic; padding: .4rem; }
.sound-control button[aria-disabled="true"] { color: var(--soft); }
.sound-icon { display: inline-block; font-style: normal; letter-spacing: 2px; margin-right: .7rem; }
.sound-control button[aria-pressed="true"] .sound-icon { animation: breathe 2s ease-in-out infinite; }
#background-status { display: block; font-size: .75rem; }
@keyframes breathe { 50% { transform: scaleY(.5); } }
#episode-view, #not-found { padding-top: 4rem; }
.back-link { font-size: .85rem; text-decoration: none; font-style: italic; }
.episode-heading { margin: 5rem 0 3rem 20%; }
.episode-heading h2 { margin: .4rem 0; font-family: "Times New Roman", "Songti SC", serif; font-size: clamp(1.65rem, 3vw, 2.65rem); font-weight: 400; line-height: 1.35; letter-spacing: 0; }
.episode-heading > p:last-child { color: var(--soft); font-size: .9rem; }
.player { display: grid; grid-template-columns: 90px 1fr auto; gap: 2rem; align-items: center; padding: 1.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#play-toggle { font-family: var(--mono); font-size: .8rem; border: 0; padding: .8rem 0; background: transparent; text-align: left; }
.progress-wrap { position: relative; min-width: 0; height: 44px; }
#progress-text { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; pointer-events: none; color: var(--soft); font-family: var(--mono); font-size: 16px; line-height: 44px; }
#progress-text span { flex: 1 1 0; min-width: 0; text-align: center; }
#seek { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; opacity: 0; cursor: pointer; }
#seek::-webkit-slider-runnable-track { height: 44px; background: transparent; }
#seek::-moz-range-track { height: 44px; background: transparent; }
#seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; height: 44px; width: 0; border: 0; }
#seek::-moz-range-thumb { height: 44px; width: 0; border: 0; }
.progress-wrap:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
#seek:disabled { cursor: wait; }
.times { display: flex; gap: .65rem; font-family: var(--mono); font-size: .75rem; font-variant-numeric: tabular-nums; }
.times span { color: var(--dim); }
.audio-help { display: flex; flex-wrap: wrap; gap: .7rem 1.5rem; min-height: 3rem; padding-top: .8rem; font-family: var(--sans); font-size: .73rem; color: var(--soft); }
#audio-status { margin-right: auto; }
.story-heading { display: grid; grid-template-columns: 20% 1fr; margin: 6rem 0 3rem; }
.story-heading h3 { margin: 0; font-size: 1.5rem; font-weight: 400; }
.story { display: flow-root; max-width: 65rem; margin: 0 auto; }
.story > p { margin: 0 0 1.5rem; font-size: 1.08rem; line-height: 2.1; overflow-wrap: break-word; }
.story-photo { float: left; clear: both; width: 37%; margin: .55rem 2.5rem 1.25rem 0; }
.story-photo img { height: auto; }
.story-photo:nth-of-type(even) { float: right; margin: .55rem 0 1.25rem 2.5rem; }
.bottom-back { display: inline-block; margin-top: 6rem; }
@media (max-width: 720px) {
  .site-head { --title-size: clamp(2.8rem, 13.5vw, 4.6rem); }
  .head-row { align-items: flex-start; }
  .section { width: calc(100% - 2.5rem); }
  .opening { min-height: 490px; height: 125vw; max-height: 630px; margin: 1.5rem 1.25rem 3rem; }
  .opening-note { left: 2%; top: 4%; font-size: 1.15rem; }
  .opening-image { left: 26%; top: 20%; width: 74%; }
  .opening-image img { height: 72vw; max-height: 360px; }
  .opening-side { left: 0; top: 35%; font-size: .72rem; }
  .scroll-note { bottom: 0; }
  .section-heading { margin-bottom: 1.8rem; }
  .section-heading > p { font-size: .7rem; }
  .filters { gap: 1.3rem; }
  .episode-card { grid-template-columns: 1fr 80px 12px; gap: .8rem 1rem; padding: 1.5rem 0; }
  .episode-card time { grid-column: 1; font-size: .8rem; }
  .category { grid-column: 2 / 4; grid-row: 1; font-size: .65rem; }
  .card-copy { grid-column: 1; grid-row: 2; }
  .card-copy strong { font-size: 1.45rem; }
  .card-copy small { font-size: .74rem; }
  .card-image { grid-column: 2; grid-row: 2; height: auto; }
  .card-arrow { grid-column: 3; grid-row: 2; }
  .about-layout { grid-template-columns: 1fr; gap: 1rem; }
  .about figure { width: 83%; }
  .about-copy { padding-top: 2rem; margin-left: 12%; }
  .about-copy p { font-size: .94rem; }
  .site-footer { margin: 6rem 1.25rem 6rem; font-size: .6rem; }
  .episode-heading { margin: 3rem 0 2rem; }
  .player { grid-template-columns: 55px 1fr; gap: .2rem 1rem; padding: .7rem 0; }
  .times { grid-column: 2; justify-content: space-between; margin-bottom: .7rem; }
  .times span { display: none; }
  .story-heading { grid-template-columns: 1fr; gap: 1rem; margin-top: 3rem; }
  .story > p { font-size: 1rem; line-height: 2.1; }
  .story-photo, .story-photo:nth-of-type(even) { float: none; width: 100%; margin: 1.8rem 0; }
  .sound-control { right: .7rem; bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

#site-title { display: inline-flex; align-items: baseline; gap: .22em; color: inherit; text-decoration: none; }
.title-radio { font-size: .72em; letter-spacing: -.035em; }
.card-copy strong { font-family: "Times New Roman", "Songti SC", serif; font-size: 1.4rem; line-height: 1.4; }
.site-head nav[hidden] + .switches { margin-left: auto; }
.opening-image img { object-fit: contain; }

/* Let the cover introduce the page without decorative slogans. */
.opening { height: auto; min-height: 0; max-height: none; margin: 3rem 4vw 6rem; padding: 0; }
.opening-image { display: block; position: static; width: min(480px, 80%); margin: 0 auto; }
.opening-image img { height: auto; max-height: none; aspect-ratio: 1; object-fit: contain; }
