/* ============================================
   Alejandro Brito · Personal Brand
   Custom styles — extends Tailwind
   ============================================ */

:root {
  --ink-0: #0A0A0A;
  --ink-50: #111111;
  --ink-100: #161616;
  --ink-200: #1E1E1E;
  --cream: #F5F5F0;
  --muted: #8A8A8A;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.04);
  /* Accent driven by HSL parts so the theme customizer can swap the
     palette of the entire site by updating just three numbers. */
  --accent-h: 77;
  --accent-s: 86%;
  --accent-l: 66%;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-dim: hsl(var(--accent-h), 60%, 50%);
  --accent-soft: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.12);
  /* Site noise / grain intensity, also controlled by the customizer */
  --noise-opacity: 0.04;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  background: var(--ink-0);
}

body {
  font-feature-settings: "ss01", "cv02", "cv11";
  position: relative;
  background-color: var(--ink-0);
}

/* Grid texture lives on a dedicated pseudo-layer instead of body bg.
   Scrolls with the page, no `background-attachment: fixed` repaint cost,
   tiles forever via repeat. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  /* The pseudo-layer extends as tall as the body — set via JS or just allow
     normal flow. Using absolute lets it stretch with content. */
}

/* Top ambient glow — fixed but contained (no scroll-time recomposite cost
   because it's painted once on its own layer). */
body::after {
  content: "";
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 800px;
  background: radial-gradient(ellipse at center, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Elevated surfaces (ink-50) — same grid feel, layered */
.bg-ink-50 {
  position: relative;
  background-color: var(--ink-50) !important;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) !important;
  background-size: 64px 64px !important;
}

/* ============================================
   HERO VIDEO · neon AB reveal background
   Plays behind the hero headline. Screen blend
   drops the dark video bg into the page; radial
   mask concentrates it behind the title area so
   it doesn't compete with stats and CTAs below.
   ============================================ */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  filter: saturate(1.15) brightness(1.05);
  /* Concentrate visibility behind the title area, fade to edges */
  -webkit-mask-image: radial-gradient(
    ellipse 75% 65% at 50% 38%,
    #000 0%,
    rgba(0, 0, 0, 0.85) 35%,
    rgba(0, 0, 0, 0.4) 70%,
    transparent 92%
  );
          mask-image: radial-gradient(
    ellipse 75% 65% at 50% 38%,
    #000 0%,
    rgba(0, 0, 0, 0.85) 35%,
    rgba(0, 0, 0, 0.4) 70%,
    transparent 92%
  );
  animation: heroVideoFadeIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes heroVideoFadeIn {
  0%   { opacity: 0;    transform: scale(1.04); }
  100% { opacity: 0.55; transform: scale(1);    }
}

/* Soft lime tint overlay — bridges the cyan-green of the neon
   sign with the lime accent palette */
.hero-video::after {
  /* Pseudo-element on a <video> isn't actually rendered in most browsers.
     This is intentionally absent — we tint via filter on the element. */
}

/* Respect reduced motion: hide the video entirely */
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none !important;
  }
}

/* ============================================
   LOGO MARK · neon badge (transparent PNG)
   ============================================ */
.logo-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  /* High-quality rendering — important for the XL centerpiece
     which still does some downscaling. Small variants are 1:1
     pixel-matched via srcset, so this is a no-op for them. */
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

/* Soft lime halo behind the mark — bridges the cyan-green logo
   with the site's lime accent palette without touching the image. */
.logo-mark::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at 50% 50%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18), transparent 65%);
  filter: blur(8px);
  z-index: -1;
  opacity: 0.55;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}
a:hover .logo-mark::before,
.logo-mark:hover::before {
  opacity: 1;
  transform: scale(1.25);
}

/* Spin-on-hover for the small/medium variants. The transition gives a
   smooth reverse-spin on mouseout too. */
