/* ============================================================
   MOMMATRIP DESIGN SYSTEM
   Redesign palette (teal ink / sun / coral / mint / sky, hard
   8px shadows) layered over the legacy "Forest Journal" token
   names so pages not yet ported keep resolving correctly.
   See ui-redesign/PORT-CONTRACT.md decision 4.
   ============================================================ */

/* Self-hosted fonts — no external Google Fonts dependency */
@font-face {
  font-family: 'Alfa Slab One';
  src: url('/static/fonts/AlfaSlabOne-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/static/fonts/CourierPrime-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/static/fonts/CourierPrime-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('/static/fonts/NunitoSans-Variable.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  color-scheme: light;

  /* Redesign palette */
  --ink: #123f3b;
  --ink-deep: #092f2c;
  --cream: #fff8e9;
  --paper: #fffdf7;
  --sun: #ffca56;
  --sun-soft: #ffe6a7;
  --coral: #f06445;
  --coral-dark: #c9482e;
  --mint: #bfe2ce;
  --mint-light: #e8f3e9;
  --sky: #b8dbe0;
  --blue: #2d6b75;
  --muted: #54716d;
  --line: rgba(18, 63, 59, 0.18);
  --line-strong: rgba(18, 63, 59, 0.38);
  --shadow: 8px 9px 0 var(--ink);
  --shadow-soft: 0 18px 50px rgba(9, 47, 44, 0.14);
  --display: 'Alfa Slab One', Rockwell, serif;
  --body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Courier Prime', monospace;
  --container: min(1180px, calc(100% - 40px));

  /* Legacy tokens — remapped aliases, not deleted (load-bearing:
     demo.js, state.js and inline template styles reference these
     by name; see PORT-CONTRACT.md decision 4). Values point into
     the redesign palette above so unported pages still look
     intentional until their own port task lands. */
  --earth-50:  var(--cream);
  --earth-100: var(--paper);
  --earth-150: var(--line);
  --earth-200: var(--line-strong);
  --earth-300: var(--line-strong);
  --earth-400: var(--line-strong);
  --stone-500: var(--muted);
  --stone-600: var(--ink);

  --forest-950: var(--ink-deep);
  --forest-900: var(--ink-deep);
  --forest-800: var(--ink);
  --forest-700: var(--blue);
  --forest-600: #3a7f89;
  --forest-500: var(--muted);
  --forest-400: #86aeb2;
  --forest-300: var(--sky);
  --forest-200: var(--mint);
  --forest-100: var(--mint-light);

  --terra-700: var(--coral-dark);
  --terra-600: var(--coral-dark);
  --terra-500: var(--coral);
  --terra-400: #f4906f;
  --terra-300: #f7ab8f;
  --terra-100: #fde4da;

  --amber-600: var(--sun);
  --amber-500: var(--sun);
  --amber-400: var(--sun-soft);
  --amber-100: var(--sun-soft);

  --white:     var(--paper);
  --ink-900:   var(--ink-deep);
  --ink-800:   var(--ink-deep);
  --ink-700:   var(--ink);
  --ink-600:   var(--ink);
  --ink-500:   var(--muted);
  --ink-400:   #7b948f;
  --ink-300:   #9fb3af;
  --ink-200:   #c7d6d3;
  --ink-100:   var(--mint-light);

  --font-display: var(--display);
  --font-serif:   var(--display);
  --font-body:    var(--body);

  --shadow-xs:   0 1px 3px rgba(9, 47, 44, 0.08);
  --shadow-sm:   0 2px 8px rgba(9, 47, 44, 0.10);
  --shadow-md:   var(--shadow);
  --shadow-lg:   0 12px 48px rgba(9, 47, 44, 0.16);
  --shadow-xl:   0 24px 80px rgba(9, 47, 44, 0.22);
  --shadow-glow: 0 0 0 3px rgba(45, 107, 117, 0.25), 0 4px 20px rgba(9, 47, 44, 0.14);

  /* Motion */
  --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --ease-in:       cubic-bezier(0.4, 0, 1, 1);
  --duration-fast: 180ms;
  --duration-mid:  320ms;
  --duration-slow: 500ms;

  /* Layout */
  --radius-sm:  0.5rem;
  --radius-md:  1rem;
  --radius-lg:  1.5rem;
  --radius-xl:  2rem;
  --max-width:  1280px;
  --nav-height: 78px;
  --demo-banner-h: 0rem;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* iOS Safari "Text Autosizing": without this, rotating to landscape makes
     Safari inflate text (and the boost sticks after rotating back). */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--earth-50);
  color: var(--ink-800);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--forest-900);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h4 { font-family: var(--font-body); font-size: 1.125rem; font-weight: 600; color: var(--ink-700); }

