/* GVI Tesla site: premium motion. A port of the main site's motion system, written for this site's inline-styled
   markup (classes are added at runtime by tesla-motion.js). Only transform + opacity animate (plus a soft glow on
   buttons). One easing curve, hover effects are mouse-only, everything is off under prefers-reduced-motion, and
   the site is fully visible with JavaScript off. */
:root { --tm-ease: cubic-bezier(.22, 1, .36, 1); }

@keyframes tm-rise   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes tm-word   { from { transform: translateY(108%); } to { transform: none; } }
@keyframes tm-show   { to { visibility: visible; } }
@keyframes tm-dd     { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tm-drift  { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.13) translate3d(-1.4%, -1%, 0); } }
@keyframes tm-vt-in  { from { opacity: 0; transform: translateY(10px); } }

/* Scroll progress bar */
.tm-progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.tm-progress i { display: block; height: 100%; background: linear-gradient(90deg, #e01b2e, #ffc60b); transform: scaleX(0); transform-origin: 0 50%; }

/* Scroll reveal (classes added by tesla-motion.js; no-JS visitors see everything) */
.tm-reveal { opacity: 0; }
.tm-reveal.tm-in { opacity: 1; animation: tm-rise .85s var(--tm-ease) var(--d, 0ms) backwards; }

/* Hero entrance: headline words slide up from a mask, the rest follows */
.tm-js h1:not(.tm-split) { visibility: hidden; animation: tm-show .01s 1.4s forwards; }   /* failsafe if JS stalls */
h1 .tm-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em 0 .14em; margin: -.08em 0 -.14em; }
h1 .tm-w > span { display: inline-block; animation: tm-word .95s var(--tm-ease) calc(.1s + var(--i, 0) * 75ms) backwards; }
.tm-hero-in { animation: tm-rise .85s var(--tm-ease) var(--hd, .05s) backwards; }
.tm-drift { animation: tm-drift 30s ease-in-out infinite alternate; transform-origin: 60% 40%; will-change: transform; }
.tm-drift.tm-off { animation-play-state: paused; }

/* Header: frosted glass + tighter bar once you scroll (page flow height is held constant by the script) */
header { transition: background .3s ease, box-shadow .3s ease, border-color .3s ease; }
header.tm-scrolled {
  background: rgba(255, 255, 255, .78) !important;
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom-color: rgba(22, 24, 28, .06) !important;
  box-shadow: 0 10px 30px -14px rgba(22, 24, 28, .22);
}
header.tm-scrolled > div { padding-top: 8px !important; padding-bottom: 8px !important; }
header.tm-scrolled > div > a > img { height: 38px !important; }

/* Dropdown menus ease in */
[data-dd]:hover > div, [data-dd]:focus-within > div { animation: tm-dd .25s var(--tm-ease) both; }

/* Buttons: sheen sweep, glow, magnetic pull and a sliding arrow on the red buttons */
.tm-btn {
  position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--s, 1));
  transition: box-shadow .35s var(--tm-ease), transform .35s var(--tm-ease), background .2s ease, color .2s ease;
}
.tm-btn:active { --s: .97; }
.tm-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .3) 50%, transparent 66%);
}
.tm-btn.tm-arrow::after {
  content: "\2192"; display: inline-block; width: 0; margin-left: -8px; opacity: 0; transform: translateX(-8px); overflow: hidden;
  transition: width .35s var(--tm-ease), margin .35s var(--tm-ease), opacity .25s ease, transform .35s var(--tm-ease);
}
.tm-btn-o { transition: box-shadow .35s var(--tm-ease), border-color .2s ease; }

/* Tiles: float up on hover, cursor spotlight, image zoom (mouse / trackpad only) */
.tm-card { position: relative; isolation: isolate; transition: transform .45s var(--tm-ease), box-shadow .45s var(--tm-ease), border-color .25s ease; }
.tm-card img { transition: transform .9s var(--tm-ease); }
@media (hover: hover) and (pointer: fine) {
  .tm-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -22px rgba(22, 24, 28, .34); border-color: rgba(224, 27, 46, .4) !important; }
  a.tm-card:hover { transform: translateY(-6px); box-shadow: 0 26px 48px -22px rgba(22, 24, 28, .36); }
  a.tm-card:hover img { transform: scale(1.05); }
  .tm-card::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 27, 46, .10), transparent 62%);
    opacity: 0; transition: opacity .35s ease;
  }
  .tm-card:hover::before { opacity: 1; }
  .tm-btn:hover { box-shadow: 0 12px 28px -10px rgba(224, 27, 46, .6); }
  .tm-btn:hover::before { transform: translateX(120%); transition: transform .85s var(--tm-ease); }
  .tm-btn.tm-arrow:hover::after, .tm-btn.tm-arrow:focus-visible::after { width: 1em; margin-left: 0; opacity: 1; transform: none; }
  .tm-btn-o:hover { box-shadow: 0 10px 24px -12px rgba(22, 24, 28, .3); }
}

/* Mobile floating action bar: slides up once you scroll past the hero */
.tm-actionbar { display: none; }
@media (max-width: 920px) {
  .tm-actionbar {
    display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(15, 17, 20, .88);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, .1);
    transform: translateY(110%); transition: transform .5s var(--tm-ease);
    font-family: 'Public Sans', system-ui, sans-serif;
  }
  .tm-actionbar.tm-show { transform: none; }
  .tm-actionbar a {
    display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border-radius: 12px;
    font-weight: 700; font-size: 15px; color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none;
  }
  .tm-actionbar a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tm-actionbar a.tm-book { background: #e01b2e; }
  footer > div { padding-bottom: 96px !important; }
}

/* Landing-page pieces from holiday.css that should reveal too are handled in the script. */

/* Page transitions (multi-page View Transitions; falls back to normal navigation) */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
header { view-transition-name: tm-header; }
::view-transition-old(root) { animation-duration: .2s; }
::view-transition-new(root) { animation: tm-vt-in .45s var(--tm-ease) both; }
::view-transition-group(tm-header) { animation-duration: .35s; animation-timing-function: var(--tm-ease); }

/* Reduced motion: every animation and hover movement off, content fully visible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tm-reveal { opacity: 1; }
  .tm-hero-in, .tm-drift, h1 .tm-w > span, [data-dd]:hover > div { animation: none !important; }
  .tm-card, .tm-btn, header { transition: none !important; }
  .tm-card:hover, a.tm-card:hover, a.tm-card:hover img, .tm-btn:hover { transform: none !important; }
  .tm-btn::before { display: none; }
  .tm-progress { display: none; }
}
