/* ==========================================================================
   MERA Travels — design system
   ========================================================================== */

/* --- palettes ------------------------------------------------------------ */
:root[data-palette="terracotta"] {
  --brand-500: #C15A3B;
  --brand-600: #A94A2E;
  --brand-700: #7A2E1A;
  --brand-050: #FBEEE6;
  --accent-500: #D9A24C;   /* ochre */
  --sage-500:  #6B7A5A;
}
:root[data-palette="clay"] {
  --brand-500: #B14A2F;
  --brand-600: #953B23;
  --brand-700: #6E2415;
  --brand-050: #F7E6DC;
  --accent-500: #E0B060;
  --sage-500:  #7C8A6B;
}
:root[data-palette="sage"] {
  --brand-500: #6B7A5A;
  --brand-600: #57664A;
  --brand-700: #3E4A34;
  --brand-050: #ECEFE4;
  --accent-500: #C89A55;
  --sage-500:  #C15A3B;
}

/* --- light theme --------------------------------------------------------- */
:root[data-theme="light"] {
  --bg:       #F7F3ED;
  --bg-sub:   #EFEAE1;
  --surface:  #FFFFFF;
  --surface-2:#FBF7F1;
  --ink:      #1F1A15;
  --ink-2:    #3A322A;
  --muted:    #5F5348;   /* was #6B5E52 — bumped for AA on bg */
  --muted-2:  #78685B;   /* was #8B7E70 — placeholders / captions */
  --line:     #E4DACB;
  --line-2:   #D6C9B5;
  --shadow-sm: 0 1px 2px rgba(31,26,21,.06), 0 1px 1px rgba(31,26,21,.04);
  --shadow-md: 0 8px 24px rgba(31,26,21,.08), 0 2px 6px rgba(31,26,21,.05);
  --shadow-lg: 0 24px 60px rgba(31,26,21,.12), 0 8px 20px rgba(31,26,21,.08);
  --on-brand: #FFFFFF;
  --overlay:  rgba(31,26,21,.55);
}

