:root {
  --sand: #F4EDDF;
  --warm-white: #FBF7EE;
  --linen: #E8DFCC;
  --stone: #C7B99E;
  --moss: #6E8258;
  --moss-dark: #4E6140;
  --terracotta: #B47656;
  /* 由 --terracotta 以 oklch 降明度推導：原色當 12px 小字在沙色底僅 3.18:1，
     且理論上限（純白底）也只有 3.70:1，永遠到不了 4.5:1 */
  --terracotta-ink: oklch(0.50 0.095 45deg);
  --clay: #A56A4B;
  --charcoal: #3B3A34;
  --soft: #6C6A62;
  --hairline: rgba(59, 58, 52, 0.12);
  --shadow: 0 1px 2px rgba(59, 58, 52, 0.04), 0 8px 32px rgba(59, 58, 52, 0.06);
  --serif: "Noto Serif TC", "Songti TC", "PingFang TC", "Georgia", "Times New Roman", serif;
  --sans: "Noto Sans TC", "PingFang TC", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  /* 流體尺度：一組變數統一驅動全頁留白，取代散落的固定 px */
  --gutter: clamp(20px, 4vw, 32px);
  --sec-y: clamp(48px, 7vw, 88px);
  --radius: clamp(12px, 1.6vw, 16px);
}

img { max-width: 100%; }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--sand);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-top: 64px;
}
@media (max-width: 768px) {
  body { padding-top: 56px; font-size: 15.5px; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(110, 130, 88, 0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(180, 118, 86, 0.08), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 500;
  color: var(--charcoal); letter-spacing: 0.02em;
  /* 折行時平均分配，避免尾行只剩一兩個字 */
  text-wrap: balance;
}
/* 實測：pretty 對中文完全無效果，balance 會把行長均分、根治尾字孤行 */
.hero__lead, .section__desc, .card__desc, .note p, .closing p { text-wrap: balance; }

/* HERO */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: clamp(72px, 11vw, 132px) var(--gutter) clamp(56px, 8vw, 96px);
}
/* 照片改成 <img> 圖層才能吃 srcset／lazy；漸層罩留在 ::after */
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  /* 實測加深：文字帶原本只有 .75 有效不透明度，苔綠小字對比僅 3.38:1 */
  background: linear-gradient(180deg,
    rgba(244, 237, 223, 0.62) 0%,
    rgba(244, 237, 223, 0.90) 58%,
    var(--sand) 100%);
}
.hero__scene {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden;
  pointer-events: none;
  --fall: 760px;
}
.hero__sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hero > *:not(.hero__media):not(.hero__scene) { position: relative; z-index: 2; }
.hero__eyebrow {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.4em; text-transform: uppercase;
  /* 壓在照片上，苔綠不足 4.5:1 → 改 charcoal（量測 6.28:1） */
  color: var(--charcoal); margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(32px, 6.4vw, 64px);
  margin: 0 0 12px; line-height: 1.15;
}
.hero h1 em { font-style: normal; color: var(--moss-dark); }
.hero__period {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 22px);
  /* 22px 不算 WCAG 大字，仍需 4.5:1 */
  color: var(--charcoal);
  margin: 0 0 28px;
  letter-spacing: 0.08em;
}
.hero__lead {
  max-width: 620px; margin: 0 auto;
  color: var(--charcoal);
  font-size: clamp(15px, 1.3vw, 16.5px);
  line-height: 1.9;
}
.hero__divider {
  display: block; width: 60px; height: 1px; margin: clamp(28px, 4vw, 40px) auto 0;
  background: var(--stone);
}

/* SECTION */
section { padding: var(--sec-y) 0; }

.section__head { text-align: center; margin-bottom: clamp(32px, 5vw, 48px); }
.section__eyebrow {
  font-size: 12px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--terracotta-ink); margin: 0 0 10px;
}
.section__title { font-size: clamp(28px, 3.6vw, 36px); margin: 0 0 12px; }
.section__desc { color: var(--soft); max-width: 560px; margin: 0 auto; }

