/* The Lodge — shared design layer.
   1. Tokens + base        4. Buttons (pill, button-in-button)
   2. Floating island nav  5. Double-bezel surfaces, eyebrow pills
   3. Mobile menu overlay  6. Scroll choreography, legacy responsive rules
   Colours come from lodge-theme.css (generated, light + dark); the role tokens
   below name the few that sit outside the palette scan. */

/* ---------- 1. Tokens + base ---------- */
:root {
  --cream: var(--bg-F6F3EC);
  --cream-2: var(--bg-EDE8DD);
  --card: var(--bg-FFFFFF);
  --ink: var(--fg-26364D);
  --ink-2: var(--fg-3B4A60);
  --muted: var(--fg-5C6A7E);
  --navy: var(--bg-26364D);
  --navy-hover: var(--bg-1C2A3D);
  --on-navy: var(--fg-F6F3EC);
  --on-navy-muted: var(--fg-B9C2CF);
  --amber: var(--bg-B27C33);
  --amber-ink: var(--fg-8C6424);
  --amber-light: var(--bg-D9A45B);
  --btn-amber: var(--bg-9C6B27);
  --btn-amber-hover: var(--bg-835A1F);
  /* role tokens: colours that are fixed by what they sit on, not by the theme */
  --on-accent: #FFFFFF;                      /* text + icons on amber fills */
  --on-accent-well: rgba(255,255,255,.18);   /* icon well inside an amber button */
  --edge-hi: rgba(255,255,255,.08);          /* top highlight on navy panels */
  --edge-hi-strong: rgba(255,255,255,.18);   /* top highlight on amber panels */
  --plate-glow: #FFFFFF;                     /* hero mascot plate */
  --plate-base: var(--ui-plate);
  --paper-ink: rgba(38,54,77,.22);           /* Logbook covers stay paper in both themes */
  --paper-tag: rgba(38,54,77,.86);
  --paper-shadow: rgba(38,54,77,.3);
  --paper-well: rgba(255,255,255,.9);
  --line: var(--line-E4DDD0);
  --line-strong: var(--line-C9BFAE);

  --font-display: 'Newsreader', 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', system-ui, sans-serif;

  /* Motion. Everything decelerates; nothing eases in. Durations by role:
     press 90ms · feedback 160ms (colour, ring) · state 280ms (lift, select, swap)
     overlay 420ms in / 240ms out · focal 750ms+ (the tier build, nothing else). */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --spring: cubic-bezier(.32,.72,0,1);   /* heavier settle, reserved for the focal moment */
  --t-press: 90ms;
  --t-fb: 160ms;
  --t-state: 280ms;
  --t-overlay: 420ms;
  --t-exit: 240ms;
  --t-focal: 750ms;

  --radius-shell: 2rem;
  --bezel: 6px;
  --radius-core: calc(var(--radius-shell) - var(--bezel));

  --z-header: 50;
  --z-menu: 60;
  --z-grain: 90;
  --z-progress: 200;
  --z-skip: 300;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--ui-selection); color: var(--ink); }
html { scrollbar-color: var(--line-C9BFAE) transparent; }
input, textarea { caret-color: var(--amber); }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Headings fill their line and only avoid a one-word last line; interactions.js keeps
   phrases, brand names and Vietnamese compound words together, so breaks fall between them. */
h1, h2, h3, h4 { text-wrap: pretty; overflow-wrap: break-word; }
.display em { white-space: nowrap; }  /* keep the emphasised phrase whole (e.g. "tử tế") */
p { text-wrap: pretty; }
img { max-width: 100%; }

/* Paper grain (fixed, never on scrolling content) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.21 0 0 0 0 0.3 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* dark: from the system setting unless the theme switch chose light, or from the switch */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --plate-glow: #E7E0D2; --plate-base: #CFC6B5; }   /* warm mid-tone, not a glare spot */
  :root:not([data-theme="light"]) body::after { opacity: .025; filter: invert(1); }
}
:root[data-theme="dark"] { --plate-glow: #E7E0D2; --plate-base: #CFC6B5; }
:root[data-theme="dark"] body::after { opacity: .025; filter: invert(1); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--line-B27C33) !important;
  outline-offset: 3px !important;
  border-radius: 8px;
}