/* --- dark theme ---------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg:       #14100C;
  --bg-sub:   #1A1512;
  --surface:  #1E1813;
  --surface-2:#251E18;
  --ink:      #F4EEE4;
  --ink-2:    #DDD3C4;
  --muted:    #B2A594;   /* was #A89B8C — lifted for AA */
  --muted-2:  #968A7A;   /* was #877B6E — placeholders / captions */
  --line:     #33291F;
  --line-2:   #453729;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  --on-brand: #FFFFFF;
  --overlay:  rgba(10,7,4,.7);
}
:root[data-theme="dark"][data-palette="terracotta"] { --brand-500: #D96A48; --brand-600: #E27B5B; --brand-050: #2E1A11; }
:root[data-theme="dark"][data-palette="clay"]       { --brand-500: #C55934; --brand-050: #2E1811; }
:root[data-theme="dark"][data-palette="sage"]       { --brand-500: #8A9B75; --brand-050: #1F241A; }

/* --- type ---------------------------------------------------------------- */
:root {
  --font-display: 'Instrument Sans', 'Inter Tight', system-ui, sans-serif;
  --font-body:    'Inter Tight', system-ui, -apple-system, Segoe UI, sans-serif;

  --fs-eyebrow: 0.72rem;
  --fs-body:    1rem;
  --fs-lead:    1.125rem;
  --fs-h5:      1.15rem;
  --fs-h4:      1.4rem;
  --fs-h3:      1.75rem;
  --fs-h2:      clamp(1.9rem, 2.6vw, 2.75rem);
  --fs-h1:      clamp(2.4rem, 4.5vw, 4rem);
  --fs-display: clamp(3rem, 7vw, 5.5rem);
}
:root[data-type-scale="compact"] {
  --fs-h1: clamp(2rem, 3.5vw, 3rem);
  --fs-h2: clamp(1.6rem, 2.2vw, 2.2rem);
  --fs-display: clamp(2.5rem, 5.5vw, 4.25rem);
}
:root[data-type-scale="expressive"] {
  --fs-h1: clamp(2.8rem, 5.5vw, 5rem);
  --fs-h2: clamp(2.1rem, 3vw, 3.2rem);
  --fs-display: clamp(3.5rem, 8vw, 6.5rem);
}

/* --- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; scrollbar-width: none; -ms-overflow-style: none; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"]  { color-scheme: dark; }

/* Hide native scrollbars visually while keeping scrolling functional
   (mouse wheel, trackpad, touch, keyboard all continue to work) */
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}
img, video { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.025em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: var(--fs-lead); color: var(--ink-2); }
.muted { color: var(--muted); }
.serif-i { font-style: italic; font-family: var(--font-display); }

/* --- layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 900px) {
  .container { padding: 0 40px; }
}
.section { padding: 80px 0; }
.section-sm { padding: 56px 0; }
@media (min-width: 900px) {
  .section { padding: 112px 0; }
  .section-sm { padding: 72px 0; }
}

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stack > * + * { margin-top: var(--stack, 16px); }

/* --- focus + a11y -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform .14s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 17px 30px; font-size: 1.02rem; }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-500); border-color: var(--brand-500); color: var(--on-brand); }
.btn-brand {
  background: var(--brand-500);
  color: var(--on-brand);
  border-color: var(--brand-500);
}
.btn-brand:hover:not(:disabled) { background: var(--brand-600); border-color: var(--brand-600); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface); border-color: var(--ink); }
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  padding-left: 6px; padding-right: 6px;
}
.btn-quiet:hover:not(:disabled) { color: var(--brand-500); }
.btn-block { width: 100%; }

.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Cancel-trip variant: quiet by default, danger tint on hover */
.btn-cancel-trip:hover:not(:disabled) {
  border-color: color-mix(in oklch, #B34433 40%, transparent) !important;
  color: #B34433 !important;
  background: color-mix(in oklch, #B34433 6%, transparent) !important;
}
.btn-cancel-confirm {
  background: #B34433 !important;
  border-color: #B34433 !important;
  color: #FFF !important;
}
.btn-cancel-confirm:hover:not(:disabled) { filter: brightness(.94); }

/* link with underline animation */
.link-u {
  position: relative; padding-bottom: 2px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  transition: color .18s, border-color .18s;
}
.link-u:hover { color: var(--brand-500); border-bottom-color: var(--brand-500); }

/* --- form controls ------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 0.85rem; font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.field-hint { font-size: 0.82rem; color: var(--muted); }
.field-error { font-size: 0.82rem; color: #B54B2E; }
.input, .textarea, .select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color .18s, box-shadow .18s, background .18s;
  font-family: var(--font-body);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-500) 18%, transparent);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
.select { padding-right: 40px; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .18s;
  font-size: 0.9rem;
  color: var(--ink-2);
  user-select: none;
}
.chip:hover { border-color: var(--ink); }
.chip[data-active="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* --- card ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
}
.card-quiet {
  background: transparent;
  border: none;
}

/* --- badges -------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-050);
  color: var(--brand-700);
  letter-spacing: 0.01em;
}
:root[data-theme="dark"] .badge { color: var(--brand-500); }
.badge-neutral {
  background: color-mix(in oklch, var(--ink) 8%, transparent);
  color: var(--ink);
}
.badge-status { padding: 4px 12px; }

/* --- top nav ------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.nav[data-scrolled="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in oklch, var(--bg) 96%, transparent);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  gap: 24px;
}
@media (min-width: 900px) {
  .nav-inner { padding: 22px 40px; }
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.nav-logo .dot { color: var(--brand-500); font-family: var(--font-display); font-style: italic; }
.nav-links {
  display: none; gap: 32px;
  align-items: center;
}
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav-links a:hover, .nav-links a[data-active="true"] { color: var(--brand-500); border-bottom-color: var(--brand-500); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
@media (min-width: 900px) { .nav-burger { display: none; } }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex; flex-direction: column;
  padding: 24px;
  animation: slideIn .28s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-menu-head { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu nav {
  margin-top: 32px;
  display: flex; flex-direction: column; gap: 6px;
}
.mobile-menu nav a {
  font-family: var(--font-display);
  font-size: 1.9rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.02em;
}
.mobile-menu-actions {
  margin-top: auto;
  padding-top: 24px;
  display: flex; gap: 8px;
}

/* --- hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 40px 0 0;
}
.hero-photo {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-sub);
}
@media (min-width: 700px) { .hero-photo { aspect-ratio: 21 / 10; } }
@media (min-width: 1100px) { .hero-photo { aspect-ratio: 21 / 9; } }
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.6s cubic-bezier(.2,.6,.2,1);
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,15,10,0) 40%, rgba(20,15,10,.55) 100%);
  z-index: 2;
  pointer-events: none;
}
.hero-caption {
  position: absolute; left: 24px; right: 24px; bottom: 24px;
  color: #FFF; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px;
}
@media (min-width: 900px) { .hero-caption { left: 40px; right: 40px; bottom: 32px; } }
.hero-caption h1 {
  color: #FFF;
  max-width: 22ch;
  font-weight: 400;
  font-family: var(--font-display);
  text-shadow: 0 2px 24px rgba(0,0,0,.25);
  /* Dedicated hero clamp — smaller on mobile than the global h1, larger on desktop.
     Prevents the hero heading from filling the whole photo on narrow viewports. */
  font-size: clamp(1.6rem, 4.4vw + 0.6rem, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
}
@media (max-width: 640px) {
  .hero-caption h1 {
    max-width: 18ch;
    line-height: 1.12;
    letter-spacing: -0.02em;
  }
  .hero-caption {
    left: 20px; right: 20px; bottom: 20px;
  }
}
@media (max-width: 420px) {
  .hero-caption h1 {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  }
}
.hero-caption .hero-meta {
  color: rgba(255,255,255,.86);
  font-size: 0.88rem;
  max-width: 26ch;
  display: none;
}
@media (min-width: 800px) { .hero-caption .hero-meta { display: block; } }

/* Editorial hero variant */
:root[data-hero="editorial"] .hero-photo { aspect-ratio: 4 / 5; max-width: 640px; margin-left: auto; }
:root[data-hero="editorial"] .hero-editorial-wrap {
  display: grid; gap: 40px; align-items: end;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  :root[data-hero="editorial"] .hero-editorial-wrap { grid-template-columns: 1.1fr .9fr; gap: 60px; }
}
:root[data-hero="editorial"] .hero-photo::after { display: none; }
:root[data-hero="editorial"] .hero-caption {
  position: static; color: var(--ink); padding: 0;
}
:root[data-hero="editorial"] .hero-caption h1 { color: var(--ink); text-shadow: none; max-width: 20ch; }
:root[data-hero="editorial"] .hero-caption .hero-meta { color: var(--muted); display: block; margin-top: 20px; }
:root[data-hero="editorial"] .hero-dots { display: none; }
@media (max-width: 480px) {
  .hero-dots { bottom: 12px !important; right: 12px !important; }
}

/* --- destination card ---------------------------------------------------- */
.dest-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
}
.dest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.dest-card-img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-sub);
}
.dest-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.6,.2,1);
}
.dest-card:hover .dest-card-img img { transform: scale(1.04); }
.dest-card-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,15,10,0) 55%, rgba(20,15,10,.5) 100%);
  pointer-events: none;
}
.dest-card-tag {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
.dest-card-meta {
  position: absolute; bottom: 16px; left: 16px; right: 16px; z-index: 2;
  color: #FFF;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px;
}
.dest-card-meta .name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.dest-card-meta .country {
  font-size: 0.8rem;
  color: rgba(255,255,255,.85);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.dest-card-meta .arrow-cap {
  width: 36px; height: 36px; border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s;
  flex-shrink: 0;
}
.dest-card:hover .arrow-cap { transform: translateX(4px); }

/* --- feature strip ------------------------------------------------------- */
.pill-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pill {
  background: color-mix(in oklch, var(--ink) 6%, transparent);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}
:root[data-theme="dark"] .pill { background: color-mix(in oklch, var(--surface) 60%, transparent); }

/* --- itinerary day ------------------------------------------------------- */
.day-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.day-card:last-child { border-bottom: 1px solid var(--line); }
.day-card .day-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--brand-500);
  letter-spacing: -0.03em;
  line-height: 1;
}
.day-card .day-num small {
  display: block; font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 6px;
}
.day-card .day-title { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 8px; }
.day-card .day-body { color: var(--ink-2); }
@media (max-width: 640px) {
  .day-card { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; }
  .day-card .day-num { font-size: 1.6rem; }
  .day-card .day-num small { display: inline; margin-left: 12px; }
}

