/* ==========================================================================
   WebTrips design system — dark glacial theme, ice-blue accent (see DESIGN.md)
   ========================================================================== */

:root {
  /* Color */
  --bg: oklch(0.14 0.02 245);
  --surface: oklch(0.18 0.02 245);
  --surface-2: oklch(0.23 0.025 245);
  --ink: oklch(0.97 0.008 220);
  --ink-body: oklch(0.84 0.015 230);
  --ink-muted: oklch(0.72 0.02 235);
  --ice: oklch(0.82 0.09 220);
  --ice-bright: oklch(0.89 0.07 215);
  --ice-deep: oklch(0.62 0.11 235);
  --line: oklch(1 0 0 / 0.10);
  --line-strong: oklch(1 0 0 / 0.18);
  --danger: oklch(0.72 0.19 25);
  --warn: oklch(0.85 0.13 85);
  --scrim: oklch(0.13 0.02 245 / 0.72);
  --ice-tint: oklch(0.82 0.09 220 / 0.08);
  --ice-ring: oklch(0.82 0.09 220 / 0.35);

  /* Z-scale */
  --z-nav: 10;
  --z-overlay: 20;
  --z-modal: 30;
  --z-toast: 40;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 220ms;

  color-scheme: dark;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--ink-body);
  line-height: 1.65;
  font-size: 1rem;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ice); text-decoration: none; }
a:hover { color: var(--ice-bright); }
p { margin: 0 0 1em; max-width: 70ch; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-stretch: 125%;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

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

::placeholder { color: var(--ink-muted); opacity: 1; }
::selection { background: var(--ice); color: var(--bg); }

/* ---- Layout helpers ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.container--narrow { max-width: 760px; }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  background: oklch(0.13 0.02 245 / 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav__logo img { height: 1.75rem; width: auto; }
.site-nav__links { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-nav__links a {
  color: var(--ink-body);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.site-nav__links a:hover { color: var(--ice-bright); }
.site-nav__links a[aria-current="page"] {
  color: var(--ice);
  border-bottom-color: var(--ice);
  font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-ice { background: var(--ice); color: var(--bg); }
.btn-ice:hover { background: var(--ice-bright); color: var(--bg); }
.btn-ice:active { background: var(--ice-deep); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ice); color: var(--ice-bright); }

.btn--lg { padding: 1rem 2.2rem; font-size: 1.0625rem; }
.btn--full { width: 100%; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ==========================================================================
   Panels, cards
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.panel--pad { padding: clamp(1.5rem, 4vw, 2.5rem); }

/* Choice tile: a radio/selection rendered as a card */
.tile {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  text-align: left;
  color: var(--ink-body);
  transition: border-color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
}
.tile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tile.is-selected,
.tile:has(input:checked) {
  border-color: var(--ice);
  background: var(--ice-tint);
  box-shadow: 0 0 0 1px var(--ice);
}
.tile input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tile__title { color: var(--ink); font-weight: 650; }
.tile.is-selected .tile__title, .tile:has(input:checked) .tile__title { color: var(--ice-bright); }

/* Compact segmented radio row (budget, level, vibe) */
.seg { display: grid; gap: 0.6rem; }
.seg--3 { grid-template-columns: repeat(3, 1fr); }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.seg label {
  display: block;
  position: relative;
  padding: 0.7rem 0.5rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 550;
  font-size: 0.9375rem;
  color: var(--ink-body);
  transition: border-color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.seg label:hover { border-color: var(--line-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) {
  border-color: var(--ice);
  background: var(--ice-tint);
  color: var(--ice-bright);
  font-weight: 650;
}
.seg__hint { display: block; font-size: 0.75rem; color: var(--ink-muted); font-weight: 450; margin-top: 2px; }
.seg label:has(input:checked) .seg__hint { color: var(--ice); }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 1.5rem; }
.field > label { display: block; font-weight: 550; color: var(--ink); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.field .sub-label { display: block; font-size: 0.8125rem; color: var(--ink-muted); margin-bottom: 0.35rem; }

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.input:focus { border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-ring); outline: none; }
.input.is-invalid { border-color: var(--danger); }
.input::-webkit-calendar-picker-indicator { cursor: pointer; }

.field-error { color: var(--danger); font-size: 0.875rem; margin-top: 0.4rem; }
.field-hint { color: var(--ice); font-size: 0.875rem; margin-top: 0.4rem; font-weight: 550; }

.notice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid;
  margin-top: 0.75rem;
}
.notice--warn { color: var(--warn); border-color: oklch(0.85 0.13 85 / 0.3); background: oklch(0.85 0.13 85 / 0.06); }
.notice--danger { color: var(--danger); border-color: oklch(0.72 0.19 25 / 0.3); background: oklch(0.72 0.19 25 / 0.06); }
.notice a { font-weight: 600; text-decoration: underline; color: inherit; }

/* ==========================================================================
   Stepper
   ========================================================================== */
.stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  max-width: 480px;
  margin: 0 auto 3rem;
}
.stepper::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: var(--line-strong);
}
.step {
  position: relative;
  text-align: center;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  color: var(--ink-muted);
  min-width: 4rem;
}
.step__dot {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  transition: background-color var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out),
              color var(--t-med) var(--ease-out);
}
.step__label { font-size: 0.8125rem; font-weight: 550; }
.step.is-current { color: var(--ink); }
.step.is-current .step__dot {
  background: var(--ice);
  border-color: var(--ice);
  color: var(--bg);
  box-shadow: 0 0 0 4px var(--ice-ring);
}
.step.is-done { color: var(--ink-body); cursor: pointer; }
.step.is-done .step__dot { background: var(--ice-deep); border-color: var(--ice-deep); color: var(--ink); }
.step.is-done:hover { color: var(--ice-bright); }

