/* ═══════════════════════════════════════════════════════════════
   RADIANT OPTIMIZER — GLOBAL UI CONSISTENCY
   Site-wide polish that makes every page feel like the same product.

   DESIGN RULE: this file does NOT shrink or lighten your typography.
   The big/bold readable style is intentional and is preserved —
   css/bold-readable.css still has the final say on type.

   Loaded on every public page, immediately before nav-unified.css.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Spacing scale — one rhythm for the whole site */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 100px;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.45);
  --glow-blue: 0 0 24px rgba(37, 99, 235, 0.35);

  /* Surfaces */
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border-1: rgba(255, 255, 255, 0.10);
  --border-2: rgba(255, 255, 255, 0.16);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ───────────────────────────────────────────────
   1. ANCHOR SCROLLING — stop headings landing
   underneath the fixed nav (#features, #pricing…)
   ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height, 92px) + 20px);
}
[id] { scroll-margin-top: calc(var(--nav-height, 92px) + 20px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ───────────────────────────────────────────────
   2. CONSISTENT TOP SPACING UNDER THE NAV
   Pages use <main style="margin-top:var(--nav-height)">.
   This guarantees it even where the inline style is missing.
   ─────────────────────────────────────────────── */
body > main:not([style*="margin-top"]) {
  margin-top: var(--nav-height, 92px);
}

/* ───────────────────────────────────────────────
   3. FOCUS / ACCESSIBILITY — same everywhere
   ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 14px 22px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--r-md) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  box-shadow: var(--shadow-md);
}

/* ───────────────────────────────────────────────
   4. SELECTION + SCROLLBAR — branded, consistent
   ─────────────────────────────────────────────── */
::selection { background: rgba(37, 99, 235, 0.55); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: rgba(59, 130, 246, 0.5) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.42);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.7); background-clip: content-box; }

/* ───────────────────────────────────────────────
   5. MEDIA — never let an image break a layout
   ─────────────────────────────────────────────── */
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }

/* ───────────────────────────────────────────────
   6. NO HORIZONTAL OVERFLOW ANYWHERE
   (a common cause of "it looks broken on my phone")
   ─────────────────────────────────────────────── */
html, body { overflow-x: hidden; max-width: 100%; }

/* ───────────────────────────────────────────────
   7. FOOTER — one layout across all pages
   ─────────────────────────────────────────────── */
.footer {
  position: relative;
  margin-top: var(--sp-9);
  padding: var(--sp-8) var(--sp-5) 0;
  border-top: 1px solid var(--border-1);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
}
.footer .footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: var(--sp-7);
}
.footer .footer-nav,
.footer .footer-legal,
.footer .footer-brand,
.footer .footer-cta { min-width: 190px; }

.footer .nav-title {
  margin: 0 0 var(--sp-4);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.footer .nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 0;
  margin: 0;
  list-style: none;
}
.footer .nav-link {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  width: fit-content;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer .nav-link:hover { color: #fff; transform: translateX(3px); }

.footer .footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-5) 0 var(--sp-6);
  border-top: 1px solid var(--border-1);
}
.footer .copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .footer { padding: var(--sp-7) var(--sp-4) 0; margin-top: var(--sp-7); }
  .footer .footer-content { gap: var(--sp-6); }
  .footer .footer-nav,
  .footer .footer-legal,
  .footer .footer-brand,
  .footer .footer-cta { min-width: 100%; }
}

/* ───────────────────────────────────────────────
   8. SHARED INTERACTION FEEL
   Consistent lift on the site's primary actions.
   ─────────────────────────────────────────────── */
.btn, .cta-btn, .primary-btn, .nice-button, button.filter-tag {
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.22s var(--ease);
}
.btn:hover, .cta-btn:hover, .primary-btn:hover, .nice-button:hover {
  transform: translateY(-2px);
}
.btn:active, .cta-btn:active, .primary-btn:active, .nice-button:active {
  transform: translateY(0);
}

/* Filter/pill tabs (news, reviews) — one look */
button.filter-tag {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
button.filter-tag:hover { background: var(--surface-2); color: #fff; }
button.filter-tag.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: rgba(96, 165, 250, 0.45);
  color: #fff;
  box-shadow: var(--glow-blue);
}

/* ───────────────────────────────────────────────
   9. MOBILE TOUCH TARGETS — nothing under 44px
   ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  a.btn, button.btn, .cta-btn, .primary-btn, button.filter-tag {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
