/* ══════════════════════════════════════════════
   FONTS
══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&family=Noto+Serif+TC:wght@600&family=Noto+Sans+TC:wght@400;500&display=swap');

@font-face {
  font-family: 'GenYoMin2 TW';
  src: url('../fonts/GenYoMin2TW-EL.otf') format('opentype');
  font-weight: 250;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GenYoMin2 TW';
  src: url('../fonts/GenYoMin2TW-L.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GenYoMin2 TW';
  src: url('../fonts/GenYoMin2TW-R.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DFPLiShuW5-B5';
  src: url('../fonts/華康隸書體W5&W5(P).TTC') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ══════════════════════════════════════════════
   RESET
══════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body {
  overflow-x: hidden;
  color: var(--color-text-primary);
  background: var(--color-bg-default);
  font-family: var(--font-sans);
}
img {
  max-width: 100%;
  display: block;
}
/* Blur-up: photos fade + sharpen in as they load. The class is added by JS,
   so images still display normally if JS is unavailable. */
img.blur-up {
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.02);
  transition: opacity 0.6s ease, filter 0.7s ease, transform 0.7s ease;
}
img.blur-up.is-loaded {
  opacity: 1;
  filter: blur(0);
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  img.blur-up { transition: opacity 0.3s ease; transform: none; filter: none; }
}
/* LQIP: a tiny blurred preview (data-URI in --lqip) painted behind the image,
   so there's no blank gap before the photo loads. JS adds .has-lqip. */
/* isolation:isolate makes .has-lqip its own stacking context, so the
   z-index:-1 placeholder stays *inside* it (above the bg, below the image)
   instead of escaping behind the container. */
.has-lqip { position: relative; overflow: hidden; isolation: isolate; }
.has-lqip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1; /* above the container's bg colour, below the image (positioned or not) */
  background-image: var(--lqip);
  background-size: cover;
  background-position: center;
  filter: blur(12px);
  transform: scale(1.1);
  border-radius: inherit;
  pointer-events: none;
}
a {
  color: inherit;
  text-decoration: none;
}
a:visited {
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ══════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════ */
:root {
  /* Color / Text */
  --color-text-primary:            #292929;
  --color-text-secondary:          #525252;
  --color-text-muted:              #bdbdbd;
  --color-text-accent:             #857765;
  --color-text-brand:              #59702f;
  --color-text-inverse-primary:    #ffffff;
  --color-text-inverse-secondary:  #bdbdbd;
  --color-text-inverse-tertiary:   #989898;
  --color-text-inverse-accent:     #e0cfb9;

  /* Color / Bg */
  --color-bg-default:  #ffffff;
  --color-bg-section:  #fefbf8;
  --color-bg-dark:     #232d11;
  --color-bg-overlay:  rgba(41, 41, 41, 0.5);

  /* Color / Border */
  --color-border-default:   #dcdcdc;
  --color-border-brand:     #59702f;
  --color-border-focus:     #59702f;
  --color-border-accent:    #857765;
  --color-border-secondary: #989898;
  --color-border-tertiary:  #656565;

  /* Color / Text (extra) */
  --color-text-tertiary:      #7c7c7c;
  --color-status-warning:     #f59e0b;

  /* Color / Action */
  --color-action-primary-bg:        #59702f;
  --color-action-primary-bg-hover:  #40521f;
  --color-action-primary-label:     #ffffff;
  --color-action-link-dark-default: #525252;
  --color-action-link-dark-hover:   #292929;
  --color-action-link-light-default:#ffffff;
  --color-action-link-light-hover:  #59702f;

  /* Spacing / Inset */
  --sp-inset-xs:  4px;
  --sp-inset-sm:  8px;
  --sp-inset-md:  12px;
  --sp-inset-lg:  16px;
  --sp-inset-xl:  24px;

  /* Spacing / Stack */
  --sp-stack-xs:   4px;
  --sp-stack-sm:   8px;
  --sp-stack-md:   12px;
  --sp-stack-lg:   16px;
  --sp-stack-xl:   20px;
  --sp-stack-2xl:  24px;
  --sp-stack-3xl:  48px;
  --sp-stack-4xl:  80px;

  /* Spacing / Layout */
  --sp-layout-2xs: 16px;
  --sp-layout-xs:  20px;
  --sp-layout-sm:  24px;
  --sp-layout-md:  40px;
  --sp-layout-lg:  44px;
  --sp-layout-xl:  80px;
  --sp-layout-2xl: clamp(80px, 8.33vw, 120px);

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-3xl:  28px;
  --r-pill: 1000px;

  /* Typography scale — mobile (phone) defaults */
  --fs-body:        16px;
  --fs-body-sm:     13px;
  --fs-label:       14px;
  --fs-logo-nav-zh: 18px;
  --fs-logo-nav-en: 12px;

  /* Font families — Chinese (default); English pages override below */
  --font-serif: 'Noto Serif TC', serif;
  --font-sans:  'Noto Sans TC', sans-serif;
  --font-logo:  'DFPLiShuW5-B5', 'Noto Serif TC', serif;
}

/* English pages use the Latin type system: Cormorant Garamond + DM Sans */
html[lang="en"] {
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans:  'DM Sans', sans-serif;
  --font-logo:  'Cormorant Garamond', serif;
}

/* Tablet ≥ 768px */
@media (min-width: 768px) {
  :root {
    --fs-body:        17px;
    --fs-body-sm:     14px;
    --fs-label:       15px;
    --fs-logo-nav-zh: 20px;
    --fs-logo-nav-en: 13px;
  }
}

/* Desktop ≥ 1280px */
@media (min-width: 1280px) {
  :root {
    --fs-body:        18px;
    --fs-body-sm:     15px;
    --fs-label:       16px;
    --fs-logo-nav-zh: 24px;
    --fs-logo-nav-en: 15px;
  }
}

/* ══════════════════════════════════════════════
   TYPOGRAPHY CLASSES
══════════════════════════════════════════════ */
.t-h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.t-h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.t-h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
}
.t-h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
}
.t-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
}
.t-body-sm {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body-sm);
  line-height: 1.5;
}
.t-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

