/* 轉色酒莊：整站是同一片葡萄棚的一整年，介面像一張黑色酒標燙金字 */

:root {
  --sans: "PingFang TC", "Noto Sans TC", "Source Han Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Chiron Sung HK", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", serif;
  --label: #141316;
  --label-text: #efece4;
  --gold: #d8b85a;
  --gold-deep: #b8973f;
  --soft: #3a383d;
  --mute: #8d8a84;
  --day-text: #1c191d;
  --night-text: #f4efe4;
  --gutter: clamp(20px, 5.2vw, 96px);
  --warning-height: calc(30px + env(safe-area-inset-bottom, 0px));
  --ruler-height: 60px;
  --band: calc(var(--warning-height) + var(--ruler-height));
  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --cols: repeat(24, 1fr);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0c10;
  color: var(--night-text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { overscroll-behavior: none; }

.display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
}

button { font: inherit; color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--label);
  color: var(--label-text);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

:where(button, a, select, input, [role="slider"]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- 畫面：海報圖先出來，WebGL 準備好才淡入接手 ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  touch-action: none;
  --photo-reserve: 0px;
}

.scene-poster,
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: calc(100% - var(--photo-reserve));
  object-fit: cover;
  object-position: 50% 50%;
}

/* Keep the four quarters aligned with the ruler at every aspect ratio. */
.scene-poster.is-panorama { object-fit: fill; }

.scene-canvas {
  opacity: 0;
}

.scene-canvas.is-ready { opacity: 1; }

/* 首屏可以在條紋上滑來滑去、點一條就過去 */
body[data-station="0"] .scene { cursor: pointer; }
body:not([data-station="0"]) .scene { cursor: ew-resize; }
body.is-dragging .scene { cursor: grabbing; }

/* ---------- 頁首 ---------- */

.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(14px, 2vw, 28px) var(--gutter);
  pointer-events: none;
}

.masthead > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: #f7f2e8;
  text-decoration: none;
  text-shadow: 0 1px 8px #141316, 0 1px 3px #141316b3;
  min-height: 44px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--gold);
  filter: drop-shadow(0 1px 6px rgba(10, 12, 8, 0.5));
}

.brand-text { display: grid; gap: 2px; }
.brand-name { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.2; }
.brand-text small { font-size: 13px; letter-spacing: 0.04em; opacity: 0.92; }

/* ---------- 按鈕 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.4em;
  border: 0;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--label);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover { background: #e4c86e; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }

.btn-ghost {
  background: rgba(20, 19, 22, 0.78);
  color: var(--label-text);
  box-shadow: inset 0 0 0 1px rgba(216, 184, 90, 0.55);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover { background: rgba(20, 19, 22, 0.92); box-shadow: inset 0 0 0 1px var(--gold); }

.btn-line {
  background: none;
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

.btn-line:hover { background: none; box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }

.btn-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.masthead .btn { min-height: 44px; font-size: 14px; }
.masthead .menu-open { min-width: 72px; }

/* ---------- 五站：同一個位置的文字，換站時被那條線掃過去 ---------- */

