:root {
  color-scheme: light;
  --ink: #1b2024;
  --ink-soft: #596168;
  --paper: #fffef9;
  --paper-deep: #f4f0e7;
  --accent: #f4c928;
  --accent-bright: #f4c928;
  --accent-deep: #725600;
  --wash: #fff4b8;
  --hairline: rgba(27, 32, 36, .13);
  --shadow-soft: 0 18px 54px rgba(24, 28, 31, .10);
  --shadow-float: 0 24px 70px rgba(14, 17, 19, .24);
  --radius-lg: 32px;
  --radius-md: 22px;
  --page-max: 980px;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper-deep);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 3%, color-mix(in srgb, var(--accent) 22%, transparent) 0, transparent 31rem),
    radial-gradient(circle at 93% 48%, color-mix(in srgb, var(--wash) 36%, transparent) 0, transparent 28rem),
    linear-gradient(180deg, #f7f3ea 0%, var(--paper-deep) 48%, #ece7dc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image:
    repeating-linear-gradient(0deg, rgba(55, 48, 39, .055) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .32) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

button, input { font: inherit; }
button { touch-action: manipulation; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry-card {
  width: min(calc(100% - 2rem), 560px);
  margin: max(12vh, 5rem) auto 0;
  padding: clamp(2rem, 7vw, 3.5rem);
  text-align: center;
  background: rgba(255, 254, 249, .92);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.entry-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 2.2rem;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.08);
}

.entry-card h1 {
  margin: .35rem 0 1rem;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.18;
  letter-spacing: -.035em;
}

.entry-card > p:last-child { margin: 0; color: var(--ink-soft); line-height: 1.75; }

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--accent-deep);
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.work-page { min-height: 100vh; padding: .7rem 0 max(4rem, env(safe-area-inset-bottom)); }

.topbar {
  position: absolute;
  z-index: 7;
  top: max(1.3rem, env(safe-area-inset-top));
  left: max(1.25rem, env(safe-area-inset-left));
  right: max(1.25rem, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  pointer-events: none;
}

.topbar span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .5rem .78rem;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  background: rgba(20, 23, 25, .58);
  color: white;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .04em;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  backdrop-filter: blur(16px) saturate(1.2);
}

.hero {
  position: relative;
  width: min(calc(100% - 1.4rem), 1120px);
  min-height: min(72svh, 720px);
  margin: 0 auto;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: clamp(28px, 7vw, 46px);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(17,19,20,.08), inset 0 -110px 120px rgba(10,12,13,.18);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(12,14,15,.12) 58%, rgba(12,14,15,.90) 100%);
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--art-position, 50% 50%);
  filter: saturate(1.03) contrast(1.02);
  transform: scale(1.012);
  transition: transform 9s cubic-bezier(.2,.65,.25,1), filter .6s ease;
}

.work-page.is-playing .hero-art { transform: scale(1.045); filter: saturate(1.08) contrast(1.03); }

.hero-copy {
  position: relative;
  z-index: 3;
  padding: 8rem 1.35rem 5.75rem;
  color: white;
}

.hero-copy .eyebrow { color: color-mix(in srgb, var(--accent) 82%, white); text-shadow: 0 1px 12px rgba(0,0,0,.45); }

.hero-copy h1 {
  max-width: 11ch;
  margin: .12rem 0 .6rem;
  font-size: clamp(2.6rem, 12.5vw, 5.8rem);
  line-height: .96;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 4px 30px rgba(0,0,0,.42);
}

.hero-copy > p:last-child {
  margin: 0;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: .025em;
  opacity: .92;
}

.player-card {
  position: relative;
  z-index: 6;
  width: min(calc(100% - 2rem), 760px);
  margin: -4.35rem auto 0;
  padding: 1.05rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  background: rgba(24, 29, 33, .96);
  color: white;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(22px) saturate(1.15);
}

.player-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-bright), transparent);
  opacity: .9;
}

.player-main {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: .95rem;
  align-items: center;
}

.play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-bright);
  color: #15191c;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-bright) 32%, transparent), inset 0 -3px 0 rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}

.play-button::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid color-mix(in srgb, var(--accent-bright) 55%, transparent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.85);
}

.work-page.is-playing .play-button::after { animation: sound-pulse 2s ease-out infinite; }
.play-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--accent-bright) 38%, transparent), inset 0 -3px 0 rgba(0,0,0,.12); }
.play-button:active { transform: translateY(1px) scale(.97); }
.play-button svg { width: 30px; height: 30px; fill: currentColor; }
.play-button:focus-visible { outline: 4px solid white; outline-offset: 4px; }
.play-button[aria-busy="true"] { cursor: progress; }

@keyframes sound-pulse {
  0% { opacity: .8; transform: scale(.86); }
  70%, 100% { opacity: 0; transform: scale(1.28); }
}

.song-meta { min-width: 0; }
.music-label { margin: 0 0 .18rem; color: var(--accent-bright); font-size: .76rem; font-weight: 780; letter-spacing: .11em; }
.song-meta h2 { margin: 0 0 .25rem; font-size: clamp(1.02rem, 4vw, 1.2rem); line-height: 1.3; overflow-wrap: anywhere; }
.song-meta > p:last-child { margin: 0; color: rgba(255,255,255,.65); font-size: .81rem; line-height: 1.45; overflow-wrap: anywhere; }

.now-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: baseline;
  margin: .95rem 0 .75rem;
  padding: .72rem .8rem;
  border-radius: 16px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.07);
}

