/* tour.com design language v0.2 — "Golden hour" (big-tech prestige tier) */
:root {
  --paper: #FAFAF8;
  --card: #FFFFFF;
  --ink: #0F0F0F;
  --muted: #6E6E6E;
  --daybreak: linear-gradient(135deg, #3A1C71, #CB4826 55%, #F6A723);
  --ember: #CB4826;
  --ember-dark: #B23A1D;
  --sea: #0B2B2B;
  --sun: #F6A723;
  --rating-ink: #8A5A14;
  --line: #ECECEC;
  --info: #6E6E6E;
  --radius-card: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(15,15,15,.04), 0 8px 24px rgba(15,15,15,.06);
  --shadow-lift: 0 2px 4px rgba(15,15,15,.05), 0 16px 40px rgba(15,15,15,.10);
  --font: "Plus Jakarta Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

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

/* ---------- No-JS warning ---------- */
.noscript-banner {
  background: #B3261E; color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 16px; text-align: center; line-height: 1.45;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(203,72,38,.55), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(58,28,113,.65), transparent 60%),
    var(--sea);
  color: #fff;
  padding: 56px 20px 0;
}
.hero-inner { max-width: 1060px; margin: 0 auto; }
.brand h1 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 28px;
  display: inline-flex; align-items: center;
}
.brand h1::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--daybreak); margin-right: 8px;
  box-shadow: 0 0 18px rgba(203,72,38,.8);
}
.brand h1 span { font-weight: 400; opacity: .75; }
.hero-headline {
  font-size: clamp(32px, 5vw, 44px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 12px; max-width: 640px;
}
.hero-sub { font-size: 16px; opacity: .82; margin: 0 0 24px; max-width: 560px; }

.search-card {
  background: var(--card); color: var(--ink);
  border-radius: var(--radius-card); box-shadow: var(--shadow-lift);
  display: flex; gap: 8px; padding: 12px; align-items: stretch;
  transform: translateY(28px); margin-bottom: -8px;
  flex-wrap: wrap;
  text-align: left; /* M1: .hero-inner centering is for the plan CTA, not the form */
}
.field { display: flex; flex-direction: column; gap: 4px; padding: 8px 16px; min-width: 130px; }
.field.grow { flex: 1 1 220px; }
.field + .field { border-left: 1px solid var(--line); }
.field label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input {
  border: 0; font: inherit; font-size: 16px; font-weight: 600;
  background: transparent; color: var(--ink); padding: 4px 0; min-height: 30px;
}
.field input:focus { outline: none; }
.field:focus-within { background: #F6F4F0; border-radius: 12px; }
.stepper { display: flex; align-items: center; gap: 12px; min-height: 30px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; font-size: 18px; line-height: 1;
  cursor: pointer; color: var(--ink);
}
.stepper button:hover { border-color: var(--ink); }
.stepper span { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.search-btn {
  background: var(--ember); color: #fff; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 16px; padding: 0 32px; cursor: pointer;
  min-height: 52px; transition: background .15s ease, transform .1s ease;
}
.search-btn:hover { background: var(--ember-dark); }
.search-btn:active { transform: scale(.98); }

/* ---------- Main ---------- */
main { max-width: 1060px; margin: 0 auto; padding: 48px 20px 40px; }

#demo-banner {
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-size: 12px;
}

#controls {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  margin: 0 0 8px; flex-wrap: wrap;
}
#pills {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding: 4px; scrollbar-width: none; flex: 1; min-width: 0;
  scroll-snap-type: x proximity;
}
#pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 12px 20px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-pill);
  cursor: pointer; color: var(--muted); transition: all .15s ease;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 600; flex: 0 0 auto; }
#sort {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 12px 16px; min-height: 44px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer;
}

#meta { color: var(--muted); font-size: 14px; margin: 8px 0 16px; min-height: 20px; }

