/* ==========================================================================
   Where Will the Magic Take Me?
   Design language inspired by a theme-park companion app: white cards on a
   light gray page, deep navy type, one action blue, pill buttons, chips.
   Mobile-first; layout expands at 640px and 1024px.
   ========================================================================== */

:root {
  /* Color */
  --navy: #1b2b4b;          /* headings */
  --ink: #2b3a55;           /* body text */
  --muted: #56657f;         /* secondary text (AA on white and --page) */
  --blue: #2771b8;          /* actions and links (AA on white) */
  --blue-dark: #1d5c99;     /* hover */
  --blue-soft: #e3edf9;     /* icon badges, active states */
  --tint: #e9effb;          /* pale periwinkle section band */
  --chip-border: #8fa3d6;   /* periwinkle chip outline */
  --page: #f4f6f9;          /* light gray page background */
  --surface: #ffffff;
  --line: #dde3ec;          /* hairlines */
  --hero-top: #4a9fd8;
  --hero-bottom: #2a4b8d;
  --accent: #4b5fd1;        /* result card accent bar */
  --focus: #f2a900;         /* focus ring: visible on white and blue */

  /* Type */
  --font: "Nunito Sans", "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;

  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(27, 43, 75, .06), 0 2px 8px rgba(27, 43, 75, .05);
  --shadow-lift: 0 4px 16px rgba(27, 43, 75, .12);

  /* Space */
  --gutter: 20px;
  --max: 1200px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1em; height: 1em; flex: none; }

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

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px;
  border-radius: var(--pill); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 28px;
  font: 700 1rem/1 var(--font);
  border-radius: var(--pill); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: .9375rem; }

.btn-solid { background: linear-gradient(90deg, #22767c, var(--blue)); color: #fff; }
.btn-solid:hover { background: linear-gradient(90deg, #1b6166, var(--blue-dark)); color: #fff; box-shadow: var(--shadow-lift); }

.btn-outline { background: var(--surface); color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-soft); color: var(--blue-dark); }

.btn-outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.btn[disabled] { opacity: .45; cursor: not-allowed; }

.text-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.text-link svg { width: 14px; height: 14px; transition: transform .15s; }
.text-link:hover { text-decoration: underline; }
.text-link:hover svg { transform: translateX(2px); }

.tag {
  display: inline-block; vertical-align: middle;
  font-size: .6875rem; font-weight: 700; letter-spacing: .02em;
  color: var(--muted); background: var(--page);
  border: 1px solid var(--line); border-radius: var(--pill);
  padding: 1px 8px; margin-left: 4px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 24px; min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--navy); font-weight: 800; font-size: 1.0625rem; text-decoration: none;
}
.brand:hover { color: var(--navy); }
.brand-mark { width: 22px; height: 22px; color: var(--blue); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: inline-block; padding: 8px 12px; border-radius: var(--pill);
  color: var(--navy); font-weight: 600; text-decoration: none;
}
.nav-links a:hover { background: var(--blue-soft); color: var(--blue-dark); }

@media (max-width: 639px) {
  .header-inner { justify-content: center; }
  .nav-links a { padding: 6px 10px; font-size: .9375rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-bottom) 100%);
  color: #fff;
  padding: 48px 0 96px;
}
/* Soft decorative sparkles: pure CSS, no imagery */
.hero::before, .hero::after {
  content: ""; position: absolute; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.9) 0 1.5px, transparent 2px) 0 0 / 46px 46px;
  opacity: .18;
}
.hero::before { inset: 0 50% 40% 0; }
.hero::after { inset: 20% 0 0 60%; background-size: 62px 62px; opacity: .12; }