a, button, [role="button"], summary { -webkit-tap-highlight-color: transparent; }
button:not(:disabled):active,
a[style*="padding"]:active {
  transform: translateY(1px) scale(.985) !important;
  transition-duration: var(--t-press) !important;
}
button:disabled { cursor: not-allowed; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: var(--z-skip);
  background: var(--navy); color: var(--on-navy) !important;
  padding: 14px 18px; border-radius: 999px;
  font: 600 14px var(--font-body); text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--t-state) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Page + reading progress: CSS scroll-driven, no scroll listeners */
#lodge-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: var(--z-progress); pointer-events: none;
  background: linear-gradient(90deg, var(--amber), var(--amber-light));
  transform-origin: 0 50%; transform: scaleX(0);
  animation: lodge-grow linear both;
  animation-timeline: scroll(root block);
}
.read-progress { transform-origin: 0 50%; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .read-progress { animation: lodge-grow linear both; animation-timeline: scroll(nearest block); }
}
@supports not (animation-timeline: scroll()) { .read-progress { display: none; } }
@keyframes lodge-grow { to { transform: scaleX(1); } }

/* ---------- 2. Floating island nav ---------- */
.island-wrap {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; justify-content: center;
  padding: 18px 20px 0;
  pointer-events: none;           /* only the pill catches clicks */
}
.island {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: max-content; max-width: 100%;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  background: var(--ui-glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow:
    0 0 0 1px var(--ui-ring),
    inset 0 1px 0 var(--ui-highlight),
    0 18px 40px -24px var(--ui-shadow);
}
.island-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px 0 0; margin-right: 4px;
  text-decoration: none; color: var(--ink);
  font: 600 19px/1 var(--font-display); letter-spacing: -0.01em;
}
.island-brand { min-height: 44px; }
.island-brand img { width: 34px; height: 34px; object-fit: contain; display: block; }
.island-nav { display: flex; align-items: center; gap: 2px; }
.island-nav a {
  position: relative;
  padding: 9px 14px; border-radius: 999px;
  font: 500 14px/1 var(--font-body); color: var(--muted);
  text-decoration: none; white-space: nowrap;
  transition: color var(--t-fb) var(--ease-out), background-color var(--t-fb) var(--ease-out);
}
.island-nav a:hover { color: var(--ink); background: var(--ui-shell); }
.island-nav a[aria-current="page"] { color: var(--ink); background: var(--ui-shell); box-shadow: inset 0 0 0 1px var(--ui-ring); }
.island-lang {
  height: 38px; min-width: 42px; padding: 0 12px; margin: 0 2px 0 6px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink);
  font: 600 13px/1 var(--font-body); letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px var(--ui-ring);
  transition: background-color var(--t-fb) var(--ease-out);
}
.island-lang:hover { background: var(--ui-shell); }
/* Desktop bar: a fixed width, so switching EN / VI never resizes it. The five links
   share the middle with equal spacing; the language button and the CTA reserve the
   width of their longer translation (the hidden .swap-alt) so they keep their size.
   Tablet and phone layouts don't reserve anything. */
.swap-alt { display: none; }
@media (min-width: 961px) {
  /* --np is the link's side padding; the brand and the theme button sit the same
     distance from their neighbouring link, so every gap on the bar matches */
  .island { --np: 14px; width: min(100%, 1040px); }
  .island-nav a { padding: 9px var(--np); }
  .island-brand { padding-right: calc(var(--np) - 6px); margin-right: 0; }
  .island-brand, .island-theme, .island-lang, .island > .btn { flex-shrink: 0; }
  .island-nav { flex: 1; justify-content: space-evenly; gap: 0; }
  .island .island-theme { margin: 0 0 0 calc(var(--np) - 6px); }
  .island .island-theme + .island-lang, .island .island-lang { margin: 0; }
  .island :is(.island-lang, .btn) .swap { display: inline-grid; justify-items: center; }
  .island :is(.island-lang, .btn) .swap > * { grid-area: 1 / 1; }
  .island :is(.island-lang, .btn) .swap-alt { display: inline; visibility: hidden; }
  .island .btn .swap { justify-items: start; }
}
@media (min-width: 961px) and (max-width: 1100px) { .island { --np: 11px; } }
@media (min-width: 961px) and (max-width: 1040px) { .island { --np: 8px; } }
/* Light / dark switch (built by interactions.js, sits before the language button) */
.island-theme {
  width: 38px; height: 38px; margin: 0 0 0 6px; flex-shrink: 0;
  display: grid; place-items: center; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); font-size: 17px;
  box-shadow: inset 0 0 0 1px var(--ui-ring);
  transition: background-color var(--t-fb) var(--ease-out);
}
.island-theme:hover { background: var(--ui-shell); }
.island-theme i { animation: lodgeThemeIcon var(--t-state) var(--ease-out); }
@keyframes lodgeThemeIcon { from { opacity: 0; rotate: -70deg; scale: .6; } }
.island-theme + .island-lang { margin-left: 4px; }

