/* ------------------------------------------------------------------
   PREEN bay kiosk · kiosk layer
   Everything that makes the glass feel like a kiosk rather than a web
   page: water atmosphere, attract loop, touch ripples, approval flash,
   shared-element transitions, richer entrances.
   ------------------------------------------------------------------ */

/* ---------- touch behaviour ---------- */
html { touch-action: manipulation; }
body { overscroll-behavior: none; }
img, svg { pointer-events: none; }
button img, button svg, .k-card img { pointer-events: none; }

/* ---------- water atmosphere ---------- */
.k-water { position: absolute; inset: 0; overflow: hidden; }
.k-water i {
  position: absolute;
  bottom: -60px;
  width: var(--s, 14px);
  height: var(--s, 14px);
  left: var(--x, 50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.12) 60%, rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.55);
  opacity: 0;
  animation: k-bubble-rise var(--d, 14s) linear infinite;
  animation-delay: var(--t, 0s);
}
.k-water i:nth-child(1)  { --x: 4%;  --s: 10px; --d: 15s; --t: 0s; }
.k-water i:nth-child(2)  { --x: 11%; --s: 18px; --d: 19s; --t: -6s; }
.k-water i:nth-child(3)  { --x: 19%; --s: 8px;  --d: 13s; --t: -2s; }
.k-water i:nth-child(4)  { --x: 27%; --s: 14px; --d: 17s; --t: -9s; }
.k-water i:nth-child(5)  { --x: 34%; --s: 22px; --d: 22s; --t: -4s; }
.k-water i:nth-child(6)  { --x: 42%; --s: 9px;  --d: 14s; --t: -11s; }
.k-water i:nth-child(7)  { --x: 50%; --s: 16px; --d: 18s; --t: -1s; }
.k-water i:nth-child(8)  { --x: 58%; --s: 12px; --d: 16s; --t: -7s; }
.k-water i:nth-child(9)  { --x: 66%; --s: 20px; --d: 21s; --t: -13s; }
.k-water i:nth-child(10) { --x: 73%; --s: 8px;  --d: 12s; --t: -3s; }
.k-water i:nth-child(11) { --x: 80%; --s: 15px; --d: 17s; --t: -10s; }
.k-water i:nth-child(12) { --x: 87%; --s: 11px; --d: 15s; --t: -5s; }
.k-water i:nth-child(13) { --x: 93%; --s: 19px; --d: 20s; --t: -12s; }
.k-water i:nth-child(14) { --x: 97%; --s: 9px;  --d: 13s; --t: -8s; }
body[data-theme="light"] .k-water i { border-color: rgba(22,119,255,0.28); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,1), rgba(219,234,255,0.35) 60%, rgba(219,234,255,0.1)); }
.k-mist {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(40% 30% at 20% 80%, rgba(255,255,255,0.18), transparent 70%),
    radial-gradient(35% 28% at 75% 85%, rgba(255,255,255,0.14), transparent 70%);
  animation: k-mist-drift 26s var(--ease-in-out) infinite alternate;
  mix-blend-mode: screen;
}
body[data-theme="light"] .k-mist { opacity: 0.6; }
body[data-theme="dark"] .k-water i { filter: opacity(0.4) blur(0.3px); }
@keyframes k-bubble-rise {
  0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  8%   { opacity: 0.85; }
  50%  { transform: translate3d(14px, -55vh, 0) scale(1); }
  92%  { opacity: 0.6; }
  100% { transform: translate3d(-10px, -112vh, 0) scale(1.15); opacity: 0; }
}
@keyframes k-mist-drift { from { transform: translate3d(-3%, 0, 0); } to { transform: translate3d(3%, -2%, 0); } }

