/* 伊亞咖啡民宿 — 白牆與鈷藍。設計規則見 DESIGN.md */

/* ---------- tokens ---------- */
:root {
  --wash: #F8F7F3;
  --paper: #FFFFFF;
  --tint: #EAF0F9;
  --line: #D9DBD6;
  --ink: #14213D;
  --ink-2: #4B566B;
  --cobalt: #1E4FA8;
  --cobalt-deep: #163E87;
  --on-cobalt: #FFFFFF;
  --lamp: #F2B544;
  --night: #14213D;          /* 頁尾與照片上的深色面，兩種模式相同 */
  --on-night: #EEF1F6;
  --on-night-2: #B9C3D4;

  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Heiti TC", system-ui, sans-serif;
  --latin: "Fraunces", Georgia, serif;

  --fs-xs: 0.875rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.625rem;
  --fs-xl: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --fs-2xl: clamp(2rem, 1.4rem + 3.6vw, 3.75rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --sec-y: clamp(72px, 11vw, 136px);
  --gutter: clamp(20px, 4vw, 40px);
  --max: 1200px;

  --r-sm: 6px;
  --r-md: 14px;
  --r-pill: 999px;
  --r-arch: 999px 999px 14px 14px;
  --shadow: 0 1px 2px rgb(20 33 61 / .06), 0 10px 30px rgb(20 33 61 / .08);
  --bar-h: 68px;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wash: #0E1626; --paper: #152036; --tint: #16243F; --line: #2A3652;
    --ink: #EEF1F6; --ink-2: #AEB8C9; --cobalt: #8FB2F2; --cobalt-deep: #B5CCF7; --on-cobalt: #0E1626;
    --night: #0A111E;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wash: #0E1626; --paper: #152036; --tint: #16243F; --line: #2A3652;
  --ink: #EEF1F6; --ink-2: #AEB8C9; --cobalt: #8FB2F2; --cobalt-deep: #B5CCF7; --on-cobalt: #0E1626;
  --night: #0A111E;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--wash); color: var(--ink);
  font: 400 var(--fs-base)/1.8 var(--sans); letter-spacing: .01em;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.3; letter-spacing: .02em; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--cobalt-deep); text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
address { font-style: normal; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--cobalt); color: var(--on-cobalt); border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sec { padding: var(--sec-y) 0; }
.sec__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5) var(--s-7); margin-bottom: var(--s-7); }

.eyebrow { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: 500; letter-spacing: .12em; color: var(--cobalt); margin-bottom: var(--s-4); }
.eyebrow .num { font-family: var(--latin); font-style: italic; font-size: var(--fs-md); letter-spacing: 0; }
.eyebrow .num::after { content: ""; display: inline-block; width: 28px; height: 1px; background: currentColor; margin-left: var(--s-3); vertical-align: middle; }
.h2 { font-size: var(--fs-xl); }
.lead { font-size: var(--fs-md); line-height: 1.85; color: var(--ink-2); max-width: 34em; margin-top: var(--s-5); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: 10px 22px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; transition: background-color .2s, color .2s, border-color .2s;
}
.btn--lg { min-height: 52px; padding: 12px 28px; font-size: var(--fs-base); }
.btn--primary { background: var(--cobalt); color: var(--on-cobalt); }
.btn--primary:hover { background: var(--cobalt-deep); color: var(--on-cobalt); }
.btn--outline { border-color: var(--cobalt); color: var(--cobalt); background: transparent; }
.btn--outline:hover { background: var(--tint); color: var(--cobalt-deep); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link { font-weight: 500; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.icon-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.bar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--wash) 94%, transparent); border-bottom: 1px solid transparent; transition: border-color .3s; }
.bar.is-scrolled { border-bottom-color: var(--line); }
.bar__in { display: flex; align-items: center; gap: var(--s-6); height: var(--bar-h); max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 30px; height: 18px; fill: none; stroke: var(--cobalt); stroke-width: 3; stroke-linecap: round; }
.brand__en { font-family: var(--latin); font-style: italic; font-size: 1.6rem; line-height: 1; color: var(--cobalt); }
.brand__zh { font-family: var(--serif); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .14em; }
.nav { display: flex; gap: var(--s-5); }
.nav a { color: var(--ink); text-decoration: none; font-size: var(--fs-sm); padding: 8px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover { color: var(--cobalt); border-bottom-color: var(--cobalt); }
.menu-btn { display: none; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); font-size: var(--fs-sm); }
.menu-btn__icon { display: grid; gap: 5px; width: 16px; }
.menu-btn__icon i { display: block; height: 1.5px; background: currentColor; transition: transform .25s; }
.menu-btn[aria-expanded="true"] .menu-btn__icon i:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__icon i:last-child { transform: translateY(-3.25px) rotate(-45deg); }
.drawer { border-top: 1px solid var(--line); background: var(--wash); padding: var(--s-3) var(--gutter) var(--s-5); }
.drawer a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: var(--fs-md); }

