/* Tiny stylesheet that layers on top of Tailwind Play CDN. Keep this small —
   anything sweeping should go through Tailwind utility classes instead. */

html { color-scheme: dark; }

::selection { background: #10b98155; color: #f8fafc; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262833; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2f323f; }

/* Subtle code styling inside prose blocks */
code:not(pre code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}

/* Tailwind Play CDN flicker mitigation */
[x-cloak] { display: none !important; }

/* ========================================================================= *
 * Motion + animations
 * Keep these on the cheap — transform / opacity only, no layout thrash.
 * Everything is opt-in via class names; respect prefers-reduced-motion below.
 * ========================================================================= */

/* ---- Keyframes ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blob-float-a {
  0%, 100% { transform: translate3d(-15%, -20%, 0) scale(1); }
  50%      { transform: translate3d(10%, 5%, 0) scale(1.15); }
}
@keyframes blob-float-b {
  0%, 100% { transform: translate3d(20%, 10%, 0) scale(1); }
  50%      { transform: translate3d(-8%, -10%, 0) scale(0.92); }
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.7; }
  80%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes marching-ants {
  to { background-position: 24px 0, -24px 0, 0 24px, 0 -24px; }
}

/* ---- Reveal-on-scroll utility ---- */
.reveal { opacity: 0; transform: translate3d(0, 14px, 0); }
.reveal.is-visible { animation: fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }

.reveal-delay-1.is-visible { animation-delay: 80ms;  }
.reveal-delay-2.is-visible { animation-delay: 160ms; }
.reveal-delay-3.is-visible { animation-delay: 240ms; }
.reveal-delay-4.is-visible { animation-delay: 320ms; }
.reveal-delay-5.is-visible { animation-delay: 400ms; }
.reveal-delay-6.is-visible { animation-delay: 480ms; }
.reveal-delay-7.is-visible { animation-delay: 560ms; }
.reveal-delay-8.is-visible { animation-delay: 640ms; }
.reveal-delay-9.is-visible { animation-delay: 720ms; }

/* ---- Hero entrance (immediate, no scroll) ---- */
.hero-enter > * { opacity: 0; animation: fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hero-enter > *:nth-child(1) { animation-delay: 0ms; }
.hero-enter > *:nth-child(2) { animation-delay: 100ms; }
.hero-enter > *:nth-child(3) { animation-delay: 200ms; }
.hero-enter > *:nth-child(4) { animation-delay: 300ms; }
.hero-enter > *:nth-child(5) { animation-delay: 400ms; }

/* ---- Hero halo (kept low-key) ---- */
.bg-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bg-blobs::before,
.bg-blobs::after {
  content: "";
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 540px;
  max-height: 540px;
  border-radius: 9999px;
  filter: blur(100px);
  opacity: 0.20;
  will-change: transform;
}
.bg-blobs::before {
  top: -15%;
  left: -10%;
  background: radial-gradient(circle at 30% 30%, #10b981, transparent 60%);
  animation: blob-float-a 22s ease-in-out infinite;
}
.bg-blobs::after {
  top: -10%;
  right: -10%;
  background: radial-gradient(circle at 70% 30%, #6366f1, transparent 60%);
  animation: blob-float-b 26s ease-in-out infinite;
}

/* ---- Single-color emerald accent text (no animation, no rainbow) ---- */
.text-shimmer {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Backwards-compat alias for the rainbow .gradient-text used in some templates */
.gradient-text {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Pulsing live-status dot ---- */
.live-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #10b981;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid #10b981;
  animation: pulse-ring 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* ---- Card hover lift ---- */
.lift {
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 200ms ease,
              box-shadow 200ms ease,
              background-color 200ms ease;
  will-change: transform;
}
.lift:hover {
  transform: translate3d(0, -1px, 0);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px -16px rgba(16, 185, 129, 0.25);
}

/* ---- Subtle accent ring on hover (no conic rainbow) ---- */
.glow-border {
  position: relative;
  isolation: isolate;
}
.glow-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(99, 102, 241, 0.25));
  opacity: 0;
  transition: opacity 280ms ease;
}
.glow-border:hover::before { opacity: 0.35; }

/* ---- Typewriter cursor for code preview ---- */
.cursor-blink::after {
  content: "▍";
  margin-left: 2px;
  color: #10b981;
  animation: blink 1.1s steps(1) infinite;
}

/* ---- Marching-ants border for an "active" empty-state ---- */
.ants {
  background-image:
    linear-gradient(90deg, #2f323f 50%, transparent 50%),
    linear-gradient(90deg, #2f323f 50%, transparent 50%),
    linear-gradient(0deg,  #2f323f 50%, transparent 50%),
    linear-gradient(0deg,  #2f323f 50%, transparent 50%);
  background-size: 12px 1px, 12px 1px, 1px 12px, 1px 12px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  animation: marching-ants 1.4s linear infinite;
}

/* ---- Smooth route transition for content swap ---- */
main { animation: fade-in 400ms ease-out; }

/* ========================================================================= *
 * Premium dark mode — restrained aurora background, faint grid, glass cards.
 * Color discipline: emerald accent, subtle indigo, plenty of slate/ink negative
 * space. No rainbow gradients, no rotating shapes, no playful bouncing.
 * ========================================================================= */

/* ---- Aurora background ---- */
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0,    0,    0) scale(1);    opacity: 0.55; }
  50%      { transform: translate3d(2%, -1.5%, 0) scale(1.04); opacity: 0.8;  }
}
.bg-aurora {
  background-color: #0a0b10;
  background-image:
    radial-gradient(60rem 36rem at 18% -10%, rgba( 16, 185, 129, 0.20), transparent 60%),
    radial-gradient(55rem 34rem at 95% 35%, rgba(  99, 102, 241, 0.16), transparent 60%),
    radial-gradient(50rem 32rem at 50% 110%, rgba( 16, 185, 129, 0.10), transparent 65%);
  pointer-events: none;
}

/* ---- Faint dot grid, with vignette mask ---- */
.bg-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
  mask-image:           radial-gradient(ellipse 120% 80% at 50% 0%, #000 35%, transparent 80%);
  -webkit-mask-image:   radial-gradient(ellipse 120% 80% at 50% 0%, #000 35%, transparent 80%);
  pointer-events: none;
}

/* ---- Drifting orbs (the only "moving" element) ---- */
.orb {
  position: absolute;
  display: block;
  width: 38rem;
  height: 38rem;
  border-radius: 9999px;
  filter: blur(110px);
  will-change: transform, opacity;
  transform: translate3d(0, var(--py, 0px), 0);
  animation: aurora-drift 22s ease-in-out infinite;
}
.orb-emerald { background: radial-gradient(circle, rgba( 16, 185, 129, 0.30), transparent 60%); animation-duration: 26s; }
.orb-indigo  { background: radial-gradient(circle, rgba( 99, 102, 241, 0.22), transparent 60%); animation-duration: 32s; }
.orb-slate   { background: radial-gradient(circle, rgba(148, 163, 184, 0.10), transparent 60%); animation-duration: 38s; }

/* ---- Glass card utilities ---- */
.glass {
  background-color: rgba(16, 19, 26, 0.62);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 40px -16px rgba(0, 0, 0, 0.6);
}
.glass-strong {
  background-color: rgba(16, 19, 26, 0.78);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Hairline divider (used between sections) ---- */
.hairline {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Subtle accent text — emerald only, no shimmer ---- */
.accent-text {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ---- Section eyebrow ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #94a3b8;
}
.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: rgba(148, 163, 184, 0.45);
  display: inline-block;
}

/* ---- Tag pill (replaces the playful "chip") ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #cbd5e1;
}

/* ========================================================================= *
 * Phase 22 — Premium motion polish
 * Linear / Vercel / Stripe vocabulary: tight spring curves, low-amplitude
 * translates, a single colour pass. No bouncing, no rotating, no toys.
 * ========================================================================= */

/* ---- Spring easing tokens (single source of truth) ---- */
:root {
  --ease-spring:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-emphasis: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Tilt-spring: stronger lift than .lift, springier landing.
       Use on premium cards where the user spends time reading.        ---- */
.tilt-spring {
  transition:
    transform     360ms var(--ease-spring),
    border-color  240ms ease,
    box-shadow    360ms var(--ease-spring);
  will-change: transform;
}
.tilt-spring:hover {
  transform: translate3d(0, -2px, 0);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 32px -18px rgba(16, 185, 129, 0.30),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* ---- Magnetic CTA — JS sets --mx / --my (-4..4 px); CSS handles the spring.
       Defaults to 0 so the element sits still until JS hooks it up.   ---- */
.magnetic {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform 280ms var(--ease-spring), background-color 200ms ease;
  will-change: transform;
}

/* ---- Typewriter cycler. JS swaps text on a 3.5s rotation; the cursor
       blinks when the typist is "thinking", solid while typing.       ---- */
.cycler {
  position: relative;
  display: inline-block;
  min-width: 1ch;
}
.cycler-word {
  display: inline-block;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.cycler-caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: #10b981;
  border-radius: 1px;
  animation: blink 1.05s steps(1) infinite;
}

/* ---- Marquee strip — slow horizontal scroll with edge fade mask.
       Track must be wide enough that the loop seam never shows.       ---- */
@keyframes marquee-x {
  from { transform: translate3d(0,    0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: marquee-x 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---- SVG draw-on stroke. Pair with stroke-dasharray + stroke-dashoffset
       set inline; CSS just animates dashoffset to 0.                  ---- */
@keyframes draw-stroke {
  to { stroke-dashoffset: 0; }
}
.draw-on {
  stroke-dasharray: var(--len, 240);
  stroke-dashoffset: var(--len, 240);
  animation: draw-stroke 1400ms var(--ease-emphasis) 200ms forwards;
}

/* ---- Pipeline walk: when the section gets `.is-walking` (set by IO),
       each .pipeline-step gets a one-shot emerald sweep with a stagger.
       Pure transform/opacity — no layout work.                        ---- */
@keyframes step-glow {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.0); }
  35%  { box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.45),
                     0 0 24px -2px rgba(16, 185, 129, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.0); }
}
.pipeline-step { transition: transform 240ms var(--ease-spring); }
.pipeline-strip.is-walking .pipeline-step {
  animation: step-glow 900ms var(--ease-emphasis) both;
}
.pipeline-strip.is-walking .pipeline-step:nth-child(1) { animation-delay:   0ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(2) { animation-delay: 120ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(3) { animation-delay: 240ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(4) { animation-delay: 360ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(5) { animation-delay: 480ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(6) { animation-delay: 600ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(7) { animation-delay: 720ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(8) { animation-delay: 840ms; }
.pipeline-strip.is-walking .pipeline-step:nth-child(9) { animation-delay: 960ms; }

/* ---- Skeleton loaders ---- */
/* Sweep a faint emerald highlight across a slate block while async work runs.
   Apply .skeleton on a block-shaped element with an explicit height/width.
   No layout work — just background-position; respects reduced motion. */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  position: relative;
  background-color: rgba(255, 255, 255, 0.04);
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(16, 185, 129, 0.10) 40%,
    rgba(16, 185, 129, 0.16) 50%,
    rgba(16, 185, 129, 0.10) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.6s linear infinite;
  border-radius: 0.375rem;
  overflow: hidden;
}

/* ---- Animated focus ring on inputs / buttons. Uses the spring curve
       and a soft emerald ring instead of the default browser blue.    ---- */
.focus-ring {
  transition: box-shadow 220ms var(--ease-spring),
              border-color 220ms ease;
}
.focus-ring:focus,
.focus-ring:focus-visible {
  outline: none;
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.18),
    0 0 0 1px rgba(16, 185, 129, 0.45) inset;
}

/* ========================================================================= *
 * Reduced motion — honor it.
 * ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .lift:hover,
  .tilt-spring:hover { transform: none; }
  main { animation: none; }
  .orb { animation: none; }
  .marquee-track { animation: none; transform: none; }
  .magnetic { transform: none; }
  .draw-on { stroke-dashoffset: 0; animation: none; }
  .pipeline-strip.is-walking .pipeline-step { animation: none; }
  .cycler-caret { animation: none; opacity: 1; }
  .skeleton { animation: none; }
}
