/* AeroVista motion & effects layer. Everything here is progressive enhancement:
 * content stays visible without JS (reveal states are scoped to html.js), and
 * prefers-reduced-motion turns the motion off at the bottom of this file. */

:root {
  --plane-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 16l20-8-4 10-5-3-3 4v-5z'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --glow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 50px -12px rgba(11,79,108,.45);
  --grad-brand: linear-gradient(120deg, #ff6b4a, #ffb36b 35%, #38bdf8 70%, #0b4f6c);
}

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px) scale(.995); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
.header { view-transition-name: site-header; }

.nav-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; pointer-events: none;
  background: var(--grad-brand); background-size: 200% 100%;
  transform-origin: left; transform: scaleX(0); opacity: 0;
  animation: shimmer 1.2s linear infinite;
}
.nav-progress.active { opacity: 1; transform: scaleX(.85); transition: transform 8s cubic-bezier(.1,.6,.1,1), opacity .2s; }
.nav-progress.done { opacity: 0; transform: scaleX(1); transition: transform .2s, opacity .4s .2s; }
@keyframes shimmer { to { background-position: -200% 0; } }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 999; transform-origin: left;
  transform: scaleX(var(--p, 0)); background: var(--accent); pointer-events: none; }

/* ---------- Header ---------- */
.header { transition: background .35s, box-shadow .35s, backdrop-filter .35s; }
.header.scrolled { background: rgba(7, 52, 71, .78); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); box-shadow: 0 10px 30px -15px rgba(0,0,0,.5); }
.header .container { transition: height .35s var(--ease-out); }
.header.scrolled .container { height: 58px; }
.logo svg { transition: transform .8s var(--ease-spring); }
.logo:hover svg { transform: rotate(-20deg) scale(1.08); }
.nav > .nav-item > a { position: relative; }
.nav > .nav-item > a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 14px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out); }
.nav > .nav-item:hover > a::after { transform: scaleX(1); transform-origin: left; }
.dropdown { animation: drop-in .28s var(--ease-out); transform-origin: top; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
.dropdown a { transition: background .2s, transform .2s, padding-left .2s; }
.dropdown a:hover { padding-left: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hero::before { content: ""; position: absolute; inset: -40%; z-index: -2;
  background: radial-gradient(40% 40% at 20% 30%, rgba(255,107,74,.55), transparent 60%),
              radial-gradient(35% 35% at 80% 20%, rgba(56,189,248,.45), transparent 60%),
              radial-gradient(45% 45% at 60% 90%, rgba(250,204,21,.25), transparent 60%);
  animation: aurora 18s ease-in-out infinite alternate; }
@keyframes aurora { 50% { transform: translate(6%, -4%) rotate(8deg) scale(1.1); } 100% { transform: translate(-5%, 5%) rotate(-6deg); } }
.hero h1 { letter-spacing: -.03em; }
.hero .type { background: var(--grad-brand); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shimmer 6s linear infinite; white-space: nowrap; }
.hero .caret { display: inline-block; width: 3px; height: .9em; margin-left: 4px; background: var(--accent);
  vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { backdrop-filter: blur(6px); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  padding: 10px 16px; border-radius: 14px; }
.hero-stats strong { display: block; font-size: 1.5rem; }
.hero-stats span { font-size: .8rem; color: #cfe3ec; }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; background: var(--brand-dark); color: #fff; padding: 12px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: ticker 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { color: #fff; text-decoration: none; white-space: nowrap; font-weight: 600; }
.ticker a b { color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Booker ---------- */
.booker { transition: box-shadow .4s; }
.booker:focus-within { box-shadow: var(--glow); }
.booker-tabs { position: relative; }
.booker-tabs .tab-ink { position: absolute; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent);
  transition: transform .45s var(--ease-spring), width .45s var(--ease-spring); }
.js .booker-tabs button.active { border-color: transparent; }
.booker-panel.active { animation: panel-in .45s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
.swap { transition: transform .5s var(--ease-spring), background .2s; }
.swap.spin { transform: rotate(180deg); }
.swap:hover { background: #d5ecf4; }
input, select, textarea { transition: border-color .2s, box-shadow .25s, transform .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,79,108,.15); }
.field.filled label, .field:focus-within label { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .25s var(--ease-out), box-shadow .25s, background .2s; will-change: transform; }
.btn:hover { box-shadow: 0 10px 24px -10px rgba(255,107,74,.7); }
.btn-secondary:hover { box-shadow: 0 10px 24px -10px rgba(11,79,108,.7); }
.btn:active { transform: scale(.96); }
.btn-primary::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out); }
.btn-primary:hover::before { transform: translateX(120%); }
.btn.is-busy { pointer-events: none; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.is-busy::after { border-color: rgba(11,79,108,.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); opacity: .45;
  background: currentColor; animation: ripple .65s var(--ease-out) forwards; z-index: 0; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.quick-link, .filters a, .pagination a, .booker-tabs button { position: relative; overflow: hidden; }

/* ---------- Cards: reveal, tilt, glare, spotlight ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.tilt { transform-style: preserve-3d; transition: transform .5s var(--ease-out), box-shadow .4s; }
.tilt.tilting { transition: transform .08s linear, box-shadow .4s; box-shadow: 0 30px 60px -25px rgba(11,79,108,.45); }
.tilt .glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.45), transparent 55%); mix-blend-mode: soft-light; z-index: 2; }
.tilt.tilting .glare { opacity: 1; }
.card { position: relative; }
.card-media { overflow: hidden; }
.card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.25));
  transition: opacity .4s; }
a.card:hover .card-media { filter: saturate(1.25); }
.card-media { transition: filter .5s; }
.spot { position: relative; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,107,74,.12), transparent 45%); }
.spot:hover::before { opacity: 1; }
.fare.popular { animation: pulse-ring 3s ease-in-out infinite; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 6px rgba(255,107,74,.14), var(--shadow); } }

/* ---------- Results ---------- */
.flight-line::after { animation: fly 3.2s var(--ease-out) infinite; }
@keyframes fly { 0% { right: 100%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { right: -6px; opacity: 0; } }
.flight, .room { transition: transform .35s var(--ease-out), box-shadow .35s; }
.flight:hover, .room:hover { transform: translateY(-3px); box-shadow: 0 24px 48px -24px rgba(11,79,108,.5); }
.flight-fare { transition: background .25s; }
.flight-fare:hover { background: var(--sky); }
.total.bump { animation: bump .5s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.15); color: var(--accent); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1001; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: #fff; color: var(--ink); border-radius: 14px; padding: 14px 18px 14px 16px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.4);
  border-left: 4px solid var(--warn); display: flex; gap: 12px; align-items: flex-start; animation: toast-in .5s var(--ease-spring); }
.toast.success { border-color: var(--ok); }
.toast.error { border-color: #dc2626; }
.toast button { margin-left: auto; background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.toast.out { animation: toast-out .35s var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.js main > .container > .flash { display: none; }

/* ---------- Searching overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 1002; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 50% 40%, rgba(11,79,108,.92), rgba(7,52,71,.97)); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .35s; }
.search-overlay.show { opacity: 1; pointer-events: auto; }
.search-overlay .orbit { width: 160px; height: 160px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.25); position: relative;
  margin: 0 auto 24px; animation: spin 2.4s linear infinite; }
.search-overlay .orbit::after { content: ""; position: absolute; top: -14px; left: 50%; width: 28px; height: 28px; background: var(--accent); -webkit-mask: var(--plane-mask) center / contain no-repeat; mask: var(--plane-mask) center / contain no-repeat; transform: translateX(-50%) rotate(15deg); }
.search-overlay h2 { text-align: center; }

/* ---------- Cursor ---------- */
.cursor-ring, .cursor-dot { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1003; border-radius: 50%; will-change: transform; }
.cursor-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1.5px solid var(--accent);
  transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), background .25s, opacity .3s; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring.hover { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(255,107,74,.12); }
.cursor-ring.down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.cursor-ring.hidden, .cursor-dot.hidden { opacity: 0; }

/* ---------- Confetti, boarding pass, back to top ---------- */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 1004; }
.boarding-pass { position: relative; animation: pass-in 1s var(--ease-spring); transform-origin: top; }
@keyframes pass-in { from { opacity: 0; transform: perspective(900px) rotateX(-70deg); } }
.boarding-pass .bp-main { position: relative; overflow: hidden; }
.boarding-pass .bp-main::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.25) var(--shine, 50%), transparent 70%); mix-blend-mode: overlay; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 0; z-index: 998; cursor: pointer;
  background: #fff; box-shadow: var(--shadow); color: var(--brand); opacity: 0; transform: translateY(20px) scale(.8);
  transition: opacity .3s, transform .4s var(--ease-spring); display: grid; place-items: center; }
.to-top.show { opacity: 1; transform: none; }
.to-top svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.to-top circle { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 138; stroke-dashoffset: calc(138 - 138 * var(--p, 0)); }
.toasts ~ .to-top, body:has(.toasts .toast) .to-top { bottom: 90px; }

/* ---------- Misc polish ---------- */
.gradient-text { background: var(--grad-brand); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s linear infinite; }
details summary { transition: color .2s; list-style: none; position: relative; padding-right: 44px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); transition: transform .35s var(--ease-spring); }
details[open] summary::after { transform: translateY(-50%) rotate(135deg); }
details[open] p { animation: panel-in .4s var(--ease-out); }
:focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255,107,74,.3); }

/* ---------- Reduced motion: keep the look, drop the motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .ticker-track { animation: none; flex-wrap: wrap; width: auto; }
  .hero::before, .hero-canvas { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (pointer: coarse) { .cursor-ring, .cursor-dot { display: none; } }