.hero-inner { position: relative; text-align: center; }
.hero-eyebrow {
  display: inline-block; font-weight: 700; font-size: .875rem;
  background: rgba(255, 255, 255, .16); border-radius: var(--pill);
  padding: 6px 14px; margin-bottom: 16px;
}
.hero h1 {
  color: #fff; font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: -.01em;
  max-width: 14ch; margin: 0 auto;
}
.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.1875rem);
  max-width: 40rem; margin: 16px auto 0; color: rgba(255, 255, 255, .92);
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.hero .btn-solid { background: #fff; color: var(--blue-dark); }
.hero .btn-solid:hover { background: var(--blue-soft); color: var(--blue-dark); }

/* ---------- Destination tiles (overlap the hero) ---------- */

.tiles { position: relative; margin-top: -64px; z-index: 2; }
.tiles ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 18px 16px 16px; text-decoration: none;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--chip-border); }
.tile-icon { width: 32px; height: 32px; color: var(--blue); margin-bottom: 6px; }
.tile-label { color: var(--navy); font-weight: 700; font-size: 1.0625rem; line-height: 1.25; }
.tile-meta { color: var(--muted); font-size: .875rem; }

@media (min-width: 1024px) {
  .tiles ul { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .tile { padding: 22px 20px 20px; }
}

/* ---------- Sections ---------- */

.section { padding: 56px 0; }
.section-tint {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.55) 0 30%, transparent 31%),
    var(--tint);
}
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 24px;
}
.section-head h2 { font-size: clamp(1.625rem, 3.5vw, 2.125rem); font-weight: 800; }
.section-sub { color: var(--muted); margin-top: 6px; max-width: 46rem; }

/* ---------- Comparison cards ---------- */

.compare-grid { display: grid; gap: 16px; }

.dest-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}
.dest-card > * { padding: 0 20px; }

.card-head {
  display: flex; align-items: center; gap: 14px;
  padding-top: 20px; padding-bottom: 12px;
}
.badge {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
.badge svg { width: 26px; height: 26px; }
.badge-lg { width: 64px; height: 64px; }
.badge-lg svg { width: 34px; height: 34px; }

.eyebrow { color: var(--muted); font-size: .875rem; }
.card-head h3 { font-size: 1.3125rem; font-weight: 800; margin-top: 2px; }
.card-summary { padding-bottom: 16px; }

.cite {
  font-size: .8125rem; font-weight: 700; white-space: nowrap;
}

.row { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 16px; }
.row h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: .8125rem; font-weight: 700; text-transform: none;
  color: var(--muted); margin-bottom: 10px;
}
.row h4 svg { width: 18px; height: 18px; color: var(--blue); }
.row h4 .tag { margin-left: auto; }

.value { color: var(--navy); font-weight: 800; font-size: 1.25rem; }
.value .tag { font-size: .6875rem; }
.note { color: var(--muted); font-size: .875rem; margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  border: 1.5px solid var(--chip-border); border-radius: var(--pill);
  padding: 4px 12px; font-size: .875rem; font-weight: 600; color: var(--navy);
  background: var(--surface);
}

.list { display: grid; gap: 10px; }
.list li { font-size: .9375rem; line-height: 1.4; }
.list li a { font-weight: 700; }
.list li span { display: block; color: var(--muted); font-size: .8125rem; }
.seasons li strong { display: block; color: var(--navy); font-size: .8125rem; }