p { color: var(--ink-600, var(--ink-500)); line-height: 1.7; }

a { color: var(--forest-600); text-decoration: none; transition: color var(--duration-fast) var(--ease-smooth); }
a:hover { color: var(--forest-500); }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: var(--demo-banner-h);
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.5rem;
  background: rgba(255, 248, 233, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background var(--duration-slow) var(--ease-smooth),
              box-shadow var(--duration-slow) var(--ease-smooth);
}
.nav.scrolled {
  background: rgba(255, 248, 233, 0.98);
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink-deep);
}
.nav-logo img, .nav-logo svg {
  width: 34px;
  height: 34px;
}
.nav-logo-text {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nav-progress {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 2px;
  color: #69807b;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--duration-fast) var(--ease-smooth);
}
.nav-step.active { color: var(--coral-dark); }
.nav-step.done { color: var(--blue); }
.nav-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--cream);
  transition: background var(--duration-mid) var(--ease-smooth),
              transform var(--duration-mid) var(--ease-spring);
}
.nav-step.active .nav-step-dot {
  background: var(--sun);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--sun-soft);
  transform: scale(1.15);
}
.nav-step.done .nav-step-dot { background: var(--mint); }
.nav-step-sep { color: var(--line-strong); font-size: 0.7rem; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}
.text-link:hover { color: var(--coral-dark); }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  width: var(--container);
  margin-inline: auto;
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer-disclosure {
  max-width: 60ch;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-size: 0.82rem;
  font-weight: 700;
}
.site-footer-links a { color: var(--muted); text-decoration: none; }
.site-footer-links a:hover { color: var(--coral-dark); }

/* ── Demo Mode Banner ──────────────────────────────────────── */
body.demo-mode { --demo-banner-h: 2.75rem; }
@media (max-width: 768px) {
  body.demo-mode { --demo-banner-h: 3.25rem; }
}

#tp-demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  height: var(--demo-banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 0 1rem;
  white-space: nowrap;
  background: var(--forest-800);
  color: var(--earth-50);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
#tp-demo-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: inherit;
  border-radius: 2rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}
#tp-demo-build {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: var(--terra-500);
  border: none;
  color: #fff;
  border-radius: 2rem;
  padding: 0.2rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.db-short { display: none; }
@media (max-width: 768px) {
  #tp-demo-banner { gap: 0.5rem; padding: 0 0.625rem; }
  .db-full { display: none; }
  .db-short { display: inline; }
  #tp-demo-exit { min-width: 44px; min-height: 44px; padding: 0.25rem 0.5rem; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition:
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translate(-1px, -2px); box-shadow: 6px 7px 0 var(--ink); }
.btn:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* Ripple */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.35) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.btn:not(:disabled):hover::after { opacity: 1; }

.btn-primary {
  background: var(--coral-dark);
  color: white;
}
.btn-primary:not(:disabled):hover { background: var(--ink-deep); }

.btn-terra {
  background: var(--coral);
  color: white;
}
.btn-terra:not(:disabled):hover { background: var(--coral-dark); }

.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-outline:not(:disabled):hover { background: var(--sun-soft); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
  padding-left: 1rem;
  padding-right: 1rem;
}
.btn-ghost:not(:disabled):hover { background: var(--mint-light); color: var(--ink); box-shadow: none; transform: none; }

.btn-lg {
  min-height: 52px;
  padding: 1rem 2.5rem;
  font-size: 1.0625rem;
}

.btn-xl {
  min-height: 56px;
  padding: 1.125rem 3rem;
  font-size: 1.125rem;
  gap: 0.625rem;
}

/* Price sub-line inside XL CTAs — always its own line, no dash */
.btn-xl { flex-direction: column; gap: .1rem; }
.btn-xl .btn-sub { display: block; font-size: .85em; font-weight: 500; opacity: .95; }