.stations {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.station {
  position: absolute;
  inset: 0;
  display: none;
  padding: 0 var(--gutter);
}

.station,
.menu {
  -webkit-mask-image: var(--sweep-mask, none);
  mask-image: var(--sweep-mask, none);
  /* The gradient stays fixed in the mask. Only its horizontal position follows the sweep. */
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-position: calc(var(--sweep-x, 0px) - 150vw) 0;
  mask-position: calc(var(--sweep-x, 0px) - 150vw) 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.station.is-active,
.station.is-leaving { display: block; }

.station.is-leaving { pointer-events: none; }
.is-comparing .station { visibility: hidden; }
.is-comparing .masthead > :not(.brand) { visibility: hidden; }
.is-menu-open :is(.station, .masthead, .ruler-band) { visibility: hidden; }

/* 文字底下的柔光：亮的畫面墊淡淡的白，暗的畫面墊淡淡的黑，看得到底下的景 */
.station::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.station[data-tone="day"] { color: var(--day-text); }
.station[data-tone="day"]::before { background: radial-gradient(ellipse 52% 46% at 18% 60%, rgba(247, 243, 234, 0.74), rgba(247, 243, 234, 0.34) 52%, rgba(247, 243, 234, 0) 78%); }
.station[data-tone="dusk"],
.station[data-tone="night"] { color: var(--night-text); }
.station[data-tone="dusk"]::before { background: radial-gradient(ellipse 52% 48% at 18% 60%, rgba(22, 14, 10, 0.58), rgba(22, 14, 10, 0.26) 55%, rgba(22, 14, 10, 0) 80%); }
.station[data-tone="night"]::before { background: radial-gradient(ellipse 52% 48% at 18% 60%, rgba(8, 8, 14, 0.62), rgba(8, 8, 14, 0.28) 55%, rgba(8, 8, 14, 0) 80%); }
.station[data-tone="dusk"] .copy,
.station[data-tone="night"] .copy { text-shadow: 0 1px 12px rgba(8, 8, 12, 0.45); }

/* 棚架下緣約在畫面高三成，文字從它下面排到節氣尺上方，垂直置中 */
.copy {
  position: absolute;
  left: var(--gutter);
  top: 30vh;
  top: 30dvh;
  bottom: calc(var(--band) + 3vh);
  width: min(35rem, 44vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.copy :where(button, a, [tabindex]) { pointer-events: auto; }

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.1em;
  margin: 0 0 0.8rem;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.kicker span:first-child { font-weight: 700; }
.kicker span + span { position: relative; }
.kicker span + span::before {
  content: "";
  position: absolute;
  left: -0.62em;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.title {
  margin: 0;
  font-size: clamp(56px, 6.6vw, 108px);
  line-height: 1.2;
  text-wrap: balance;
}

.title:focus { outline: none; }

#title-0 { font-size: clamp(40px, 4.4vw, 74px); line-height: 1.22; }

.body {
  max-width: 32em;
  margin: 1rem 0 1.4rem;
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

.station[data-tone="day"] .body { font-weight: 500; }

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

/* 第 1 站：三個數字 */
.numbers {
  display: flex;
  gap: clamp(20px, 2.6vw, 40px);
  margin: 0 0 1.5rem;
}

.numbers div { display: grid; gap: 2px; }
.numbers dt { font-size: 13px; letter-spacing: 0.04em; opacity: 0.8; }
.numbers dd { margin: 0; font-size: 14px; }
.numbers b { margin-right: 4px; font-size: clamp(32px, 2.8vw, 44px); line-height: 1.2; }

/* 第 3 站：四張小酒標 */
.labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
  max-width: 30rem;
}

.mini-label {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 82px;
  padding: 14px 16px 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--label);
  color: var(--label-text);
  text-align: left;
  text-shadow: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* 燙金的雙框線 */
.mini-label::before,
.mini-label::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(216, 184, 90, 0.7);
}

.mini-label::before { inset: 5px; }
.mini-label::after { inset: 8px; border-color: rgba(216, 184, 90, 0.3); }
.mini-label b { color: var(--gold); font-size: 21px; line-height: 1.3; }
.mini-label span { font-size: 13px; opacity: 0.85; }
.mini-label:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.36); }

/* 第 5 站：酒窖五步 */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(239, 236, 228, 0.38);
  border-radius: var(--radius);
  background: rgba(20, 19, 22, 0.42);
}

.steps b { color: var(--gold); font-size: 18px; line-height: 1; }

.tour,
.address {
  max-width: 32em;
  margin: 0 0 1.2rem;
  font-size: 15px;
  line-height: 1.75;
}

.address { margin: 1rem 0 0; font-size: 13px; opacity: 0.85; }

/* ---------- 線掃過、滑過四季畫面時的節氣標籤 ---------- */

.term-chip {
  position: fixed;
  left: 0;
  top: clamp(90px, 18dvh, 178px);
  z-index: 15;
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: min(360px, calc(100vw - 24px));
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--label);
  color: var(--label-text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(clamp(12px, calc(var(--chip-x, 0px) - 50%), calc(100vw - 100% - 12px)));
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}

.term-chip.is-visible { opacity: 1; }
.term-chip b { color: var(--gold); font-size: 16px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.term-chip span { font-size: 13px; line-height: 1.5; }
.term-chip span:empty { display: none; }

/* ---------- 節氣尺：首屏每六格對齊一季 ---------- */

.ruler-band {
  position: fixed;
  inset: auto 0 var(--warning-height);
  z-index: 18;
  height: var(--ruler-height);
  background: var(--label);
  color: var(--label-text);
  border-top: 1px solid var(--soft);
}

.ruler { position: relative; height: 100%; }

.ruler ol {
  display: grid;
  grid-template-columns: var(--cols);
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ruler li { position: relative; min-width: 0; }

.ruler button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0 0 6px;
  border: 0;
  background: none;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.ruler button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ruler button:focus-visible { z-index: 1; outline-offset: -2px; }

.ruler button::before {
  content: "";
  width: 1px;
  height: 10px;
  background: currentColor;
  opacity: 0.6;
  transition: height 0.2s var(--ease), width 0.2s var(--ease), background-color 0.2s var(--ease);
}

.ruler button:hover,
.ruler button.is-hover { opacity: 1; }
.ruler button.is-hover::before { height: 18px; }

/* 四季分段：每季第一格左邊一條分隔線 */
.ruler li:nth-child(6n + 1)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 6px;
  width: 1px;
  background: rgba(239, 236, 228, 0.16);
}

.ruler li:first-child::before { display: none; }
.ruler button.is-season { opacity: 0.85; }
.ruler button.is-station { opacity: 1; font-weight: 700; }
.ruler button.is-station::before { height: 16px; opacity: 0.9; }
.ruler button.is-current { color: var(--gold); }
.ruler button.is-current::before,
.ruler button.is-passing::before { width: 3px; height: 22px; background: var(--gold); opacity: 1; }

.ruler .today {
  position: absolute;
  top: 3px;
  left: 50%;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0.9;
  pointer-events: none;
  background: var(--label);
  color: var(--gold);
}

.warning {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  display: grid;
  place-items: center;
  min-height: var(--warning-height);
  margin: 0;
  padding: 3px 12px calc(3px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--soft);
  background: var(--label);
  color: var(--label-text);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- 第 2 站：夏果與冬果對照，中間的線可以拖 ---------- */

.compare {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.compare[hidden] { display: none; }

.compare-side {
  position: absolute;
  bottom: calc(var(--band) + 16px);
  display: grid;
  gap: 10px;
  width: min(300px, 38vw);
  padding: 20px 22px;
  border-radius: var(--radius);
  background: rgba(20, 19, 22, 0.82);
  color: var(--label-text);
  box-shadow: inset 0 0 0 1px rgba(216, 184, 90, 0.45), 0 14px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.compare-summer { left: var(--gutter); }
.compare-winter { right: var(--gutter); }
.compare-summer { clip-path: inset(0 var(--covered, 0px) 0 0); }
.compare-winter { clip-path: inset(0 0 0 var(--covered, 0px)); }
.compare-side h2 { margin: 0; color: var(--gold); font-size: 30px; line-height: 1.25; }
.compare-side dl { display: grid; gap: 8px; margin: 0; }
.compare-side dl div { display: grid; grid-template-columns: 3em 1fr; gap: 10px; font-size: 15px; line-height: 1.6; }
.compare-side dt { opacity: 0.7; }
.compare-side dd { margin: 0; }

.compare-handle {
  position: absolute;
  top: 0;
  bottom: var(--band);
  left: var(--handle, 50vw);
  width: 48px;
  margin-left: -24px;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}

.compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 248, 228, 0.9);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
}

.compare-handle span {
  position: absolute;
  top: 50%;
  left: calc(50% + var(--grip, 0px));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--label);
  box-shadow: inset 0 0 0 1px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
}

.compare-handle span::before,
.compare-handle span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}

.compare-handle span::before { left: 12px; transform: translateY(-50%) rotate(45deg); }
.compare-handle span::after { right: 12px; transform: translateY(-50%) rotate(-135deg); }

.compare-close {
  position: absolute;
  top: clamp(14px, 2vw, 28px);
  right: var(--gutter);
  pointer-events: auto;
}

/* ---------- 面板：做成酒標 ---------- */

.sheet-layer {
  position: fixed;
  inset: 0 0 var(--warning-height);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.sheet-layer[hidden] { display: none; }

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in 0.25s var(--ease);
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px - var(--warning-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--mute) var(--label);
  color-scheme: dark;
  padding: 26px 28px 28px;
  border-radius: var(--radius);
  background: var(--label);
  color: var(--label-text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: sheet-in 0.25s var(--ease);
}

.sheet:focus { outline: none; }

.sheet-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  min-width: 64px;
  min-height: 44px;
  margin: -10px -12px 0 12px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--label);
  color: var(--label-text);
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(239, 236, 228, 0.3);
}