.logo-mark-sm img,
.logo-mark-md img {
  transition:
    transform 0.8s cubic-bezier(0.34, 1.4, 0.5, 1),
    filter 0.5s ease;
  transform-origin: 50% 50%;
  will-change: transform;
}

a:hover .logo-mark-sm img,
a:hover .logo-mark-md img {
  transform: rotate(360deg) scale(1.06);
  filter: brightness(1.15) saturate(1.15) drop-shadow(0 0 6px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.45));
}

/* Optional: faster spin on smaller variant for a sharper "snap" feel */
.logo-mark-sm img {
  transition-duration: 0.7s, 0.5s;
}

/* Sizes */
.logo-mark-sm { width: 44px; height: 44px; }
.logo-mark-md { width: 60px; height: 60px; }
.logo-mark-xl {
  width: 220px;
  height: 220px;
}
@media (min-width: 768px) {
  .logo-mark-xl { width: 280px; height: 280px; }
}

/* XL gets a stronger ambient halo + breathing animation */
.logo-mark-xl::before {
  inset: -15%;
  background: radial-gradient(circle at 50% 50%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.22), transparent 60%);
  filter: blur(28px);
  opacity: 0.8;
}

@keyframes logoBreath {
  0%, 100% { transform: scale(1);    filter: brightness(1)    saturate(1); }
  50%      { transform: scale(1.02); filter: brightness(1.08) saturate(1.08); }
}
.logo-mark-xl img {
  animation: logoBreath 4.5s ease-in-out infinite;
  transform-origin: center;
}

/* ============================================
   CURSOR RIBBONS CANVAS
   ============================================ */
#ribbons-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* All content sits above the canvas. Sections that need their own
   solid surfaces (cards, testimonials etc.) already opt-in via classes. */
header, main, footer, section {
  position: relative;
  z-index: 1;
}

/* ============================================
   GRAIN OVERLAY (fixed, GPU-friendly)
   ============================================ */
.grain {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ============================================
   STATUS DOT (breathing)
   ============================================ */
.status-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5); }
  70%  { box-shadow: 0 0 0 8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0); }
  100% { box-shadow: 0 0 0 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0); }
}

.dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
}

/* ============================================
   GLASS BUTTON · Apple Tahoe liquid glass
   Adapted from the reference but with our lime palette.
   Continuous shimmer sweep + lime glow halo on hover +
   aggressive scale/lift + magnetic arrow shift.
   ============================================ */
.btn-glass {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: 9999px;
  color: var(--cream);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  user-select: none;

  /* Translucent surface — a slight lime tint blends with the page */
  background: linear-gradient(
    135deg,
    rgba(245, 245, 240, 0.08) 0%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.05) 50%,
    rgba(245, 245, 240, 0.04) 100%
  );

  /* Real frosted glass — Chromium/Safari supported */
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);

  /* Apple-style nested inset shadow stack — gives the convex/refractive edge */
  box-shadow:
    inset  0   0   0  1px rgba(245, 245, 240, 0.10),
    inset  1.5px 2.5px 0 -1px rgba(255, 255, 255, 0.45),
    inset -1.5px -1.5px 0 -1px rgba(255, 255, 255, 0.20),
    inset -2px -5px 1px -4px rgba(255, 255, 255, 0.18),
    inset -0.5px -1px 4px 0   rgba(0, 0, 0, 0.18),
    inset  0    2px 4px -2px rgba(0, 0, 0, 0.22),
    inset  2px -6px 1px -4px rgba(0, 0, 0, 0.10),
    0 1px 4px  0   rgba(0, 0, 0, 0.25),
    0 6px 18px -6px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.20);

  transition:
    transform   0.5s cubic-bezier(0.34, 1.5, 0.5, 1),
    box-shadow  0.5s cubic-bezier(0.34, 1.5, 0.5, 1),
    color       0.3s ease;
}