@keyframes btn-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ══════════════════════════════════════════════
   BUTTON
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn--primary {
  background: var(--color-action-primary-bg);
  color: var(--color-action-primary-label);
  padding: var(--sp-inset-md) var(--sp-inset-xl);
  border-radius: var(--r-xs);
}
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,0.20) 50%, transparent 75%);
  animation: btn-shimmer 3s linear infinite;
}
.btn--primary:hover  { opacity: 0.8; }
.btn--primary:hover::after { opacity: 0; }
.btn--primary:active { transform: scale(0.97); }
.hero__cta:active   { transform: translateX(-50%) scale(0.97); }
.btn__icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   FEATURE CARD
══════════════════════════════════════════════ */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg-default);
  border-radius: var(--r-lg);
  padding: 16px 24px;
  cursor: pointer;
  color: var(--color-text-primary);
  text-decoration: none;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:visited { color: var(--color-text-primary); }
.card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.card:active {
  transform: scale(0.97);
  box-shadow: none;
}
.card__header {
  display: flex;
  align-items: center;
  width: 100%;
}
.card__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
  color: var(--color-text-accent);
  flex: 1;
  text-align: center;
}
.card__arrow-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.card__body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* ══════════════════════════════════════════════
   LINK
══════════════════════════════════════════════ */
.link--dark {
  color: var(--color-action-link-dark-default);
  border-bottom: 1px solid var(--color-action-link-dark-default);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.link--dark:hover {
  color: var(--color-action-link-dark-hover);
  border-color: var(--color-action-link-dark-hover);
}
.link--dark:active { transform: scale(0.98); }

/* ══════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 24px max(var(--sp-layout-2xl), calc((100% - 1200px) / 2), env(safe-area-inset-right)) 24px max(var(--sp-layout-2xl), calc((100% - 1200px) / 2), env(safe-area-inset-left));
  transition: transform 0.3s ease, background-color 0.3s ease;
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar__wordmark {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
}
.navbar__wordmark-row1 {
  display: flex;
  gap: var(--sp-inset-sm);
  align-items: center;
}
.navbar__wordmark img {
  height: 24px;
  width: auto;
}
.navbar__wordmark-title {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: var(--fs-logo-nav-zh);
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--color-text-inverse-primary);
  white-space: nowrap;
}
.navbar__wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: var(--fs-logo-nav-en);
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--color-text-inverse-primary);
  white-space: nowrap;
}
.navbar__brandmark {
  justify-self: center;
}
.navbar__brandmark img {
  height: 100px;
  width: 143px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--color-text-inverse-primary);
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-link:hover  { opacity: 0.7; }
.nav-link:visited { color: var(--color-text-inverse-primary); }
/* .nav-link.active underline is drawn by the sliding .slide-bar (see JS). */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 4px;
  justify-self: end;
}
.navbar__hamburger span {
  display: block;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s;
}
.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Navbar states */
.navbar--transparent { background-color: transparent; }
.navbar--dark        { background-color: var(--color-bg-dark); }
.navbar--hidden      { transform: translateY(-100%); }
.navbar--visible     { transform: translateY(0); }


/* ══════════════════════════════════════════════
   MOBILE DRAWER
══════════════════════════════════════════════ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: var(--color-bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.drawer.open {
  transform: translateY(0);
  pointer-events: all;
}
.drawer__close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: white;
  font-size: 28px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.drawer__close:hover { opacity: 1; }
.drawer__link {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  transition: opacity 0.2s;
}
.drawer__link:hover   { opacity: 0.7; }
.drawer__link:visited { color: #ffffff; }

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
}
/* Position-based gradient (image-agnostic): darker at the top for the
   transparent navbar and at the bottom for the CTA, vibrant in the middle. */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.12) 26%,
    rgba(0, 0, 0, 0.12) 66%,
    rgba(0, 0, 0, 0.38) 100%
  );
  z-index: 1;
}
.hero__text {
  position: absolute;
  left: max(min(8.33vw, 120px), env(safe-area-inset-left));
  top: 57%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: min(1.11vw, 16px);
  width: min(48.5vw, 699px);
}
/* Soft scrim behind the headline — desktop only. */
@media (min-width: 1280px) {
  .hero__text::before {
    content: "";
    position: absolute;
    inset: -28px -90px;
    z-index: -1;
    background: radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.3) 45%,
      rgba(0, 0, 0, 0) 78%
    );
    pointer-events: none;
  }
}
.hero__h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}
/* The EN headline is longer than the ZH one — let it wrap instead of overflowing */
html[lang="en"] .hero__h1 { white-space: normal; text-wrap: balance; }
.hero__subtitle {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  text-align: right;
  white-space: nowrap;
}
.hero__cta {
  position: absolute;
  bottom: 25.6%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.hero__cta-icon {
  width: 16px;
  height: 16px;
  display: block;
}

/* ══════════════════════════════════════════════
   SECTION COMMON
══════════════════════════════════════════════ */
.section {
  padding: var(--sp-layout-xl) max(var(--sp-layout-2xl), calc((100% - 1200px) / 2));
}
.section__eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--color-text-accent);
  text-transform: uppercase;
}
.section__h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.section__head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px;
}

