/* bookianoong.com — one stylesheet for the home page and every lyric page.
   Light = 宣纸 (sample A), dark = 夜墨 (sample B). The theme is set on <html data-theme>
   by the inline script in each page's <head>; js/theme.js runs the 自动/日/夜 switch. */

@font-face {
  font-family: "Brush";
  src: url("../assets/font/brush-subset.woff2") format("woff2");
  font-display: swap;
}

/* ---------- theme tokens ---------- */
:root {
  --bg: #f4ecdd;
  --bg-alt: #ebe0cc;
  --text: #2b241c;
  --muted: #6e6152;
  --accent-text: #85612a;
  --btn-bg: #2b241c;
  --btn-text: #f4ecdd;
  --card: #fbf6ec;
  --line: #d8c9ae;
  --wordmark: #1f1a14;
  --wordmark-shadow: none;
  --hero-filter: none;
  --hero-glow: rgba(248, 240, 226, .72);
  --hero-ink: #2b241c;
  --hero-sub: #4d4235;
  --roman: #3b3126;
  --stage-filter: blur(40px) brightness(1.2) saturate(.75);
  --stage-wash: rgba(244, 236, 221, .8);
  --cover-shadow: 0 26px 60px rgba(70, 50, 20, .32);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #13110e;
  --bg-alt: #1b1814;
  --text: #efe6d6;
  --muted: #a99b86;
  --accent-text: #e3c07f;
  --btn-bg: #e3c07f;
  --btn-text: #1a150f;
  --card: #221e19;
  --line: #3a332a;
  --wordmark: #e9c88a;
  --wordmark-shadow: drop-shadow(0 2px 14px rgba(0, 0, 0, .55));
  --hero-filter: saturate(.8) brightness(.62) contrast(1.05);
  --hero-glow: rgba(19, 17, 14, .45);
  --hero-ink: #f3e7cf;
  --hero-sub: #d9c9ab;
  --roman: #e9c88a;
  --stage-filter: blur(40px) brightness(.38) saturate(1.1);
  --stage-wash: rgba(19, 17, 14, .2);
  --cover-shadow: 0 30px 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(227, 192, 127, .18);
  color-scheme: dark;
}

/* No JavaScript: follow the device setting instead of the clock. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #13110e; --bg-alt: #1b1814; --text: #efe6d6; --muted: #a99b86; --accent-text: #e3c07f;
    --btn-bg: #e3c07f; --btn-text: #1a150f; --card: #221e19; --line: #3a332a;
    --wordmark: #e9c88a; --hero-filter: saturate(.8) brightness(.62) contrast(1.05);
    --hero-glow: rgba(19, 17, 14, .45); --hero-ink: #f3e7cf; --hero-sub: #d9c9ab; --roman: #e9c88a;
    --stage-filter: blur(40px) brightness(.38) saturate(1.1); --stage-wash: rgba(19, 17, 14, .2);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  transition: background-color .4s, color .4s;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }

.brush { font-family: "Brush", "Kaiti SC", "STKaiti", "KaiTi", serif; font-weight: 400; }
.en { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; letter-spacing: .02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }

/* The 書琴歌 wordmark: one alpha image used as a mask, painted in the theme colour. */
.wm { filter: var(--wordmark-shadow); }
.wm::before {
  content: ""; display: block; aspect-ratio: 900 / 306;
  background: var(--wordmark);
  -webkit-mask: url("../assets/img/wordmark-ink.webp") center / contain no-repeat;
  mask: url("../assets/img/wordmark-ink.webp") center / contain no-repeat;
}

/* ---------- theme switch (under About, and at the foot of lyric pages) ---------- */
.theme-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line);
}
.theme-row-label { font-size: 14px; color: var(--muted); letter-spacing: .08em; }
.theme-row-label .en { font-size: 15px; }
.theme-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}
.theme-switch button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); font: inherit; font-size: 15px; letter-spacing: .1em;
}
.theme-switch button svg { width: 16px; height: 16px; flex: none; }
.theme-switch button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); }
.theme-switch button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.lp .theme-row { justify-content: center; }

