@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/cormorant.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --gold-line: rgba(201, 164, 92, 0.34);
  --gold-dim: rgba(214, 182, 116, 0.62);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
}

body {
  overflow: hidden;
  font-family: 'Cormorant Garamond', 'Songti SC', 'Noto Serif SC', serif;
  color: #E9CD8C;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: default;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

/* 中央极淡的暖光，让黑色有空气感 */
.glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(72% 58% at 50% 46%,
    rgba(128, 96, 42, 0.13) 0%,
    rgba(74, 56, 22, 0.05) 38%,
    rgba(0, 0, 0, 0) 66%);
}

/* 地平线：一条极细的金线 + 上方一层舞台光 */
.horizon {
  position: absolute;
  left: 50%;
  bottom: 7vh;
  width: min(74vw, 1180px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(201, 164, 92, 0) 0%,
    rgba(201, 164, 92, 0.26) 30%,
    rgba(233, 205, 140, 0.38) 50%,
    rgba(201, 164, 92, 0.26) 70%,
    rgba(201, 164, 92, 0) 100%);
  filter: blur(0.3px);
}

.horizon::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 108%;
  height: 190px;
  background: radial-gradient(50% 100% at 50% 100%,
    rgba(201, 164, 92, 0.10) 0%,
    rgba(201, 164, 92, 0.035) 45%,
    rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(132% 100% at 50% 50%,
    rgba(0, 0, 0, 0) 58%,
    rgba(0, 0, 0, 0.42) 90%,
    rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

/* 2% 噪点，吃掉大面积黑的色带 */
.grain {
  position: absolute;
  inset: -40%;
  opacity: 0.032;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ---------- 倒计时 ---------- */
.center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4vw;
  pointer-events: none;
  z-index: 2;
}

.countdown {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  gap: clamp(0.7rem, 1.9vw, 2.2rem);
  user-select: none;

  /* 整行共用一条金属渐变，字与字之间不断层 */
  background-image:
    linear-gradient(100deg,
      rgba(255, 255, 255, 0) 41%,
      rgba(255, 252, 235, 0.62) 50%,
      rgba(255, 255, 255, 0) 59%),
    linear-gradient(180deg,
      #FFFCF0 0%,
      #F6E4B6 13%,
      #E2C174 32%,
      #C09446 52%,
      #7D5B25 72%,
      #A67F39 88%,
      #D8B972 100%);
  background-size: 320% 100%, 100% 100%;
  background-position: -110% 0, 0 0;
  background-blend-mode: soft-light, normal;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: sheen 15s cubic-bezier(0.42, 0, 0.2, 1) infinite;

  filter: drop-shadow(0 0 22px rgba(201, 164, 92, 0.10));
}

@keyframes sheen {
  0%, 58% { background-position: -110% 0, 0 0; }
  100%    { background-position: 210% 0, 0 0; }
}

.unit {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.num {
  font-size: clamp(2.2rem, 6.6vw, 6.1rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.015em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.lbl {
  font-family: 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', serif;
  font-size: clamp(0.7rem, 1.05vw, 0.95rem);
  letter-spacing: 0.38em;
  margin-right: -0.38em;
  color: var(--gold-dim);
  -webkit-text-fill-color: var(--gold-dim);
  text-shadow: none;
}

/* 归零后的 2027 */
.year {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2.6rem, 8.4vw, 7.4rem);
  line-height: 1;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
  opacity: 0;
  transition: opacity 2.4s ease;
  background-image: linear-gradient(180deg,
    #FFFCF0 0%, #F6E4B6 14%, #E2C174 34%,
    #C09446 54%, #7D5B25 74%, #D8B972 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
}

.countdown.is-out { opacity: 0; transition: opacity 1.6s ease; }
.year.is-in { opacity: 1; }

/* ---------- 声音开关 ---------- */
.sound {
  position: fixed;
  right: clamp(1.1rem, 2.4vw, 2.2rem);
  bottom: clamp(1.1rem, 2.4vw, 2.2rem);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, 0.42);
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 0.8s ease, border-color 0.4s ease;
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
}

.sound:hover,
.sound:focus-visible { opacity: 0.95; border-color: rgba(233, 205, 140, 0.7); outline: none; }
.sound.idle { opacity: 0.12; }
.sound.is-muted { opacity: 0.16; border-color: rgba(201, 164, 92, 0.2); }

.sound svg {
  width: 15px;
  height: 15px;
  fill: rgba(233, 205, 140, 0.85);
  stroke: rgba(233, 205, 140, 0.85);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-fill: none;
}
.sound svg .wave { fill: none; }
.sound.is-muted svg .wave { display: none; }

/* ---------- 画布 ---------- */
#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 640px) {
  .countdown { gap: clamp(0.45rem, 1.6vw, 0.9rem); }
  .num { font-size: clamp(1.9rem, 6.4vw, 3.3rem); }
  .lbl { letter-spacing: 0.18em; margin-right: -0.18em; font-size: 0.54rem; }
  .horizon { bottom: 9vh; width: 86vw; }
}

@media (prefers-reduced-motion: reduce) {
  .countdown { animation: none; }
}