/* ══════════════════════════════════════════════
   PHILOSOPHY
══════════════════════════════════════════════ */
.philosophy {
  background: var(--color-bg-default);
}
.philosophy__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
.philosophy__img {
  width: 100%;
  height: auto;
  border-radius: var(--r-xs);
}

@media (min-width: 768px) and (max-width: 1279px) {
  .hero__bg { object-position: 80% center; }
}
/* Philosophy 從平板起左右排列；平板 gutter 32px */
@media (min-width: 768px) {
  .philosophy__inner {
    grid-template-columns: 349px 1fr;
    gap: 32px;
  }
  .philosophy__content { gap: var(--sp-stack-3xl); }
  .philosophy__img {
    width: 349px;
    height: 465px;
    object-fit: cover;
  }
}
@media (min-width: 1280px) {
  .hero__bg { object-position: center; }
  .features__head { margin-bottom: 64px; }
  .philosophy__inner { gap: 64px; }
}
.philosophy__content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.philosophy__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-lg);
}
.philosophy__eyebrow {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-border-brand);
}
.philosophy__h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text-primary);
}
.philosophy__quote {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-secondary);
  border-left: 1px solid var(--color-border-accent);
  padding-left: 16px;
  margin: 0;
}
.philosophy__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.philosophy__list-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border-accent);
}
.philosophy__num {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.philosophy__list-text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

/* ══════════════════════════════════════════════
   FEATURES
══════════════════════════════════════════════ */
.features {
  background: var(--color-bg-section);
}
.features__head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-stack-lg);
  margin-bottom: var(--sp-stack-3xl);
}
.features__eyebrow {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-border-brand);
}
.features__h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text-primary);
}
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card__icon {
  height: 80px;
  width: auto;
  max-width: none;
  display: block;
}

/* ══════════════════════════════════════════════
   LOCATION / MAP
══════════════════════════════════════════════ */
.location {
  background: var(--color-bg-default);
}
.location__eyebrow {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-action-primary-bg);
  margin-bottom: 32px;
}
.location__tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--color-border-secondary);
  margin-bottom: 48px;
}
.tab {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
  color: var(--color-text-muted);
  padding: 12px 0;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab--active { color: var(--color-text-primary); }
.tab:hover   { color: var(--color-text-primary); }

/* ── Sliding active underline (navbar / anchor nav / 兩校 tabs) ──
   One <span class="slide-bar"> per bar; JS animates its left + width to the
   active item, so the underline glides instead of jumping. */
.location__tabs,
.team__tabs,
.campus-tabs,
.navbar__nav,
.feature-nav__inner { position: relative; }
.slide-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition: left 0.3s ease, width 0.3s ease, opacity 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .slide-bar { transition: opacity 0.25s ease; }
}

/* ── Two-school (咪咪 / 家田) content transition ──
   Added by JS to the newly-active panel on every switch: a calm in-place
   fade (no horizontal motion of the large panels). The underline still slides. */
@keyframes tabFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tab-fade-in { animation: tabFadeIn 0.25s ease both; }
@media (prefers-reduced-motion: reduce) {
  .tab-fade-in { animation: none; }
}

.location__body {
  display: flex;
  gap: 32px;
  align-items: start;
}
.location__map {
  flex: 0 0 600px;
  height: 600px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-default);
  display: flex;
  align-items: center;
  justify-content: center;
}
.location__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.location__info {
  flex: 1;
}

.campus-info { display: none; }
.campus-info--active {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.campus-info__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #101828;
}
.campus-info__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.campus-info__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.campus-info__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.campus-info__cta {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-xl);
}

.icon-btn,
.icon-btn:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border-brand);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--color-border-brand);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(89, 112, 47, 0.08);
}
.icon-btn:active {
  transform: scale(0.94);
}

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.footer {
  background: var(--color-bg-dark);
}
.footer__inner {
  padding: 40px max(var(--sp-layout-2xl), calc((100% - 1200px) / 2));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

/* Col 1: Brand */
.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer__brandmark-link { display: inline-block; }
.footer__brandmark-img {
  width: 143px;
  height: 100px;
  object-fit: contain;
  object-position: left center;
}
.footer__wordmark {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__wordmark-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer__wordmark-img {
  height: 24px;
  width: auto;
}
.footer__wordmark-zh {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--color-action-link-light-default);
  white-space: nowrap;
}
.footer__wordmark-en {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--color-action-link-light-default);
  white-space: nowrap;
}
.footer__tagline {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--color-text-inverse-secondary);
  line-height: 1.5;
}

/* Col 2–3: Campus */
.footer__campus-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer__section-label {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text-inverse-tertiary);
  line-height: 1.4;
}
.footer__section-label--ghost { visibility: hidden; }
.footer__campus-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__campus-label {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--color-text-inverse-accent);
  line-height: 1.5;
}
.footer__info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.footer__info-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
}
.footer__info-item {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  color: #efefef;
  line-height: 1.5;
}
a.footer__info-item--link,
a.footer__info-item--link:visited {
  color: #efefef;
  transition: opacity 0.2s;
}
a.footer__info-item--link:hover { opacity: 0.7; }
.footer__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: opacity 0.2s;
}
.footer__social-btn:hover { opacity: 0.7; }

/* Bottom bar */
.footer__bottom {
  padding: 24px max(var(--sp-layout-2xl), calc((100% - 1200px) / 2));
  border-top: 1px solid var(--color-border-secondary);
}
.footer__copy {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}
.footer__copy-zh {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-text-inverse-tertiary);
  line-height: 1.5;
}
.footer__copy-en {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-inverse-tertiary);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   INNER PAGE (about / features / campus)
   No hero — reserve space under the fixed navbar.