@media (max-width: 1080px) { .nav { gap: var(--s-4); } .brand__zh { display: none; } }
@media (max-width: 900px) {
  .nav, .bar__book { display: none; }
  .menu-btn { display: inline-flex; }
  .brand__zh { display: inline; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(16px, 5vw, 64px) 0 var(--s-7); }
.hero__grid { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: var(--s-7); }
.hero__title { font-size: var(--fs-2xl); line-height: 1.22; letter-spacing: .03em; }
.hero__title .ln { display: block; white-space: nowrap; }
.hl { color: var(--cobalt); }
.hero__en { margin-top: var(--s-5); font-family: var(--latin); font-style: italic; font-size: var(--fs-md); color: var(--ink-2); line-height: 1.5; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__photo { border-radius: var(--r-arch); overflow: hidden; aspect-ratio: 5 / 5.4; background: var(--tint); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s-7); border-top: 1px solid var(--line); }
.facts li { padding: var(--s-5) var(--s-4) 0 0; display: grid; gap: 2px; }
.facts li + li { padding-left: var(--s-5); border-left: 1px solid var(--line); }
.facts b { font-family: var(--serif); font-weight: 600; font-size: var(--fs-lg); color: var(--cobalt); line-height: 1.3; }
.facts span { font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .hero__photo { aspect-ratio: 4 / 3; max-height: 52vh; order: -1; }
  .hero__cta .btn { flex: 1 1 auto; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts li { padding-bottom: var(--s-4); }
}

.wave { display: block; width: 100%; height: 28px; fill: none; stroke: var(--cobalt); stroke-width: 2; opacity: .55; }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s-8); align-items: center; }
.stats { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); margin: var(--s-6) 0 0; }
.stats div { display: grid; }
.stats dt { font-family: var(--latin); font-style: italic; font-size: 2.25rem; line-height: 1.1; color: var(--cobalt); }
.stats dd { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.about__photos { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-4); align-items: end; }
.arch { border-radius: var(--r-arch); overflow: hidden; background: var(--tint); }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch--tall { aspect-ratio: 3 / 4.4; }
.arch--short { aspect-ratio: 3 / 3.6; margin-bottom: var(--s-8); }
.quote { margin: var(--s-9) auto 0; max-width: 720px; text-align: center; }
.quote p { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.6; }
.quote p::before, .quote p::after { color: var(--cobalt); }
.quote p::before { content: "「"; }
.quote p::after { content: "」"; }
.quote footer { margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--ink-2); }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6); margin-top: var(--s-9); padding-top: var(--s-7); border-top: 1px solid var(--line); }
.points svg { width: 32px; height: 32px; fill: none; stroke: var(--cobalt); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--s-4); }
.points h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.points p { color: var(--ink-2); }
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .points { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ---------- rooms ---------- */
.rooms { background: var(--paper); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 40px; padding: 6px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-size: var(--fs-sm); color: var(--ink); }
.chip:hover { border-color: var(--cobalt); color: var(--cobalt); }
.chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.rooms__count { font-size: var(--fs-xs); color: var(--ink-2); margin-bottom: var(--s-4); }
.rooms__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-7) var(--s-5); }
.room[hidden] { display: none; }
.room__btn { display: grid; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); }
.room__photo { position: relative; aspect-ratio: 3 / 3.8; border-radius: var(--r-arch); overflow: hidden; background: var(--tint); }
.room__photo img { width: 100%; height: 100%; object-fit: cover; }
.room__more { position: absolute; right: 12px; bottom: 12px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--paper); color: var(--ink); font-size: var(--fs-xs); }
.room__where { margin-top: var(--s-4); font-size: var(--fs-xs); color: var(--cobalt); letter-spacing: .08em; font-weight: 500; }
.room__name { font-family: var(--serif); font-weight: 600; font-size: var(--fs-lg); line-height: 1.3; margin-top: 2px; }
.room__en { font-family: var(--latin); font-style: italic; color: var(--ink-2); font-size: var(--fs-sm); }
.room__line { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.7; }
.room__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.tag { padding: 2px 10px; border-radius: var(--r-sm); background: var(--tint); color: var(--ink); font-size: var(--fs-xs); line-height: 1.7; }
.room__btn:hover .room__name { color: var(--cobalt); }
.note { margin-top: var(--s-7); font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 1080px) { .rooms__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .rooms__grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-6) var(--s-4); } }
@media (max-width: 520px) {
  .rooms__grid { gap: var(--s-6) var(--s-3); }
  .room__name { font-size: var(--fs-md); }
  .room__line { display: none; }
  .room__more { right: 8px; bottom: 8px; padding: 2px 8px; }
  .tag { padding: 1px 7px; }
}