/* Hamburger: two lines morph into an X */
.lodge-menu-btn {
  display: none; position: relative;
  width: 42px; height: 42px; border: 0; border-radius: 999px;
  background: var(--navy); cursor: pointer;
}
.lodge-menu-btn span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; border-radius: 2px;
  background: var(--on-navy);
  transition: transform var(--t-state) var(--ease-out);
}
.lodge-menu-btn span:first-child { transform: translateY(-3.5px); }
.lodge-menu-btn span:last-child { transform: translateY(3.5px); }
.island-wrap.menu-open { z-index: calc(var(--z-menu) + 1); }
.menu-open .lodge-menu-btn span:first-child { transform: rotate(45deg); }
.menu-open .lodge-menu-btn span:last-child { transform: rotate(-45deg); }

/* ---------- 3. Mobile menu overlay (built by interactions.js) ---------- */
.menu-overlay {
  position: fixed; inset: 0; z-index: var(--z-menu);
  display: flex; flex-direction: column;
  padding: 120px 28px 48px;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--ui-glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(1.3);
  backdrop-filter: blur(40px) saturate(1.3);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-exit) var(--ease-out), visibility 0s linear var(--t-exit);
}
.menu-overlay.is-open { opacity: 1; visibility: visible; transition: opacity var(--t-overlay) var(--ease-out); }
/* auto margins centre the list when it fits and let it scroll from the top when it
   doesn't (landscape phones), where justify-content: center would clip the first links */