══════════════════════════════════════════════ */
body.page--inner { padding-top: 88px; }
@media (min-width: 768px) {
  body.page--inner { padding-top: 96px; }
}

/* Shared inner-page section: mobile-first padding-y 48 / 64 / 80 */
.about-section {
  padding: var(--sp-stack-3xl) var(--sp-layout-xs);
}
@media (min-width: 768px) {
  .about-section { padding: 64px var(--sp-layout-sm); }
}
@media (min-width: 1280px) {
  .about-section {
    padding: var(--sp-layout-xl) max(var(--sp-layout-2xl), calc((100% - 1200px) / 2));
  }
}

/* Eyebrow with leading rule */
.about-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-sm);
}
.about-eyebrow::before {
  content: '';
  flex-shrink: 0;
  width: 40px;
  height: 1px;
  background: var(--color-text-brand);
}
.about-eyebrow__text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-brand);
}

/* ── Page header ── */
.page-header { background: var(--color-bg-default); }
.page-header__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.page-header__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-md);
}
.page-header__title {
  color: var(--color-text-primary);
}
.page-header__desc {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-tertiary);
}
.page-header__desc-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
}
@media (min-width: 1280px) {
  .page-header__desc { max-width: 720px; }
}
/* About page header photos — portrait + near-square pair (Figma 131:187, h matched) */
.page-header__media {
  display: grid;
  grid-template-columns: 82fr 117fr 103fr;
  gap: 16px;
  width: 100%;
}
.about-pic {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--color-bg-section);
  cursor: pointer;
}
.about-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-pic:nth-child(1) { aspect-ratio: 82 / 123; }
.about-pic:nth-child(2) { aspect-ratio: 117 / 123; }
.about-pic:nth-child(3) { aspect-ratio: 103 / 123; }
@media (min-width: 1280px) {
  .page-header__media { max-width: 600px; }
}

/* ══════════════════════════════════════════════
   CAMPUS PAGE — 校園環境
══════════════════════════════════════════════ */
.campus-school { display: none; }
.campus-school.is-active { display: block; }

/* Section wrapper — alternating backgrounds, centred content */
.campus-sec--alt { background: var(--color-bg-section); }
.campus-sec__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
  max-width: 820px;
  margin-inline: auto;
}

/* School tabs (re-uses .tab / .tab--active) */
.campus-tabs {
  display: flex;
  gap: 24px;
}

/* Section head: title + sub + divider rule */
.campus-sec__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
}
.campus-sec__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.campus-sec__sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body-sm);
  line-height: 1.5;
  color: var(--color-text-tertiary);
}
.campus-sec__rule {
  margin-top: var(--sp-stack-md);
  height: 1px;
  width: 100%;
  background: var(--color-border-default);
}

/* Image groups (re-use .feature__media / .feature__pic for lightbox) */
.campus-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-lg);
  width: 100%;
}
.campus-row {
  display: flex;
  gap: var(--sp-stack-lg);
}
.campus-row > .campus-pic {
  flex: 1 1 0;
  min-width: 0;
}
.campus-pic { width: 100%; }
.campus-pic--p { aspect-ratio: 3 / 4; }   /* 直幅 */
.campus-pic--l { aspect-ratio: 4 / 3; }   /* 橫幅 */
.campus-pic--w { aspect-ratio: 16 / 9; }  /* 寬幅 */

/* Shared grey lead paragraph under a section title */
.about-lead {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-tertiary);
}
@media (min-width: 1280px) {
  .about-lead { max-width: 720px; }
}

/* Shared eyebrow + title head block */
.about-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-md);
}
.about-head__title { color: var(--color-text-primary); }

/* ── Commitment — 我們的承諾 ── */
.commitment { background: var(--color-bg-section); }
.commitment__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.commitment__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-stack-2xl);
}
@media (min-width: 768px) {
  .commitment__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .commitment__grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-stack-lg); }
}

.content-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-md);
  padding: var(--sp-inset-lg);
  background: var(--color-bg-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--r-xs);
}
.content-card__num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-secondary);
}
.content-card__rule {
  width: 60px;
  height: 1px;
  background: var(--color-text-muted);
}
.content-card__text {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

/* ── Team roster — 師資陣容 ── */
.team { background: var(--color-bg-default); }
.team__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.team__roster {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-lg);
}
.team__tabs {
  display: flex;
  gap: var(--sp-inset-md);
}
@media (min-width: 1280px) {
  .team__roster { max-width: 760px; }
}

.team__list {
  display: none;
  list-style: none;
}
.team__list.is-active {
  display: flex;
  flex-direction: column;
}

.member { border-bottom: 1px solid var(--color-border-default); }
.member__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-inset-md);
  padding: var(--sp-inset-sm) 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, padding 0.2s ease;
}
.member__trigger:hover {
  background: var(--color-bg-section);
  padding-left: var(--sp-inset-xs);
  padding-right: var(--sp-inset-xs);
}
.member__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
}
.member__name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-md);
}
.member__name,
.member__title {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-primary);
}
.member__title { color: var(--color-text-tertiary); }
.member__role {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-tertiary);
}
.member__arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.member__trigger:active { opacity: 0.6; }

