/* ============================================================
   SWIT — dynamic enhancements
   aurora · live hero demo · today-ticker · bento 3D tilt
   products flow-spine · scroll progress + section rail
   All motion respects prefers-reduced-motion.
   ============================================================ */

/* ---------- Aurora flowing background ---------- */
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
  opacity: 0.6;
  will-change: transform;
}
.aurora-blob--1 {
  width: 60vw; height: 60vw;
  top: -20vw; left: 30vw;
  background: radial-gradient(circle, oklch(66% 0.17 232 / 0.55), transparent 62%);
  animation: aurora-1 30s var(--ease-inout) infinite alternate;
}
.aurora-blob--2 {
  width: 50vw; height: 50vw;
  top: 35vh; left: -10vw;
  background: radial-gradient(circle, oklch(60% 0.15 255 / 0.45), transparent 60%);
  animation: aurora-2 38s var(--ease-inout) infinite alternate;
}
@keyframes aurora-1 { to { transform: translate3d(-16vw, 12vh, 0) scale(1.18) rotate(40deg); } }
@keyframes aurora-2 { to { transform: translate3d(18vw, -10vh, 0) scale(1.12) rotate(-30deg); } }

/* cursor-reactive aurora */
.aurora-cursor {
  position: absolute;
  top: 0; left: 0;
  width: 42vw; height: 42vw;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(72% 0.15 228 / 0.20), transparent 60%);
  filter: blur(40px);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.9s var(--ease-out);
  will-change: transform;
}
body.aurora-on .aurora-cursor { opacity: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) {
  .aurora-cursor { display: none; }
  .aurora-blob { animation: none; }
}

/* ---------- Hero: live translate float card ---------- */
.float-card--b { min-width: 14.5rem; }
.lt { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.lt__src {
  font-size: 0.7rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}
.lt__out {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  white-space: nowrap;
}
.lt__out::after {
  content: "";
  display: inline-block;
  width: 1.5px; height: 0.95em;
  margin-left: 2px;
  vertical-align: -1px;
  background: var(--accent-bright);
  animation: lt-caret 0.9s steps(1) infinite;
}
.lt.done .lt__out::after { opacity: 0; }
@keyframes lt-caret { 50% { opacity: 0; } }

/* voice waveform (upgrades the hero .eq) */
.float-card--a .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.float-card--a .eq i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--grad-accent);
  animation: wave 1s var(--ease-inout) infinite;
}
.float-card--a .eq i:nth-child(1) { animation-delay: 0s; }
.float-card--a .eq i:nth-child(2) { animation-delay: 0.18s; }
.float-card--a .eq i:nth-child(3) { animation-delay: 0.36s; }
.float-card--a .eq i:nth-child(4) { animation-delay: 0.12s; }
.float-card--a .eq i:nth-child(5) { animation-delay: 0.28s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .float-card--a .eq i { animation: none; height: 10px; }
  .lt__out::after { animation: none; }
}

/* ---------- Hero today-ticker ---------- */
.hero__ticker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.hero__ticker b {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ticker__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 oklch(72% 0.15 155 / 0.6);
  animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 oklch(72% 0.15 155 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px oklch(72% 0.15 155 / 0); }
}
@media (prefers-reduced-motion: reduce) { .ticker__dot { animation: none; } }

/* ---------- Bento: 3D tilt + glare ---------- */
.bento__cell {
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease-out), border-color var(--dur) var(--ease-out);
}
.cell__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  background: radial-gradient(
    180px 180px at var(--gx, 50%) var(--gy, 50%),
    oklch(100% 0 0 / 0.10), transparent 60%);
  z-index: 2;
}
.bento__cell:hover .cell__glare { opacity: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) {
  .bento__cell { transition: border-color var(--dur) var(--ease-out); }
  .cell__glare { display: none; }
}

/* ---------- Products flow spine ---------- */
#products .shell { position: relative; }
.spine {
  position: absolute;
  left: 0; top: 8%;
  width: 2px; height: 84%;
  z-index: 0;
  pointer-events: none;
  background: var(--line);
  overflow: visible;
}
.spine__fill {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: var(--spine, 0%);
  background: linear-gradient(180deg, var(--accent-bright), var(--accent) 60%, transparent);
  box-shadow: 0 0 14px -2px var(--accent);
}
.spine__node {
  position: absolute;
  left: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  translate: -50% -50%;
  background: var(--bg-3);
  border: 2px solid var(--line-2);
  transition: border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background 0.4s;
}
.spine__node.lit {
  background: var(--accent);
  border-color: var(--accent-bright);
  box-shadow: 0 0 16px -2px var(--accent);
}
@media (max-width: 880px) { .spine { display: none; } }
@media (prefers-reduced-motion: reduce) { .spine__fill { transition: none; } }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--grad-accent);
  box-shadow: 0 0 12px -2px var(--accent);
}

/* ---------- Section rail (right side) ---------- */
.rail {
  position: fixed;
  right: clamp(0.7rem, 1.4vw, 1.6rem);
  top: 50%;
  translate: 0 -50%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}