/* --- footer -------------------------------------------------------------- */
/* Footer uses a fixed dark palette in both light and dark mode so contrast is
   guaranteed. This avoids the light-text-on-light-bg bug that occurred when
   footer inherited var(--ink) / var(--bg) which invert in dark mode. */
.footer {
  --footer-bg: #17110C;
  --footer-fg: #F4EEE4;
  --footer-fg-muted: rgba(244, 238, 228, 0.72);
  --footer-fg-quiet: rgba(244, 238, 228, 0.50);
  --footer-line: rgba(244, 238, 228, 0.14);
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 120px 0 40px;
  margin-top: 120px;
}
@media (min-width: 900px) {
  .footer { padding: 160px 0 48px; margin-top: 140px; }
}
/* The closing block: keep the CTA far enough from both the top edge and
   the horizontal divider below it, so it doesn't sit on the seam. */
.footer-close {
  padding-bottom: 96px;
}
@media (min-width: 900px) {
  .footer-close { padding-bottom: 128px; }
}
.footer h4 {
  color: var(--footer-fg);
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  max-width: 14ch;
  font-weight: 400;
  line-height: 1.05;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 80px 0 56px;
  border-top: 1px solid var(--footer-line);
}
@media (min-width: 900px) {
  .footer-cols { padding: 96px 0 64px; }
}
@media (min-width: 700px) { .footer-cols { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-cols h5 {
  color: var(--footer-fg-quiet);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 20px;
}
.footer-cols p { color: var(--footer-fg-muted); }
.footer-cols a, .footer-cols li {
  color: var(--footer-fg-muted);
  font-size: 0.95rem;
  line-height: 2;
  display: block;
  transition: color .18s;
}
.footer-cols a:hover { color: var(--footer-fg); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid var(--footer-line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  color: var(--footer-fg-quiet);
  font-size: 0.82rem;
}
.footer-bottom a { color: var(--footer-fg-quiet); transition: color .18s; }
.footer-bottom a:hover { color: var(--footer-fg); }
.footer-newsletter {
  display: flex; gap: 8px;
  background: rgba(244,238,228,.06);
  padding: 6px;
  border-radius: 999px;
  max-width: 380px;
  border: 1px solid var(--footer-line);
}
.footer-newsletter input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--footer-fg);
  font-size: 0.9rem;
}
.footer-newsletter input:focus { outline: none; }
.footer-newsletter input::placeholder { color: var(--footer-fg-quiet); }

/* --- modal / dialog ------------------------------------------------------ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .22s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 22px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: popIn .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 140px; }

/* --- toast --------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 40px);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }

/* --- misc utility -------------------------------------------------------- */
.spacer-24 { height: 24px; } .spacer-40 { height: 40px; } .spacer-60 { height: 60px; }
.divider { height: 1px; background: var(--line); border: none; margin: 40px 0; }
.tabular { font-variant-numeric: tabular-nums; }
.wrap-tight { max-width: 640px; }
.wrap-med   { max-width: 780px; }
.wrap-wide  { max-width: 960px; }

/* dot separator between meta pieces */
.dot-sep { color: var(--muted-2); margin: 0 8px; }

/* subtle striped placeholder for missing photos */
.photo-placeholder {
  background: repeating-linear-gradient(
    45deg,
    var(--bg-sub) 0 12px,
    var(--bg) 12px 24px
  );
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85rem;
}

/* segmented radio */
.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.segmented button {
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink-2);
  transition: background .18s, color .18s;
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* rating stars */
.stars {
  display: inline-flex; gap: 4px; color: var(--accent-500); font-size: 1.05rem;
}
.stars.selectable button {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--line-2); transition: color .12s, transform .12s;
  font-size: 1.5rem; line-height: 1;
}
.stars.selectable button[data-lit="true"] { color: var(--accent-500); }
.stars.selectable button:hover { transform: scale(1.15); }

/* progress bar (planner steps) */
.progress {
  display: flex; gap: 8px; margin-bottom: 40px;
}
.progress-step {
  flex: 1; height: 3px;
  background: var(--line);
  border-radius: 999px;
  transition: background .3s;
}
.progress-step[data-done="true"] { background: var(--brand-500); }

/* icons (used inline) */
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

/* dashboard tabs */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand-500); }
.tabs button:hover { color: var(--ink); }

/* skeleton loader */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skel {
  background: linear-gradient(90deg, var(--bg-sub), var(--surface), var(--bg-sub));
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}

/* trip card in dashboard */
.trip-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  align-items: center;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  cursor: pointer;
}
.trip-row:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.trip-row-img {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-sub);
}
.trip-row-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
  .trip-row { grid-template-columns: 80px 1fr; padding: 16px; gap: 14px; }
  .trip-row > *:nth-child(3) { grid-column: 1 / -1; }
}

/* ---- animations for on-scroll reveal (subtle) ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal[data-in="true"] { opacity: 1; transform: none; }