.menu-overlay nav { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.menu-overlay > :last-child { margin-bottom: auto; }
.menu-overlay nav a, .menu-overlay .menu-cta {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--t-exit) var(--ease-out), transform var(--t-exit) var(--ease-out);
}
/* links follow the panel in, one beat apart; on close they all leave together */
.menu-overlay.is-open nav a, .menu-overlay.is-open .menu-cta {
  opacity: 1; transform: none;
  transition-duration: var(--t-overlay), 560ms;
  transition-delay: calc(var(--i, 0) * 45ms + 60ms);
}
.menu-overlay nav a {
  display: block; padding: 10px 0;
  font: 500 clamp(36px, 10vw, 52px)/1.05 var(--font-display); letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.menu-overlay nav a[aria-current="page"] { font-style: italic; color: var(--amber-ink); }
.menu-overlay .menu-cta { margin-top: 36px; align-self: flex-start; }
body.menu-locked { overflow: hidden; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 7px 7px 7px 24px;
  border-radius: 999px; border: 0; cursor: pointer;
  font: 600 15px/1 var(--font-body); letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--t-state) var(--ease-out), background-color var(--t-fb) var(--ease-out), box-shadow var(--t-fb) var(--ease-out);
}
.btn:active { transform: scale(.98) !important; transition-duration: var(--t-press); }
.btn-icon {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px;
  transition: transform var(--t-state) var(--ease-out), background-color var(--t-fb) var(--ease-out);
}
@media (hover: hover) { .btn:hover .btn-icon { transform: translate(3px, -1px) scale(1.06); } }
.btn-amber { background: var(--btn-amber); color: var(--on-accent); box-shadow: 0 1px 2px rgba(var(--shadow-rgb-38-54-77), .18), 0 10px 22px -14px rgba(var(--shadow-rgb-38-54-77), .45); }
.btn-amber:hover { background: var(--btn-amber-hover); }
.btn-amber .btn-icon { background: var(--on-accent-well); }
.btn-ink { background: var(--navy); color: var(--on-navy); }
.btn-ink:hover { background: var(--navy-hover); }
.btn-ink .btn-icon { background: rgba(var(--line-rgb-246-243-236), .12); }
.btn-sm { min-height: 44px; padding: 7px 7px 7px 18px; font-size: 14px; gap: 10px; }
.btn-sm .btn-icon { width: 30px; height: 30px; font-size: 14px; }
.btn-ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { background: var(--ui-shell); }
.btn-ghost .btn-icon { background: var(--ui-shell); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font: 600 15px/1 var(--font-body); color: var(--ink); text-decoration: none;
}
.link-arrow .btn-icon { width: 32px; height: 32px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.link-arrow:hover .btn-icon { transform: translate(3px, -1px) scale(1.06); background: var(--ui-shell); }

/* ---------- 5. Double-bezel surfaces + eyebrow pills ---------- */
/* One surface per card. The .bezel wrapper stays in the markup as a layout hook
   but draws nothing; the core is the card. */
.bezel { border-radius: var(--radius-shell); }
.bezel-core {
  height: 100%;
  border-radius: var(--radius-shell);
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px var(--ui-ring),
    0 24px 48px -36px var(--ui-shadow);
}
.label {
  font: 600 13px/1.3 var(--font-body); letter-spacing: 0.01em;
  color: var(--amber-ink);
}
.label.on-dark { color: var(--amber-light); }

/* ---------- 5b. Page primitives (all pages) ---------- */
.page {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);   /* plain paper; the grain overlay supplies texture */
  min-height: 100dvh;
}
/* Blueprint grid: used sparingly, only inside the boxes where "drawing board" means
   something (the tier ladder, Logbook covers). Add .grid-paper to any box to opt in. */