/* Continuous shimmer sweep — a lime light bar crosses every 4.5s */
.btn-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 35%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.38) 50%,
    transparent 65%
  );
  background-size: 260% 100%;
  background-position: 200% 50%;
  pointer-events: none;
  animation: glassShimmer 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  mix-blend-mode: overlay;
  z-index: 0;
}

@keyframes glassShimmer {
  0%   { background-position: 200% 50%; }
  55%  { background-position: -130% 50%; }
  100% { background-position: -130% 50%; }
}

/* Lime halo — appears on hover, breathes */
.btn-glass::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(
    ellipse at center,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.55),
    transparent 65%
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: blur(16px);
  pointer-events: none;
}

/* Children must sit above the shimmer */
.btn-glass > * {
  position: relative;
  z-index: 2;
}

.btn-glass:hover {
  transform: translateY(-2px) scale(1.06);
  color: var(--cream);
  box-shadow:
    inset  0   0   0  1px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.30),
    inset  1.5px 2.5px 0 -1px rgba(255, 255, 255, 0.60),
    inset -1.5px -1.5px 0 -1px rgba(255, 255, 255, 0.30),
    inset -2px -5px 1px -4px rgba(255, 255, 255, 0.25),
    inset -0.5px -1px 4px 0   rgba(0, 0, 0, 0.22),
    inset  0    2px 4px -2px rgba(0, 0, 0, 0.25),
    inset  2px -6px 1px -4px rgba(0, 0, 0, 0.12),
    0 4px 14px  0   rgba(0, 0, 0, 0.35),
    0 12px 36px -6px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.45);
}

.btn-glass:hover::after {
  opacity: 1;
  animation: glassGlowBreath 1.4s ease-in-out infinite;
}

@keyframes glassGlowBreath {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%      { opacity: 1;    transform: scale(1.12); }
}

.btn-glass:hover svg {
  transform: translateX(5px);
}

.btn-glass:active {
  transform: translateY(0) scale(0.94);
  transition-duration: 0.18s;
}

/* Reduced motion — kill shimmer + glow animation */
@media (prefers-reduced-motion: reduce) {
  .btn-glass::before { animation: none; opacity: 0.3; }
  .btn-glass:hover::after { animation: none; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink-0);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.6) inset,
              0 8px 24px -8px rgba(0,0,0,0.5);
}
.btn-primary:hover {
  background: #FFFFFF;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.8) inset,
              0 12px 32px -8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.375rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink-0);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.4) inset,
              0 12px 32px -10px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
}
.btn-primary-lg:hover {
  background: #D5FF6E;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.5) inset,
              0 16px 40px -10px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.55);
  transform: translateY(-1px);
}
.btn-primary-lg:active {
  transform: translateY(0);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.375rem;
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--line);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.02);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================
   SERVICE CARDS (Bento)
   ============================================ */
.service-card {
  position: relative;
  padding: 2rem;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--ink-50) 0%, var(--ink-0) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.5s ease,
              background 0.5s ease;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.04) inset,
              0 24px 48px -24px rgba(0,0,0,0.6);
}

@media (min-width: 768px) {
  .service-card {
    padding: 2.5rem;
  }
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0) 0%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0) 50%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.14);
}
.service-card:hover::before {
  opacity: 1;
}

.service-card h3 {
  transition: color 0.3s ease;
}
.service-card:hover h3 {
  color: var(--accent);
}

/* Spotlight effect (cursor-tracked) */
.service-card .spotlight {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 50%),
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.10),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 5;
}
.service-card:hover .spotlight {
  opacity: 1;
}

/* ============================================
   AI SERVICE CARD · with Spline 3D scene
   ============================================ */
.service-card-ai {
  padding: 0 !important;
}

.spline-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 60%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.10), transparent 60%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.03), transparent 50%),
    var(--ink-100);
  border-top: 1px solid var(--line);
}
@media (min-width: 768px) {
  .spline-stage {
    border-top: none;
    border-left: 1px solid var(--line);
  }
}