.sheet-close:hover { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }

.sheet h2 { margin: 6px 0 10px; color: var(--gold); font-size: clamp(30px, 3.2vw, 40px); line-height: 1.25; }
.sheet p { margin: 0 0 14px; font-size: 15px; line-height: 1.8; }

.sheet-photo {
  display: block;
  width: calc(100% + 56px);
  max-width: none;
  height: auto;
  margin: -26px -28px 20px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.sheet-rows,
.label-rows { display: grid; gap: 0; margin: 0 0 16px; }

.sheet-rows div,
.label-rows div {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(239, 236, 228, 0.14);
  font-size: 15px;
  line-height: 1.65;
}

.sheet-rows dt,
.label-rows dt { color: var(--mute); }
.sheet-rows dd,
.label-rows dd { margin: 0; }
.sheet-note { color: var(--mute); font-size: 14px; }
.sheet h2, .label-face h2 { text-wrap: balance; }

/* 酒標：正標與背標疊在同一格，按「看背標」整張翻過去 */
.bottle-label {
  display: grid;
  margin: 8px 0 18px;
  perspective: 1400px;
}

.label-face {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 30px 26px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(216, 184, 90, 0.08), rgba(216, 184, 90, 0) 70%),
    #0f0e11;
  text-align: center;
  backface-visibility: hidden;
  transition: transform 0.7s var(--ease);
}