.grid-paper {
  background-image:
    linear-gradient(rgba(var(--bg-rgb-38-54-77), .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--bg-rgb-38-54-77), .05) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.display {
  font-family: var(--font-display);
  font-weight: 450;
  letter-spacing: -0.025em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
}
.display em { font-style: italic; font-weight: 400; color: var(--amber-ink); }
.lede { font-size: 18px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 44ch; }
.sec { padding: 136px 0; }
.sec-head { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; margin-bottom: 64px; max-width: 760px; }
.sec-head h2 { font-size: clamp(40px, 5vw, 64px); }
.sec-head p { font-size: 17px; line-height: 1.7; color: var(--muted); margin: 0; }  /* .sec-head (760px) sets the measure */

/* Footer (all pages) */
.foot { padding: 120px 0 40px; }
.foot-top { display: grid; grid-template-columns: 6fr 3fr 3fr; gap: 48px; padding-bottom: 72px; }
.foot-mark { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.foot-mark img { width: 64px; height: 64px; object-fit: contain; }
.foot-word { font: italic 400 clamp(56px, 7vw, 104px)/0.9 var(--font-display); letter-spacing: -0.035em; color: var(--ink); }
.foot-mark p { margin: 0; color: var(--muted); font-size: 15px; }
/* direct contact in every footer: the one route that still works if the form, JS or email fails */
.foot-reach { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.foot-reach a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 15px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; overflow-wrap: anywhere; transition: text-decoration-color var(--t-fb) var(--ease-out), color var(--t-fb) var(--ease-out); }
.foot-reach a:hover { text-decoration-color: var(--amber); }
.foot-reach i { font-size: 18px; color: var(--amber-ink); flex: none; }
.foot-col { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.foot-h { margin: 0 0 6px; font: 600 13px/1.3 var(--font-body); letter-spacing: 0.01em; color: var(--amber-ink); }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.45; transition: color var(--t-fb) var(--ease-out); }
.foot-col a:hover { color: var(--amber-ink); }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; box-shadow: 0 -1px 0 var(--line); font-size: 13px; color: var(--muted); }
.foot-legal a { color: var(--muted); text-decoration: none; }
.foot-legal a:hover { color: var(--ink); }
.foot-legal nav { display: flex; gap: 22px; }

.foot-top.is-compact { grid-template-columns: 6fr 6fr; }
.foot-top.is-compact .foot-col { flex-direction: row; flex-wrap: wrap; gap: 12px 28px; align-content: flex-start; }
.foot-top.is-compact .foot-col .foot-h { flex-basis: 100%; }

@media (max-width: 960px) { .foot-top, .foot-top.is-compact { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .wrap { padding: 0 16px; }
  .sec { padding: 96px 0; }
  .foot { padding-top: 88px; }
  .foot-top { gap: 36px; padding-bottom: 48px; }
  .foot-col a, .foot-legal a { display: inline-flex; align-items: center; min-height: 44px; }
  .foot-col { gap: 0; }
  .foot-legal nav { gap: 4px 22px; flex-wrap: wrap; }
}

/* ---------- 5b2. Chips + search field (shared by Home and the inner pages) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink);
  font: 600 14px/1.2 var(--font-body); cursor: pointer;
  transition: border-color var(--t-fb) var(--ease-out), background-color var(--t-fb) var(--ease-out), color var(--t-fb) var(--ease-out), transform var(--t-state) var(--ease-out);
}
@media (hover: hover) { .chip:hover { border-color: var(--line-8C6424); } }
.chip:active { transform: scale(.97); }
/* selected = filled + a tick, so the state never rests on colour alone */
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.chip-tick { font-size: 16px; margin-left: -4px; animation: lodgeTick var(--t-state) var(--ease-out); }
@keyframes lodgeTick { from { opacity: 0; scale: .4; } }
/* soft variant: personal state (saved) rather than a filter choice */
.chip.is-soft[aria-pressed="true"], .chip.is-soft.is-on { background: var(--bg-F3E7D4); border-color: var(--line-B27C33); color: var(--fg-8A6A3B); }
.chip-sm { min-height: 40px; padding: 8px 14px; font-size: 13px; gap: 7px; }
/* chips that sit on a navy panel (Pricing estimator) */
.navy-panel .chip { border-color: rgba(var(--line-rgb-246-243-236), .22); color: var(--on-navy); font-weight: 500; }
@media (hover: hover) { .navy-panel .chip:hover { border-color: var(--line-D9A45B); } }
.navy-panel .chip[aria-pressed="true"] { background: rgba(var(--bg-rgb-217-164-91), .16); border-color: var(--line-D9A45B); font-weight: 700; }
.navy-panel .chip-tick { color: var(--amber-light); }
.search { position: relative; display: flex; align-items: center; }
.search i { position: absolute; left: 16px; font-size: 18px; color: var(--fg-6F7B8D); pointer-events: none; }
.search input { width: 260px; min-height: 44px; padding: 12px 18px 12px 44px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--card); color: var(--ink); font: 400 14px var(--font-body); outline: none; transition: box-shadow var(--t-fb) var(--ease-out); }
.search input:focus { box-shadow: inset 0 0 0 1.5px var(--line-8C6424), 0 0 0 4px rgba(var(--line-rgb-178-124-51), .12); }

/* ---------- 5c. Hardening helpers ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Whole-card click target from one real button (the title). The card needs position: relative. */
.stretch {
  all: unset; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit;
}
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.stretch:focus-visible { outline: none !important; }
/* Long names, emails and pasted links never push the layout sideways */
h1, h2, h3, p, li, dd, dt, blockquote, figcaption, label, strong, b { overflow-wrap: break-word; }
.req { color: var(--amber-ink); font-weight: 600; }

/* ---------- 6. Motion ----------
   Content is visible by default; there is no blanket entrance on every section.
   The one authored moment is the tier "layers" stack (home.css, .layers.is-built). */

/* Mobile dock CTA (interactions.js shows it once the hero scrolls away) */
.dock-cta {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: var(--z-header);
  display: none; justify-content: space-between;
  translate: 0 calc(100% + 24px);
  transition: translate var(--t-exit) var(--ease-out);
}
.dock-cta.is-on { translate: 0 0; transition-duration: var(--t-overlay); }
@media (max-width: 680px) {
  .dock-cta { display: flex; }
  body.has-dock .foot { padding-bottom: 96px; }  /* the dock never covers the last links */
}

/* Messenger launcher (interactions.js): navy button bottom-right, glass panel above it
   that opens by itself once per visit.
   On phones the button closes the dock row, so the dock gives up its right end. */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: var(--z-header);
  width: 56px; height: 56px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--navy); color: var(--on-navy); font-size: 26px;
  box-shadow: 0 0 0 2px rgba(var(--line-rgb-246-243-236), .5), inset 0 1px 0 var(--edge-hi), 0 1px 2px rgba(var(--shadow-rgb-38-54-77), .2), 0 14px 30px -14px rgba(var(--shadow-rgb-38-54-77), .55);
  transition: transform var(--t-state) var(--ease-out), background-color var(--t-fb) var(--ease-out);
  animation: lodgeChatIn var(--t-overlay) var(--ease-out) both .6s;
}
.chat-fab:hover { background: var(--navy-hover); }
.chat-fab:active { transform: scale(.94); transition-duration: var(--t-press); }
.chat-fab i { grid-area: 1 / 1; transition: opacity var(--t-fb) var(--ease-out), transform var(--t-state) var(--ease-out); }
.chat-fab .ph-x { opacity: 0; transform: rotate(-45deg) scale(.7); font-size: 22px; }
.chat-fab[aria-expanded="true"] .ph-messenger-logo { opacity: 0; transform: rotate(45deg) scale(.7); }
.chat-fab[aria-expanded="true"] .ph-x { opacity: 1; transform: none; }
@keyframes lodgeChatIn { from { opacity: 0; transform: translateY(12px) scale(.9); } }

