/* ══════════════════════════════════════
   ZOE YANG — Base / Reset / Variables
   ══════════════════════════════════════ */

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

:root {
  /* Color roles are defined in palette.css. */

  /* Accent role: interactive emphasis only (text links, CTAs, selected
     calendar slots, step numbers). Navigation chrome (dock, footer,
     contact rows) brightens toward white instead — never the accent. */

  /* Legacy aliases — keep until no var(--cream/--ink/--mid/--light) remain */
  --cream: var(--bg);
  --ink: var(--text-strong);
  --mid: var(--text-mid);
  --light: var(--line-faint);

  /* Tint and diffuse the scenery behind glass. Keep lettering on the front face. */
  --glass-bg: rgba(var(--palette-black-rgb), .74);
  --glass-blur: blur(24px) saturate(1.25) brightness(.64);
  --glass-border: 0;

  /* Inset reflections follow the silhouette without changing layout or hit targets. */
  --glass-rim: inset 0 1px 0 rgba(var(--palette-white-rgb), .20), inset 1px 0 0 rgba(var(--palette-white-rgb), .065), inset 0 -1px 0 rgba(var(--palette-white-rgb), .085);

  /* Elevation scale — dark surfaces get lighter + deeper shadow as they rise.
     1: resting (glass panels, cards)  2: floating chrome (dock, dropdowns)
     3: overlays (modal, lightbox, editors). Photos/cards stay shadowless. */
  --elev-1: 0 1px 0 rgba(var(--palette-white-rgb), 0.03), 0 4px 20px rgba(var(--palette-black-rgb), 0.18);
  --elev-2: 0 1px 0 rgba(var(--palette-white-rgb), 0.05), 0 8px 32px rgba(var(--palette-black-rgb), 0.35);
  --elev-3: 0 1px 0 rgba(var(--palette-white-rgb), 0.06), 0 24px 64px rgba(var(--palette-black-rgb), 0.55);
  --glass-shadow: var(--glass-rim), 0 6px 18px rgba(var(--palette-black-rgb), .18), 0 1px 3px rgba(var(--palette-black-rgb), .18);

  /* Radius scale — sharp is the signature. sm: content surfaces,
     md: floating chrome (dock, pills). Circles stay 50%. */
  --radius-sm: 2px;
  --radius-md: 6px;

  /* Motion — one curve for things entering or leaving, one for things moving
     on screen, one for the dock's drawer-like slides. Durations by what the
     motion is doing: feedback acknowledges a press, control is a hover or small
     state change, panel is a menu or overlay, reveal is content arriving on
     scroll. UI stays under 300ms; only reveals, which nobody is waiting on,
     run longer. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-feedback: 150ms;
  --dur-control: 200ms;
  --dur-panel: 300ms;
  --dur-reveal: 500ms;

  /* Z-index scale */
  --z-header: 900;     /* fixed nav bar */
  --z-dropdown: 910;   /* nav dropdown menus */
  --z-drawer: 940;     /* mobile slide-out + its overlay (930) */
  --z-dock: 970;       /* top/bottom dock (submenu shell sits at 969) */
  --z-modal: 2000;     /* password modal, blog editor */
  --z-lightbox: 3000;  /* full-screen photo viewer */
  --z-skip: 10000;     /* skip link above everything */

  /* Navigation and the outer glass surfaces use the chrome width. */
  --content-max: 1200px;
  --section-padding: max(160px, calc((100vw - var(--content-max)) / 2));

  /* Type scale — editorial display faces paired with a deliberately quieter
     sans-serif reading layer. Keeping these roles here prevents each page from
     inventing subtly different body sizes and leading. */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  /* The After Hours glass header sets the shared page-heading inset. */
  --page-panel-top: 140px;
  --page-content-max: calc(var(--content-max) - 80px);
  --page-min-gutter: 52px;
  --page-heading-inset: max(var(--page-min-gutter), calc((100% - var(--page-content-max)) / 2));
  --page-panel-gutter: calc(var(--page-heading-inset) - var(--page-panel-pad-inline));
  --page-panel-pad-top: 36px;
  --page-panel-pad-inline: 40px;
  --page-heading-top: calc(var(--page-panel-top) + var(--page-panel-pad-top));
  --page-label-lift: 12px;
  --page-heading-label-gap: 28px;
  --type-menu-label: 10px;
  --type-subtitle: 12px;
  --type-page-title: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --type-display: clamp(2rem, 1.55rem + 1.8vw, 3rem);
  --type-title: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --type-item: 1.25rem;
  --tracking-label: 0.08em;
  --space-related: 0.75rem;
  --space-group: clamp(1.5rem, 3vw, 2.5rem);
  --type-body: 16px;
  --type-small: 14px;
  --type-chrome: 12px;
  --type-label: var(--type-small);
  --leading-display: 1.16;
  --leading-body: 1.75;
  --measure-reading: 60ch;

  /* Reserve room for 14px captions, 44px controls, and wrapping art tools.
     The viewer can scroll at very short heights; JS reads this same budget. */
  --lightbox-max-h: max(180px, calc(100dvh - 340px));

  /* Semantic text colors */
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-strong);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: 0.015em;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Chinese-language pages (e.g. booking, lang="zh-Hans"): pair Montserrat with
   a coordinated system CJK sans stack so mixed EN/中文 lines share one look.
   Selectors with an explicit font-family (imported after base.css) still win. */