/* Inner refraction border (taste rule: liquid glass) */
.spline-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 3;
}

/* Spline viewer element */
.spline-viewer-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}
.spline-viewer-el.is-loaded {
  opacity: 1;
}

/* Hide Spline default logo/branding */
spline-viewer::part(logo) {
  display: none !important;
}

/* Cover the watermark corner with brand-matching gradient */
.spline-mask {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 160px;
  height: 56px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(17, 17, 17, 0.5) 35%,
    var(--ink-100) 65%,
    var(--ink-100) 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* ============================================
   AGGRESSIVE AI LOADER · "system booting" aesthetic
   Multiple expanding rings, HUD corner brackets,
   scanlines, cycling code text. Fades out once
   the Spline scene finishes loading.
   ============================================ */
.spline-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.7s ease, filter 0.5s ease;
  overflow: hidden;
}
.spline-stage.is-loaded .spline-loader {
  opacity: 0;
  filter: blur(6px);
}

/* HUD corner brackets — tactical/scifi framing */
.spline-hud-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  opacity: 0.7;
  animation: hudPulse 2.4s ease-in-out infinite;
}
.spline-hud-tl { top: 14px;    left: 14px;  border-right: none;  border-bottom: none; }
.spline-hud-tr { top: 14px;    right: 14px; border-left: none;   border-bottom: none; animation-delay: 0.3s; }
.spline-hud-bl { bottom: 14px; left: 14px;  border-right: none;  border-top: none;    animation-delay: 0.6s; }
.spline-hud-br { bottom: 14px; right: 14px; border-left: none;   border-top: none;    animation-delay: 0.9s; }
@keyframes hudPulse {
  0%, 100% { opacity: 0.4; box-shadow: 0 0 0 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0); }
  50%      { opacity: 0.95; box-shadow: 0 0 8px 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3); }
}

/* Scanlines — slow vertical drift */
.spline-scanlines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 2px,
      hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.05) 3px,
      transparent 4px
    );
  pointer-events: none;
  animation: scanScroll 0.4s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.7;
}
@keyframes scanScroll {
  from { background-position-y: 0;  }
  to   { background-position-y: 4px; }
}

/* Sweep — horizontal lime line that scans the area */
.spline-sweep {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.7) 50%,
    transparent 100%
  );
  box-shadow: 0 0 12px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
  animation: sweepDown 3s ease-in-out infinite;
}
@keyframes sweepDown {
  0%   { top: 0;   opacity: 0; }
  10%  {           opacity: 1; }
  90%  {           opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Central energy orb */
.spline-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.9),
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.9) 30%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2) 60%,
    transparent 75%
  );
  filter: blur(0.5px);
  animation: orbBreath 1.6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
@keyframes orbBreath {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 24px 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4); }
  50%      { transform: scale(1.18); box-shadow: 0 0 40px 4px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.6); }
}

/* Multiple staggered expanding rings */
.spline-orb-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.45);
  animation: ringExpand 2.4s ease-out infinite;
}
.spline-orb-ring-2 { animation-delay: 0.6s; border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3); }
.spline-orb-ring-3 { animation-delay: 1.2s; border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18); }
.spline-orb-ring-4 { animation-delay: 1.8s; border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.1); }
@keyframes ringExpand {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(3.6); opacity: 0; }
}

/* Cycling boot text */
.spline-loader-text {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-top: 1.5rem;
  position: relative;
  z-index: 2;
  min-height: 1em;
  text-shadow: 0 0 12px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
}
.spline-loader-text::before {
  content: ">_ ";
  opacity: 0.55;
}

/* Secondary fake-progress bar */
.spline-progress {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 1px;
  background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.12);
  overflow: hidden;
  z-index: 2;
}
.spline-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--accent) 50%,
    transparent 100%
  );
  animation: progressSlide 1.6s ease-in-out infinite;
}
@keyframes progressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ============================================
   AI FLOW NODES (animated)
   ============================================ */
