/* ============================================================
   PDL MOTION LAYER — shared animation & component styles
   Loaded on core + blog pages after tailwind.css.
   Contract: nothing here hides content by default — elements are
   visible without JS; pdl-animations.js hides-then-animates.
   ============================================================ */

/* ---- Animated gradient (hero fallback when WebGL/3D is off) ---- */
.pdl-gradient-anim {
  background-size: 220% 220% !important;
  animation: pdlGradientPan 18s ease-in-out infinite alternate;
}
@keyframes pdlGradientPan {
  from { background-position: 0% 30%; }
  to   { background-position: 100% 70%; }
}

/* ---- Hero 3D canvas ---- */
#hero3d {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0;
}

/* ---- Condensed nav on scroll ---- */
header.sticky > div:first-child { transition: height 300ms ease; }
header.pdl-condensed {
  /* Near-opaque solid (cheaper to repaint while scrolling than a heavy blur) */
  background: rgba(0, 43, 69, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px -14px rgba(0, 20, 35, 0.6);
}
header.pdl-condensed > div:first-child { height: 3.5rem; }

/* ---- Mobile menu item entrance ---- */
#mobileMenu:not(.hidden) li {
  animation: pdlMenuIn 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
#mobileMenu:not(.hidden) li:nth-child(1) { animation-delay: 0ms; }
#mobileMenu:not(.hidden) li:nth-child(2) { animation-delay: 35ms; }
#mobileMenu:not(.hidden) li:nth-child(3) { animation-delay: 70ms; }
#mobileMenu:not(.hidden) li:nth-child(4) { animation-delay: 105ms; }
#mobileMenu:not(.hidden) li:nth-child(5) { animation-delay: 140ms; }
#mobileMenu:not(.hidden) li:nth-child(6) { animation-delay: 175ms; }
#mobileMenu:not(.hidden) li:nth-child(7) { animation-delay: 210ms; }
#mobileMenu:not(.hidden) li:nth-child(8) { animation-delay: 245ms; }
#mobileMenu:not(.hidden) li:nth-child(9) { animation-delay: 280ms; }
@keyframes pdlMenuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Custom cursor (desktop, pointer:fine only — JS adds the class) ---- */
html.pdl-cursor-on, html.pdl-cursor-on body,
html.pdl-cursor-on a, html.pdl-cursor-on button,
html.pdl-cursor-on input, html.pdl-cursor-on select,
html.pdl-cursor-on textarea, html.pdl-cursor-on label { cursor: none; }
.pdl-cursor-dot, .pdl-cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 2147483000;
  pointer-events: none; will-change: transform;
}
.pdl-cursor-dot::after {
  content: ''; display: block; width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #39b8fd;
}
.pdl-cursor-ring::after {
  content: ''; display: block; width: 38px; height: 38px;
  margin: -19px 0 0 -19px; border-radius: 50%;
  border: 1.5px solid rgba(57, 184, 253, 0.8);
  background: rgba(57, 184, 253, 0);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
              background-color 250ms ease, border-color 250ms ease;
}
.pdl-cursor-ring.is-hover::after { transform: scale(1.5); background: rgba(57, 184, 253, 0.12); }
.pdl-cursor-ring.is-down::after  { transform: scale(0.7); }

/* ---- Magnetic buttons ---- */
.pdl-magnetic { will-change: transform; }

/* ============================================================
   CODE-TO-WEBSITE HERO WINDOW
   ============================================================ */
.pdl-hb {
  border-radius: 0.9rem; overflow: hidden;
  background: #06121f;
  border: 1px solid rgba(57, 184, 253, 0.25);
  box-shadow: 0 24px 70px -18px rgba(0, 10, 20, 0.8), 0 0 60px -20px rgba(57, 184, 253, 0.35);
  position: relative;
}
.pdl-hb-chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pdl-hb-url {
  margin-left: 8px; flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.07); border-radius: 9999px;
  padding: 3px 12px; font-size: 11px; color: rgba(255, 255, 255, 0.65);
  font-family: 'Inter', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdl-hb-stage { display: flex; flex-direction: column; aspect-ratio: 4 / 3.4; }