/* ---------- Cards ---------- */
.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius-card);
  overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform .2s ease-out, box-shadow .2s ease-out;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.imgwrap { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #EFEDEA; }
.imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease-out; }
.card:hover .imgwrap img { transform: scale(1.03); }
.img-fallback { width: 100%; height: 100%; background: var(--daybreak); }
.pick-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--daybreak); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 8px 16px; border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(58,28,113,.35);
}
.body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin: 0; }
.rating-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.stars { color: var(--sun); letter-spacing: 1px; font-size: 12px; }
.rating-num { font-weight: 700; color: var(--rating-ink); }
.rating-src { color: var(--muted); }
.dot { color: var(--line); }
.duration { color: var(--muted); }
.desc {
  font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.per { font-size: 12px; color: var(--muted); }
.price-note {
  border: 0; background: none; padding: 0; cursor: help;
  color: var(--muted); font-size: 12px; text-decoration: underline dotted;
}

/* Provider option rows — the decision point */
.options { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  text-decoration: none; color: var(--ink); min-height: 52px;
  transition: border-color .15s ease, background .15s ease;
}
.option:hover { border-color: var(--ember); background: #FFF9F6; }
.option:active { background: #FFF9F6; border-color: var(--ember); }
.option-name { font-weight: 700; font-size: 14px; white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.option-name .ext { color: var(--ember); font-weight: 700; }
.option-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.option-meta strong { color: var(--rating-ink); }

.honesty { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.honesty p { font-size: 12px; color: var(--info); margin: 0; line-height: 1.5; }
.honesty .neutral { color: var(--info); } /* ✓ glyph stays gray, never green */
.honesty .avail::before { content: "ⓘ "; }

/* Comparison synthesis note — sits under the provider option rows */
.compare-note { font-size: 12px; color: var(--info); margin-top: 8px; }
.compare-note::before { content: "ⓘ "; }

/* ---------- Skeleton ---------- */
.skel { background: var(--card); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
.skel .img { aspect-ratio: 4/3; }
.shimmer {
  background: linear-gradient(100deg, #EFEDEA 40%, #F8F6F3 50%, #EFEDEA 60%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel .ln { height: 16px; border-radius: 8px; margin: 16px 16px 0; }
.skel .ln.short { width: 55%; margin-bottom: 16px; }

/* ---------- Empty state ---------- */
#empty, #search-error {
  text-align: center; padding: 64px 20px; color: var(--muted);
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
#empty p, #search-error p { margin: 8px 0; }
#empty-clear, #error-retry {
  margin-top: 16px; padding: 12px 20px; min-height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--ink); background: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
#empty-clear:hover, #error-retry:hover { background: var(--ink); color: #fff; }

/* ---------- Footer ---------- */
footer {
  background: var(--sea); color: rgba(255,255,255,.78);
  padding: 40px 20px; font-size: 14px; line-height: 1.6;
}
footer > p { max-width: 1060px; margin: 8px auto; }
footer strong { color: #fff; }
.proto-note { opacity: .55; }

/* ---------- Handoff modal ---------- */
#handoff-modal {
  position: fixed; inset: 0; background: rgba(11,43,43,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 80;
  animation: fade .18s ease-out;
  overflow-y: auto; /* 3b: tall viewports clip the card without this */
}
#handoff-modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  background: #fff; border-radius: var(--radius-card); padding: 28px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lift); animation: rise .22s ease-out;
  max-height: calc(100dvh - 40px); overflow-y: auto; /* 3b: clip fix on short viewports */
}
@keyframes rise { from { transform: translateY(16px); opacity: .6; } }
.modal-card h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
.modal-card h2 span {
  background: var(--daybreak); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.modal-card .modal-trust {
  font-size: 12px; color: var(--info); border-top: 1px solid var(--line);
  padding-top: 12px; margin-top: 12px;
} /* scoped under .modal-card so margin-top wins over .modal-card p */
.modal-actions { display: flex; gap: 8px; }
.modal-actions .cta {
  flex: 1; background: var(--ember); color: #fff; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; padding: 12px; cursor: pointer; min-height: 48px;
}
.modal-actions .cta:hover { background: var(--ember-dark); }
.modal-actions .ghost {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-weight: 600; padding: 12px; cursor: pointer; min-height: 48px;
}
.modal-actions .ghost:hover { border-color: var(--ink); }

@media (max-width: 640px) {
  .search-card { transform: translateY(20px); }
  .field + .field { border-left: 0; border-top: 1px solid var(--line); }
  .field { min-width: 0; }
  .search-btn { width: 100%; }
  #handoff-modal { align-items: flex-end; padding: 0; }
  .modal-card { border-radius: var(--radius-card) var(--radius-card) 0 0; max-width: none; }
  .modal-card::before {
    content: ""; display: block; width: 40px; height: 4px; border-radius: 2px;
    background: var(--line); margin: 0 auto 16px;
  }
  .modal-actions { flex-direction: column; }
  #pills { flex: 1 1 100%; }
  .sort-wrap { width: 100%; justify-content: space-between; }
  #sort { flex: 1; }
  .option { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---- Conversational planner ---- */
.plan-cta {
  display: inline-block;
  /* Clear the search card's 28px downward bleed (translateY) plus breathing room. */
  margin: 48px auto 16px;
  padding: 12px 24px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.14);
  color: #fff;
  font: 600 16px/1.45 inherit;
  font-family: inherit;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .15s ease;
}
.plan-cta:hover { background: rgba(255,255,255,.24); }
.hero-inner { text-align: center; }

#planner[hidden] { display: none; }
body.planner-open { overflow: hidden; }
#planner {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 60;
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 50px rgba(20,10,40,.25);
  border-left: 1px solid rgba(0,0,0,.06);
  animation: plan-in .22s ease;
}
@keyframes plan-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.plan-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--daybreak);
  color: #fff;
}
.plan-title { font-size: 16px; }
.plan-title #plan-mode { font-weight: 400; opacity: .8; font-size: 12px; }
#plan-close {
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
#plan-messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  background: #FAFAF8;
}
.plan-msg { max-width: 88%; font-size: 14px; line-height: 1.5; }
.plan-msg.bot {
  align-self: flex-start;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 16px; border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.plan-msg.user {
  align-self: flex-end;
  background: var(--ink); color: #fff;
  padding: 12px 16px; border-radius: 16px 4px 16px 16px;
}
.plan-msg.plan-hint { font-size: 12px; color: var(--muted); background: none; border: 0; box-shadow: none; padding: 0 4px; }
.plan-msg.typing span {
  display: inline-block; width: 8px; height: 8px; margin-right: 4px;
  background: #b9b9c0; border-radius: 50%;
  animation: plan-blink 1s infinite;
}
.plan-msg.typing span:nth-child(2) { animation-delay: .15s; }
.plan-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes plan-blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

#plan-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}
#plan-chips:empty { display: none; }
.plan-chip {
  border: 1.5px solid var(--ink); color: var(--ink); background: #fff;
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; min-height: 44px;
  display: inline-flex; align-items: center;
}
.plan-chip:active { transform: scale(.97); }
.plan-chip.primary { background: var(--ember); border-color: var(--ember); color: #fff; }
.plan-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

#plan-form { display: flex; gap: 8px; padding: 12px 16px; background: #fff; }
#plan-input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 12px 16px; font-size: 16px; font-family: inherit; outline: none;
}
#plan-input:focus { border-color: var(--ember); }
.plan-send {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--ember);
  color: #fff; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.plan-send:hover { background: var(--ember-dark); }

.plan-intro { margin-bottom: 12px; font-size: 16px; }
.plan-intro strong { font-weight: 800; letter-spacing: -0.01em; }
/* Plan arrival moment — kicker + summary card + staged day reveal */
.plan-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ember); margin-bottom: 4px;
}
.plan-summary {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-card);
  padding: 16px; margin-bottom: 16px;
}
.plan-summary-title { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.plan-summary-meta { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.plan-summary-totals { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.plan-summary-close { font-size: 12px; color: var(--info); line-height: 1.5; }
.plan-note {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--info); line-height: 1.5;
}
.plan-note::before { content: "ⓘ "; }
.plan-day {
  margin: 12px 0; padding-top: 12px; border-top: 1px dashed rgba(0,0,0,.12);
  animation: plan-day-in .35s ease-out both;
}
/* nth-of-type counts the div siblings inside the plan bubble: kicker(1) +
   summary(2) + intro(3), so day 1 is the 4th div. */
.plan-day:nth-of-type(5) { animation-delay: 90ms; }
.plan-day:nth-of-type(6) { animation-delay: 180ms; }
.plan-day:nth-of-type(7) { animation-delay: 270ms; }
@keyframes plan-day-in { from { opacity: 0; transform: translateY(10px); } }
.plan-day-head { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.plan-day-intro { font-size: 14px; color: var(--muted); margin-bottom: 8px; font-style: italic; }
.plan-day-foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.plan-tour { margin-bottom: 12px; }
.plan-tour-title { font-weight: 700; font-size: 14px; }
.plan-tour-meta { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.plan-tour-why { font-size: 12px; color: var(--muted); margin-top: 4px; }
.plan-tour .option { margin: 4px 0; }

@media (max-width: 560px) {
  #planner { width: 100vw; border-left: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