/* ── Team detail Drawer ── */
.team-drawer {
  position: fixed;
  inset: 0;
  z-index: 600;
  visibility: hidden;
  /* keep visible through the slide-out, then hide */
  transition: visibility 0s linear 0.35s;
}
.team-drawer.is-open {
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.team-drawer__overlay {
  position: absolute;
  inset: 0;
  background: var(--color-bg-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.team-drawer.is-open .team-drawer__overlay { opacity: 1; }
.team-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  /* Theme tokens — overridden per role below (JS adds the modifier class) */
  --dw-bg: var(--color-bg-section);
  --dw-text: var(--color-text-primary);
  --dw-muted: var(--color-text-tertiary);
  --dw-bar-border: var(--color-border-default);
  --dw-bio-border: var(--color-border-default);
  --dw-close-bg: transparent;
  --dw-close-hover: var(--color-border-default);
  --dw-close-icon: var(--color-text-primary);
  background: var(--dw-bg);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.team-drawer.is-open .team-drawer__panel { transform: translateX(0); }
@media (max-width: 767px) {
  .team-drawer__panel { width: 100vw; }
}
/* Role themes — 執行長 (brand green) / 園長 (brown) / 老師・廚師 (default light) */
.team-drawer--ceo .team-drawer__panel {
  --dw-bg: #40521f;                                 /* green/950 */
  --dw-text: var(--color-text-inverse-primary);     /* #ffffff */
  --dw-muted: var(--color-text-inverse-secondary);  /* #bdbdbd */
  --dw-bio-border: #989898;                          /* border/secondary（bar 沿用 #dcdcdc） */
  --dw-close-bg: transparent;
  --dw-close-hover: rgba(255, 255, 255, 0.12);
  --dw-close-icon: var(--color-text-inverse-primary);
}
.team-drawer--mgmt .team-drawer__panel {
  --dw-bg: #6e6152;                                 /* brown/800 */
  --dw-text: var(--color-text-inverse-primary);     /* #ffffff */
  --dw-muted: var(--color-text-inverse-secondary);  /* #bdbdbd */
  --dw-bio-border: #989898;                          /* border/secondary（bar 沿用 #dcdcdc） */
  --dw-close-bg: transparent;
  --dw-close-hover: rgba(255, 255, 255, 0.12);
  --dw-close-icon: var(--color-text-inverse-primary);
}

/* Sticky top bar — 師資介紹 • 校區 */
.team-drawer__bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-inset-md);
  padding: var(--sp-stack-lg) var(--sp-layout-xs);
  border-bottom: 1px solid var(--dw-bar-border);
  background: var(--dw-bg);
}
.team-drawer__crumb {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-md);
  min-width: 0;
}
.team-drawer__crumb span:not(.team-drawer__dot) {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--dw-muted);
  white-space: nowrap;
}
.team-drawer__dot {
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dw-muted);
}
.team-drawer__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--dw-close-bg);
  color: var(--dw-close-icon);
  transition: background 0.15s ease;
}
.team-drawer__close:hover  { background: var(--dw-close-hover); }
.team-drawer__close:active { transform: scale(0.94); }

/* Scrollable body */
.team-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Name block */
.team-drawer__member {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
  padding: var(--sp-stack-3xl) var(--sp-layout-xs);
}
.team-drawer__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-inset-md);
}
.team-drawer__name,
.team-drawer__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--dw-text);
}
.team-drawer__role {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Bio — numbered list */
.team-drawer__bio-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-lg);
  padding-bottom: var(--sp-stack-3xl);
}
.team-drawer__bio-title {
  padding: 0 var(--sp-layout-xs);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--dw-muted);
}
.team-drawer__bio {
  list-style: none;
}
.team-drawer__bio li {
  display: flex;
  gap: var(--sp-inset-lg);
  margin: 0 var(--sp-layout-xs);
  padding: var(--sp-inset-lg) 0;
  border-bottom: 1px solid var(--dw-bio-border);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--dw-text);
}
.team-drawer__bio li::before {
  content: '•';
  flex-shrink: 0;
  color: var(--dw-text);
}

/* ══════════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}
[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-delay="3"] { transition-delay: 0.3s; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */

/* Tablet 768–1279px：漢堡選單啟動 */
@media (max-width: 1279px) {
  :root { --sp-layout-2xl: 24px; }

  /* Section padding-y → 平板 64px（對齊 CLAUDE.md，桌機 80px 為 base） */
  .section { padding-block: 64px; }

  /* Navbar → 漢堡 */
  .navbar__nav            { display: none; }
  .navbar__hamburger      { display: flex; }


  .features__grid        { grid-template-columns: repeat(2, 1fr); }

  /* Location 平板維持左右排列，地圖改為彈性寬度（gutter 沿用 32px） */
  .location__map         { flex: 1 1 0; min-width: 0; height: 420px; }

  .footer__inner         { grid-template-columns: 1fr 1fr; }
  .footer__brand         { grid-column: 1 / -1; }
}

/* Phone ≤ 767px */
@media (max-width: 767px) {
  :root {
    --sp-layout-2xl: 20px;
  }

  /* Section padding-y → 手機 48px（對齊 CLAUDE.md） */
  .section { padding-block: 48px; }

  /* Navbar wordmark */
  .navbar__wordmark img   { height: 18px; }
  .navbar__wordmark-row1  { gap: 6px; }

  /* Hero */
  .hero__text { left: 24px; }
  /* The wrapping EN headline needs more width than the narrow ZH text column */
  html[lang="en"] .hero__text { width: min(82vw, 320px); }
  .hero__cta  { bottom: 48px; }

  /* Features */
  .features__grid         { grid-template-columns: 1fr; }

  /* Location 手機才上下堆疊 */
  .location__body         { flex-direction: column; }
  .location__map          { flex: none; width: 100%; height: 280px; }

  /* Footer */
  .footer__inner          { grid-template-columns: 1fr; }
  .footer__brand          { grid-column: auto; }
  .footer__section-label--ghost { display: none; }
  .footer__bottom         { padding: 20px var(--sp-layout-2xl); }
}


