/* Gloss — a soft top sheen and a lit edge on raised surfaces */
/* No blur anywhere (scroll cost). The page sheets load after this file, so the cards they restyle are
   raised with an `html ` prefix on the selector. The shimmer is a strip (::before — ::after belongs to the pointer glow further down) that SLIDES across the card
   with `transform` — once when the card comes into view and again on hover. It must never be a moving
   background: that repaints the whole card every frame (measured: scroll 58 → 50 frames a second). */
.site-header { background: var(--gloss), var(--header-bg); box-shadow: var(--gloss-edge); }

.card,
html .model-card,
html .fact-card,
html .savings__card,
html .wf-card {
  position: relative;
  overflow: hidden; /* fallback for browsers without `clip` */
  overflow: clip; /* keeps the strip inside the rounded card */
  background: var(--gloss), var(--surface);
}
.card, html .wf-card { box-shadow: var(--gloss-edge), var(--shadow-1); }
html .fact-card, html .savings__card { box-shadow: var(--gloss-edge); }
.card::before,
html .fact-card::before,
html .savings__card::before,
html .wf-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--shimmer);
  transform: translateX(-110%);
  pointer-events: none;
}
/* The strip only transitions while hovered, so it sweeps once in and snaps back unseen. */
@media (hover: hover) {
  .card:hover::before,
  html .fact-card:hover::before,
  html .savings__card:hover::before,
  html .wf-card:hover::before { transform: translateX(110%); transition: transform 800ms var(--ease); }
}
/* The model card's own hover lift keeps its shadow, with the lit edge on top. */
html .model-card:hover { box-shadow: var(--gloss-edge), var(--shadow-lift); }
/* One sweep when the card comes into view (site.js adds `gloss-in`; phones have no hover). `backwards`,
   never `forwards`: once done the strip rests off the card again, so the hover sweep still works. */
@keyframes gloss-sweep { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
.gloss-in::before { animation: gloss-sweep 1100ms var(--ease) 150ms 1 backwards; }

.btn--primary { background-image: var(--gloss-btn); box-shadow: var(--gloss-edge); }
.btn--secondary { background-image: var(--gloss); }
.segmented { background-image: var(--gloss); }

/* Motion layer: page transitions, pointer light, tilt, animated border, energy field.
   Loaded on every page right after components.css. Colours come from tokens only. */

/* Page-to-page cross-fade (the @view-transition opt-in lives in core.css). The header and the guide bar
   keep a name of their own so they stay still while the rest fades; a name is unique per page. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: var(--ease);
}
.site-header { view-transition-name: site-header; }
.guide-bar { view-transition-name: guide-bar; }
/* A motorbike picture carries its model's name (set by class — a style attribute is blocked by the CSP). */
/* display: block — a <picture> is inline by default, and a named element split into several boxes cancels the transition. */
.vt-bike-evo, .vt-bike-feliz-ii, .vt-bike-viper { display: block; }
.vt-bike-evo { view-transition-name: bike-evo; }
.vt-bike-feliz-ii { view-transition-name: bike-feliz-ii; }
.vt-bike-viper { view-transition-name: bike-viper; }

/* The energy field: a canvas drawn by energy.js behind a hero or a page head. */
.energy { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: var(--energy-opacity); }

/* Pointer light and tilt: fine pointers only (pointer.js never runs elsewhere). The glow sits on a
   pseudo-element, below the content (an isolated stacking context puts it above the element's own
   background and below everything in flow), so no later background shorthand can erase it. */
@media (hover: hover) and (pointer: fine) {
  .is-lit { position: relative; isolation: isolate; }
  .is-lit::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--pointer-light), transparent 70%);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .stage__tab {
    transform: perspective(800px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
    transition: transform 160ms var(--ease);
  }
}

/* Animated border for the stage frame: a rotated conic square behind a 1 px mask. Static until the
   frame is hovered or holds focus; only the transform animates, so the frame never repaints. */
.ring { position: relative; overflow: hidden; }
.ring::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(200%, 1200px);
  height: auto;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, var(--brand-strong), var(--ai), transparent 40%, transparent 70%, var(--brand-strong));
  transform: translate(-50%, -50%) rotate(0deg);
  pointer-events: none;
}
.ring::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: var(--surface);
  pointer-events: none;
}
.ring > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .ring:hover::before,
  .ring:focus-within::before { animation: ring-turn 8s linear infinite; }
}
@keyframes ring-turn {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ask Vinz: the row, the suggestions and the log live in the open guide bar (vinz.js fills the log).
   Without JavaScript the whole box is hidden and the bar keeps its links. The open body scrolls on its own
   when it is taller than 70% of the screen. */
html:not(.js) .vinz-ask { display: none; }
.guide-bar[open] .guide-bar__body { max-height: 70svh; overflow-y: auto; }
.vinz-ask { display: grid; gap: 12px; margin-bottom: 12px; }
.vinz-ask__row { display: flex; gap: 8px; }
.vinz-ask__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.vinz-ask__input::placeholder { color: var(--ink-2); }
.vinz-ask__input:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
.vinz-ask__send { background: var(--brand); color: var(--on-brand); }
.vinz-ask__send:hover { background: var(--brand-strong); }
.vinz-ask__suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.vinz-ask__suggest { border: 0; cursor: pointer; font-family: inherit; }
@media (max-width: 479px) {
  .vinz-ask__suggestions { flex-wrap: nowrap; overflow-x: auto; }
  .vinz-ask__suggest { flex: 0 0 auto; }
}
.vinz-ask__log { display: grid; gap: 12px; max-height: 320px; overflow-y: auto; }
.vinz-ask__log:empty { display: none; }
.vinz-ask__exchange { display: grid; gap: 8px; }
.vinz-ask__question {
  justify-self: end;
  max-width: 85%;
  margin: 0;
  padding: 6px 12px;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.vinz-ask__answer {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.vinz-ask__answer p { margin: 0; }
.vinz-ask__who { display: flex; align-items: center; gap: 8px; color: var(--ai); font-size: 0.8125rem; font-weight: 600; }
.vinz-ask__who .vinz-orb::after { animation: none; }
.vinz-ask__source { color: var(--provenance); font-size: 0.75rem; }