.pulse-node {
  transform-origin: center;
  animation: nodePulse 2.4s ease-in-out infinite;
}
@keyframes nodePulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.2); }
}

.ai-flow line {
  stroke-dasharray: 4 4;
  animation: dash 3s linear infinite;
}
@keyframes dash {
  to { stroke-dashoffset: -16; }
}

/* ============================================
   PROCESS STEPS
   ============================================ */
.process-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  transition: background 0.4s ease, padding 0.4s ease;
  position: relative;
  cursor: default;
}

@media (min-width: 768px) {
  .process-step {
    grid-template-columns: 6rem 1fr 12rem;
    gap: 3rem;
    padding: 3rem 0;
  }
}

.process-step.last {
  border-bottom: 1px solid var(--line);
}

.process-step:hover {
  padding-left: 1rem;
  padding-right: 1rem;
}

.process-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
.process-step:hover::after {
  opacity: 1;
}

.step-num {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--muted);
  line-height: 1;
  transition: color 0.4s ease;
}
.process-step:hover .step-num {
  color: var(--accent);
}

.step-content h3 {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.process-step:hover .step-content h3 {
  transform: translateX(4px);
}

.step-meta {
  text-align: left;
}
@media (min-width: 768px) {
  .step-meta { text-align: right; }
}

/* ============================================
   MARQUEE
   ============================================ */
.marquee {
  animation: scroll 35s linear infinite;
  will-change: transform;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-slow {
  animation: scroll 60s linear infinite;
  will-change: transform;
}

/* pause on hover */
.marquee:hover,
.marquee-slow:hover {
  animation-play-state: paused;
}

/* ============================================
   WORK VISUALS (subtle hover scale)
   ============================================ */
.work-visual {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.work-visual:hover {
  transform: translateY(-4px);
}
.work-visual > div {
  transition: border-color 0.4s ease;
}
.work-visual:hover > div {
  border-color: rgba(255,255,255,0.12);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonial {
  padding: 2.5rem;
  border-radius: 16px;
  background: var(--ink-0);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.04) inset;
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.testimonial:hover {
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

/* ============================================
   FORM
   ============================================ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink-50);
  color: var(--cream);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.3s ease, background 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: rgba(138, 138, 138, 0.7);
}

.form-input:focus {
  border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
  background: var(--ink-100);
  box-shadow: 0 0 0 4px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.08);
}

textarea.form-input {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%238A8A8A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ============================================
   HERO HEADLINE · sequential beat reveal
   Three perceived beats, synced to the neon video
   via --gooey-cycle (still set by JS from
   video.duration; falls back to 5s).

   Beat 1: "Construyo"          (4% → 12%)
   Beat 2: "producto"           (22% → 30%)
   Beat 3: "que [squiggle]" +
           "vende."             (40% → 48%)  ← both lines together

   Then everyone holds visible (48% → 72%)
   and exits together (72% → 85%).
   No threshold filter — preserves antialiasing.
   ============================================ */
.hero-seg {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity, filter;
  animation-duration: var(--gooey-cycle, 5s);
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  /* Subtle drop-shadow gives the segments weight as they enter */
}

.hero-seg-1 { animation-name: heroBeat1; }
.hero-seg-2 { animation-name: heroBeat2; }
.hero-seg-3,
.hero-seg-4 { animation-name: heroBeat3; }

/* Keep seg-3's inline-flex layout (was clobbered by .hero-seg's
   inline-block declaration above) */
.hero-seg.inline-flex { display: inline-flex; }

/* --- BEAT 1 ----------------------------------- */
@keyframes heroBeat1 {
  0%, 4% {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(10px);
  }
  12% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  80% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
}

/* --- BEAT 2 ----------------------------------- */
@keyframes heroBeat2 {
  0%, 22% {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(10px);
  }
  30% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  80% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
}

/* --- BEAT 3 (que [squiggle] + vende.) ---------- */
@keyframes heroBeat3 {
  0%, 40% {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(10px);
  }
  48% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  80% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-seg {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ============================================
   FADE-IN ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SCROLL FX SYSTEM · variant entrance animations
   Each variant has a hidden state and is unlocked
   by adding .is-visible (toggled via IntersectionObserver).
   --stagger CSS var allows JS to set per-item delays.
   ============================================ */
.fx {
  --stagger: 0;
  --fx-duration: 1.05s;
  --fx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  transition:
    opacity var(--fx-duration) var(--fx-ease),
    transform var(--fx-duration) var(--fx-ease),
    clip-path 1.2s var(--fx-ease),
    filter 0.8s var(--fx-ease);
  transition-delay: calc(var(--stagger) * 90ms);
  will-change: transform, opacity;
}
.fx.is-visible {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  filter: none;
}

/* Variant: fade up with subtle skew (editorial heading feel) */
.fx-heading {
  transform: translateY(40px) skewY(2.5deg);
  filter: blur(2px);
}

/* Variant: fade up (cards, testimonials) */
.fx-fade-up {
  transform: translateY(50px);
}

/* Variant: zoom up with slight rotate (service cards) */
.fx-zoom-up {
  transform: translateY(70px) scale(0.94) rotate(-1deg);
}

/* Variant: slide from left edge (eyebrows, alternate steps) */
.fx-slide-right {
  transform: translateX(-60px);
}

/* Variant: slide from right edge (alternate steps) */
.fx-slide-left {
  transform: translateX(60px);
}

/* Variant: clip-path wipe from left */
.fx-clip-x {
  clip-path: inset(0 100% 0 0);
}

/* Variant: clip-path wipe from bottom */
.fx-clip-up {
  clip-path: inset(100% 0 0 0);
}

/* Variant: dramatic 3D rotate-in (for the AI hero card) */
.fx-rotate-3d {
  transform: perspective(1200px) rotateX(15deg) translateY(60px) scale(0.92);
  transform-origin: 50% 100%;
}

/* Don't animate when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fx,
  .fx.is-visible {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ============================================
   CLIENTS · TRUSTED BY SLIDER
   ============================================ */
.clients-stage {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0;
}

.clients-marquee {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: max-content;
  will-change: transform;
}
/* Animation starts only after JS has populated enough clones to fill viewport */
.clients-marquee.ready {
  animation: scrollClients 32s linear infinite;
}
.clients-marquee:hover {
  animation-play-state: paused;
}
@keyframes scrollClients {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.client-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  opacity: 0.55;
  transition:
    opacity 0.5s ease,
    color 0.5s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
}
.client-logo:hover {
  opacity: 1;
  color: var(--accent);
  transform: translateY(-2px);
}

.client-icon {
  width: 52px;
  height: auto;
  flex-shrink: 0;
  color: inherit;
}

.client-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.05;
}

.client-tag {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 17px;
  letter-spacing: -0.005em;
  color: inherit;
  opacity: 0.85;
}

.client-name {
  font-family: "Geist", system-ui, sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.025em;
  color: inherit;
}

.client-name-serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 36px;
  letter-spacing: -0.01em;
  color: inherit;
  line-height: 1;
}

.client-sub {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.75;
  margin-top: 4px;
}

/* Decorative asterisk separator between client logos */
.client-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
  opacity: 0.38;
  flex-shrink: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.client-sep svg {
  width: 100%;
  height: 100%;
  display: block;
}
.clients-marquee:hover .client-sep {
  opacity: 0.55;
  transform: rotate(45deg);
}

/* Edge fades — simulate progressive blur with multi-stop linear gradient */
.clients-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 180px;
  pointer-events: none;
  z-index: 2;
}
.clients-fade-left {
  left: 0;
  background: linear-gradient(
    to right,
    var(--ink-0) 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.4) 70%,
    transparent 100%
  );
}
.clients-fade-right {
  right: 0;
  background: linear-gradient(
    to left,
    var(--ink-0) 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.4) 70%,
    transparent 100%
  );
}

/* Cosmic horizon below the slider — sparkles + arc */
.clients-horizon {
  position: relative;
  margin-top: 2rem;
  height: 240px;
  overflow: hidden;
  mask-image: radial-gradient(60% 100% at 50% 0%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(60% 100% at 50% 0%, #000, transparent 85%);
}

#sparkles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Subtle ellipse forming the "horizon line" */
.clients-arc {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 200%;
  aspect-ratio: 4 / 1;
  border-top: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 0%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.025) 0%,
    transparent 50%
  );
  z-index: 2;
}

/* Soft accent glow at the horizon center */
.clients-glow {
  position: absolute;
  left: 50%;
  top: -40px;
  transform: translateX(-50%);
  width: 400px;
  height: 200px;
  background: radial-gradient(ellipse at center, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.16), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 2;
}

/* ============================================
   THEME CUSTOMIZER · panel
   Premium synth-panel feel — native range inputs
   styled across browsers, preset chips that preview
   their color, big live HSL readout.
   ============================================ */
.customizer-panel {
  background: linear-gradient(180deg, var(--ink-50) 0%, var(--ink-0) 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2rem;
  display: grid;
  gap: 2rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 28px 64px -24px rgba(0, 0, 0, 0.6),
    0 0 0 1px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.04);
  transition: box-shadow 0.5s ease;
}
@media (min-width: 768px) {
  .customizer-panel {
    padding: 2.5rem;
  }
}

.customizer-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) {
  .customizer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

.customizer-preview {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.preview-swatch {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3),
    0 0 28px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.45);
  flex-shrink: 0;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease;
}

/* Preset chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--ink-100);
  color: var(--cream);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.4, 0.5, 1);
}

.preset-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: hsl(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px hsla(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%), 0.6);
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.preset:hover {
  border-color: hsla(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%), 0.6);
  background: hsla(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%), 0.06);
  transform: translateY(-1px);
}
.preset:hover .preset-dot {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 16px hsla(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%), 0.9);
}

.preset.active {
  border-color: hsl(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%));
  background: hsla(var(--p-h, 77), var(--p-s, 86%), var(--p-l, 66%), 0.1);
}

/* Slider grid */
.customizer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.5rem;
}
@media (min-width: 768px) {
  .customizer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.customizer-row {
  display: grid;
  gap: 0.75rem;
}

.customizer-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.slider-value {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

/* Range slider — cross-browser custom */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--ink-200);
  outline: none;
  cursor: pointer;
  border: 1px solid var(--line);
}