.now-line span { color: var(--accent-bright); font-size: .72rem; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.now-lyric { min-width: 0; font-size: .92rem; line-height: 1.5; font-weight: 670; overflow-wrap: anywhere; }

.progress-wrap { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; align-items: center; gap: .6rem; }
.progress { width: 100%; height: 26px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.progress::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent-bright) 0 var(--progress, 0%), rgba(255,255,255,.22) var(--progress, 0%) 100%); }
.progress::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.22); }
.progress::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent-bright); }
.progress::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; appearance: none; border: 3px solid var(--ink); border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 2px var(--accent-bright); }
.progress::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 2px var(--accent-bright); }
.progress:focus-visible { outline: 3px solid white; outline-offset: 2px; border-radius: 99px; }

.current-time, .duration { color: rgba(255,255,255,.66); font-size: .75rem; font-variant-numeric: tabular-nums; }
.duration { text-align: right; }
.player-status { min-height: 1.3em; margin: .4rem 0 0; color: rgba(255,255,255,.66); font-size: .78rem; }

.content {
  width: min(calc(100% - 1.5rem), 760px);
  margin: 1.25rem auto 0;
  display: grid;
  gap: 1rem;
}

.paper-card {
  position: relative;
  padding: clamp(1.3rem, 5vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: rgba(255, 254, 249, .94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.paper-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent) 62%, transparent);
}

.section-number {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  margin-bottom: 1.2rem;
  padding: 0 .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, white);
  color: var(--accent-deep);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .05em;
}

.paper-card h2 { margin: 0 0 1rem; font-size: clamp(1.35rem, 5vw, 1.7rem); line-height: 1.25; letter-spacing: -.025em; }
.explanation { margin: 0; max-width: 38em; color: #33393e; font-size: 1.08rem; line-height: 1.9; text-wrap: pretty; }

.animal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.animal-card { position: relative; margin: 0; }
.animal-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid rgba(27,32,36,.09); border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 10%, #fff); }
.animal-card.cartoon img { object-fit: contain; padding: .4rem; }
.animal-card figcaption { margin-top: .65rem; color: #3d444a; font-weight: 720; font-size: .9rem; line-height: 1.45; }

.lyrics-card { padding-bottom: 1rem; }
.lyrics-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lyrics-head h2 { margin: 0; }
.lyrics-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 60px;
  min-height: 48px;
  padding: .65rem .85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 780;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.lyrics-toggle::after { content: "⌄"; font-size: 1rem; transform: translateY(-1px); transition: transform .25s ease; }
.lyrics-toggle[aria-expanded="true"]::after { transform: rotate(180deg) translateY(-1px); }
.lyrics-toggle:hover { background: color-mix(in srgb, var(--accent) 10%, white); border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); }
.lyrics-toggle:active { transform: scale(.97); }
.lyrics-toggle:focus-visible { outline: 4px solid color-mix(in srgb, var(--accent) 52%, transparent); outline-offset: 2px; }

.lyrics { display: grid; gap: .3rem; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .45s cubic-bezier(.2,.75,.25,1), opacity .25s ease, margin .35s ease; }
.lyrics.open { max-height: 36rem; overflow-y: auto; opacity: 1; margin-top: 1rem; padding-right: .25rem; }

.lyric-line {
  width: 100%;
  margin: 0;
  padding: .72rem .85rem;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 14px 14px 0;
  background: transparent;
  color: #5b636a;
  text-align: left;
  font-size: 1rem;
  line-height: 1.65;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.lyric-line:hover { color: var(--ink); background: rgba(27,32,36,.04); }
.lyric-line:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent); outline-offset: -1px; }
.lyric-line.active { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, white); color: var(--ink); font-weight: 760; transform: translateX(2px); }

.credits { padding: .35rem .5rem; color: color-mix(in srgb, var(--ink) 66%, transparent); font-size: .78rem; line-height: 1.75; }
.credits a { text-underline-offset: 3px; }
.credits a:hover { color: var(--ink); }
.privacy { display: flex; gap: .6rem; align-items: flex-start; }
.privacy svg { flex: 0 0 18px; margin-top: .22rem; }

@media (min-width: 760px) {
  .work-page { padding-top: 1rem; }
  .hero { min-height: min(74vh, 760px); }
  .hero-copy { width: min(100%, var(--page-max)); margin: 0 auto; padding-inline: 2rem; padding-bottom: 6.5rem; }
  .player-card { width: min(calc(100% - 3rem), var(--page-max)); margin-top: -4.8rem; padding: 1.25rem; }
  .player-main { grid-template-columns: 76px minmax(0, 1fr); }
  .play-button { width: 76px; height: 76px; }
  .now-line, .progress-wrap, .player-status { margin-left: 5.7rem; }
  .content { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); width: min(calc(100% - 3rem), var(--page-max)); gap: 1.15rem; }
  .content .wide { grid-column: 1 / -1; }
  .understanding-card { grid-column: 1 / 2; }
  .animal-card-section { grid-column: 2 / 3; }
}

@media (max-width: 759px) {
  .hero { min-height: min(72svh, 660px); }
  .content { margin-top: 1rem; }
}

@media (max-width: 330px) {
  .topbar { left: .75rem; right: .75rem; gap: .35rem; }
  .topbar span { padding: .42rem .55rem; font-size: .68rem; }
  .hero { width: calc(100% - .7rem); border-radius: 24px; }
  .hero-copy { padding-inline: .9rem; }
  .player-card, .content { width: calc(100% - .75rem); }
  .player-main { grid-template-columns: 56px minmax(0, 1fr); gap: .7rem; }
  .play-button { width: 56px; height: 56px; }
  .now-line { grid-template-columns: 1fr; gap: .25rem; }
  .progress-wrap { grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem; gap: .35rem; }
  .animal-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .work-page.is-playing .hero-art { transform: scale(1.012); }
}

@media (forced-colors: active) {
  .topbar span, .player-card, .paper-card, .play-button, .lyrics-toggle { border: 2px solid CanvasText; }
}
