/* ClaudeClip — base + custom CSS */

:root {
  --bg: #0A0A0F;
  --bg-soft: #101018;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --violet: #8B5CF6;
  --electric: #3B82F6;
  --magenta: #EC4899;
  --grad: linear-gradient(120deg, #8B5CF6 0%, #3B82F6 45%, #EC4899 100%);
}

html.light {
  --bg: #F7F7FB;
  --bg-soft: #FFFFFF;
  --fg: #0A0A14;
  --muted: rgba(10, 10, 20, 0.62);
  --hairline: rgba(10, 10, 20, 0.08);
  --hairline-strong: rgba(10, 10, 20, 0.14);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.85);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); }

/* Selection */
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ---------- Gradients ---------- */
.bg-grad {
  background-image: var(--grad);
}
.text-grad {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ring-grad {
  position: relative;
}
.ring-grad::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Mesh background ---------- */
.mesh-bg {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.55;
  z-index: 0;
}
.mesh-bg::before,
.mesh-bg::after,
.mesh-bg > i {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.mesh-bg::before {
  width: 55vw; height: 55vw;
  left: -10vw; top: -10vw;
  background: radial-gradient(closest-side, rgba(139,92,246,0.85), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
.mesh-bg::after {
  width: 60vw; height: 60vw;
  right: -15vw; top: 10vw;
  background: radial-gradient(closest-side, rgba(236,72,153,0.7), transparent 70%);
  animation: drift2 28s ease-in-out infinite alternate;
}
.mesh-bg > i {
  width: 45vw; height: 45vw;
  left: 25vw; top: 30vw;
  background: radial-gradient(closest-side, rgba(59,130,246,0.7), transparent 70%);
  animation: drift3 32s ease-in-out infinite alternate;
  display: block;
}
@keyframes drift  { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(8vw, 6vw, 0) scale(1.1); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-6vw, 8vw, 0) scale(1.05); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-4vw,-6vw, 0) scale(1.12); } }

html.light .mesh-bg { opacity: 0.35; filter: blur(80px); }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
}
.glass-strong {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
          backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--hairline-strong);
}
.glow-violet { box-shadow: 0 30px 80px -40px rgba(139,92,246,0.7), 0 0 0 1px rgba(139,92,246,0.18) inset; }
.glow-soft   { box-shadow: 0 30px 70px -40px rgba(0,0,0,0.6); }

/* ---------- Hairline divider ---------- */
.hairline { border-color: var(--hairline); }
.hairline-b { border-bottom: 1px solid var(--hairline); }
.hairline-t { border-top: 1px solid var(--hairline); }

.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn-grad {
  background-image: var(--grad);
  background-size: 200% 200%;
  background-position: 0% 50%;
  transition: background-position 600ms ease, transform 200ms ease, box-shadow 300ms ease;
  box-shadow: 0 10px 40px -10px rgba(139,92,246,0.55), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.btn-grad:hover { background-position: 100% 50%; transform: translateY(-1px); box-shadow: 0 16px 48px -12px rgba(236,72,153,0.6), 0 0 0 1px rgba(255,255,255,0.08) inset; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  transition: all 200ms ease;
}
.btn-ghost:hover { background: var(--glass); border-color: rgba(255,255,255,0.28); }

/* ---------- Marquee ---------- */
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
@keyframes marquee {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-50%,0,0); }
}
.marquee:hover { animation-play-state: paused; }

/* ---------- Floats ---------- */
.float-y { animation: floatY 6s ease-in-out infinite; }
.float-y2 { animation: floatY 7.5s ease-in-out infinite 0.6s; }
.float-y3 { animation: floatY 5.3s ease-in-out infinite 1.2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Pulse ring */
.pulse-ring {
  position: relative;
}
.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(236,72,153,0.6);
  animation: pulseRing 2.4s ease-out infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Image placeholders: tasteful striped fallbacks */
.placeholder-img {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 12px, rgba(255,255,255,0.02) 12px 24px),
    linear-gradient(135deg, rgba(139,92,246,0.25), rgba(236,72,153,0.18));
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 12px;
}

/* Word fade-up (no framer-motion) */
.word-stagger > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  animation: wordIn 0.75s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 60ms);
  margin-right: 0.22em;
}
@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Hero element fade-up */
.hero-fade {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.7s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Reveal on scroll (IntersectionObserver-driven) */
.reveal-fade {
  opacity: 0;
  transform: translateY(var(--reveal-y, 28px));
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.reveal-fade.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover lift */
.card-hover {
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
}

/* HowItWorks step 01: photo drops into upload zone */
.drop-in {
  animation: dropIn 0.9s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: 0.2s;
}
@keyframes dropIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 40px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* HowItWorks step 02: timeline bars grow */
.bar-in {
  height: 4px;
  opacity: 0;
  animation: barIn 0.6s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: var(--bar-d, 0s);
}
@keyframes barIn {
  to { height: var(--bar-h, 50%); opacity: 1; }
}

/* HowItWorks step 03: format cards rise */
.card-rise {
  opacity: 0;
  transform: translateY(16px);
  animation: cardRise 0.7s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: var(--rise-d, 0.1s);
}
@keyframes cardRise {
  to { opacity: 1; transform: translateY(0); }
}

/* UseCases tab content crossfade (keyed remount) */
.tab-content-in {
  animation: tabIn 0.45s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes tabIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Accordion height transition (grid-template-rows trick) */
.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s cubic-bezier(.2,.7,.2,1), opacity 0.35s ease;
}
.accordion-body.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.accordion-body > div {
  min-height: 0;
}

/* Showcase tile fake-progress bar (drives even when video can't load) */
.tile-progress {
  width: 0%;
  animation: tileProgress 18s linear forwards;
}
@keyframes tileProgress {
  to { width: 100%; }
}

/* Lightbox */
.lb-back {
  background: rgba(6, 6, 10, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
          backdrop-filter: blur(12px) saturate(120%);
  animation: lbBack 0.3s ease forwards;
}
@keyframes lbBack { from { opacity: 0; } to { opacity: 1; } }
.lb-in {
  animation: lbIn 0.45s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes lbIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee { animation: none !important; }
}

/* Tab pill underline */
.tab-underline {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: left 300ms cubic-bezier(.2,.7,.2,1), width 300ms cubic-bezier(.2,.7,.2,1);
}

/* Slider thumb on before/after */
.ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.95) 12%, rgba(255,255,255,0.95) 88%, rgba(255,255,255,0.0));
  pointer-events: none;
}
.ba-knob {
  position: absolute;
  top: 50%;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #0A0A0F;
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  cursor: ew-resize;
}

/* FAQ chevron */
.chev { transition: transform 250ms ease; }
.chev.open { transform: rotate(180deg); }

/* Focus ring */
:focus-visible {
  outline: 2px solid #8B5CF6;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Subtle grain */
.grain::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
}