.pdl-hb-code {
  flex: 0 0 42%; min-height: 0; overflow: hidden;
  margin: 0; padding: 14px 16px;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75; color: #7dd3fc;
  white-space: pre-wrap; word-break: break-all;
}
.pdl-hb-code .pdl-hb-caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 1px;
  background: #39b8fd; vertical-align: text-bottom;
  animation: pdlCaret 0.9s steps(1) infinite;
}
@keyframes pdlCaret { 50% { opacity: 0; } }
.pdl-hb-site {
  flex: 1 1 58%; min-height: 0; position: relative;
  margin: 0 14px 14px; border-radius: 0.6rem; overflow: hidden;
  background: #f7f9fb; display: flex; flex-direction: column;
}
.pdl-hb-site [data-build] { opacity: 0; }
.pdl-hb .is-built { opacity: 1; }
.pdl-hb-nav {
  height: 17%; min-height: 24px; background: #003A5C;
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
}
.pdl-hb-nav i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.55); }
.pdl-hb-nav i:nth-child(1) { width: 26px; background: #39b8fd; }
.pdl-hb-nav i:nth-child(2) { width: 18px; margin-left: auto; }
.pdl-hb-nav i:nth-child(3) { width: 18px; }
.pdl-hb-nav i:nth-child(4) { width: 30px; background: #39b8fd; border-radius: 6px; height: 9px; }
.pdl-hb-hero {
  flex: 1; background: linear-gradient(135deg, #002B45, #005082);
  display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 14px;
}
.pdl-hb-hero .pdl-hb-headline { width: 64%; height: 9px; border-radius: 5px; background: #ffffff; }
.pdl-hb-hero .pdl-hb-sub { width: 44%; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.5); }
.pdl-hb-hero .pdl-hb-cta { width: 64px; height: 14px; border-radius: 7px; background: #39b8fd; margin-top: 3px; }
.pdl-hb-cards { height: 30%; display: flex; gap: 8px; padding: 9px 12px; background: #ffffff; }
.pdl-hb-cards i { flex: 1; border-radius: 5px; background: #E6F4FC; border: 1px solid #b7e0f7; }
.pdl-hb-badge {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  background: #06121f; color: #7ef0a8; border: 1px solid rgba(126, 240, 168, 0.4);
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
  padding: 4px 10px; border-radius: 9999px; opacity: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.pdl-hb-sheen {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-130%);
}
/* Static end-state — mobile, reduced-motion, no-JS-enhancement */
.pdl-hb.is-complete .pdl-hb-code { display: none; }
.pdl-hb.is-complete .pdl-hb-stage { aspect-ratio: 4 / 3; }
.pdl-hb.is-complete .pdl-hb-site { margin-top: 14px; }
.pdl-hb.is-complete .pdl-hb-site [data-build],
.pdl-hb.is-complete .pdl-hb-badge { opacity: 1; }

/* Hero proof strip (compact stats under badges) */
.pdl-proof-strip {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pdl-proof-strip > div {
  flex: 1 1 0; min-width: 110px; padding: 12px 16px; text-align: center;
}
.pdl-proof-strip > div + div { border-left: 1px solid rgba(255, 255, 255, 0.15); }

/* ============================================================
   PRICING EXPLORER — ARIA tabs
   ============================================================ */
.pdl-tablist {
  display: flex; gap: 10px; padding: 4px 2px 14px;
  overflow-x: auto; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pdl-tablist::-webkit-scrollbar { display: none; }
.pdl-tab {
  scroll-snap-align: start; flex-shrink: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 9999px;
  background: transparent; color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 11px 22px;
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease, transform 250ms ease;
}
.pdl-tab:hover { border-color: #39b8fd; color: #ffffff; }
.pdl-tab[aria-selected="true"] {
  background: #39b8fd; border-color: #39b8fd; color: #002B45; transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(57, 184, 253, 0.7);
}
.pdl-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: #39b8fd; flex-shrink: 0;
  animation: pdlTabDot 2.4s ease-in-out infinite; }
.pdl-tab[aria-selected="true"] .pdl-tab-dot { background: #002B45; animation: none; }
@keyframes pdlTabDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(57, 184, 253, 0.6); } 50% { box-shadow: 0 0 0 5px rgba(57, 184, 253, 0); } }
.pdl-tabpanel[hidden] { display: none; }
.pdl-tabpanel:focus { outline: none; }

/* ============================================================
   SCORE GAUGES (Lighthouse-style, real measured values only)
   ============================================================ */
/* Responsive so all four gauges sit on ONE row even on a 390px phone */
.pdl-gauge { position: relative; width: clamp(58px, 19vw, 96px); height: clamp(58px, 19vw, 96px); margin: 0 auto; }
.pdl-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pdl-gauge .pdl-gauge-track { fill: none; stroke: rgba(57, 184, 253, 0.15); stroke-width: 7; }
.pdl-gauge .pdl-gauge-bar   { fill: none; stroke: #0cce6b; stroke-width: 7; stroke-linecap: round; }
.pdl-gauge .pdl-gauge-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(16px, 5.5vw, 26px); color: #0cce6b;
}

/* ============================================================
   SEO GROWTH CALCULATOR
   ============================================================ */
.pdl-calc-result { overflow: hidden; }
.pdl-calc-num {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.1; color: #39b8fd;
}
.pdl-calc-bar-track {
  height: 14px; border-radius: 9999px; background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.pdl-calc-bar-fill {
  height: 100%; width: 0; border-radius: 9999px;
  background: linear-gradient(90deg, #005082, #39b8fd);
}

/* ============================================================
   WORD-BY-WORD SCROLL REVEAL TEXT  ([data-pdl-textreveal])
   Words dim by default ONLY once JS has split them (.pdl-tr-on);
   no-JS / reduced-motion keeps the text fully legible.
   ============================================================ */
.pdl-tr-on .pdl-tr-word { opacity: 0.18; will-change: opacity; }

/* ============================================================
   STICKY-STACKING FEATURED CARDS  (.pdl-stack)
   Default: normal vertical cards (no-JS / mobile / reduced-motion).
   JS adds .is-on on desktop to enable the sticky+scale stack.
   ============================================================ */
.pdl-stack-card { position: static; width: 100%; margin-bottom: 28px; transform-origin: center top; }
.pdl-stack.is-on .pdl-stack-wrap { min-height: 80vh; }
.pdl-stack.is-on .pdl-stack-card {
  position: sticky; top: calc(110px + var(--i, 0) * 26px);
  margin-bottom: 0; will-change: transform;
}
@media (max-width: 1023px) {
  .pdl-stack.is-on .pdl-stack-card { position: static; top: auto; transform: none; margin-bottom: 28px; }
  .pdl-stack.is-on .pdl-stack-wrap { min-height: 0; }
}

/* ============================================================
   PROCESS — scroll-drawn progress line
   ============================================================ */
.pdl-progress-track {
  position: relative; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.14); margin-bottom: 28px; overflow: hidden;
}
.pdl-progress-fill {
  position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(90deg, #39b8fd, #7dd3fc);
  transform: scaleX(0); transform-origin: left center;
}

/* ============================================================
   BEFORE / AFTER SLIDER (component shipped dormant — populate
   only with genuine before assets; see CLAUDE.md backlog)
   ============================================================ */
.pdl-ba { position: relative; overflow: hidden; border-radius: 0.75rem; }
.pdl-ba img { display: block; width: 100%; }
.pdl-ba .pdl-ba-top { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.pdl-ba input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize;
}
.pdl-ba .pdl-ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  background: #39b8fd; pointer-events: none; transform: translateX(-50%);
}

/* ============================================================
   REDUCED MOTION — kill everything decorative
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .pdl-gradient-anim { animation: none; }
  #mobileMenu:not(.hidden) li { animation: none; }
  .pdl-hb-caret { animation: none; }
  .pdl-tab-dot { animation: none; }
  .pdl-tab, header.sticky > div:first-child { transition: none; }
  .pdl-cursor-dot, .pdl-cursor-ring { display: none; }
  .pdl-progress-fill { transform: none; }
  #hero3d { display: none; }
  .pdl-tr-on .pdl-tr-word { opacity: 1; }
  .pdl-stack.is-on .pdl-stack-card { position: static; top: auto; transform: none; margin-bottom: 28px; }
  .pdl-stack.is-on .pdl-stack-wrap { min-height: 0; }
}