/* ---------- attract loop ---------- */
.k-attract {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: 1fr auto;
  color: #fff;
  background: var(--p-ink);
  cursor: pointer;
  animation: k-fade 600ms var(--ease-out) both;
  overflow: hidden;
}
.k-attract.is-out { animation: k-attract-out 420ms var(--ease-in-out) both; }
.k-attract__slides { position: absolute; inset: 0; }
.k-attract__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1200ms var(--ease-in-out);
}
.k-attract__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1); }
.k-attract__slide.is-on { opacity: 1; }
.k-attract__slide.is-on img { animation: k-kenburns 9s linear both; }
.k-attract__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,28,43,0.35) 0%, rgba(11,28,43,0.15) 40%, rgba(11,28,43,0.86) 100%);
}
.k-attract__body {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: var(--sp-4);
  padding: var(--page-x);
}
.k-attract__brand { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.34em; font-size: 30px; }
.k-attract__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(56px, 7.5vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 40px rgba(0,0,0,0.35);
  max-width: 12ch;
}
.k-attract__sub { font-size: var(--fs-lg); color: rgba(255,255,255,0.8); max-width: 42ch; }
.k-attract__ticker { display: flex; gap: 12px; flex-wrap: wrap; }
.k-attract__ticker .k-chip { min-height: 48px; padding: 0 18px; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); color: #fff; font-size: var(--fs-md); }
.k-attract__ticker .k-chip b { font-family: var(--font-display); font-size: 1.15em; }
.k-attract__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--page-x) var(--page-x);
}
.k-attract__tap {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 0 34px 0 22px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--p-ink);
  font-weight: 800;
  font-size: var(--fs-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: k-tap-pulse 2.2s var(--ease-in-out) infinite;
}
.k-attract__tap i {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--p-blue);
  color: #fff;
}
.k-attract__tap i svg { width: 26px; height: 26px; }
.k-attract__dots { display: flex; gap: 8px; }
.k-attract__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.32); transition: background var(--dur-base), transform var(--dur-base); }
.k-attract__dots i.is-on { background: #fff; transform: scale(1.25); }
@keyframes k-kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes k-tap-pulse { 0%, 100% { transform: translateY(0); box-shadow: 0 24px 60px rgba(0,0,0,0.35); } 50% { transform: translateY(-4px); box-shadow: 0 32px 70px rgba(0,0,0,0.4), 0 0 0 10px rgba(255,255,255,0.10); } }
@keyframes k-attract-out { to { opacity: 0; transform: scale(1.04); } }

/* ---------- touch ripple ---------- */
.k-ripple-host { position: relative; overflow: hidden; }
.k-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.25) 40%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: k-ripple-out 620ms var(--ease-out) forwards;
  mix-blend-mode: screen;
}
.k-card .k-ripple { background: radial-gradient(circle, rgba(22,119,255,0.28) 0%, rgba(22,119,255,0.12) 40%, transparent 70%); mix-blend-mode: normal; }
@keyframes k-ripple-out { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* ---------- approval flash ---------- */
.k-approve {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 60% at 50% 50%, #22c58e 0%, #0e9f6e 60%, #0a7a56 100%);
  color: #fff;
  animation: k-approve-in 420ms var(--ease-out) both, k-approve-out 380ms var(--ease-in-out) 1100ms both;
}
.k-approve__mark {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 22px rgba(255,255,255,0.10), 0 0 0 48px rgba(255,255,255,0.06);
  animation: k-pop 520ms var(--ease-emph) both;
}
.k-approve__mark svg { width: 104px; height: 104px; }
.k-approve__mark path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: k-draw 480ms 160ms var(--ease-out) forwards; }
.k-approve__text { position: absolute; bottom: 18%; font-family: var(--font-display); font-size: clamp(34px, 4vw, 56px); font-weight: 600; letter-spacing: -0.01em; animation: k-rise 500ms 200ms var(--ease-out) both; }
@keyframes k-approve-in { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(140% at 50% 50%); } }
@keyframes k-approve-out { to { opacity: 0; } }