/* ==========================================================================
   Skeleton loading
   ========================================================================== */
.skeleton {
  border-radius: 10px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.05), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ==========================================================================
   Wizard cards
   ========================================================================== */
.wizard-card { display: none; }
.wizard-card.active { display: block; animation: stepIn 320ms var(--ease-out); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Photo sections (brand surfaces)
   ========================================================================== */
.photo-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.photo-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.photo-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--bg) 0%, oklch(0.13 0.02 245 / 0.55) 35%, oklch(0.13 0.02 245 / 0.18) 70%);
}

.photo-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(5rem, 14vh, 9rem) 0;
}
.photo-band__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.photo-band__scrim { position: absolute; inset: 0; z-index: -1; background: var(--scrim); }

/* ==========================================================================
   Reveal motion (enhancement only — content visible by default;
   site.js applies .reveal-armed only when IntersectionObserver exists)
   ========================================================================== */
.reveal-armed [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
.reveal-armed [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
  margin-top: 0;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer img { height: 1.4rem; opacity: 0.85; }
.site-footer p { margin: 0; font-size: 0.875rem; color: var(--ink-muted); }
.site-footer nav { display: flex; gap: 1.5rem; font-size: 0.875rem; }
.site-footer nav a { color: var(--ink-muted); }
.site-footer nav a:hover { color: var(--ice); }

/* ==========================================================================
   Effects — vanilla ports of React Bits (Split Text, Count Up, Tilt, Magnet).
   All enhancement-only: without JS (or with reduced motion) content renders
   plain and fully visible. Wired up in site.js.
   ========================================================================== */
.split-word { display: inline-block; white-space: nowrap; }
.split-char { display: inline-block; }
[data-split-text].split-ready .split-char { opacity: 0; transform: translateY(0.7em); }
[data-split-text].split-playing .split-char {
  animation: splitCharIn 600ms var(--ease-out) both;
  animation-delay: calc(var(--split-base, 0ms) + var(--char-i) * 28ms);
}
@keyframes splitCharIn {
  from { opacity: 0; transform: translateY(0.7em); }
  to { opacity: 1; transform: none; }
}

[data-tilt] {
  will-change: transform;
  transition: transform 350ms var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
}

[data-magnet]:not(.btn) { display: inline-block; transition: transform 250ms var(--ease-out); }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-armed [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 560px) {
  .seg--3 { grid-template-columns: 1fr; }
  .stepper { max-width: 100%; }
  .step { min-width: 3.2rem; }
  .step__label { font-size: 0.72rem; }
}

/* Nav needs ~520px at full size (5 links); compress below that so nothing clips */
@media (max-width: 560px) {
  .site-nav { padding-left: 1rem; padding-right: 1rem; }
  .site-nav__logo img { height: 1.1rem; }
  .site-nav__links { gap: 0.75rem; }
  .site-nav__links a { font-size: 0.8125rem; }
  .site-nav__links a[href="/"] { display: none; } /* logo is the home link */
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Print (the final plan doubles as a printable itinerary)
   ========================================================================== */
@media print {
  body { background: #fff; color: #111; }
  .site-nav, .site-footer, .no-print { display: none !important; }
  .panel { border-color: #ccc; }
  h1, h2, h3, h4, .tile__title { color: #000; }
  a { color: #0a58a5; text-decoration: underline; }
}