/* ══════════════════════════════════════════════
   BOOKING DIALOG
══════════════════════════════════════════════ */
@keyframes dialogOpen {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes sheetSlideDown {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

.booking-dialog {
  width: 560px;
  max-width: 90vw;
  max-height: 90vh;
  margin: 5vh auto auto;
  border: none;
  border-radius: var(--r-2xl);
  padding: 0;
  overflow: hidden;
  background: var(--color-bg-section);
}
.booking-dialog::backdrop {
  background: var(--color-bg-overlay);
  animation: backdropFade 0.25s ease;
}
.booking-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialogOpen 0.25s ease;
}

.booking-dialog__inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Drag handle — mobile bottom-sheet only (desktop modal is centred) */
.booking-dialog__handle { display: none; }

/* Header + subtitle + divider stay fixed; only the body (form) scrolls. */
.booking-dialog__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-inset-xl) var(--sp-inset-xl) var(--sp-stack-lg);
  background: var(--color-bg-section);
}

.booking-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-stack-2xl) var(--sp-inset-xl) var(--sp-inset-xl);
}
.booking-dialog__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  color: var(--color-text-primary);
}
.booking-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.booking-dialog__close:hover  { background: var(--color-border-default); }
.booking-dialog__close:active { transform: scale(0.94); }

.booking-dialog__subtitle {
  flex-shrink: 0;
  padding: 0 var(--sp-inset-xl);
  font-size: var(--fs-body-sm);
  color: var(--color-text-tertiary);
  line-height: 1.5;
}
.booking-dialog__divider {
  flex-shrink: 0;
  height: 1px;
  margin: var(--sp-stack-2xl) var(--sp-inset-xl) 0;
  border: none;
  background: var(--color-border-default);
}

/* ── Form ── */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.booking-form__fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-lg);
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-inset-md);
}

.form-label {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 7em;                 /* uniform label column so every field's left edge aligns */
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding-top: var(--sp-inset-md);
}
.form-label__text {
  width: auto;
}
.form-label--plain {
  white-space: nowrap;
}
.form-asterisk {
  width: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  color: var(--color-status-warning);
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ── Field wrapper ── */
.field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--r-sm);
  padding: var(--sp-inset-md) var(--sp-inset-lg);
  display: flex;
  align-items: center;
  background: var(--color-bg-default);
  transition: border-color 0.2s ease;
}
.field:focus-within { border-color: var(--color-border-focus); border-width: 2px; }
.field--error       { border-color: var(--color-status-warning); border-width: 2px; }

.form-field-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-field-wrap .field { flex: none; width: 100%; }
.form-error {
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  color: var(--color-status-warning);
  line-height: 1.5;
  text-align: right;
}

.field input,
.field select {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-primary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder { color: var(--color-text-muted); }

.field option {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
}

/* Select: custom arrow via background */
.field--select {
  position: relative;
  cursor: pointer;
}
.field--select select {
  padding-right: 28px;
  cursor: pointer;
}
.field--select::after {
  content: '';
  position: absolute;
  right: var(--sp-inset-lg);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23292929' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.field--select select.select--empty { color: var(--color-text-muted); }

/* Custom select */
.field--custom-select { cursor: pointer; user-select: none; }
.field--custom-select select { display: none; }
.custom-select__label {
  flex: 1;
  min-width: 0;
  padding-right: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  line-height: 1.5;
}
.custom-select__label.select--empty { color: var(--color-text-muted); }

/* Dropdown panel */
.csp {
  position: fixed;
  z-index: 9999;
  list-style: none;
  padding: 4px 0;
  background: var(--color-bg-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  overflow: hidden;
}
.csp__option {
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  cursor: pointer;
  line-height: 1.5;
  white-space: normal;        /* let long options (full school names) wrap instead of clipping */
}
.csp__option:hover { background: var(--color-bg-section); }
.csp__option--active { color: var(--color-action-primary-bg); font-weight: 500; }

/* Date field — input fills the whole wrapper so the full area is clickable */
.field--date {
  padding: 0;
  cursor: pointer;
  display: block;
  position: relative;
}
.field--date input[type="date"] {
  padding: var(--sp-inset-md) var(--sp-inset-lg);
  color: var(--color-text-primary);
  cursor: pointer;
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
}
.date-placeholder {
  position: absolute;
  left: var(--sp-inset-lg);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
}
.field--date input[type="date"].date--empty { color: transparent; }
.field--date input[type="date"].date--empty:focus { color: var(--color-text-primary); }
.field--date input[type="date"]:not(.date--empty) ~ .date-placeholder,
.field--date input[type="date"]:focus ~ .date-placeholder { display: none; }

/* Birthday picker: native <input type=date> on phone/tablet (nice wheel picker
   with year selection); Year/Month/Day <select>s on desktop, because Safari's
   desktop date picker has no year navigation. Toggled at the desktop breakpoint. */
.bday-sel { display: none; }
@media (min-width: 1280px) {
  .bday-native { display: none; }
  .bday-sel { display: flex; }
}
.field--date input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  width: 100%;
  min-width: 0;
}
.field--date input[type="date"]::-webkit-datetime-edit {
  color: inherit;
  padding: 0;
  flex: 1;
  min-width: 0;
}
.field--date input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  width: 100%;
}
.field--date input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.5;
  margin-right: 4px;
  flex-shrink: 0;
}