/* Long-label XL CTAs must wrap on phones, never overflow the card/viewport
   (preview + lobby "Unlock Your Complete Trip" $9.99 one time). */
@media (max-width: 640px) {
  .btn-xl { white-space: normal; max-width: 100%; text-align: center; line-height: 1.35; padding: 1rem 1.4rem; width: 100%; }
}

.btn-icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: 3px 4px 0 var(--ink);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--earth-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform var(--duration-mid) var(--ease-smooth),
    box-shadow var(--duration-mid) var(--ease-smooth),
    border-color var(--duration-mid) var(--ease-smooth);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--earth-150);
}

/* Tile cards (places/hotels) */
.tile-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 5px 6px 0 var(--ink);
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}
/* hover-only: on touch devices :hover fires mid-swipe (touch-start) and the
   transform cancels the native horizontal scroll gesture used by the hotel
   photo carousel */
@media (hover: hover) {
  .tile-card:hover {
    transform: translate(-2px, -3px);
    box-shadow: 7px 8px 0 var(--ink);
  }
}
.tile-card.selected {
  box-shadow: 0 0 0 4px var(--sun), 5px 6px 0 var(--ink);
}
.tile-card.selected::before {
  content: 'Selected ✓';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  padding: 0.3rem 0.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink-deep);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 2px 3px 0 var(--ink);
  animation: popIn var(--duration-mid) var(--ease-spring);
}

.tile-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sky);
}
.tile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-smooth);
}
@media (hover: hover) { .tile-card:hover .tile-img-wrap img { transform: scale(1.06); } }

.tile-img-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(9, 47, 44, 0.35) 70%,
    rgba(9, 47, 44, 0.72) 100%
  );
}

.tile-category-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--sun);
  color: var(--ink-deep);
}

/* ── Curated fallback photos ──────────────────────────────────
   When no real venue photo could be found, a category-relevant curated
   image renders instead of a bare leaf. A brand-tint overlay + small
   "Representative" chip mark it as intentional app art — never a claim
   that it's a photo of that exact venue. Applied to any image wrapper
   carrying .has-fallback-photo (tile cards, booking/plan thumbnails). */
.has-fallback-photo { position: relative; }
.has-fallback-photo img { filter: saturate(0.85); }
/* A real element (not ::after) placed right after the <img> and before any
   badge/gradient/text siblings, so it tints only the photo and never
   paints over card text or badges. */
.fallback-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(58, 127, 137, 0.4), rgba(201, 72, 46, 0.28));
  mix-blend-mode: multiply;
  pointer-events: none;
}
.fallback-chip {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  pointer-events: none;
}
.fallback-chip.compact {
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.52rem;
  border-radius: 0.4rem;
  border-width: 1px;
}

.tile-img-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  color: white;
}
.tile-img-info .tile-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: white;
  line-height: 1.15;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.tile-stars {
  display: flex;
  gap: 2px;
  align-items: center;
  font-size: 0.8rem;
}
.star { color: var(--amber-400); }
.star.half { opacity: 0.5; }
.tile-rating-text { margin-left: 4px; font-size: 0.75rem; color: rgba(255,255,255,0.8); }

.tile-body {
  padding: 1rem 1.125rem 1.125rem;
}
.tile-description {
  font-size: 0.85rem;
  color: var(--ink-500);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-wizard-match {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.625rem;
  border-left: 3px solid var(--coral);
  padding: 0.5rem 0.65rem;
  background: #fff1eb;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}
.tile-wizard-match::before { content: '✦'; font-size: 0.7rem; margin-top: 2px; flex-shrink: 0; color: var(--coral-dark); }

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.tile-tag {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--mint-light);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}
.tile-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px dashed var(--line-strong);
  font-size: 0.78rem;
  color: var(--ink-400);
}
.tile-meta span { display: flex; align-items: center; gap: 0.25rem; }