:lang(zh-Hans) {
  font-family: 'Montserrat', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

a { color: inherit; text-decoration: none; }
small { font-size: var(--type-small); }
button { font-family: inherit; font-size: var(--type-small); }
input, select, textarea { font-family: inherit; font-size: var(--type-body); }

/* Balanced headings keep the editorial hierarchy composed at every width;
   paragraph wrapping remains natural but avoids stranded final words where
   supported. These are progressive enhancements with safe browser fallbacks. */
h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(var(--palette-blue-rgb), 0.38);
  color: var(--palette-white);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════
   SHARED TYPE PATTERNS — single source of truth.
   The per-page class names are kept as aliases so existing markup
   (and JS-generated markup) keeps working; page files may override
   only margins/alignment, never the core style.
   ══════════════════════════════════════ */

@media (max-width: 760px) {
  :root {
    --page-panel-top: 112px;
    --page-panel-pad-top: 28px;
    --page-panel-pad-inline: 28px;
  }
}
@media (max-width: 480px) {
  :root {
    --page-panel-top: 96px;
    --page-min-gutter: 32px;
    --page-panel-pad-top: 24px;
    --page-panel-pad-inline: 20px;
  }
}

/* Ruled eyebrow label (— LABEL ——) */
.section-label,
.catalog-label,
.blog-label,
.gallery-series,
.neptune-label {
  font-family: var(--font-body);
  font-size: var(--type-menu-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-mid);
  margin-top: calc(0px - var(--page-label-lift));
  margin-bottom: var(--page-heading-label-gap);
  display: flex;
  align-items: center;
  gap: 20px;
}

.section-label::after,
.catalog-label::after,
.blog-label::after,
.gallery-series::after,
.neptune-label::after {
  content: '';
  flex: 0 0 40px;
  height: 1px;
  background: var(--line-faint);
}

/* Shared page and section titles */
.section-title,
.gallery-page-title,
.blog-page-title,
.video-title,
.neptune-title {
  font-family: var(--font-display);
  font-size: var(--type-page-title);
  font-weight: 300;
  font-style: normal;
  line-height: var(--leading-display);
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}

/* Introductory captions */
.gallery-subtitle,
.blog-subtitle,
.neptune-subtitle {
  font-family: var(--font-body);
  font-size: var(--type-subtitle);
  font-weight: 400;
  line-height: var(--leading-body);
  color: var(--text-secondary);
  letter-spacing: 0.015em;
  max-width: var(--measure-reading);
}

/* Increase material density when transparency is unavailable or unwanted. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-bg: var(--surface-raised); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root {
    --glass-bg: var(--surface-raised);
    --glass-blur: none;
    --glass-rim: inset 0 0 0 1px var(--line-faint);
    --glass-border: 1px solid rgba(var(--palette-white-rgb), .35);
  }
}