/* Hue slider has a rainbow track */
.slider-hue {
  background: linear-gradient(
    to right,
    hsl(0,   85%, 60%) 0%,
    hsl(60,  85%, 60%) 17%,
    hsl(120, 85%, 60%) 33%,
    hsl(180, 85%, 60%) 50%,
    hsl(240, 85%, 60%) 67%,
    hsl(300, 85%, 60%) 83%,
    hsl(360, 85%, 60%) 100%
  );
  border-color: rgba(255, 255, 255, 0.06);
}

/* Saturation track — fades from gray to current hue at full sat */
.slider-sat {
  background: linear-gradient(
    to right,
    hsl(var(--accent-h), 0%, 50%) 0%,
    hsl(var(--accent-h), 100%, 50%) 100%
  );
}

/* Lightness track — fades from dark to current hue to white */
.slider-light {
  background: linear-gradient(
    to right,
    hsl(var(--accent-h), var(--accent-s), 15%) 0%,
    hsl(var(--accent-h), var(--accent-s), 50%) 50%,
    hsl(var(--accent-h), var(--accent-s), 85%) 100%
  );
}

/* Noise track — fades from dim to current accent */
.slider-noise {
  background: linear-gradient(
    to right,
    var(--ink-200) 0%,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.6) 100%
  );
}