/* ---------- dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgb(10 17 30 / .72); }
.room-dlg { width: min(1100px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow); }
.room-dlg__in { display: grid; grid-template-columns: 1.35fr 1fr; position: relative; }
.room-dlg__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.room-dlg__media { background: var(--tint); padding: var(--s-4); display: grid; gap: var(--s-3); min-width: 0; }
.room-dlg__stage { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--line); }
.room-dlg__stage img { width: 100%; height: 100%; object-fit: cover; }
.room-dlg__ctrl, .lightbox__ctrl { display: flex; align-items: center; justify-content: center; gap: var(--s-4); }
.room-dlg__count, .lightbox__count { min-width: 4.5em; text-align: center; font-family: var(--latin); font-style: italic; font-size: var(--fs-sm); color: var(--ink-2); }
.room-dlg__thumbs { display: flex; gap: var(--s-2); overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.room-dlg__thumbs button { flex: 0 0 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--line); opacity: .7; }
.room-dlg__thumbs button[aria-current="true"] { border-color: var(--cobalt); opacity: 1; }
.room-dlg__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.room-dlg__info { padding: var(--s-7) var(--s-6) var(--s-6); display: flex; flex-direction: column; overflow-y: auto; }
.room-dlg__where { margin-bottom: var(--s-2); }
.room-dlg__title { font-size: var(--fs-xl); }
.room-dlg__en { font-family: var(--latin); font-style: italic; color: var(--ink-2); }
.room-dlg__desc { margin-top: var(--s-4); color: var(--ink-2); }
.spec { margin: var(--s-5) 0 var(--s-6); display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); }
.spec dt, .spec dd { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.spec dt { color: var(--ink-2); padding-right: var(--s-5); }
.spec dd { margin: 0; }
.room-dlg__info .btn { margin-top: auto; align-self: start; }
@media (max-width: 820px) {
  .room-dlg { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .room-dlg__in { grid-template-columns: 1fr; height: 100%; overflow-y: auto; }
  .room-dlg__info { overflow: visible; padding: var(--s-5) var(--gutter) var(--s-7); }
  .room-dlg__close { position: fixed; }
}

.lightbox { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; background: rgb(10 17 30 / .96); color: var(--on-night); display: none; }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; padding: var(--s-8) var(--s-4) var(--s-5); }
.lightbox__fig { max-width: min(1400px, 100%); max-height: 100%; display: grid; place-items: center; min-height: 0; height: 100%; }
.lightbox__fig img { width: auto; max-width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 6px; }
.lightbox__close { position: absolute; top: 12px; right: 12px; }
.lightbox .icon-btn { background: transparent; color: var(--on-night); border-color: rgb(255 255 255 / .3); }
.lightbox .icon-btn:hover { border-color: #fff; }
.lightbox__count { color: var(--on-night-2); }

/* ---------- cafe ---------- */
.cafe { background: var(--tint); }
.cafe__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: start; }
.perk { margin-top: var(--s-6); padding: var(--s-5); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow); }
.perk__title { font-size: var(--fs-sm); font-family: var(--sans); font-weight: 500; letter-spacing: .12em; color: var(--cobalt); margin-bottom: var(--s-3); }
.perk li { display: grid; grid-template-columns: 6.5em 1fr; gap: var(--s-4); padding: var(--s-3) 0; align-items: baseline; }
.perk li + li { border-top: 1px solid var(--line); }
.perk b { white-space: nowrap; font-family: var(--serif); font-size: var(--fs-lg); color: var(--cobalt); line-height: 1.3; }
.perk small { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.cafe__photo { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 11; }
.cafe__photo img { width: 100%; height: 100%; object-fit: cover; }
.menu { margin-top: var(--s-6); }
.menu__title { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.menu__title small { font-family: var(--sans); font-weight: 400; font-size: var(--fs-xs); color: var(--ink-2); margin-left: var(--s-2); letter-spacing: .04em; }
.menu li { display: flex; align-items: baseline; gap: var(--s-3); padding: 8px 0; }
.menu i { flex: 1; border-bottom: 1px dotted var(--ink-2); opacity: .5; transform: translateY(-4px); }
.menu em { font-style: italic; font-family: var(--latin); font-size: var(--fs-md); color: var(--cobalt); }
.menu .link { display: inline-block; margin-top: var(--s-3); }
@media (max-width: 900px) { .cafe__grid { grid-template-columns: 1fr; gap: var(--s-7); } }

/* ---------- gallery ---------- */
.tabs { display: inline-flex; padding: 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--paper); }
.tabs button { min-height: 40px; padding: 6px 20px; border: 0; border-radius: var(--r-pill); background: transparent; font-size: var(--fs-sm); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--cobalt); color: var(--on-cobalt); }
.gallery__grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; grid-auto-flow: dense; gap: var(--s-3); }
.gallery__grid li:nth-child(5n+1) { grid-column: span 2; grid-row: span 2; }
.gallery__grid button { width: 100%; height: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--tint); }
.gallery__grid img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 820px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; } }