.chat-panel {
  position: fixed; right: 24px; bottom: 92px; z-index: var(--z-header);
  width: 320px; max-width: calc(100vw - 24px);
  padding: 20px 14px 14px; border-radius: 24px;
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
  background: var(--ui-glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--ui-ring), inset 0 1px 0 var(--ui-highlight), 0 24px 48px -24px var(--ui-shadow);
  transform-origin: calc(100% - 28px) 100%;
  opacity: 0; transform: translateY(8px) scale(.96);
  transition: opacity var(--t-exit) var(--ease-out), transform var(--t-exit) var(--ease-out);
}
.chat-panel.is-open { opacity: 1; transform: none; transition-duration: var(--t-overlay); }
.chat-x {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 18px;
  background: transparent; color: var(--muted);
  transition: background-color var(--t-fb) var(--ease-out), color var(--t-fb) var(--ease-out);
}
.chat-x:hover { background: var(--ui-shell); color: var(--ink); }
.chat-title { margin: 0 48px 0 6px; font: 500 22px/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.chat-sub { margin: 8px 6px 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.chat-cta {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 7px 7px 7px 18px; border-radius: 999px;
  background: var(--navy); color: var(--on-navy); text-decoration: none;
  font-size: 15px; font-weight: 600;
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 10px 22px -14px rgba(var(--shadow-rgb-38-54-77), .45);
  transition: background-color var(--t-fb) var(--ease-out), transform var(--t-state) var(--ease-out);
}
.chat-cta:hover { background: var(--navy-hover); }
.chat-cta:active { transform: scale(.98); transition-duration: var(--t-press); }
.chat-cta > i { font-size: 22px; }
.chat-cta > span:first-of-type { flex: 1; }
.chat-cta-go { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; font-size: 16px; background: rgba(var(--line-rgb-246-243-236), .12); transition: transform var(--t-state) var(--ease-out); }
@media (hover: hover) { .chat-cta:hover .chat-cta-go { transform: translate(2px, -2px); } }
@media (min-width: 681px) { body.has-chat .foot { padding-bottom: 96px; } }  /* the launcher never covers the last footer line */
@media (max-width: 680px) {
  .chat-fab { right: 12px; bottom: 12px; width: 50px; height: 50px; font-size: 24px; }
  body.has-chat .dock-cta { right: 70px; }
  .chat-panel { right: 12px; bottom: 72px; width: auto; left: 12px; max-width: none; }
  body.has-chat:not(.has-dock) .foot { padding-bottom: 80px; }
}
@media print { .chat-fab, .chat-panel { display: none !important; } }

/* Reduced motion: nothing travels, scales or rotates on its own. State still
   changes visibly, as a short cross-fade in place, so the page never feels broken. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-delay: 0s !important; }
  @keyframes lodgeRise { from { opacity: 0; } }
  @keyframes lodgeSlide { from { opacity: 0; } }
  @keyframes lodge-spin { 50% { opacity: .35; } }
  .menu-overlay nav a, .menu-overlay .menu-cta { transform: none; }
  .dock-cta { translate: none; opacity: 0; visibility: hidden; transition: opacity var(--t-state) var(--ease-out), visibility 0s linear var(--t-state); }
  .dock-cta.is-on { opacity: 1; visibility: visible; transition: opacity var(--t-state) var(--ease-out); }
  @keyframes lodgeChatIn { from { opacity: 0; } }
  .chat-panel, .chat-fab i, .chat-fab[aria-expanded="true"] i { transform: none !important; }
  .btn:hover .btn-icon, .t-step:hover, .feature:hover, .post:hover, .save-btn:hover, .svc.is-pick { transform: none !important; }
  .cascade > * { transition: none; }
  @keyframes lodgeThemeIcon { from { opacity: 0; } }
}

/* Island nav collapses below laptop width. From here down the bar is touch-first:
   every control is a full 44px target and never shrinks; when space runs out the
   wordmark gives way first, never the buttons. */
@media (max-width: 960px) {
  .island { width: 100%; justify-content: space-between; padding-left: 12px; }
  .island-nav { display: none; }
  .island-lang { margin-left: auto; }
  .island-theme { margin-left: auto; }
  .lodge-menu-btn { display: block; }
  .island-lang, .lodge-menu-btn, .island-theme { height: 44px; flex-shrink: 0; }
  .island-theme, .lodge-menu-btn { width: 44px; }
  .island-brand span, .island-lang { white-space: nowrap; }
}
@media (max-width: 680px) {
  .island-wrap { padding: 12px 12px 0; }
  .island > .btn { display: none; }
  .island-brand { font-size: 18px; }
}
/* small phones (360–420px): tighten the bar so "The Lodge" + "Tiếng Việt" stay on one line */
@media (max-width: 420px) {
  .island { gap: 4px; padding-right: 6px; }
  .island-brand { gap: 7px; padding-right: 4px; margin-right: 0; font-size: 17px; }
  .island-brand img { width: 30px; height: 30px; }
  .island-lang { padding: 0 9px; margin-left: auto; }
  .island-theme + .island-lang { margin-left: 2px; }
}
/* below 360px only the mascot mark stays; the name remains for screen readers */
@media (max-width: 359px) {
  .island-brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .island-brand { min-width: 44px; justify-content: center; padding-right: 0; }
}
/* touch laptops and tablets in landscape keep the full bar, at touch size */
@media (min-width: 961px) and (pointer: coarse) {
  .island-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .island-lang, .island-theme { height: 44px; }
  .island-theme { width: 44px; }
}
/* short screens (phones on their side): the menu list scales to the height */
@media (max-height: 560px) {
  .menu-overlay { padding-top: 84px; padding-bottom: 24px; }
  .menu-overlay nav a { font-size: clamp(26px, 8vh, 36px); padding: 5px 0; }
  .menu-overlay .menu-cta { margin-top: 18px; }
}
/* phones: a long button label wraps inside the button instead of pushing the page sideways */
@media (max-width: 480px) {
  .btn { white-space: normal; max-width: 100%; line-height: 1.25; text-align: left; }
}
/* iOS zooms into any field under 16px on focus */
@media (max-width: 768px), (pointer: coarse) {
  .search input { font-size: 16px; }
}

/* labels repeated inline on stacked table rows (phones) */
.m-label { display: none; }

/* The navy mascot needs a paper backing on dark surfaces */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.island-brand img, .foot-mark img) { background: var(--ui-plate); border-radius: 999px; padding: 3px; }
}
:root[data-theme="dark"] :is(.island-brand img, .foot-mark img) { background: var(--ui-plate); border-radius: 999px; padding: 3px; }
