/* ═══════════════════════════════════════════════════════════
   INSPIRA UI — Vanilla CSS reimplementations
   Each block matches a component from inspira-ui.com.
   For Vue+Inspira migration, see HANDOFF.md
   ═══════════════════════════════════════════════════════════ */


/* ─── ShimmerButton ─────────────────────────────────────── */
/* Inspira: app/components/inspira/ui/shimmer-button/ShimmerButton.vue
   Props mapped: shimmerColor, shimmerSize, shimmerDuration, background */
.shimmer-btn {
  --shimmer-color: rgba(255,255,255,0.92);
  --shimmer-cut: 0.05em;
  --shimmer-speed: 3s;
  --shimmer-bg: var(--ink);

  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.10);
  color: white;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: var(--shimmer-bg);
  overflow: hidden;
  transform: translateZ(0);
  transition: transform 300ms var(--ease-out);
}
.shimmer-btn:active { transform: translateY(1px); }
.shimmer-btn .ph { font-size: 17px; transition: transform 240ms var(--ease-out); }
.shimmer-btn:hover .ph { transform: translateX(3px); }

.shimmer-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--shimmer-bg);
  margin: var(--shimmer-cut);
}
.shimmer-btn::after {
  content: "";
  position: absolute;
  inset: -100%;
  z-index: -2;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    var(--shimmer-color) 60deg,
    transparent 120deg,
    transparent 240deg,
    var(--shimmer-color) 300deg,
    transparent 360deg);
  animation: shimmer-spin var(--shimmer-speed) linear infinite;
  opacity: 0.85;
  filter: blur(1px);
}
@keyframes shimmer-spin {
  to { transform: rotate(360deg); }
}

/* Inverse (light bg, dark text) */
.shimmer-btn.invert {
  --shimmer-color: rgba(0,0,0,0.85);
  --shimmer-bg: white;
  color: var(--ink);
  border-color: rgba(0,0,0,0.06);
}


/* ─── BorderBeam ────────────────────────────────────────── */
/* Inspira: border-beam/BorderBeam.vue
   Animated colored beam tracing the border of any element. */
.with-border-beam { position: relative; }
.border-beam {
  --bb-size: 240px;
  --bb-duration: 8s;
  --bb-from: var(--accent);
  --bb-to:   #9333ea;

  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1.5px solid transparent;
  -webkit-mask:
    linear-gradient(white, white) content-box,
    linear-gradient(white, white);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  overflow: hidden;
}
.border-beam::after {
  content: "";
  position: absolute;
  width: var(--bb-size);
  aspect-ratio: 1 / 1;
  background: linear-gradient(to left, var(--bb-from), var(--bb-to), transparent);
  offset-anchor: 90% 50%;
  offset-path: rect(0 auto auto 0 round calc(var(--bb-size)));
  animation: border-beam-trace var(--bb-duration) infinite linear;
}
@keyframes border-beam-trace {
  to { offset-distance: 100%; }
}


/* ─── AnimatedList ──────────────────────────────────────── */
/* Inspira: animated-list/AnimatedList.vue
   Stack of cards, oldest fades out at top, newest enters at bottom.
   Driven by JS in inspira.js: data-anim-list. */