/* ---------- shared-element (View Transitions API) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 420ms; animation-timing-function: var(--ease-out); }
::view-transition-old(wash-hero), ::view-transition-new(wash-hero) { animation-duration: 520ms; animation-timing-function: var(--ease-emph); object-fit: cover; }
::view-transition-group(wash-hero) { animation-duration: 520ms; animation-timing-function: var(--ease-emph); }
html.k-vt .k-scene { animation: none; }
.s-details__hero img { view-transition-name: wash-hero; animation: k-kenburns 18s linear infinite alternate !important; }

/* ---------- richer entrances ---------- */
.k-card.k-enter { animation-name: k-spring-in; animation-duration: 760ms; }
.s-details .k-phases__item { animation: k-rise 520ms var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
.k-howto__item.is-on { animation: k-glow-border 2s var(--ease-in-out) infinite; }
.k-btn--xl { position: relative; overflow: hidden; }
.k-btn--xl::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,0.28) 50%, transparent 60%);
  transform: translateX(-140%);
  animation: k-sweep 3.6s var(--ease-in-out) 1.4s infinite;
}
.k-price.is-tick { animation: k-pop 360ms var(--ease-emph); }
@keyframes k-spring-in { 0% { opacity: 0; transform: translateY(28px) scale(0.96); } 60% { opacity: 1; transform: translateY(-4px) scale(1.01); } 100% { transform: none; } }
@keyframes k-glow-border { 0%, 100% { box-shadow: 0 0 0 0 rgba(58,166,255,0.0); } 50% { box-shadow: 0 0 0 6px rgba(58,166,255,0.22); } }

/* ---------- details highlights ---------- */
.s-details__highlights { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.s-details__highlights .k-chip { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.16); color: #fff; }
.s-details__highlights .k-chip .k-icon { color: #9fd0ff; }

/* ---------- windshield (Welcome · ui/glass.js) ---------- */
/* Water on the glass, the intermittent wiper and the arrival fog: one fixed layer over the whole glass,
   top bar included. It never takes a touch, and dialogs, toasts and the attract loop sit above it. */
.k-glass {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 240ms var(--ease-in-out);
}
.k-glass.is-leaving { opacity: 0; }
.k-glass__beads { position: absolute; inset: 0; }
/* A bead, lit like water on glass: a sharp highlight top left, a bright crescent where light gathers at
   the bottom, a dark rim, a small shadow. The rim keeps it apart from the foam in the bay photo. */
.k-glass__bead {
  --s: 12px;
  position: absolute;
  width: var(--s);
  height: calc(var(--s) * 1.1);
  margin: calc(var(--s) * -0.5) 0 0 calc(var(--s) * -0.5);
  border-radius: 50% 50% 46% 46% / 44% 44% 56% 56%;
  background:
    radial-gradient(circle at 32% 27%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 255, 255, 0) 20%),
    radial-gradient(60% 34% at 52% 82%, rgba(225, 244, 255, 0.55) 0 35%, rgba(225, 244, 255, 0) 100%),
    radial-gradient(circle at 50% 42%, rgba(160, 210, 255, 0.06) 0 46%, rgba(210, 236, 255, 0.22) 70%, rgba(4, 12, 20, 0.5) 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45), 0 0 0 0.75px rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-emph);
}
.k-glass__bead.is-in { opacity: 1; transform: scale(1); }
/* Heavier beads run a little way down. `translate` leaves `transform` to the grow-in; a browser without
   it simply keeps the bead still. */
.k-glass__bead.is-runner.is-in { animation: k-bead-run var(--run-ms, 3s) cubic-bezier(0.55, 0, 0.85, 0.55) 1.1s forwards; }
.k-glass__bead.is-runner::before {
  content: "";
  position: absolute;
  left: 33%;
  bottom: 50%;
  width: 34%;
  height: var(--run, 60px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(220, 240, 255, 0), rgba(220, 240, 255, 0.2) 70%, rgba(220, 240, 255, 0.32));
  transform-origin: 50% 100%;
  transform: scaleY(0);
}
.k-glass__bead.is-runner.is-in::before { animation: k-bead-trail var(--run-ms, 3s) cubic-bezier(0.55, 0, 0.85, 0.55) 1.1s forwards; }
.k-glass__bead.is-wiped { opacity: 0; transition: opacity 160ms var(--ease-out); }
@keyframes k-bead-run { to { translate: 0 var(--run, 60px); } }
@keyframes k-bead-trail { to { transform: scaleY(1); } }