/* Submit */
.booking-form__submit {
  width: 100%;
  background: var(--color-action-primary-bg);
  color: #efefef;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  line-height: 1.5;
  padding: var(--sp-inset-md) var(--sp-inset-xl);
  border-radius: var(--r-xl);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.booking-form__submit:hover  { opacity: 0.8; }
.booking-form__submit:active { transform: scale(0.98); }
.booking-form__submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Disclaimer */
.booking-form__disclaimer {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-sm);
}
.booking-form__disclaimer li {
  font-size: var(--fs-body-sm);
  color: var(--color-text-tertiary);
  line-height: 1.5;
}

/* Success state */
.booking-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 0;
  text-align: center;
}
.booking-success__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.1vw, 30px);
  color: var(--color-text-primary);
}
.booking-success__body {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
  .booking-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 90vh;    /* fallback */
    max-height: 90svh;   /* exclude Safari's toolbar so the sheet top isn't pushed up */
    margin: auto auto 0;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  }
  .booking-dialog[open] {
    animation: sheetSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .booking-dialog.is-closing {
    animation: sheetSlideDown 0.3s ease forwards;
  }
  .booking-dialog__handle {
    display: block;
    flex-shrink: 0;
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--color-text-muted);
    touch-action: none;
  }
}


/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-bg-default);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);   /* 隨裝置：13 / 14 / 15px */
  font-weight: 400;
  line-height: 1.5;
  padding: var(--sp-inset-md) var(--sp-inset-lg);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  animation: toastIn 0.3s ease forwards, toastOut 0.3s ease 2.7s forwards;
}
.toast__icon { flex-shrink: 0; width: 24px; height: 24px; }

/* ══════════════════════════════════════════════
   SHARE SNACKBAR — screenshot-share prompt (mobile/tablet)
══════════════════════════════════════════════ */
.snackbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-inset-md);
  background: rgba(41, 41, 41, 0.7);   /* grey/950 (#292929) @ 70% */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: var(--sp-inset-md) var(--sp-inset-lg);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, top 0.3s ease;
}
.snackbar.is-open    { opacity: 1; transform: translateY(0); }
.snackbar.is-closing { opacity: 0; transform: translateY(-12px); }
/* 漢堡選單或 lightbox 開啟時隱藏 snackbar */
.drawer.open ~ .snackbar,
.lightbox.is-open ~ .snackbar { display: none; }
.snackbar__main {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-md);
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.snackbar__main:active { opacity: 0.7; }
.snackbar__text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body-sm);   /* 隨裝置：13 / 14 / 15px */
  line-height: 1.5;
  color: var(--color-text-inverse-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.snackbar__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.snackbar__close:active { opacity: 0.6; }
.snackbar__icon { display: block; width: 24px; height: 24px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ══════════════════════════════════════════════
   FEATURES PAGE
══════════════════════════════════════════════ */
.feature--bg-default { background: var(--color-bg-default); }
.feature--bg-section { background: var(--color-bg-section); }

.feature__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}
.feature__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
}

/* ── Media (image groups) ── */
.feature__media { width: 100%; order: 2; }   /* 手機/平板：文字在上、圖在下 */
.feature__row { display: grid; gap: 16px; }
.feature__pic {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--color-bg-section);
  cursor: pointer;
}
.feature__pic > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Fullscreen hint (< 1280px) — purely a visual cue; the whole image opens
   the lightbox. Persistent faint bg, deepens on hover. */
.pic-fs {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--r-sm);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease;
}
.pic-fs:hover {
  background: rgba(255, 255, 255, 0.35);
}
.pic-fs img {
  width: 16px;
  height: 16px;
  display: block;
  filter: brightness(0) invert(1); /* render the icon white (#ffffff) */
}
/* 桌機（≥1280px）：隱藏 fullscreen btn */
@media (min-width: 1280px) {
  .pic-fs { display: none; }
  .feature__pic,
  .about-pic { transition: opacity 0.2s ease; }
  .feature__pic:hover,
  .about-pic:hover { opacity: 0.92; }
}

/* Feature 1 media: narrow portrait + wide landscape (Figma 110:203, h matched) */
.feature__media--f1 {
  display: grid;
  grid-template-columns: 110fr 203fr;
  gap: 16px;
  aspect-ratio: 335 / 170;
}
.feature__media--f1 .feature__pic { height: 100%; }

/* Feature 2 media: 1 full + 2 below */
.feature__media--f2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature__media--f2 > .feature__pic { aspect-ratio: 4 / 3; }
.feature__media--f2 .feature__row { grid-template-columns: 1fr 1fr; }
.feature__media--f2 .feature__row .feature__pic { aspect-ratio: 3 / 4; }

/* Feature 3 media: 1 full + 3 below */
.feature__media--f3 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature__media--f3 > .feature__pic { aspect-ratio: 4 / 3; }
.feature__media--f3 .feature__row { grid-template-columns: repeat(3, 1fr); }
.feature__media--f3 .feature__row .feature__pic { aspect-ratio: 101 / 135; }

/* Feature 4 media: 2 full + 2 below (left wider) */
.feature__media--f4 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature__media--f4 > .feature__pic:nth-of-type(1) { aspect-ratio: 335 / 251; }
.feature__media--f4 .feature__row { grid-template-columns: 168fr 150fr; align-items: start; }
.feature__media--f4 .feature__row .feature__pic:nth-of-type(1) { aspect-ratio: 168 / 200; }
.feature__media--f4 .feature__row .feature__pic:nth-of-type(2) { aspect-ratio: 150 / 200; }