/* ---------- stay ---------- */
.stay { background: var(--paper); }
.stay__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--s-8); align-items: start; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-top: var(--s-6); }
.times div { padding: var(--s-5); border-radius: var(--r-md); background: var(--tint); display: grid; }
.times div > span { font-size: var(--fs-xs); color: var(--ink-2); letter-spacing: .06em; }
.times b { font-family: var(--latin); font-style: italic; font-weight: 500; font-size: 2.75rem; line-height: 1.2; color: var(--cobalt); }
.times small { font-size: var(--fs-xs); color: var(--ink-2); }
.info { margin: 0; border-top: 1px solid var(--line); }
.info div { display: grid; grid-template-columns: 7em 1fr; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.info dt { font-weight: 500; }
.info dd { margin: 0; color: var(--ink-2); }
@media (max-width: 900px) { .stay__grid { grid-template-columns: 1fr; gap: var(--s-7); } }
@media (max-width: 420px) { .info div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- access ---------- */
.access__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; }
.addr { margin-top: var(--s-5); font-size: var(--fs-md); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.route { position: relative; display: grid; gap: var(--s-5); padding-left: 36px; }
.route::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; border-left: 2px dashed var(--cobalt); opacity: .5; }
.route li { position: relative; display: grid; }
.route li::before { content: ""; position: absolute; left: -33px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--wash); border: 2px solid var(--cobalt); }
.route b { font-weight: 500; }
.route span { font-size: var(--fs-sm); color: var(--ink-2); }
.route .is-home { padding: var(--s-4) var(--s-5); margin-left: -12px; border-radius: var(--r-md); background: var(--cobalt); color: var(--on-cobalt); }
.route .is-home::before { left: -21px; top: 22px; background: var(--lamp); border-color: var(--lamp); }
.route .is-home b { font-family: var(--serif); font-size: var(--fs-md); }
.route .is-home span { color: inherit; opacity: .85; font-family: var(--latin); font-style: italic; }
@media (max-width: 820px) { .access__grid { grid-template-columns: 1fr; gap: var(--s-7); } }