/* CATEGORY */
.category { margin-bottom: clamp(48px, 7vw, 72px); }
.category:last-child { margin-bottom: 0; }

.category__banner {
  /* 固定 240/180px 換成比例盒：超寬螢幕不再把照片壓成細長條 */
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(20px, 3vw, 28px);
  position: relative;
  box-shadow: var(--shadow);
  background: var(--linen);
}
.category__banner img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) brightness(1.02);
}
.category__banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(59, 58, 52, 0) 45%, rgba(59, 58, 52, 0.30) 100%);
  pointer-events: none;
}
/* 標籤給實底霜面藥丸，不靠漸層猜對比——照片亮部也保證 6:1 以上 */
.category__banner-label {
  position: absolute;
  left: clamp(14px, 2.2vw, 22px);
  bottom: clamp(12px, 2vw, 18px);
  z-index: 1;
  color: var(--warm-white);
  background: rgba(59, 58, 52, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-family: var(--serif);
  font-size: clamp(10.5px, 1vw, 12.5px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.category__head {
  display: flex; align-items: baseline; gap: clamp(12px, 2vw, 20px);
  flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--hairline); margin-bottom: 28px;
}
.category__index {
  font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); color: var(--stone);
  line-height: 1; font-weight: 400;
}
.category__title {
  font-size: clamp(19px, 2.2vw, 24px); margin: 0; line-height: 1.3;
}
.category__title small {
  display: block; font-family: var(--sans); font-size: 12px;
  letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--moss-dark); margin-top: 6px; font-weight: 400;
}

.cards {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--warm-white);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(59, 58, 52, 0.06), 0 16px 40px rgba(59, 58, 52, 0.08);
}
.card__name {
  font-family: var(--serif); font-size: 20px; margin: 0 0 4px;
  color: var(--charcoal);
}
.card__en {
  font-size: 12px; letter-spacing: 0.2em; color: var(--terracotta-ink);
  margin: 0 0 14px; font-style: italic;
}
.card__desc { color: var(--soft); font-size: 14.5px; line-height: 1.75; margin: 0; }

/* SCHEDULE */
.schedule { background: linear-gradient(180deg, var(--warm-white) 0%, var(--sand) 100%); }
.schedule .section__head { margin-bottom: 36px; }

.days {
  display: grid; gap: clamp(12px, 1.6vw, 14px);
  /* min() 防護：視窗窄於 260px 時不再撐出橫向捲動 */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.day {
  background: var(--warm-white);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
}
.day__label {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.day__name { font-family: var(--serif); font-size: 20px; margin: 0; }
.day__en { font-size: 11px; letter-spacing: 0.3em; color: var(--stone); }
.slot { display: flex; gap: 14px; padding: 8px 0; align-items: baseline; }
.slot + .slot { border-top: 1px dashed var(--hairline); }
.slot__time {
  font-family: var(--serif); font-size: 15px; color: var(--moss-dark);
  min-width: 56px; letter-spacing: 0.05em;
}
.slot__class { font-size: 14.5px; color: var(--charcoal); }
.slot__class small { display: block; font-size: 11px; color: var(--soft); margin-top: 2px; letter-spacing: 0.15em; }

/* NOTES */
.notes {
  background: var(--warm-white);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.notes__grid {
  display: grid;
  gap: clamp(24px, 3.5vw, 32px);
  /* 原本 769–1023px 是硬三欄、每欄僅約 207px；改 auto-fit 讓平板自動降成兩欄 */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.note h3 {
  font-size: 17px; margin: 0 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.note h3::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--moss);
}
.note p { color: var(--soft); margin: 0; font-size: 14.5px; line-height: 1.8; }

/* CLOSING */
.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: clamp(80px, 12vw, 132px) var(--gutter);
}
.closing__media { position: absolute; inset: 0; z-index: 0; }
.closing__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}
.closing__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(244, 237, 223, 0.92) 0%, rgba(244, 237, 223, 0.82) 100%);
}
.closing > *:not(.closing__media) { position: relative; z-index: 1; }
.closing__line {
  width: 40px; height: 1px; background: var(--stone);
  margin: 0 auto 32px;
}
.closing p {
  font-family: var(--serif); font-size: clamp(20px, 2.6vw, 26px);
  color: var(--charcoal); margin: 0 auto 16px; max-width: 680px; line-height: 1.7;
}
/* 提高 specificity：原本 .closing p (0,1,1) 壓過 .closing__sig (0,1,0)，
   導致這行實際以 26px 襯線 charcoal 渲染，設計意圖從未生效 */