/* ---------- hero (home) ---------- */
.hero {
  position: relative; overflow: hidden; min-height: 80svh;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--hero-ink);
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg img { object-fit: cover; object-position: 50% 70%; filter: var(--hero-filter); transition: filter .4s; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 72% 46% at 50% 28%, var(--hero-glow), transparent 70%),
    linear-gradient(to bottom, transparent 60%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding: 14svh 16px 0; }
.hero h1 { margin: 0 auto; width: min(78vw, 520px); }
.roman {
  margin: 14px 0 0; color: var(--roman);
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600;
  font-size: clamp(14px, 3.6vw, 18px); letter-spacing: .42em; padding-left: .42em;
}
.tagline { margin: 10px 0 0; display: flex; flex-direction: column; gap: 2px; }
.tagline .brush { font-size: clamp(22px, 6vw, 30px); letter-spacing: .12em; }
.tagline .en { font-size: 16px; color: var(--hero-sub); }
.cue {
  position: absolute; z-index: 2; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; text-decoration: none;
  font-size: 14px; line-height: 1.3; color: var(--hero-ink);
}
.cue::after { content: ""; width: 1px; height: 28px; margin-top: 8px; background: currentColor; opacity: .6; }

@media (min-aspect-ratio: 1/1) {
  .hero-inner { padding-top: 12vh; }
  .hero::after {
    background:
      radial-gradient(ellipse 42% 40% at 50% 30%, var(--hero-glow), transparent 72%),
      linear-gradient(to bottom, transparent 65%, var(--bg) 100%);
  }
}

/* ---------- newest song: the stage (sample C layout) ---------- */
.stage { position: relative; overflow: hidden; padding: 48px 0 72px; }
.stage-bg {
  position: absolute; z-index: 0; inset: -60px; background-size: cover; background-position: center;
  filter: var(--stage-filter); transform: scale(1.1); transition: filter .4s;
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--stage-wash) 18%, var(--stage-wash) 70%, var(--bg) 100%);
}
.stage-grid { position: relative; z-index: 2; display: grid; gap: 22px; align-items: center; }
.stage-cover { margin: 0 auto; width: min(80vw, 440px); }
.stage-cover img { width: 100%; border-radius: 8px; box-shadow: var(--cover-shadow); }
.stage-text { text-align: center; }
.kicker {
  margin: 0; display: flex; justify-content: center; align-items: baseline; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: .2em; color: var(--accent-text);
}
.kicker .en { letter-spacing: .04em; font-weight: 500; }
.song-title { margin: 4px 0 0; font-size: clamp(48px, 13vw, 84px); line-height: 1.15; letter-spacing: .06em; }
.song-sub { margin: 0; font-size: 21px; color: var(--muted); }
.song-series { margin: 4px 0 0; font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.lyric-quote { margin: 20px auto 0; padding: 0; max-width: 26em; font-size: 17px; line-height: 1.9; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 8px;
  min-height: 52px; padding: 13px 42px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-text); border: 0;
  font: inherit; font-size: 20px; font-weight: 600; letter-spacing: .12em; text-decoration: none; cursor: pointer;
}
.btn .en { letter-spacing: .02em; font-weight: 500; }
.link-quiet { color: var(--accent-text); font-size: 15px; text-underline-offset: 4px; }
.soon { margin: 26px 0 0; color: var(--accent-text); letter-spacing: .12em; }
.sp-facade {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px; margin: 20px auto 0;
  padding: 12px 16px; border-radius: 12px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--text);
  border: 1px solid var(--line); font: inherit; font-size: 15px;
}
.sp-facade .en { display: block; font-size: 14px; color: var(--muted); }
.sp-play { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #1db954; position: relative; }
.sp-play::after {
  content: ""; position: absolute; left: 15px; top: 12px;
  border-left: 12px solid #000; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.sp-embed { display: block; width: 100%; max-width: 440px; margin: 20px auto 0; border: 0; border-radius: 12px; }

@media (min-width: 820px) {
  .stage { padding: 96px 0; }
  .stage-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
  .stage-text { text-align: left; }
  .kicker, .actions { justify-content: flex-start; }
  .lyric-quote, .sp-facade, .sp-embed { margin-left: 0; }
}

/* ---------- bands ---------- */
.band { padding: 64px 0; background: var(--bg); }
.band-alt { background: var(--bg-alt); }
.sec-h { margin: 0 0 28px; display: flex; align-items: baseline; gap: 12px; font-weight: 400; }
.sec-h .brush { font-size: 36px; line-height: 1.2; letter-spacing: .08em; }
.sec-h .en { font-size: 18px; color: var(--muted); }

.works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
@media (min-width: 720px) { .works { grid-template-columns: repeat(4, 1fr); gap: 32px 24px; } }
.work a, .work > div { display: flex; flex-direction: column; text-decoration: none; }
.work img { width: 100%; aspect-ratio: 1; border-radius: 4px; transition: transform .2s; }
.work a:hover img { transform: translateY(-2px); }
.w-title { margin-top: 10px; font-size: 24px; line-height: 1.3; }
.w-sub { font-size: 15px; line-height: 1.3; color: var(--muted); }
.w-meta { margin-top: 4px; font-size: 13px; letter-spacing: .08em; color: var(--accent-text); }
.work.is-soon img { filter: grayscale(.55) brightness(.85); }

.lyric-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lyric-links li { border-bottom: 1px solid var(--line); }
.lyric-links a { display: flex; align-items: baseline; gap: 12px; padding: 16px 0; text-decoration: none; }
.lyric-links a::after { content: "→"; margin-left: auto; color: var(--accent-text); }
.lyric-links .brush { font-size: 28px; }
.lyric-links .en { color: var(--muted); }
.empty { padding: 18px 0; color: var(--muted); }
.empty .en { display: block; }

.platforms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.platforms a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); text-decoration: none; font-size: 15px;
}
.platforms a:hover { border-color: var(--accent-text); }

