/* ═══════════════════════════════════════════════════════════════
   Yugawatt Landing — Responsive & Conversion UX Layer
   Loaded after page CSS. Applies to all landing pages.
   ═══════════════════════════════════════════════════════════════ */

/* ── Global resets ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }

/* ── Touch targets: min 44px for all interactive elements ── */
a, button, input[type="submit"], .hero-cta, .end-cta, .card-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card-link { min-height: 40px; }

/* ── Focus-visible for keyboard nav (accessibility) ── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #4B1D8C;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Tap feedback (tactile) ── */
.hero-cta:active, .end-cta:active, .card-link:active, .yw-submit-btn:active {
  transform: scale(0.97);
  transition: transform 0.05s;
}

/* ── Prevent image overflow ── */
img { max-width: 100%; height: auto; }

/* ── SVG infographic containment ── */
.pillar-infographic { overflow: hidden; }
.pillar-infographic svg { display: block; width: 100%; height: auto; max-width: 100%; }

/* ── Prefers reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Card entrance animation (scroll-triggered, FAIL-OPEN) ──
   Default is fully visible so content never stays blank if JS/IO fails.
   Animation only runs when <html class="js-animate"> is set by responsive.js
   after IntersectionObserver is ready. */
.card, .pillar {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
@media (prefers-reduced-motion: no-preference) {
  html.js-animate .card:not(.visible),
  html.js-animate .pillar:not(.visible) {
    opacity: 0;
    transform: translateY(24px);
  }
  html.js-animate .card.visible,
  html.js-animate .pillar.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger pillars (only meaningful when animating) */
html.js-animate .pillar:nth-child(1) { transition-delay: 0s; }
html.js-animate .pillar:nth-child(2) { transition-delay: 0.1s; }
html.js-animate .pillar:nth-child(3) { transition-delay: 0.2s; }
html.js-animate .card:nth-child(2) { transition-delay: 0.05s; }
html.js-animate .card:nth-child(3) { transition-delay: 0.1s; }
html.js-animate .card:nth-child(4) { transition-delay: 0.15s; }

/* ── Floating mobile CTA ── */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #120e2c;
  padding: 12px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  z-index: 100;
  border-top: 1px solid #24352a;
}
.mobile-cta-bar a {
  display: block;
  text-align: center;
  background: var(--page-accent, #ffb000);
  color: var(--page-accent-ink, #120e2c);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 999px;
  min-height: 48px;
}
.mobile-cta-bar a:active { transform: scale(0.97); }

/* ═══ BREAKPOINTS ═══════════════════════════════════════════════ */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  .split-layout {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 32px !important;
    margin-top: 20px !important;
  }
  .value-pillars { padding-top: 0 !important; width: 100%; }
  #waitlist-container { width: 100%; max-width: 480px; margin: 0 auto; }
  .landing-hero { padding: 64px 20px 48px !important; }
  .proof-strip { flex-direction: column !important; gap: 12px !important; }
  .proof-item { min-width: 0 !important; }
  .pillar-infographic svg { max-height: 100px; }
}

/* ── Small tablet (≤700px) ── */
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr !important; }
  .landing-hero { padding: 56px 16px 40px !important; }
  .hero-h1 { font-size: clamp(1.6rem, 7vw, 2.4rem) !important; }
  .hero-lede { font-size: 1.05rem !important; max-width: 100% !important; margin-bottom: 28px !important; }
  .end-card { padding: 48px 20px !important; margin-top: 48px !important; }
  .end-card h2 { font-size: 1.4rem !important; }
  .end-cta { font-size: 0.95rem !important; padding: 14px 28px !important; }
  .pillar { gap: 14px !important; margin-bottom: 28px !important; }
  .pillar-icon { width: 40px !important; height: 40px !important; font-size: 1rem !important; }
  .pillar-content h3 { font-size: 1.1rem !important; }
  .pillar-content p { font-size: 0.92rem !important; }
  .pillar-infographic { padding: 8px !important; }
  .pillar-infographic svg { max-height: 90px; }
  .theme { margin-bottom: 32px !important; padding: 0 16px !important; }
  .theme-header { gap: 10px !important; margin-bottom: 16px !important; }
  .theme-title { font-size: 1.15rem !important; }
  .card img { height: 120px !important; }
  .card-body { padding: 16px !important; }
  .card-links { gap: 8px !important; }
  .card-link { font-size: 0.82rem !important; padding: 10px 18px !important; flex: 1; text-align: center; }
  .news-link { padding: 20px 16px !important; }
  .news-link h3 { font-size: 1rem !important; }
  .news-link p { font-size: 0.82rem !important; }
}