.label-face::before,
.label-face::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(216, 184, 90, 0.75);
}

.label-face::before { inset: 8px; }
.label-face::after { inset: 12px; border-color: rgba(216, 184, 90, 0.3); }

.label-back { transform: rotateY(-180deg); text-align: left; align-items: stretch; }
.bottle-label.is-flipped .label-front { transform: rotateY(180deg); }
.bottle-label.is-flipped .label-back { transform: rotateY(0deg); }

.label-house { margin: 0 0 18px !important; color: var(--mute); font-size: 13px !important; letter-spacing: 0.1em; }
.label-face h2 { margin: 0 0 4px; font-size: clamp(38px, 5vw, 52px); }
.label-kind { margin: 0 0 22px !important; color: var(--gold); font-size: 14px !important; letter-spacing: 0.1em; }
.label-front .label-rows { width: 100%; text-align: left; }
.label-warning { margin: 4px 0 18px !important; padding: 10px 12px; border: 1px solid rgba(239, 236, 228, 0.4); font-size: 13px !important; line-height: 1.7 !important; text-align: center; }
.label-flip { margin-top: auto; align-self: center; }

/* 預約表單 */
.sheet-form { display: grid; gap: 14px; }
.sheet-form label { display: grid; gap: 6px; font-size: 14px; color: var(--mute); }
.sheet-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.sheet-form :where(select, input:not([type="checkbox"])) {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(239, 236, 228, 0.3);
  border-radius: var(--radius);
  background: #1d1b20;
  color: var(--label-text);
  font: inherit;
  font-size: 16px;
}