/* Webkit thumb */
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--ink-0);
  cursor: grab;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.5, 1),
    box-shadow 0.3s ease;
  box-shadow:
    0 0 0 0 hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0),
    0 1px 3px rgba(0, 0, 0, 0.35);
}

.slider::-webkit-slider-thumb:hover,
.slider:focus::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow:
    0 0 0 8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18),
    0 1px 3px rgba(0, 0, 0, 0.35);
}

.slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.05);
}

/* Firefox thumb */
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--ink-0);
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.slider::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* Customizer footer */
.customizer-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 640px) {
  .customizer-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.customizer-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--ink-100);
  color: var(--cream);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    color 0.3s ease,
    transform 0.4s cubic-bezier(0.34, 1.4, 0.5, 1);
  flex-shrink: 0;
}
.customizer-reset:hover {
  border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
  color: var(--accent);
  transform: translateY(-1px);
}
.customizer-reset:active {
  transform: translateY(0) scale(0.97);
}
.customizer-reset svg {
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.customizer-reset:hover svg {
  transform: rotate(-180deg);
}

/* Soft ambient glow behind the panel */
#adapt::before {
  content: "";
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.08),
    transparent 65%
  );
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .slider::-webkit-slider-thumb,
  .slider::-moz-range-thumb,
  .preset,
  .customizer-reset,
  .preview-swatch {
    transition: none;
  }
}