/* Vote row (group trips) */
.tile-vote-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.125rem 0.9rem;
  border-top: 1px dashed var(--line-strong);
  background: var(--mint-light);
}
.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
  transition: background var(--duration-fast) var(--ease-smooth);
}
.vote-btn:hover { background: var(--sun-soft); }
.vote-btn.voted-yes { background: var(--mint); }
.vote-btn.voted-no  { background: #fff1eb; }
.vote-tally { margin-left: auto; font-family: var(--mono); font-size: 0.67rem; color: var(--muted); }

/* ── Sticky CTA Bar ────────────────────────────────────────── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  padding: 1rem 2rem;
  background: var(--ink-deep);
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: white;
  transform: translateY(100%);
  transition: transform var(--duration-mid) var(--ease-spring);
  box-shadow: 0 -6px 0 rgba(9, 47, 44, 0.2);
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta-info {
  font-size: 0.9375rem;
  color: var(--mint);
  font-weight: 600;
}
.sticky-cta-info strong { color: white; }

/* ── "Looking for something else?" chat widget (discover, hotels) ──── */
#chat-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 5.75rem;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.625rem;
}
#chat-toggle {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: var(--sun);
  box-shadow: 4px 5px 0 var(--ink);
  color: var(--ink-deep);
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}
#chat-toggle:hover { transform: translate(-1px, -2px); box-shadow: 6px 7px 0 var(--ink); }
#chat-panel {
  display: none;
  flex-direction: column;
  width: min(360px, calc(100vw - 2.5rem));
  height: 440px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: 7px 8px 0 var(--ink);
}
#chat-panel.open { display: flex; }
#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  background: var(--ink-deep);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
}
#chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--mint);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-msg {
  max-width: 87%;
  padding: 0.55rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  background: var(--mint-light);
  color: var(--ink);
}
.chat-msg.user { align-self: flex-end; background: var(--sun-soft); }
#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px dashed var(--line-strong);
}
#chat-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  outline: none;
  background: white;
  color: var(--ink-deep);
}
#chat-input:focus { box-shadow: 0 0 0 3px var(--sun-soft); }
#chat-send {
  width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral-dark);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}
#chat-send:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 760px) {
  #chat-widget { right: 0.875rem; }
}

/* ── Filter Chips ──────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0;
}
.chip {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-smooth);
}
.chip:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 var(--ink);
}
.chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ── Tags ──────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tag-forest  { background: var(--forest-100); color: var(--forest-700); }
.tag-terra   { background: var(--terra-100);  color: var(--terra-700);  }
.tag-amber   { background: var(--amber-100);  color: var(--amber-600);  }
.tag-neutral { background: var(--earth-100);  color: var(--stone-600);  }

/* ── Page Wrapper ──────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--demo-banner-h));
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 768px) { .container { padding: 0 2.5rem; } }
@media (min-width: 1200px) { .container { padding: 0 3rem; } }

/* ── Section Headers ───────────────────────────────────────── */
.section-header {
  padding: 3rem 0 2rem;
}
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest-500);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--forest-400);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--forest-900);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  font-size: 1.0625rem;
  color: var(--ink-400);
  max-width: 560px;
}

/* ── Place/Hotel Grids ─────────────────────────────────────── */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-bottom: 8rem;
}
@media (min-width: 1024px) {
  .places-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .places-grid { grid-template-columns: repeat(4, 1fr); }
}

.hotels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 8rem;
}
@media (min-width: 1200px) {
  .hotels-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Swipeable hotel photo gallery ────────────────────────────── */
.hotel-carousel {
  position: absolute; inset: 0; display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none;
  touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.hotel-carousel::-webkit-scrollbar { display: none; }
.hotel-carousel-slide { flex: 0 0 100%; scroll-snap-align: start; }
.hotel-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 32px; height: 32px; border: 1.5px solid var(--ink); border-radius: 50%;
  background: var(--paper); color: var(--ink); font-size: 1.1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-smooth);
}
.hotel-carousel-prev { left: 0.5rem; }
.hotel-carousel-next { right: 0.5rem; }
@media (hover: hover) {
  .tile-card:hover .hotel-carousel.has-gallery ~ .hotel-carousel-nav {
    opacity: 1; pointer-events: auto;
  }
}
.hotel-carousel-dots {
  position: absolute; bottom: 0.6rem; left: 50%; transform: translateX(-50%);
  z-index: 6; display: none; gap: 0.3rem;
}
.hotel-carousel.has-gallery ~ .hotel-carousel-dots { display: flex; }
.hotel-carousel-dots .dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5);
  transition: background 0.2s ease;
}
.hotel-carousel-dots .dot.active { background: white; }

