/* ==========================================================================
   雲端新廣播 2026-11 捲動敘事版
   版面分三層：紙底與巨字（最底）、立體收音機畫布（中）、內容卡與面板（上）。
   既有元件（播放器、節目帶、聲紋卡、播客、公告）的樣式沿用原檔，這裡只管新骨架與配色。
   ========================================================================== */

:root {
  --paper: #f4ecdd;
  --surface: #fffaf0;
  --ink: #1b2a2c;
  --ink-soft: #3f5052;
  --teal-deep: #0d5c59;
  --teal-night: #0a3534;
  --orange: #e2793a;
  --sc-ease: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body.sc {
  background:
    radial-gradient(900px 500px at 92% -4%, rgba(226, 121, 58, .10), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(57, 189, 183, .10), transparent 60%),
    var(--paper);
  overflow-x: hidden;
}

/* 紙紋：一層很淡的雜點，蓋在最底 */
body.sc::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--paper-grain, none);
  background-size: 300px 300px;
  opacity: .5;
  mix-blend-mode: multiply;
}

/* ---------- 立體收音機畫布與外框 ---------- */
.sc-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
}
html.no-3d .sc-canvas { display: none; }

.sc-frame {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  border: 10px solid var(--teal-deep);
}

.site-header { z-index: 20; background: rgba(244, 236, 221, .78); margin: 10px 10px 0; top: 10px; border-radius: 0 0 18px 18px; }
main#top { position: relative; }

/* ---------- 巨字 ---------- */
.sc-giant {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  align-self: start;
}
.sc-giant span {
  display: block;
  color: var(--teal-deep);
  line-height: .9;
  white-space: nowrap;
  -webkit-mask-image: var(--grain, none);
  mask-image: var(--grain, none);
  -webkit-mask-size: 520px 520px;
  mask-size: 520px 520px;
  will-change: transform;
}
.sc-giant span.alt { color: var(--orange); }
.sc-giant .lat {
  font-family: "Anton", "Impact", "Noto Sans TC", sans-serif;
  font-size: min(31vw, 68vh);
  letter-spacing: -.01em;
}
.sc-giant .zh {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
  letter-spacing: -.04em;
  transform-origin: center;
}
.sc-giant .zh.g3 { font-size: min(29vw, 58vh); }
.sc-giant .zh.g4 { font-size: min(22vw, 52vh); }
.sc-intro-about .sc-giant .lat { font-size: min(21vw, 56vh); }
.sc-intro[data-stage="podcast"] .sc-giant .lat { font-size: min(27vw, 62vh); }

/* ---------- 第一幕 ---------- */
.sc-hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 96px);
  min-height: calc(100svh - 96px);
}
.sc-hero > * { grid-area: 1 / 1; }
.sc-giant-hero {
  position: absolute;
  inset: 0;
  height: auto;
  align-items: start;
  padding-top: 2vh;
}
.sc-hero-copy {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  width: min(1320px, calc(100% - 72px));
  margin: 0 auto;
  padding: 0 0 44px;
  pointer-events: none;
}
.sc-hero-copy > * { pointer-events: auto; }
.sc-hero-title { max-width: 440px; }
.sc-eyebrow {
  margin: 0 0 6px;
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .22em;
}
.sc-hero-title h1 {
  margin: 0;
  font-size: clamp(44px, 5.4vw, 84px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.04em;
  color: var(--ink);
}
.sc-hero-title .slogan { margin: 10px 0 0; font-size: clamp(20px, 2vw, 28px); font-weight: 800; color: var(--teal-deep); }
.sc-hero-title .sub-slogan { margin: 4px 0 0; color: var(--ink-soft); font-size: 17px; }
.sc-hero-player { justify-self: end; width: min(540px, 100%); }
.sc-hero-player .player-title strong { white-space: nowrap; }
.sc-hero-player .radio-player { margin: 0; background: var(--surface); box-shadow: 0 2px 4px rgba(27, 42, 44, .06), 0 18px 44px rgba(60, 40, 20, .18); }
.sc-scroll-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin: 14px 4px 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
}
.sc-scroll-hint i { width: 2px; height: 26px; background: var(--teal-deep); animation: sc-drip 1.8s var(--sc-ease) infinite; transform-origin: top; }
@keyframes sc-drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- 各幕：巨字在後、收音機在中、卡片在兩側 ---------- */
.sc-intro {
  position: relative;
  display: grid;
  min-height: 170vh;
}
.sc-intro > * { grid-area: 1 / 1; }
.sc-flank {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  z-index: 3;
  align-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 36vw) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  width: min(1480px, calc(100% - 72px));
  margin: 0 auto;
  padding: 110px 0 40px;
  pointer-events: none;
}
.sc-side { display: grid; gap: 14px; align-content: center; pointer-events: none; min-width: 0; }
.sc-side > * { pointer-events: auto; margin: 0; }
.sc-left { justify-items: start; }
.sc-right { justify-items: end; }
.sc-side > .now-playing,
.sc-side > .listen-help,
.sc-side > .weather-now,
.sc-side > .editorial-panel,
.sc-side > .hero-lead,
.sc-side > .listen-note,
.sc-side > .native-player { width: min(370px, 100%); }
.sc-side .hero-lead { padding: 14px 18px; background: var(--surface); border-radius: 16px; }
.sc-side .hero-lead { font-size: 17px; color: var(--ink-soft); }
.sc-side .now-playing,
.sc-side .listen-help,
.sc-side .weather-now,
.sc-side .editorial-panel {
  background: var(--surface);
  border: 1px solid rgba(27, 42, 44, .10);
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(27, 42, 44, .05), 0 16px 40px rgba(60, 40, 20, .14);
}
.sc-side .now-playing, .sc-side .listen-help { padding: 18px 20px; }
.sc-side .listen-note { font-size: 14px; color: var(--ink-soft); }
.sc-side .editorial-panel { max-height: 72vh; overflow: auto; }

