:root {
  color-scheme: light;
  --paper: #f6f0e7;
  --ink: #2f302a;
  --muted: #77776e;
  --accent: #8d5946;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -15%, rgba(255, 255, 255, .92), transparent 55%),
    var(--paper);
}

button, a { font: inherit; }
button { color: inherit; }

.loading-mark {
  width: 28px;
  height: 28px;
  margin: 45vh auto;
  border: 1px solid rgba(141, 89, 70, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

.album-shell {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
}

.album-shell::before, .album-shell::after {
  position: absolute;
  z-index: -1;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(141, 89, 70, .1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.album-shell::before { top: 8%; left: -230px; }
.album-shell::after { right: -230px; bottom: 7%; }

.topbar {
  display: flex;
  width: min(100% - 40px, 1100px);
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

.wordmark {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .18em;
  text-decoration: none;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.quiet-link, .music-toggle, .icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(47, 48, 42, .15);
  border-radius: 99px;
  background: rgba(255, 255, 255, .48);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}

.quiet-link:hover, .music-toggle:hover, .icon-button:hover {
  border-color: rgba(141, 89, 70, .4);
  background: white;
}

.music-toggle:active, .icon-button:active { transform: scale(.97); }
.music-toggle[aria-pressed="true"] { border-color: rgba(141, 89, 70, .45); color: var(--accent); }
.music-toggle:disabled { cursor: default; opacity: .55; }

.volume-mark { width: 14px; height: 14px; fill: currentColor; }

.landing {
  display: grid;
  width: min(100% - 40px, 980px);
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .78fr);
  align-items: center;
  gap: clamp(36px, 8vw, 112px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.landing-copy { max-width: 470px; }
.eyebrow {
  margin: 0 0 17px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .24em;
}

.landing h1, .cover-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: .09em;
}

.landing h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.4; }
.landing-intro { margin: 22px 0 30px; color: var(--muted); font-family: var(--serif); font-size: 15px; line-height: 2.1; }

.album-links { display: flex; flex-wrap: wrap; gap: 12px; }
.album-link {
  display: inline-flex;
  min-width: 145px;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 17px;
  border: 1px solid rgba(141, 89, 70, .25);
  border-radius: 3px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 14px;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.album-link:hover { background: var(--accent); color: white; }

.landing-art {
  position: relative;
  width: min(100%, 360px);
  justify-self: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  background: linear-gradient(160deg, #d6c0a7 0%, #b7a68f 45%, #777d6d 100%);
  box-shadow: 0 22px 70px rgba(76, 61, 48, .15);
}

.landing-art::before {
  position: absolute;
  top: 15%;
  left: 50%;
  width: 56%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(247, 231, 204, .45);
  content: "";
}

.landing-art::after {
  position: absolute;
  right: -10%;
  bottom: -30%;
  left: -10%;
  height: 75%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(120deg, rgba(53, 68, 58, .88), rgba(131, 139, 111, .8));
  content: "";
}

.art-caption {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 24px;
  left: 20px;
  color: rgba(255, 255, 255, .88);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .16em;
  text-align: center;
}

.footer-note {
  padding: 0 20px 22px;
  color: #969187;
  font-size: 10px;
  letter-spacing: .14em;
  text-align: center;
}

.album-main {
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
}

.cover-view {
  display: grid;
  width: min(100% - 40px, 1040px);
  flex: 1;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1fr);
  align-items: center;
  gap: clamp(28px, 7vw, 92px);
  margin: 0 auto;
  padding: 20px 0 54px;
  animation: fade-in .7s ease both;
}

.cover-copy { max-width: 410px; }
.cover-title { font-size: clamp(36px, 5.4vw, 62px); line-height: 1.45; }
.cover-intro { margin: 22px 0 27px; color: var(--muted); font-family: var(--serif); font-size: 15px; line-height: 2.2; white-space: pre-line; }
.cover-meta { margin: 0 0 28px; color: #979187; font-size: 11px; letter-spacing: .15em; }

.start-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: white;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.start-button:hover { background: #704634; }
.start-button:active { transform: translateY(1px); }
.start-button:disabled { background: #a99b8d; cursor: default; }

.cover-photo {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 4 / 5;
  justify-self: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, .48), transparent 35%),
    linear-gradient(150deg, #dbc9b1, #a9a590 56%, #697366);
  box-shadow: 0 24px 70px rgba(76, 61, 48, .17);
}

.cover-photo img, .slide-frame img {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
}

.slide-frame img { object-fit: contain; }

.cover-photo.is-placeholder::before {
  position: absolute;
  top: 16%;
  left: 50%;
  width: 34%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(244, 229, 205, .45);
  content: "";
}

.cover-photo.is-placeholder::after {
  position: absolute;
  right: -8%;
  bottom: -26%;
  left: -8%;
  height: 65%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(125deg, rgba(50, 66, 55, .88), rgba(139, 144, 115, .9));
  content: "";
}

.photo-caption {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 20px;
  left: 16px;
  color: rgba(255, 255, 255, .9);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .18em;
  text-align: center;
}

.slideshow {
  display: flex;
  width: min(100% - 40px, 1100px);
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 16px 0 36px;
  animation: fade-in .65s ease both;
}

.slide-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.slide-heading p { margin: 0 0 8px; color: var(--accent); font-size: 10px; letter-spacing: .2em; }
.slide-heading h1 { margin: 0; font-family: var(--serif); font-size: clamp(23px, 4vw, 34px); font-weight: 500; letter-spacing: .08em; }
.slide-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

.slide-frame {
  position: relative;
  width: 100%;
  max-height: min(67svh, 720px);
  min-height: 300px;
  flex: 1;
  overflow: hidden;
  background: #ded5c8;
  box-shadow: 0 20px 70px rgba(58, 49, 38, .13);
}

.slide-frame img { opacity: 0; transition: opacity .65s ease; }
.slide-frame img.is-visible { opacity: 1; }
.slide-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: linear-gradient(145deg, #ded3c3, #a39d8a);
  color: white;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .1em;
  text-align: center;
}

.slide-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 17px;
}

.slide-caption { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 13px; }
.slide-controls { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 42px; height: 42px; padding: 0; font-size: 15px; }
.icon-button:disabled { cursor: default; opacity: .4; }
.pause-button { width: auto; padding: 0 14px; font-size: 11px; }

.progress-track { height: 2px; margin-top: 13px; overflow: hidden; background: rgba(47, 48, 42, .12); }
.progress-fill { width: 0; height: 100%; background: var(--accent); }
.progress-fill.is-running { animation: progress var(--slide-duration) linear forwards; }

.error-message {
  width: min(100% - 40px, 620px);
  margin: 8vh auto;
  color: var(--muted);
  font-family: var(--serif);
  line-height: 2;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 3;
  right: 16px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 12px 17px;
  border-radius: 2px;
  background: rgba(47, 48, 42, .92);
  color: white;
  font-size: 12px;
  text-align: center;
  animation: fade-in .2s ease both;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes progress { to { width: 100%; } }

@media (min-width: 900px) {
  .slide-frame { min-height: 360px; }
}

@media (max-width: 700px) {
  .topbar { width: calc(100% - 32px); min-height: 64px; }
  .landing { width: calc(100% - 44px); grid-template-columns: 1fr; gap: 38px; padding: 36px 0 42px; }
  .landing-copy { text-align: center; }
  .landing-intro { max-width: 350px; margin-right: auto; margin-left: auto; }
  .album-links { justify-content: center; }
  .landing-art { width: min(74vw, 290px); }
  .cover-view { width: calc(100% - 40px); grid-template-columns: 1fr; gap: 28px; padding: 22px 0 36px; }
  .cover-copy { order: 1; text-align: center; }
  .cover-photo { width: min(72vw, 320px); }
  .cover-intro { max-width: 370px; margin-right: auto; margin-left: auto; }
  .cover-meta { margin-bottom: 20px; }
  .slideshow { width: calc(100% - 32px); padding-top: 22px; }
  .slide-frame { min-height: 42svh; max-height: 62svh; }
  .slide-bottom { align-items: flex-start; }
  .slide-caption { max-width: 48%; padding-top: 11px; line-height: 1.7; }
}

@media (max-width: 380px) {
  .wordmark { font-size: 11px; }
  .quiet-link, .music-toggle { min-height: 37px; padding: 0 10px; font-size: 11px; }
  .album-link { min-width: 130px; }
  .slide-controls { gap: 5px; }
  .icon-button { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