/* Condensation on arrival. glass.js grows --sweep with the blade, so the fog clears exactly behind it. */
.k-glass__fog {
  --sweep: 0deg;
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0 0 0 -0.32'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23f)'/%3E%3C/svg%3E"),
    radial-gradient(130% 90% at 50% 100%, rgba(226, 238, 248, 0.4), rgba(226, 238, 248, 0.24) 55%, rgba(226, 238, 248, 0.32) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(0.7) brightness(1.06);
  backdrop-filter: blur(10px) saturate(0.7) brightness(1.06);
  -webkit-mask-image: conic-gradient(from 270deg at 50% calc(100% + var(--pivot-drop, 48px)), transparent var(--sweep), #000 calc(var(--sweep) + 1.5deg));
  mask-image: conic-gradient(from 270deg at 50% calc(100% + var(--pivot-drop, 48px)), transparent var(--sweep), #000 calc(var(--sweep) + 1.5deg));
  animation: k-fade 220ms var(--ease-out) both;
}

/* The wiper: an arm from a pivot just below the glass, the rubber blade on its outer three quarters,
   and the line of water it pushes on its leading edge. At rest it lies flat, out of sight. */
.k-glass__wiper {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--pivot-drop, 48px));
  width: 24px;
  height: var(--blade, 1200px);
  margin-left: -12px;
  transform-origin: 50% 100%;
  transform: rotate(-90deg);
}
.k-glass__wiper.is-moving { will-change: transform; }
.k-glass__arm {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  height: 100%;
  margin-left: -4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #0b1218, #3a4855 45%, #10181f);
  box-shadow: -10px 12px 24px rgba(0, 0, 0, 0.32);
}
.k-glass__blade {
  position: absolute;
  left: 50%;
  top: 0;
  width: 16px;
  height: 76%;
  margin-left: -8px;
  border-radius: 8px;
  background: linear-gradient(90deg, #000 0%, #1f2830 38%, #070b0f 62%, #000 100%);
  box-shadow:
    4px 0 0 -1px rgba(224, 244, 255, 0.55),
    10px 0 18px rgba(224, 244, 255, 0.2),
    -12px 14px 26px rgba(0, 0, 0, 0.38);
}

/* A ring through the water where a finger touched empty glass. */
.k-glass__ring {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 1.5px solid rgba(224, 244, 255, 0.9);
  animation: k-ring 900ms var(--ease-out) forwards;
}
.k-glass__ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(224, 244, 255, 0.7);
  animation: k-ring-inner 900ms 90ms var(--ease-out) backwards;
}
@keyframes k-ring { from { transform: scale(0.3); opacity: 1; } to { transform: scale(7); opacity: 0; } }
@keyframes k-ring-inner { from { transform: scale(0.2); opacity: 0.9; } to { transform: scale(0.75); opacity: 0; } }

/* ---------- fullscreen hint ---------- */
.k-fs {
  position: fixed;
  right: var(--page-x);
  bottom: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--k-chrome-line);
  background: var(--k-chrome-surface);
  color: var(--k-chrome-fg);
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  animation: k-rise 500ms var(--ease-out) both;
}
.k-fs .k-icon { width: 18px; height: 18px; }
.k-fs[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  /* .s-details__hero img: its zoom above is !important and more specific than the universal rule in
     motion.css, so it has to be listed here (details and offer share the hero). */
  .k-water, .k-mist, .k-attract__slide img, .k-btn--xl::after, .s-details__hero img { animation: none !important; }
  /* glass.js draws nothing under reduced motion; this is the backstop. */
  .k-glass { display: none; }
}