.sc-lede {
  padding: 20px 24px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(27, 42, 44, .05), 0 16px 40px rgba(60, 40, 20, .14);
  font-size: clamp(24px, 2.3vw, 38px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
  max-width: 13em;
}
.sc-lede b {
  display: block;
  margin-bottom: 10px;
  font-family: "Anton", sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--orange);
}
.sc-right .sc-lede { text-align: right; }

/* 關於這一幕：左右兩欄直接用原本的 about-section 內容 */
.sc-intro-about { min-height: 150vh; }
.sc-flank.about-section { padding: 110px 0 40px; margin: 0 auto; gap: 20px; align-items: center; }
.sc-flank.about-section .sc-left { width: min(400px, 100%); padding: 24px 26px; background: var(--surface); border-radius: 20px; box-shadow: 0 2px 4px rgba(27, 42, 44, .05), 0 16px 40px rgba(60, 40, 20, .14); }
.sc-flank.about-section h2 { font-size: clamp(32px, 3.2vw, 52px); font-weight: 900; }
.sc-flank.about-section p { margin-top: 14px; }
.sc-flank.about-section dl { grid-template-columns: 1fr; gap: 10px; width: min(360px, 100%); }
.sc-flank.about-section dl div { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; align-items: center; padding: 14px 20px; box-shadow: 0 10px 26px rgba(60, 40, 20, .12); }
.sc-flank.about-section dd { margin: 0; }

/* ---------- 功能面板：整條紙帶蓋過收音機 ---------- */
.sc-panel {
  position: relative;
  z-index: 3;
  padding: 72px 0 96px;
  background: var(--paper);
  border-top: 3px solid var(--teal-deep);
  box-shadow: 0 -30px 60px rgba(60, 40, 20, .10);
}
.sc-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--paper-grain, none);
  background-size: 300px 300px;
  opacity: .5;
  mix-blend-mode: multiply;
}
.sc-panel > .section-shell { position: relative; }
.sc-chapter[hidden] { display: none; }
.sc-chapter .section-head h2 { font-weight: 900; }