.rail__dot {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: oklch(100% 0 0 / 0.18);
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.rail__dot:hover { transform: scale(1.35); background: oklch(100% 0 0 / 0.4); }
.rail__dot.active {
  background: var(--accent);
  box-shadow: 0 0 12px -1px var(--accent);
}
.rail__dot::after {
  content: attr(data-label);
  position: absolute;
  right: 18px; top: 50%;
  translate: 0 -50%;
  padding: 0.25em 0.6em;
  font-family: var(--font-display);
  font-size: 0.7rem;
  white-space: nowrap;
  color: var(--text);
  background: oklch(20% 0.01 240 / 0.9);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
  backdrop-filter: blur(8px);
}
.rail__dot:hover::after { opacity: 1; }
@media (max-width: 880px) { .rail { display: none; } }

/* ---------- Hero scroll parallax depth ---------- */
.hero-stage__inner,
.float-card,
.hero-phone { will-change: transform; }

/* ---------- Quality pass: anchors, tap, mobile/perf ---------- */
* { -webkit-tap-highlight-color: transparent; }
[id] { scroll-margin-top: 88px; }

@media (max-width: 760px) {
  /* lighten the atmosphere on phones for smoother scroll */
  .aurora-blob { animation: none; filter: blur(42px); opacity: 0.4; }
  .orb { filter: none; }
  .try.card, .feed.card { padding: 1.2rem; }
  .feed__list { max-height: 22rem; }
  .reviews-wall .review { flex-basis: 84vw; }
}
@media (hover: none) {
  /* hover-only affordances shouldn't trap touch users */
  .reviews-wall .review:hover { transform: none; }
  .bento__cell:hover { transform: none; }
}

/* ---------- Interactive "try it" + live feed band ---------- */
.try__grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.6rem);
  align-items: stretch;
}
.try.card, .feed.card { padding: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); }
.try__h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h3);
  letter-spacing: -0.02em;
  margin: 0.7rem 0 1.4rem;
}
.try__io { display: flex; flex-direction: column; gap: 0.9rem; }
.try__lbl {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}
.try__input {
  width: 100%;
  padding: 0.85em 1em;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: oklch(100% 0 0 / 0.03);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.try__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.try__phrases { display: flex; flex-direction: column; gap: 0.5rem; }
.tphrase {
  position: relative;
  text-align: left;
  padding: 0.7em 1em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
  background: oklch(100% 0 0 / 0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.tphrase:hover { color: var(--text); border-color: var(--line-2); }
.tphrase.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tphrase.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 60%;
  translate: 0 -50%;
  border-radius: 0 3px 3px 0;
  background: var(--accent-bright);
}
.try__go { align-self: flex-start; }
.try__out {
  position: relative;
  margin-top: 0.3rem;
  padding: 1.1rem 1.2rem;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%),
    oklch(100% 0 0 / 0.02);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-height: 5.5rem;
}
.try__result {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--text);
  min-height: 1.5em;
}
.try__result::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1.05em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent-bright);
  animation: lt-caret 0.9s steps(1) infinite;
  opacity: 0;
}
.try__out.typing .try__result::after { opacity: 1; }
.try__wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  margin-top: 0.9rem;
  opacity: 0.25;
  transition: opacity var(--dur) var(--ease-out);
}
.try__out.playing .try__wave { opacity: 1; }
.try__wave i {
  flex: 1;
  height: 5px;
  border-radius: 2px;
  background: var(--grad-accent);
}
.try__out.playing .try__wave i { animation: wave 0.9s var(--ease-inout) infinite; }

/* live activity feed */
.feed { display: flex; flex-direction: column; }
.feed__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 1rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.feed__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: hidden;
  flex: 1;
}
.feed__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  background: oklch(100% 0 0 / 0.02);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  animation: feed-in 0.5s var(--ease-out) both;
}
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
.feed__ic {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 0.95rem;
}
.feed__ic svg { width: 16px; height: 16px; }
.feed__body { min-width: 0; line-height: 1.3; display: flex; flex-direction: column; gap: 0.15rem; }
.feed__title { display: block; font-size: 0.86rem; color: var(--text); }
.feed__meta { display: block; font-size: 0.72rem; color: var(--faint); }
.feed__amt {
  margin-left: auto;
  align-self: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--good);
  white-space: nowrap;
}
.feed__time {
  margin-left: auto;
  align-self: center;
  font-size: 0.72rem;
  color: var(--faint);
  white-space: nowrap;
}
@media (max-width: 880px) {
  .try__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .try__out.playing .try__wave i { animation: none; }
  .try__result::after { animation: none; }
  .feed__item { animation: none; }
}

/* ---------- Reviews: drag carousel ---------- */
.reviews-wall {
  display: flex;
  gap: clamp(0.9rem, 0.5rem + 1.2vw, 1.4rem);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.4rem 0.2rem 1.4rem;
  cursor: grab;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.reviews-wall::-webkit-scrollbar { display: none; }
.reviews-wall.dragging { cursor: grabbing; scroll-snap-type: none; }
.reviews-wall.dragging .review { pointer-events: none; }
.reviews-wall .review {
  flex: 0 0 clamp(270px, 78vw, 350px);
  margin-bottom: 0;
  scroll-snap-align: center;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.reviews-wall .review:hover { transform: translateY(-5px); border-color: var(--line-2); }
.reviews-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--faint);
}
.reviews-hint svg { width: 1.05em; height: 1.05em; }
@media (prefers-reduced-motion: reduce) {
  .reviews-wall .review:hover { transform: none; }
}