.budget { display: inline-flex; gap: 2px; font-weight: 800; font-size: 1.5rem; line-height: 1; }
.budget b { color: #c9d2e0; font-weight: 800; }
.budget[data-min="1"] b:nth-child(-n+1),
.budget[data-min="2"] b:nth-child(-n+2),
.budget[data-min="3"] b:nth-child(-n+3) { color: var(--blue); }
.budget[data-min="1"][data-max="2"] b:nth-child(2),
.budget[data-min="2"][data-max="3"] b:nth-child(3) { color: #8fb5de; }

.card-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; border-top: 1px solid var(--line);
  padding-top: 16px; padding-bottom: 18px;
}

/* Tablet: 2 × 2 cards, rows aligned with subgrid */
@media (min-width: 640px) {
  .compare-grid { grid-template-columns: repeat(2, 1fr); column-gap: 16px; row-gap: 0; }
  .dest-card {
    display: grid; grid-row: span 8; grid-template-rows: subgrid; row-gap: 0;
    margin-bottom: 16px;
  }
  .card-actions { margin-top: 0; }
}

/* Desktop: 4 across so every row reads straight across */
@media (min-width: 1024px) {
  .compare-grid { grid-template-columns: repeat(4, 1fr); }
  .dest-card > * { padding-left: 18px; padding-right: 18px; }
}

/* Budget legend */
.legend {
  margin-top: 8px; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--blue); border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.legend h3 { font-size: 1.0625rem; font-weight: 800; margin-bottom: 10px; }
.legend-scale { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 10px; }
.legend-scale li { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; }
.legend-scale .budget { font-size: 1.125rem; }
.legend p { color: var(--muted); font-size: .9375rem; }

/* ---------- Quiz ---------- */

.quiz-card {
  max-width: 760px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 20px;
}
@media (min-width: 640px) { .quiz-card { padding: 32px; } }

.progress-track { height: 4px; background: var(--line); border-radius: var(--pill); overflow: hidden; }
.progress-fill { height: 100%; width: 25%; background: var(--blue); border-radius: var(--pill); transition: width .25s ease; }
.quiz-step { color: var(--muted); font-size: .875rem; margin: 12px 0 4px; }

.question { border: 0; margin: 0; padding: 0; min-width: 0; }
.question + .question { margin-top: 28px; }
.question legend {
  padding: 0; margin-bottom: 16px;
  font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 800; color: var(--navy);
}
.question legend:focus { outline: none; }
.question legend:focus-visible { outline: 3px solid var(--focus); }

.options { display: flex; flex-wrap: wrap; gap: 10px; }
.option { position: relative; cursor: pointer; }
.option input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.option span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 8px 18px; border: 1.5px solid var(--chip-border); border-radius: var(--pill);
  font-weight: 600; color: var(--navy); background: var(--surface);
  transition: background-color .15s, border-color .15s, color .15s;
}
.option:hover span { background: var(--blue-soft); }
.option input:checked + span {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt-dollar { color: var(--blue); }
.option input:checked + span .opt-dollar { color: #fff; }

.quiz-error { color: #b3261e; font-weight: 600; font-size: .9375rem; min-height: 1.5em; margin-top: 12px; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.quiz-actions .btn { min-width: 120px; }

/* Result card: accent bar on the left, like the app's recommendation card */
.result {
  position: relative; border-left: 5px solid var(--accent);
  padding: 4px 0 0 20px;
}
.result:focus { outline: none; }
.result-eyebrow { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy); }
.result-eyebrow svg { color: var(--accent); width: 18px; height: 18px; }
.result-body { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0 20px; }
.result h3 { font-size: clamp(1.5rem, 3.5vw, 1.875rem); font-weight: 800; margin-bottom: 6px; }
.result .card-actions { border-top: 0; padding: 0; }

/* ---------- Sources ---------- */

.sources-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .sources-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sources-grid { grid-template-columns: repeat(4, 1fr); } }

.source-group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; scroll-margin-top: 84px;
}
.source-group h3 { font-size: 1.0625rem; font-weight: 800; margin-bottom: 10px; }
.source-group li { padding: 7px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.source-group li:first-child { border-top: 0; }
.source-group:target { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: #d7deea; padding: 32px 0 40px; font-size: .9375rem; }
.site-footer strong { color: #fff; }
.footer-inner { display: grid; gap: 8px; max-width: 820px; }
.site-footer a { color: #fff; }

/* ---------- Form fields (shared by quiz + price tool) ---------- */

.field-row { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; min-width: 0; }
.field-sm { flex: 0 1 110px; }
.field label { font-size: .875rem; font-weight: 700; color: var(--navy); }
.optional { font-weight: 400; color: var(--muted); }

.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  font: 600 1rem var(--font); color: var(--navy);
  background: var(--surface); border: 1.5px solid #b9c4d6; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: var(--chip-border); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field input::placeholder { color: #8a96ab; font-weight: 400; }

.money { position: relative; }
.money > span {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 700; pointer-events: none;
}
.money input { padding-left: 28px; }

.form-error { color: #b3261e; font-weight: 600; font-size: .9375rem; min-height: 0; }
.form-error:not(:empty) { margin-top: 10px; }

/* Quiz: typed budget */
.custom-budget {
  margin-top: 18px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--page); border: 1px solid var(--line);
}
.custom-budget .note { margin-top: 10px; }

.result-links { display: inline-flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; }

/* ---------- Price your dates ---------- */

.setup-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
@media (min-width: 640px) { .setup-card { padding: 24px 28px; } }

.trip-summary { margin-top: 14px; color: var(--navy); font-weight: 800; font-size: 1.125rem; }

.happening { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.happening h3 { font-size: .875rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.happening ul { display: grid; gap: 10px; }
@media (min-width: 1024px) { .happening ul { grid-template-columns: repeat(2, 1fr); gap: 10px 24px; } }
.happening li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: .9375rem; }
.happening li strong {
  font-size: .75rem; font-weight: 700; color: var(--blue-dark); background: var(--blue-soft);
  border-radius: var(--pill); padding: 2px 10px;
}
.happening li a { font-weight: 700; }
.event-dates { flex-basis: 100%; color: var(--muted); font-size: .8125rem; }
.happening .note { margin-top: 12px; }

.cost-tip {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 20px 0 16px; color: var(--ink); font-size: .9375rem;
}
.cost-tip svg { width: 18px; height: 18px; color: var(--accent); margin-top: 3px; }

.cost-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .cost-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cost-grid { grid-template-columns: repeat(4, 1fr); } }

.cost-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.cost-card .card-head { padding: 18px 18px 6px; }
.cost-card .card-head h3 { font-size: 1.125rem; font-weight: 800; }
.cost-card .badge { width: 40px; height: 40px; }
.cost-card .badge svg { width: 22px; height: 22px; }

.cost-fields { display: grid; gap: 12px; padding: 10px 18px 14px; }
.cost-fields .field { flex: none; }
.cost-fields .field label { font-size: .8125rem; }
.included {
  font-size: .8125rem; color: var(--muted);
  background: var(--page); border-radius: var(--radius-sm); padding: 8px 10px;
}

.price-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 18px 14px; margin-top: auto; }
.price-links a { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: .875rem; text-decoration: none; }
.price-links a:hover { text-decoration: underline; }
.price-links svg { width: 13px; height: 13px; }

.cost-total {
  position: relative; display: grid; gap: 2px;
  border-top: 1px solid var(--line); padding: 14px 18px 16px;
  background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius);
}
.total-label { font-size: .8125rem; font-weight: 700; color: var(--muted); }
.cost-total strong { color: var(--navy); font-size: 1.625rem; font-weight: 800; line-height: 1.15; }
.total-meta { display: grid; gap: 2px; font-size: .8125rem; color: var(--muted); }
.budget-ok { color: #1d6b3a; font-weight: 700; }
.budget-over { color: #b3261e; font-weight: 700; }

.cost-flag {
  display: none; position: absolute; top: -13px; right: 14px;
  background: var(--blue); color: #fff; font-size: .75rem; font-weight: 800;
  border-radius: var(--pill); padding: 3px 12px;
}
.cost-card.is-cheapest { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue), var(--shadow-lift); }
.cost-card.is-cheapest .cost-flag { display: inline-block; }
.cost-card.is-cheapest .cost-total { background: var(--blue-soft); }

.cost-result {
  margin-top: 20px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent); border-radius: var(--radius-sm);
  font-size: 1.0625rem;
}
.cost-result strong { color: var(--navy); }
.cost-result .note { margin-top: 6px; }
#cost-clear { margin-top: 16px; }

@media (max-width: 639px) {
  .nav-links { flex-wrap: wrap; justify-content: center; gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: .875rem; }
}