.sheet-form :where(select, input):hover { border-color: rgba(239, 236, 228, 0.55); }

.sheet-form .check {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--label-text);
  font-size: 15px;
}

.sheet-form .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.sheet-form .check .field-error { grid-column: 2; }
.sheet-form [aria-invalid="true"] { border-color: #e59a7c; }
.field-error { color: #f0b49c; font-size: 13px; }
.sheet-form .btn { justify-self: start; min-width: 10em; }

.form-done { text-align: left; }
.form-done:focus { outline: none; }

.stamp {
  display: inline-block;
  margin: 6px 0 14px !important;
  padding: 6px 16px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 26px !important;
  line-height: 1.3 !important;
  transform: rotate(-4deg);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

/* ---------- 全螢幕選單：畫面先被掃成夜裡的葡萄園，五站浮在上面 ---------- */

.menu {
  position: fixed;
  inset: 0 0 var(--warning-height);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: calc(78px + env(safe-area-inset-top, 0px)) var(--gutter) 32px;
  background: linear-gradient(90deg, rgba(6, 6, 10, 0.72), rgba(6, 6, 10, 0.4) 55%, rgba(6, 6, 10, 0.12));
  color: var(--night-text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu[hidden] { display: none; }

.menu-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 6vw, 96px);
  width: 100%;
  margin: auto 0;
}

.menu-close {
  position: absolute;
  top: clamp(14px, 2vw, 28px);
  right: var(--gutter);
  min-height: 44px;
}

.menu-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.menu-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.menu-list b { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.25; transition: color 0.2s var(--ease); }
.menu-list span { font-size: 15px; opacity: 0.82; }
.menu-list button:hover b,
.menu-list button[aria-current="true"] b { color: var(--gold); }

.menu-foot { display: grid; gap: 14px; justify-items: start; padding-bottom: 8px; }
.menu-foot p { margin: 0; font-size: 14px; line-height: 1.8; opacity: 0.9; }

.menu.is-open .menu-list li,
.menu.is-open .menu-foot {
  animation: menu-rise 0.25s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.025s);
}

.menu-list li:nth-child(2) { --i: 1; }
.menu-list li:nth-child(3) { --i: 2; }
.menu-list li:nth-child(4) { --i: 3; }
.menu-list li:nth-child(5) { --i: 4; }
.menu-foot { --i: 5; }

@keyframes menu-rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- 窄螢幕與直式：直式取景，文字排在下半 ---------- */

@media (max-width: 900px), (max-aspect-ratio: 4/5) {
  :root { --ruler-height: 50px; }

  .copy {
    top: auto;
    bottom: calc(var(--band) + 18px);
    width: auto;
    right: var(--gutter);
    justify-content: flex-end;
  }

  .station[data-tone="day"]::before { background: linear-gradient(to top, rgba(247, 243, 234, 0.88), rgba(247, 243, 234, 0.6) 45%, rgba(247, 243, 234, 0) 72%); }
  .station[data-tone="dusk"]::before { background: linear-gradient(to top, rgba(22, 14, 10, 0.78), rgba(22, 14, 10, 0.45) 45%, rgba(22, 14, 10, 0) 72%); }
  .station[data-tone="night"]::before { background: linear-gradient(to top, rgba(8, 8, 14, 0.8), rgba(8, 8, 14, 0.45) 45%, rgba(8, 8, 14, 0) 72%); }

  .title { font-size: clamp(42px, 11vw, 64px); }
  #title-0 { font-size: clamp(32px, 8.4vw, 48px); }
  .body { margin: 0.7rem 0 1rem; font-size: 15px; line-height: 1.75; }
  .numbers { margin-bottom: 1rem; }
  .labels { gap: 8px; }
  .mini-label { min-height: 70px; padding: 12px 14px 10px; }
  .mini-label b { font-size: 18px; }

  .ruler button { gap: 0; font-size: 0; }
  .ruler button.is-station { gap: 4px; font-size: 11px; }
  .ruler .today { top: 2px; font-size: 10px; padding: 0 4px; }
  .warning { font-size: 12px; }

  .compare-side { width: min(260px, calc(50vw - 16px)); padding: 14px 16px; }
  .compare-summer { left: 12px; }
  .compare-winter { right: 12px; }
  .compare-side h2 { font-size: 24px; }
  .compare-side dl div { grid-template-columns: 2.6em 1fr; gap: 8px; font-size: 13px; }

  .menu { background: linear-gradient(to top, rgba(6, 6, 10, 0.86), rgba(6, 6, 10, 0.63) 60%, rgba(6, 6, 10, 0.32)); }
  .menu-inner { grid-template-columns: 1fr; }
  .menu-list b { font-size: clamp(26px, 7.6vw, 36px); }
}

@media (max-width: 560px) {
  .masthead-cta { display: none; }
  .brand-text small { display: none; }
  .actions .btn { flex: 1 1 auto; }
  .steps li { padding: 4px 10px 4px 6px; font-size: 14px; }
  .sheet-layer { padding: 0; align-items: end; }
  .sheet { width: 100%; max-height: calc(100dvh - 40px - var(--warning-height)); padding: 22px 20px 26px; border-radius: 10px 10px 0 0; }
  .sheet-photo { width: calc(100% + 40px); margin: -22px -20px 18px; }
  .sheet-form .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sheet-form .pair:has([name="date"]) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }
  .has-form .sheet-photo { max-height: 170px; }
  .label-face { padding: 30px 22px 22px; }
}

@media (max-aspect-ratio: 4/5) {
  .scene {
    --photo-reserve: clamp(100px, calc(100dvh - 132vw), 275px);
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--photo-reserve) - 105px), transparent calc(100% - var(--photo-reserve)));
  }
  .station[data-tone="day"]::before {
    background: linear-gradient(to top, #d9d4c9 15%, #e8e3d7 29%, #eee9ddbb 40%, #eee9dd00 61%);
  }
  .station[data-tone="dusk"]::before,
  .station[data-tone="night"]::before {
    background: linear-gradient(to top, #0d0c10 13%, #0d0c10d4 35%, #0d0c1000 65%);
  }
  .copy { bottom: calc(var(--band) + 18px); }
}

@media (max-height: 780px) and (min-width: 901px) {
  .title { font-size: clamp(44px, 5.4vw, 80px); }
  #title-0 { font-size: clamp(36px, 3.8vw, 58px); }
  .body { margin: 0.6rem 0 1rem; font-size: 15px; }
  .copy { top: 24vh; }
  .numbers b { font-size: 34px; }
  .mini-label { min-height: 68px; }
  .compare-side { padding: 12px 16px; gap: 6px; }
  .compare-side h2 { font-size: 24px; }
  .compare-side dl { gap: 5px; }
  .compare-side dl div { font-size: 14px; line-height: 1.45; }
}

@media (min-width: 761px) {
  .sheet.has-form { width: min(940px, 100%); }
  .has-form .sheet-body {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
    column-gap: 30px;
    align-items: start;
    align-content: start;
  }
  .has-form .sheet-photo {
    grid-row: 1 / span 3;
    width: 100%;
    height: 100%;
    max-height: min(530px, 70dvh);
    min-height: 260px;
    margin: 0;
  }
}

@media (max-width: 560px) {
  .ruler button.is-station span { overflow: visible; max-width: none; }
  .ruler .is-current { font-size: 12px; }
  .sheet-photo { max-height: 218px; }
}

@media (max-width: 360px) {
  .sheet-form .pair,
  .sheet-form .pair:has([name="date"]) { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