/* ============================================
   FOOTER · ANIMATED BOXES HERO
   ============================================ */
.footer-boxes {
  position: relative;
  overflow: hidden;
  background: var(--ink-0);
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.boxes-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.boxes-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  transform:
    translate(-50%, -50%)
    skewX(-48deg)
    skewY(14deg)
    scale(0.72);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  will-change: transform;
}

.boxes-row {
  display: flex;
  flex-shrink: 0;
}

.boxes-cell {
  width: 56px;
  height: 28px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background-color: transparent;
  transition: background-color 2s ease;
  position: relative;
}

/* Plus marker at alternating intersections */
.boxes-cell-plus::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23ffffff' stroke-opacity='0.14' stroke-width='1' stroke-linecap='round'><path d='M5 1v8M1 5h8'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

/* Radial mask: keeps the center readable, fades grid at edges.
   Using mask-image (alpha) instead of an opaque overlay avoids
   color-banding artifacts on high-density / 2K+ displays. */
.boxes-mask {
  position: absolute;
  inset: 0;
  background: var(--ink-0);
  pointer-events: none;
  z-index: 3;
  -webkit-mask-image: radial-gradient(
    ellipse 60% 70% at 50% 50%,
    transparent 0%,
    transparent 30%,
    rgba(0, 0, 0, 0.6) 65%,
    #000 100%
  );
          mask-image: radial-gradient(
    ellipse 60% 70% at 50% 50%,
    transparent 0%,
    transparent 30%,
    rgba(0, 0, 0, 0.6) 65%,
    #000 100%
  );
}

/* Tiny noise overlay on the boxes section to break up any
   residual banding. Confined here, not full-page. */
.footer-boxes::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 5;
}

.boxes-content {
  position: relative;
  z-index: 10;
  padding: 5rem 1.5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  /* Let mouse events pass through to the grid behind */
  pointer-events: none;
}

/* But keep interactive elements clickable */
.boxes-content a,
.boxes-content button {
  pointer-events: auto;
}

/* ============================================
   SCROLLBAR (subtle)
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ink-0);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-200);
  border-radius: 10px;
  border: 2px solid var(--ink-0);
}
::-webkit-scrollbar-thumb:hover {
  background: #2a2a2a;
}

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

/* ============================================
   FOCUS-VISIBLE (a11y)
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Sections smoother on entry */
section {
  scroll-margin-top: 5rem;
}