/* ---------- finale / contact ---------- */
.finale { position: relative; padding: var(--sec-y) 0; background: var(--night); overflow: hidden; }
.finale__bg { position: absolute; inset: 0; }
.finale__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.finale .wrap { position: relative; }
.finale__card { max-width: 560px; padding: clamp(28px, 5vw, 48px); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow); }
.finale__en { font-family: var(--latin); font-style: italic; font-size: var(--fs-md); color: var(--cobalt); margin-bottom: var(--s-2); }
.finale__card .h2 { margin-bottom: var(--s-5); }
.contact { margin-top: var(--s-6); border-top: 1px solid var(--line); }
.contact li { display: grid; grid-template-columns: 6em 1fr; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); align-items: start; }
.contact li > span { font-size: var(--fs-sm); color: var(--ink-2); }
.contact a { word-break: break-all; }
.contact__line img { width: 112px; height: 112px; margin-top: var(--s-2); border-radius: var(--r-sm); background: #fff; padding: 6px; }

/* ---------- footer ---------- */
.foot { background: var(--night); color: var(--on-night-2); padding: 0 0 var(--s-8); font-size: var(--fs-sm); }
.wave--foot { stroke: var(--lamp); opacity: .7; margin-bottom: var(--s-7); }
.foot__in { display: grid; gap: var(--s-2); }
.foot__brand { font-family: var(--serif); font-weight: 600; color: var(--on-night); font-size: var(--fs-md); margin-bottom: var(--s-2); }
.foot__brand .brand__en { color: var(--lamp); margin-right: 6px; }
.foot__note { font-size: var(--fs-xs); }

/* ---------- mobile booking bar ---------- */
.mbook { display: none; }
@media (max-width: 900px) {
  .mbook {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s-2);
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--wash); border-top: 1px solid var(--line);
  }
  .mbook .btn--outline { background: var(--paper); }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* =====================================================================
   動態（只在 html.motion 時生效；選「減少動態效果」或不支援時，內容一律直接顯示）
   ===================================================================== */
:root {
  --ease: cubic-bezier(.16, 1, .3, 1);      /* 進場：快起慢收 */
  --ease-io: cubic-bezier(.65, 0, .35, 1);  /* 遮罩、轉場：對稱 */
  --t0: 0s;                                  /* 首頁進場起點；有開場幕時延後 */
}
.has-curtain { --t0: .85s; }