.closing p.closing__sig {
  font-family: var(--sans); font-size: 12px;
  letter-spacing: 0.4em;
  /* 壓在照片上，terracotta 系列到不了 4.5:1 → 用 charcoal */
  color: var(--charcoal);
  text-transform: uppercase; margin: 28px auto 0;
  max-width: none;
}

/* SPACING FOOTER */
.spacer { height: 32px; }

/* ── 落葉：楓葉持續飄過 hero ─────────────────────────────── */
.scene__fall { position: absolute; inset: 0; }
.leaf {
  position: absolute;
  top: -44px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  will-change: transform, opacity;
  animation: leafFall var(--dur) linear var(--delay) infinite;
}
.leaf svg {
  display: block;
  width: 100%; height: 100%;
  fill: var(--c);
  /* 投影讓葉子在照片亮部（逆光天空）也讀得出輪廓 */
  filter: drop-shadow(0 1px 2px rgba(59, 58, 52, 0.30));
  animation: leafSway var(--sway) ease-in-out var(--delay) infinite alternate;
}
@keyframes leafFall {
  0%   { transform: translateY(0);           opacity: 0; }
  6%   {                                     opacity: var(--op); }
  90%  {                                     opacity: var(--op); }
  100% { transform: translateY(var(--fall)); opacity: 0; }
}
@keyframes leafSway {
  from { transform: translateX(-9px) rotate(-28deg); }
  to   { transform: translateX(9px)  rotate(34deg); }
}

/* ── 斷點：桌面 ≥1024 / 平板 641–1023 / 手機 ≤640 ───────────
   注意 768px 那一段是 policies 給的 nav 斷點（header 64→56px），
   body padding-top 必須跟著它切，不可改成別的數字。          */

@media (max-width: 1023px) {
  .hero__scene { --fall: 700px; }
  .category__banner { aspect-ratio: 16 / 8; }
}

@media (max-width: 640px) {
  .hero__scene { --fall: 620px; }
  /* 「九月與十月 · 每週固定時段」在 28px 下會折出單字「段」 */
  .section__title { font-size: 24px; }
  /* 尾字孤行由 text-wrap: balance 處理，不再縮字級遷就字數 */
  /* 手機 hero 較矮，14 片會過於熱鬧，留 8 片 */
  .leaf:nth-of-type(n + 9) { display: none; }
  .category__banner { aspect-ratio: 3 / 2; }
  .category__banner-label { letter-spacing: 0.2em; }
  .day__label { gap: 10px; }
  .slot { gap: 10px; }
  .slot__time { min-width: 48px; }
}

@media (max-width: 400px) {
  .hero__scene { --fall: 560px; }
  /* 390px 下 eyebrow 正好用滿內容寬、零餘裕，360px 就會折行 */
  .hero__eyebrow { font-size: 11.5px; letter-spacing: 0.24em; }
  .closing p.closing__sig { letter-spacing: 0.26em; }
  .leaf:nth-of-type(n + 7) { display: none; }
  .category__banner { aspect-ratio: 4 / 3; }
  .card { padding: 20px 18px; }
  .day { padding: 18px 16px 14px; }
}

/* 使用者要求減少動態時，落葉整層不渲染 */
@media (prefers-reduced-motion: reduce) {
  .scene__fall { display: none; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