/* ---------- 頁尾：深色收尾與巨大字標 ---------- */
.site-footer {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 72px 0 0;
  background: var(--teal-night);
  color: #f4ecdd;
  overflow: hidden;
}
.site-footer p, .site-footer a { color: #f4ecdd; }
.site-footer img { background: #f4ecdd; border-radius: 14px; padding: 6px 10px; }
.sc-wordmark {
  margin: 40px 0 -4vw;
  text-align: center;
  font-family: "Anton", "Impact", sans-serif;
  font-size: 23vw;
  line-height: .86;
  white-space: nowrap;
  color: rgba(244, 236, 221, .13);
  -webkit-mask-image: var(--grain, none);
  mask-image: var(--grain, none);
  -webkit-mask-size: 520px 520px;
  mask-size: 520px 520px;
  user-select: none;
}

/* 迷你播放列要壓在外框內 */
.nr-mini { z-index: 45; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 靜態版（不跑立體）：用插畫收音機，各幕不釘住 ---------- */
.sc-lite-radio { display: none; }
html.no-3d .sc-lite-radio {
  display: block;
  position: relative;
  z-index: 2;
  width: min(520px, 74vw);
  height: auto;
  place-self: center;
  transform: rotate(-9deg);
  filter: drop-shadow(18px 26px 22px rgba(60, 40, 20, .28));
}
html.no-3d .sc-intro { min-height: 0; }
html.no-3d .sc-giant { position: absolute; inset: 0; height: auto; opacity: .22; }
html.no-3d .sc-hero .sc-giant { opacity: 1; }
html.no-3d .sc-flank { position: relative; height: auto; padding: 120px 0 80px; }
html.no-3d .sc-mid { min-height: 220px; background: url("../assets/radio.svg") center / contain no-repeat; filter: drop-shadow(10px 16px 14px rgba(60, 40, 20, .22)); }
html.no-3d .sc-scroll-hint { visibility: hidden; }

/* ---------- 平板與手機直式 ---------- */
@media (max-width: 900px) {
  .sc-frame { border-width: 6px; }
  .site-header { margin: 6px 6px 0; top: 6px; }
  .sc-hero { min-height: 0; }
  .sc-giant-hero { padding: 130px 0 200px; align-items: center; }
  .site-footer { padding-bottom: 110px; }
  .sc-wordmark { margin-bottom: 0; }
  .sc-hero-copy {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(250px, 1fr) auto;
    align-items: stretch;
    width: calc(100% - 36px);
    min-height: 600px;
    padding: 14px 0 24px;
    gap: 0;
  }
  .sc-hero-title { max-width: none; }
  .sc-hero-title h1 { font-size: clamp(40px, 12vw, 64px); }
  .sc-hero-title .sub-slogan { display: none; }
  .sc-hero-player { justify-self: stretch; width: 100%; grid-row: 3; }
  .sc-scroll-hint { justify-content: center; }

  .sc-intro { min-height: 0; display: block; }
  .sc-intro > .sc-giant { height: 100svh; }
  .sc-flank,
  .sc-flank.about-section {
    position: relative;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    width: calc(100% - 36px);
    margin: -34svh auto 0;
    padding: 0 0 12svh;
    gap: 14px;
  }
  .sc-mid { display: none; }
  .sc-side { justify-items: stretch; }
  .sc-side:empty { display: none; }
  .sc-side > * { width: 100% !important; }
  .sc-right .sc-lede { text-align: left; }
  .sc-lede { font-size: clamp(26px, 8vw, 38px); padding: 16px 18px; background: var(--surface); border-radius: 18px; box-shadow: 0 12px 30px rgba(60, 40, 20, .14); max-width: none; }
  .sc-side .editorial-panel { max-height: none; }
  .sc-flank.about-section dl { width: 100%; }
  .sc-panel { padding: 48px 0 64px; }
  .sc-wordmark { font-size: 24vw; }
  .sc-giant .lat { font-size: 34vw; }
  .sc-giant .zh.g3 { font-size: 31vw; }
  .sc-giant .zh.g4 { font-size: 23vw; }
  .sc-intro-about .sc-giant .lat { font-size: 21vw; }
  .sc-intro[data-stage="podcast"] .sc-giant .lat { font-size: 27vw; }
  html.no-3d .sc-flank { margin-top: 0; padding: 40px 0 56px; }
  html.no-3d .sc-lite-radio { width: 58vw; margin: 150px 0 240px; }
  html.no-3d .sc-hero .sc-giant { opacity: .25; }
  html.no-3d .sc-intro > .sc-giant { height: auto; }
  html.no-3d .sc-mid { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-scroll-hint i { animation: none; }
}
@media (prefers-contrast: more) {
  .sc-giant span, .sc-wordmark { -webkit-mask-image: none; mask-image: none; }
}

/* 大字體與特大字體是把整頁放大；巨字、畫布與外框以視窗為準，要縮回來才不會撐破版面 */
html[data-font="large"] .sc-giant, html[data-font="large"] .sc-wordmark, html[data-font="large"] .sc-canvas, html[data-font="large"] .sc-frame { zoom: calc(1 / 1.12); }
html[data-font="xlarge"] .sc-giant, html[data-font="xlarge"] .sc-wordmark, html[data-font="xlarge"] .sc-canvas, html[data-font="xlarge"] .sc-frame { zoom: calc(1 / 1.28); }