.notify { display: grid; gap: 10px; margin-top: 18px; }
.notify input {
  min-height: 52px; padding: 0 16px; border-radius: 12px; font: inherit; font-size: 16px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
}
.notify .btn { margin-top: 0; width: 100%; font-size: 17px; padding: 13px 28px; }
.fine { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.notify-msg { margin: 6px 0 0; font-size: 15px; color: var(--accent-text); }
@media (min-width: 560px) {
  .notify { grid-template-columns: 1fr auto; }
  .notify .btn { width: auto; }
  .fine, .notify-msg { grid-column: 1 / -1; }
}

.about p { margin: 0 0 14px; font-size: 17px; line-height: 2; }
.about .en { font-size: 18px; line-height: 1.6; color: var(--muted); }

.foot { padding: 36px 0 44px; background: var(--bg-alt); color: var(--muted); font-size: 14px; text-align: center; }
.foot p { margin: 2px 0; }

/* ---------- lyric page ---------- */
.lp-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg-alt);
}
.lp-top a { text-decoration: none; }
.lp-back { font-size: 15px; color: var(--accent-text); white-space: nowrap; }
.lp-home { width: 96px; }
.lp { padding: 40px 16px 72px; text-align: center; }
.lp-cover { width: min(56vw, 240px); margin: 0 auto 18px; border-radius: 6px; box-shadow: var(--cover-shadow); }
.lp h1 { margin: 0; font-size: clamp(44px, 12vw, 64px); line-height: 1.2; font-weight: 400; letter-spacing: .06em; }
.lp-credit { margin: 6px 0 34px; font-size: 14px; color: var(--muted); letter-spacing: .08em; }
.lyrics { font-size: 18px; line-height: 2.1; }
.lyrics p { margin: 0 0 1.8em; }
.lp .actions { justify-content: center; }
.lp-more { margin-top: 56px; text-align: left; }
.lp-more h2 { margin: 0 0 12px; font-size: 26px; font-weight: 400; }