/* Budget switcher: 2x2 grid of uniform single-line chips on mobile */
@media (max-width: 768px) {
  #budget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label select"
      "b1 b2"
      "b3 b4";
    align-items: center;
    gap: 0.6rem;
  }
  #budget-row > span { grid-area: label; margin-right: 0; }
  #budget-row #currency-select { grid-area: select; margin-left: 0 !important; justify-self: end; }
  #budget-row [data-budget="budget"]  { grid-area: b1; }
  #budget-row [data-budget="mid"]     { grid-area: b2; }
  #budget-row [data-budget="upscale"] { grid-area: b3; }
  #budget-row [data-budget="luxury"]  { grid-area: b4; }
  #budget-row [data-budget] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
  }
}

/* Stagger reveal animation */
.places-grid .tile-card,
.hotels-grid .tile-card {
  opacity: 0;
  transform: translateY(20px);
  animation: cardReveal 0.5s var(--ease-out) forwards;
}
@keyframes cardReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Loading Overlay ───────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-smooth);
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-bg {
  position: absolute;
  inset: 0;
  background: var(--forest-900);
  background-size: cover;
  background-position: center;
}
.loading-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(9, 47, 44, 0.82) 0%,
    rgba(5, 26, 24, 0.92) 100%
  );
}

.loading-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.loading-logo {
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.6s var(--ease-out) 0.2s forwards;
}

.loading-spinner-wrap {
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.4s var(--ease-out) 0.4s forwards;
}
.loading-ring {
  width: 48px;
  height: 48px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: var(--sun);
  border-radius: 50%;
  animation: spinRing 1s linear infinite;
  margin: 0 auto;
}
@keyframes spinRing { to { transform: rotate(360deg); } }

.loading-message {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  min-height: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.4s var(--ease-out) 0.5s forwards;
}
.loading-sub {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: fadeIn 0.4s var(--ease-out) 0.7s forwards;
}

/* Leaf canvas */
#leaf-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Hero Image Banner ─────────────────────────────────────── */
.hero-banner {
  position: relative;
  width: 100%;
  height: 45vh;
  min-height: 300px;
  overflow: hidden;
  background: var(--forest-900);
}
.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: transform 0.8s var(--ease-smooth);
}
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(22, 40, 25, 0.1) 0%,
    rgba(22, 40, 25, 0.65) 100%
  );
}
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 2.5rem 3rem;
}
.hero-destination {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: white;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  margin-bottom: 0.5rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}
.hero-meta-item { display: flex; align-items: center; gap: 0.375rem; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--forest-900);
  color: var(--earth-50);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.35s var(--ease-spring);
  max-width: 320px;
}
.toast.leaving { animation: toastOut 0.3s var(--ease-in) forwards; }
.toast.success { border-left: 3px solid var(--forest-400); }
.toast.error   { border-left: 3px solid var(--terra-500); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ── Forms / Inputs ────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--earth-200);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-800);
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus {
  border-color: var(--forest-500);
  box-shadow: 0 0 0 3px rgba(74, 136, 88, 0.18);
}
.input::placeholder { color: var(--ink-300); }

.input-date {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color-scheme: light;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--earth-200), transparent);
  margin: 2rem 0;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes popIn {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Utility Classes ───────────────────────────────────────── */
.hidden      { display: none !important; }
.sr-only     { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 0.75rem; }
.gap-4       { gap: 1rem; }
.gap-6       { gap: 1.5rem; }
.mt-2        { margin-top: 0.5rem; }
.mt-4        { margin-top: 1rem; }
.mt-6        { margin-top: 1.5rem; }
.mt-8        { margin-top: 2rem; }
.mb-4        { margin-bottom: 1rem; }
.mb-6        { margin-bottom: 1.5rem; }
.font-display { font-family: var(--font-display); }
.italic      { font-style: italic; }
.opacity-60  { opacity: 0.6; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  .nav-progress { display: none; }
  .places-grid  { grid-template-columns: 1fr; }
  .hotels-grid  { grid-template-columns: 1fr; }
  .hero-content { padding: 1.5rem; }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