/* Feature 5 & 6 media: 2×2 grid */
.feature__media--grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.feature__media--grid2 .feature__pic { aspect-ratio: 3 / 4; }

/* ── Head / desc / list ── */
.feature__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-xs);
}
/* Feature number — small serif label, muted (per design) */
.feature__num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-tertiary);
}
.feature__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.feature__desc {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.feature__list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.feature__list li {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-lg);
  padding: var(--sp-inset-lg) 0;
  border-bottom: 1px solid var(--color-border-default);
}
.feature__list li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 1px;
  background: var(--color-border-tertiary);
}
.feature__list-text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

/* Desktop: 兩欄交錯 */
@media (min-width: 1280px) {
  .feature__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
  }
  .feature__media { order: 0; }   /* 桌機回到左右兩欄交錯 */
  .feature--image-right .feature__media { order: 2; }
}

/* ══════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
}
.lightbox.is-open { display: block; }
.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox__content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-stack-2xl);
  width: min(92vw, 720px);
  padding: var(--sp-inset-xl) 0;
}
.lightbox__top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.lightbox__counter {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: #ffffff;
}
.lightbox__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  color: #ffffff;
  transition: opacity 0.2s ease;
}
.lightbox__close:hover  { opacity: 0.7; }
.lightbox__close:active { transform: scale(0.94); }
.lightbox__stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: var(--r-xs);
}
.lightbox__controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-inset-sm);
}
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #ffffff;
  transition: opacity 0.2s ease;
}
.lightbox__nav:hover    { opacity: 0.7; }
.lightbox__nav:disabled { opacity: 0.35; cursor: default; }
.lightbox__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lightbox__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.lightbox__dot.is-active {
  background: #ffffff;
  border-color: #ffffff;
}
.lightbox--single .lightbox__controls { display: none; }

/* ══════════════════════════════════════════════
   FEATURE NAV — 目錄
══════════════════════════════════════════════ */
.feature { scroll-margin-top: var(--anchor-h, 0px); }

/* Desktop（≥1280）：頂部 anchor bar，緊貼 navbar 下方、與其一起隱藏/出現 */
.feature-nav { display: none; }
@media (min-width: 1280px) {
  .feature-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 479;                 /* navbar 之下 */
    background: var(--color-bg-default);
    border-bottom: 1px solid var(--color-border-default);
    transform: translateY(var(--nav-h, 96px));  /* 預設貼在 navbar 下方 */
    transition: transform 0.3s ease;
  }
  /* navbar 收起時，anchor bar 滑到最頂、持續顯示 */
  .feature-nav.is-top { transform: translateY(0); }
  .feature-nav__inner {
    display: flex;
    gap: var(--sp-stack-2xl);
    overflow-x: auto;
    padding: var(--sp-stack-lg) max(var(--sp-layout-2xl), calc((100% - 1200px) / 2));
    scrollbar-width: none;
  }
  .feature-nav__inner::-webkit-scrollbar { display: none; }
  .feature-nav__link {
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: var(--fs-label);
    letter-spacing: 0.04em;
    color: var(--color-text-primary);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
  }
  /* active underline is drawn by the sliding .slide-bar (see JS) */
  .feature-nav__num { margin-right: 6px; }
}

/* Mobile + tablet（<1280）：浮動「目錄」鈕 */
.feature-toc {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 450;
}
@media (min-width: 1280px) { .feature-toc { display: none; } }
.feature-toc__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: var(--sp-inset-md) var(--sp-inset-lg);
  background: var(--color-bg-dark);
  color: var(--color-text-inverse-primary);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);   /* 手機 14 / 平板 15，跟隨 label token */
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* TOC bottom-sheet drawer */
.toc-sheet {
  position: fixed;
  inset: 0;
  z-index: 710;
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}
.toc-sheet.is-open {
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.toc-sheet__overlay {
  position: absolute;
  inset: 0;
  background: var(--color-bg-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.toc-sheet.is-open .toc-sheet__overlay { opacity: 1; }
.toc-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-bg-default);
  border-radius: var(--r-3xl) var(--r-3xl) 0 0;
  padding-bottom: var(--sp-inset-xl);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.toc-sheet.is-open .toc-sheet__panel { transform: translateY(0); }
.toc-sheet__handle {
  flex-shrink: 0;
  width: 40px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--color-text-muted);
  /* drag affordance — finger grabs here to pull the sheet down */
  touch-action: none;
  cursor: grab;
}
.toc-sheet__bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-inset-md);
  padding: var(--sp-stack-lg) var(--sp-layout-xs);
  margin-bottom: var(--sp-stack-2xl);
  background: var(--color-bg-default);
  border-bottom: 1px solid var(--color-border-default);
  border-radius: var(--r-3xl) var(--r-3xl) 0 0;
}
.toc-sheet__crumb {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-md);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--color-text-tertiary);
}
.toc-sheet__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}
.toc-sheet__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--color-bg-default);
  transition: background 0.15s ease;
}
.toc-sheet__close:hover  { background: var(--color-bg-section); }
.toc-sheet__close:active { transform: scale(0.94); }
.toc-sheet__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack-2xl);
  padding: 0 var(--sp-layout-xs);
}
.toc-sheet__list a {
  display: flex;
  align-items: center;
  gap: var(--sp-inset-md);
  padding: var(--sp-inset-sm) var(--sp-inset-lg);
  border-bottom: 1px solid var(--color-border-default);
  transition: background 0.15s ease;
}
.toc-sheet__list a:active { background: var(--color-bg-section); }
.toc-sheet__num {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-tertiary);
}
.toc-sheet__title {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-primary);
}
.toc-sheet__list a img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