.anim-list {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  width: 100%;
}
.anim-list-item {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--sh-sm);
  animation: anim-list-enter 600ms var(--ease-out) both;
  transition: transform 400ms var(--ease-out), opacity 400ms ease;
}
.anim-list-item.exiting {
  animation: anim-list-exit 500ms var(--ease-out) both;
}
@keyframes anim-list-enter {
  0% { opacity: 0; transform: scale(0.7) translateY(-16px); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes anim-list-exit {
  to { opacity: 0; transform: scale(0.7) translateY(16px); }
}

.anim-list-item .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 17px;
  color: white;
}
.anim-list-item .body {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.anim-list-item .who {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.anim-list-item .who .when {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.anim-list-item .what {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 3px;
  letter-spacing: -0.005em;
}


/* ─── AnimatedBeam ──────────────────────────────────────── */
/* Inspira: animated-beam/AnimatedBeam.vue
   SVG path between two refs with traveling gradient.
   Driven by JS: data-beam-stage / data-beam-from / data-beam-to */
.beam-stage {
  position: relative;
  isolation: isolate;
}
.beam-stage svg.beam-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.beam-stage > .beam-node {
  position: relative;
  z-index: 1;
}


/* ─── SpinningText ──────────────────────────────────────── */
/* Inspira: spinning-text/SpinningText.vue */
.spin-text {
  position: relative;
  width: 8em;
  aspect-ratio: 1 / 1;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  animation: spin-text-rotate 16s linear infinite;
}
.spin-text span {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: 0 0;
}
@keyframes spin-text-rotate {
  to { transform: rotate(360deg); }
}


/* ─── BlurReveal / TextReveal ──────────────────────────── */
/* Inspira: blur-reveal + text-reveal
   Word-by-word blur+fade on scroll into view. */
.reveal-words { display: inline; }
.reveal-words .word {
  display: inline-block;
  filter: blur(8px);
  opacity: 0;
  transform: translateY(10px);
  transition: filter 800ms var(--ease-out),
              opacity 800ms var(--ease-out),
              transform 800ms var(--ease-out);
  white-space: pre;
}
.reveal-words.revealed .word {
  filter: blur(0);
  opacity: 1;
  transform: translateY(0);
}


/* ─── NumberTicker ──────────────────────────────────────── */
/* Inspira: number-ticker/NumberTicker.vue
   data-ticker="68" data-ticker-suffix="%" */
.ticker {
  font-family: var(--font-display);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}


/* ─── AuroraBackground ──────────────────────────────────── */
/* Inspira: aurora-background/AuroraBackground.vue */
.aurora-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 30%, transparent 75%);
}
.aurora-bg::before,
.aurora-bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 35% 40% at 30% 40%, #2563ff 0%, transparent 60%),
    radial-gradient(ellipse 30% 35% at 70% 60%, #9333ea 0%, transparent 60%),
    radial-gradient(ellipse 25% 30% at 50% 80%, #2563ff 0%, transparent 55%);
  filter: blur(40px);
  opacity: 0.55;
  animation: aurora-drift 18s ease-in-out infinite alternate;
}
.aurora-bg::after {
  animation-duration: 24s;
  animation-direction: alternate-reverse;
  opacity: 0.35;
  background:
    radial-gradient(ellipse 40% 35% at 70% 30%, #4f46e5 0%, transparent 55%),
    radial-gradient(ellipse 30% 40% at 30% 70%, #2563ff 0%, transparent 60%);
}
@keyframes aurora-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-3%, 4%) rotate(2deg); }
  100% { transform: translate(4%, -2%) rotate(-1deg); }
}


/* ─── BentoGrid ─────────────────────────────────────────── */
/* Inspira: bento-grid/BentoGrid.vue */
.bento {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .bento { grid-template-columns: repeat(4, 1fr); } }

.bento-cell {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 240ms, transform 240ms var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.bento-cell:hover { border-color: var(--line-2); }
.bento-cell.span-2 { grid-column: span 1; }
@media (min-width: 1000px) {
  .bento-cell.span-2 { grid-column: span 2; }
}
.bento-cell .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.bento-cell h4 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  max-width: 14ch;
}
.bento-cell p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: auto 0 0;
  max-width: 32ch;
}


/* ─── CardSpotlight ─────────────────────────────────────── */
/* Inspira: card-spotlight/CardSpotlight.vue
   Mouse-tracked radial gradient. JS sets --mx / --my. */
.spotlight {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  overflow: hidden;
  transition: border-color 240ms;
  isolation: isolate;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(37, 99, 255, 0.08),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
  z-index: 0;
}
.spotlight:hover::before { opacity: 1; }
.spotlight:hover { border-color: var(--line-2); }
.spotlight > * { position: relative; z-index: 1; }


/* ─── AppleCardCarousel ─────────────────────────────────── */
/* Inspira: apple-card-carousel/AppleCardCarousel.vue
   Horizontal scroll-snap rail with arrow controls. */
.apple-carousel {
  position: relative;
  width: 100%;
}
.apple-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 24px;
  padding: 8px 24px 32px;
  margin: 0 -24px;
  scrollbar-width: none;
}
.apple-rail::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .apple-rail {
    padding: 8px 48px 40px;
    margin: 0 -48px;
    scroll-padding-left: 48px;
  }
}

.apple-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 320px;
  height: 460px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--bg-warm);
  transition: transform 360ms var(--ease-out);
}
@media (min-width: 768px) {
  .apple-card { width: 380px; height: 520px; }
}
.apple-card:hover { transform: translateY(-4px); }
.apple-card .img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
}
.apple-card .grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 35%, rgba(0,0,0,0.85) 100%);
}
.apple-card .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px;
  color: white;
}
.apple-card .meta .num {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}
.apple-card .meta h4 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0;
}

.apple-arrows {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.apple-arrows button {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--bg-warm);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--ink);
  transition: background 200ms;
}
.apple-arrows button:hover { background: #ece9e2; }
.apple-arrows button:disabled { opacity: 0.35; cursor: not-allowed; }


/* ─── ContainerScroll ───────────────────────────────────── */
/* Inspira: container-scroll/ContainerScroll.vue
   Element starts tilted, flattens and scales as you scroll. */
.container-scroll {
  perspective: 1200px;
  padding: 80px 0;
}
.container-scroll-card {
  transform-style: preserve-3d;
  transform-origin: center top;
  transition: transform 80ms linear;
  border-radius: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  will-change: transform;
}


/* ─── Marquee ───────────────────────────────────────────── */
/* Inspira: marquee/Marquee.vue */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee-scroll var(--marquee-dur, 70s) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track.reverse { animation-direction: reverse; }
@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}


/* ─── Compare (before/after slider) ─────────────────────── */
/* Inspira: compare/Compare.vue */
.compare-slider {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg-warm);
  aspect-ratio: 16 / 10;
}
.compare-slider .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.compare-slider .after {
  clip-path: inset(0 0 0 var(--cmp, 50%));
}
.compare-slider .handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--cmp, 50%);
  width: 2px;
  background: white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
  z-index: 5;
  cursor: ew-resize;
}
.compare-slider .handle::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.compare-slider .handle::before {
  content: "⇆";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  z-index: 1;
}
.compare-slider .label {
  position: absolute;
  top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.compare-slider .label.left  { left: 16px; }
.compare-slider .label.right { right: 16px; }