/* ── Phone (≤480px) ── */
@media (max-width: 480px) {
  .landing-hero { padding: 48px 14px 36px !important; }
  .eyebrow-badge { font-size: 0.68rem !important; padding: 5px 10px !important; margin-bottom: 18px !important; }
  .hero-h1 { font-size: clamp(1.5rem, 8vw, 2rem) !important; margin-bottom: 16px !important; }
  .hero-lede { font-size: 1rem !important; line-height: 1.5 !important; margin-bottom: 24px !important; }
  .hero-cta { font-size: 0.95rem !important; padding: 14px 24px !important; width: 100%; max-width: 320px; }
  .hero-trust { font-size: 0.78rem !important; margin-top: 12px !important; }
  .split-layout { padding: 0 14px !important; gap: 24px !important; }
  .value-pillars { padding-top: 0 !important; }
  .pillar { gap: 12px !important; margin-bottom: 24px !important; flex-direction: row; }
  .pillar-icon { width: 36px !important; height: 36px !important; font-size: 0.9rem !important; }
  .pillar-content h3 { font-size: 1.05rem !important; margin-bottom: 6px !important; }
  .pillar-content p { font-size: 0.88rem !important; line-height: 1.45 !important; }
  .pillar-infographic { padding: 8px !important; margin-bottom: 10px !important; }
  .pillar-infographic svg { max-height: 80px; }
  .proof-strip { padding: 0 14px !important; }
  .proof-item { padding: 14px 16px !important; }
  .proof-item strong { font-size: 0.88rem !important; }
  .proof-item span { font-size: 0.72rem !important; }
  .end-card { padding: 40px 16px !important; }
  .end-card h2 { font-size: 1.2rem !important; }
  .end-cta { font-size: 0.92rem !important; padding: 14px 24px !important; min-height: 48px; }
  .theme { padding: 0 14px !important; margin-bottom: 28px !important; }
  .theme-header { gap: 10px !important; }
  .theme-icon { width: 36px !important; height: 36px !important; font-size: 1.1rem !important; }
  .theme-title { font-size: 1.05rem !important; }
  .theme-desc { font-size: 0.82rem !important; }
  .card img { height: 110px !important; }
  .card-body { padding: 14px !important; }
  .card-body h3 { font-size: 1rem !important; }
  .card-body p { font-size: 0.85rem !important; margin-bottom: 12px !important; }
  .card-links { flex-direction: row !important; }
  .card-link { flex: 1 !important; font-size: 0.78rem !important; padding: 10px 12px !important; min-height: 40px; }
  .grid { gap: 16px !important; padding: 0 14px !important; }
  .news-link { padding: 16px 14px !important; }
  .news-link h3 { font-size: 0.95rem !important; }
  .news-link p { font-size: 0.78rem !important; }
  .yugawatt-waitlist-form { padding: 20px 18px !important; }
  .yw-form-header h3 { font-size: 1.1rem !important; margin-bottom: 18px !important; }
  .yw-input-group { margin-bottom: 16px !important; }
  .yw-input-group label { font-size: 0.72rem !important; }
  .yw-input-group input, .yw-input-group select { padding: 12px 14px !important; font-size: 16px !important; }
  .yw-submit-btn { padding: 14px !important; font-size: 1rem !important; min-height: 48px; }
  /* Show floating CTA on phone */
  .mobile-cta-bar { display: block; }
  body { padding-bottom: 76px; }
}

/* ── Small phone (≤360px) ── */
@media (max-width: 360px) {
  .landing-hero { padding: 40px 12px 32px !important; }
  .hero-h1 { font-size: 1.4rem !important; }
  .hero-lede { font-size: 0.92rem !important; }
  .hero-cta { font-size: 0.88rem !important; padding: 12px 20px !important; }
  .pillar { gap: 10px !important; }
  .pillar-icon { width: 32px !important; height: 32px !important; font-size: 0.8rem !important; }
  .pillar-content h3 { font-size: 0.98rem !important; }
  .pillar-content p { font-size: 0.82rem !important; }
  .card-link { font-size: 0.72rem !important; padding: 8px 10px !important; }
  .end-card h2 { font-size: 1.1rem !important; }
  .yw-form-header h3 { font-size: 1rem !important; }
  .yw-input-group input, .yw-input-group select { font-size: 15px !important; }
}

/* ── Large desktop (≥1200px) — center and constrain ── */
@media (min-width: 1200px) {
  .split-layout { max-width: 1100px; }
  .pillar-infographic svg { max-height: 110px; }
}
/* ── 3D container responsive ── */
.pillar-3d {
  min-height: 90px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f3f0;
  border: 1px solid #e3e8e3;
}
.pillar-3d canvas {
  max-width: 100%;
}
/* Static fallback when WebGL / reduced-motion / CDN fails */
.pillar-3d-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 90px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--page-accent, #4B1D8C);
  background:
    radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--page-accent, #4B1D8C) 22%, transparent), transparent 55%),
    linear-gradient(135deg, #fbfaf8, #eef2ee);
}
/* SVG-chart fallback (rendered from yw-svg-lib.js) — fill the card */
.pillar-3d-fallback .yw-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  max-height: 120px;
  display: block;
}
.pillar-3d-fallback .yw-svg .yw-stroke,
.pillar-3d-fallback .yw-svg .yw-stroke-soft,
.pillar-3d-fallback .yw-svg .yw-icon-stroke {
  stroke: var(--page-accent, #4B1D8C);
}
@media (max-width: 700px) {
  .pillar-3d { height: 90px !important; min-height: 90px; }
  .pillar-3d canvas { max-height: 90px; }
}
@media (max-width: 480px) {
  .pillar-3d { height: 80px !important; min-height: 80px; }
  .pillar-3d canvas { max-height: 80px; }
}
@media (max-width: 360px) {
  .pillar-3d { height: 70px !important; min-height: 70px; }
}