/* ---------- 開場幕：每個瀏覽階段只播一次，不擋操作超過 1.5 秒 ---------- */
.curtain { display: none; }
.motion.has-curtain .curtain {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--cobalt); color: var(--on-cobalt); pointer-events: none;
  animation: curtainUp .9s var(--ease-io) .75s forwards;
}
.curtain svg { width: 72px; height: 44px; fill: none; stroke: var(--lamp); stroke-width: 2.4; stroke-linecap: round; }
.curtain path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s var(--ease-io) .05s forwards; }
.curtain span { font-family: var(--latin); font-style: italic; font-size: 2.75rem; line-height: 1; opacity: 0; animation: fadeUp .6s var(--ease) .25s forwards; }
@keyframes curtainUp { to { transform: translateY(-100%); visibility: hidden; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 頁首：往下捲收起、往上捲出現，底部一條閱讀進度 ---------- */
.bar { transition: transform .5s var(--ease), border-color .3s; }
.motion .bar.is-hidden { transform: translateY(-100%); }
.bar__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--cobalt); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.motion .drawer:not([hidden]) a { animation: fadeUp .5s var(--ease) both; }
.motion .drawer a:nth-child(2) { animation-delay: .04s; } .motion .drawer a:nth-child(3) { animation-delay: .08s; }
.motion .drawer a:nth-child(4) { animation-delay: .12s; } .motion .drawer a:nth-child(5) { animation-delay: .16s; }
.motion .drawer a:nth-child(6) { animation-delay: .2s; }  .motion .drawer a:nth-child(7) { animation-delay: .24s; }

/* ---------- 首頁進場 ---------- */
.hero__title .ln { overflow: hidden; padding-bottom: .06em; }
.hero__title .ln > span { display: inline-block; }
.motion .hero .eyebrow { animation: fadeUp .9s var(--ease) calc(var(--t0) + .25s) both; }
.motion .hero__title .ln > span { animation: lineUp 1.1s var(--ease) calc(var(--t0) + .35s) both; }
.motion .hero__title .ln + .ln > span { animation-delay: calc(var(--t0) + .47s); }
.motion .hero__en { animation: fadeUp 1s var(--ease) calc(var(--t0) + .7s) both; }
.motion .hero__cta .btn { animation: fadeUp 1s var(--ease) calc(var(--t0) + .82s) both; }
.motion .hero__cta .btn + .btn { animation-delay: calc(var(--t0) + .9s); }
.motion .hero__photo { animation: unveil 1.5s var(--ease-io) calc(var(--t0) + .1s) both; }
.motion .hero__photo img { animation: settle 2.6s var(--ease) calc(var(--t0) + .1s) both; }
.motion .facts li { animation: fadeUp 1s var(--ease) both; animation-delay: calc(var(--t0) + 1s); }
.motion .facts li:nth-child(2) { animation-delay: calc(var(--t0) + 1.08s); }
.motion .facts li:nth-child(3) { animation-delay: calc(var(--t0) + 1.16s); }
.motion .facts li:nth-child(4) { animation-delay: calc(var(--t0) + 1.24s); }
@keyframes lineUp { from { transform: translateY(110%); } to { transform: none; } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes settle { from { scale: 1.3; } to { scale: 1; } }

/* ---------- 波浪：先畫出來，再慢慢漂 ---------- */
.wave { overflow: hidden; }
.wave path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.motion .wave path { stroke-dashoffset: 1; }
.motion .wave.is-in path { animation: draw 1.8s var(--ease-io) forwards, drift 14s linear 1.8s infinite; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(240px); } }

/* ---------- 捲動進場（由 main.js 加上 rv-*，捲到才加 is-in） ---------- */
.motion .rv-up { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.motion .rv-up.is-in { opacity: 1; transform: none; }

.motion .rv-group > * { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms + var(--d, 0ms)); }
.motion .rv-group.is-in > * { opacity: 1; transform: none; }

.motion .rv-lines .ln { display: block; overflow: hidden; padding-bottom: .06em; }
.motion .rv-lines .ln > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 100ms + var(--d, 0ms)); }
.motion .rv-lines.is-in .ln > span { transform: none; }

.motion .rv-img { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-io); transition-delay: var(--d, 0ms); }
.motion .rv-img img { scale: 1.25; transition: scale 1.9s var(--ease); transition-delay: var(--d, 0ms); }
.motion .rv-img.is-in { clip-path: inset(0); }
.motion .rv-img.is-in img { scale: var(--sc, 1); }
.motion .rv-img.rv-done img { transition: scale .8s var(--ease); transition-delay: 0s; }

/* 區塊編號後的短線：跟著長出來 */
.motion .eyebrow.rv-up .num::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s var(--ease) .25s; }
.motion .eyebrow.rv-up.is-in .num::after { transform: none; }

/* 引言：一個字一個字從模糊浮現 */
.motion .quote .ch { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(.3em); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.motion .quote.is-in .ch { opacity: 1; filter: none; transform: none; }

/* 視差：圖片放大一點，捲動時由 main.js 移動 translate */
[data-parallax] img { --sc: 1.14; scale: var(--sc); will-change: translate; }
.finale__bg img { --sc: 1.2; }

/* ---------- 按鈕與卡片的細節 ---------- */
.btn { transition: background-color .25s, color .25s, border-color .25s, transform .35s var(--ease), box-shadow .35s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgb(30 79 168 / .55); }
.btn:active { transform: translateY(0) scale(.98); }
.btn [aria-hidden="true"] { display: inline-block; transition: transform .35s var(--ease); }
.btn:hover [aria-hidden="true"] { transform: translate(3px, -3px); }

.room__btn { transition: transform .5s var(--ease); }
.room__photo { transition: box-shadow .5s var(--ease); }
.room__photo img { transition: scale .8s var(--ease); }
.room__btn:hover .room__photo { box-shadow: 0 18px 40px -22px rgb(20 33 61 / .55); }
.room__btn:hover .room__photo img, .room__btn:focus-visible .room__photo img { scale: 1.07; }
.room__more { transition: transform .45s var(--ease), background-color .3s, color .3s; }
.room__btn:hover .room__more { transform: translateY(-4px); background: var(--cobalt); color: var(--on-cobalt); }
.room__name { transition: color .3s; }
.gallery__grid img { transition: scale .8s var(--ease); }
.gallery__grid button:hover img { scale: 1.06; }

/* ---------- 跑馬燈 ---------- */
.band { overflow: hidden; background: var(--cobalt); color: var(--on-cobalt); padding: clamp(18px, 3vw, 28px) 0; }
.band__track { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); width: max-content; white-space: nowrap; will-change: transform; }
.band span { font-family: var(--latin); font-style: italic; font-size: clamp(1.75rem, 1rem + 3.4vw, 3.5rem); line-height: 1.2; }
.band span:nth-of-type(2n) { font-family: var(--serif); font-style: normal; font-weight: 500; font-size: clamp(1.25rem, .9rem + 2vw, 2.25rem); letter-spacing: .08em; }
.band i { font-style: normal; color: var(--lamp); font-size: clamp(1rem, .8rem + 1vw, 1.5rem); }

/* ---------- 篩選、分頁、對話框 ---------- */
.chip { transition: background-color .3s, border-color .3s, color .3s, transform .3s var(--ease); }
.chip:active { transform: scale(.96); }
.tabs { position: relative; }
.tabs button { position: relative; z-index: 1; transition: color .35s; }
.tabs__pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--r-pill); background: var(--cobalt); transition: transform .55s var(--ease), width .55s var(--ease); }
.js .tabs button[aria-selected="true"] { background: transparent; }

.motion .room-dlg[open] { animation: dlgIn .7s var(--ease); }
.motion .room-dlg[open]::backdrop { animation: fadeIn .45s ease; }
.motion .room-dlg[open] .room-dlg__info > * { animation: fadeUp .8s var(--ease) both; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(2) { animation-delay: .08s; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(3) { animation-delay: .14s; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(4) { animation-delay: .2s; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(5) { animation-delay: .26s; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(6) { animation-delay: .32s; }
.motion .room-dlg[open] .room-dlg__info > :nth-child(7) { animation-delay: .38s; }
.motion .room-dlg.is-closing { animation: dlgOut .32s var(--ease-io) forwards; }
.motion .room-dlg.is-closing::backdrop { animation: fadeOut .32s ease forwards; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(48px) scale(.97); } }
@keyframes dlgOut { to { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@media (max-width: 820px) {
  @keyframes dlgIn { from { transform: translateY(100%); } }
  @keyframes dlgOut { to { transform: translateY(100%); } }
}

.motion .lightbox[open] { animation: lbIn .45s ease; }
.motion .lightbox[open] .lightbox__ctrl, .motion .lightbox[open] .lightbox__close { animation: fadeIn .5s ease .25s both; }
.motion .lightbox.is-closing { animation: fadeOut .3s ease forwards; }
@keyframes lbIn { from { background-color: rgb(10 17 30 / 0); } }

/* ---------- 入住／退房時間：數字滾動 ---------- */
.roll { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: top; }
.roll__col { display: flex; flex-direction: column; transition: transform 1.8s var(--ease); transition-delay: calc(var(--i) * 110ms + .2s); }
.roll__col > span { height: 1.2em; line-height: 1.2em; }

/* ---------- 交通：路線畫出來、站點依序出現、伊亞的燈亮起 ---------- */
.motion .route.rv-group::before { transform: scaleY(0); transform-origin: 50% 0; transition: transform 1.6s var(--ease-io); }
.motion .route.rv-group.is-in::before { transform: none; }
.motion .route.rv-group > * { transform: translateX(-18px); transition-delay: calc(var(--i, 0) * 180ms + .2s); }
.motion .route.is-in .is-home::before { animation: lamp 2.4s ease-out 1.2s 3; }
@keyframes lamp { 0% { box-shadow: 0 0 0 0 rgb(242 181 68 / .7); } 100% { box-shadow: 0 0 0 16px rgb(242 181 68 / 0); } }
