/* ==========================================================================
   Pixel Architecture - Main Stylesheet
   Imports tokens, sets baseline, layout primitives, components, utilities.
   ========================================================================== */

@import url('./tokens.css');
@import url('./components.css');
@import url('./animations.css');

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--pa-font-body);
  font-size: var(--pa-fs-base);
  line-height: 1.65;
  color: var(--pa-text);
  background: var(--pa-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--pa-teal); color: #fff; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--pa-bg-soft); }
::-webkit-scrollbar-thumb { background: var(--pa-slate-300); border-radius: 6px; border: 3px solid var(--pa-bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--pa-teal); }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--pa-font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pa-slate);
  line-height: 1.08;
  margin: 0 0 var(--pa-space-5);
}

h1, .h1 { font-size: var(--pa-fs-5xl); font-weight: 700; letter-spacing: -0.035em; }
h2, .h2 { font-size: var(--pa-fs-4xl); font-weight: 700; letter-spacing: -0.03em; }
h3, .h3 { font-size: var(--pa-fs-3xl); }
h4, .h4 { font-size: var(--pa-fs-2xl); line-height: 1.2; }
h5, .h5 { font-size: var(--pa-fs-xl);  line-height: 1.3; }
h6, .h6 { font-size: var(--pa-fs-lg);  line-height: 1.4; font-weight: 600; }

.display { font-size: var(--pa-fs-display); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; }

p { margin: 0 0 var(--pa-space-5); max-width: 70ch; }
.lead { font-size: var(--pa-fs-lg); line-height: 1.6; color: var(--pa-text-muted); max-width: 60ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--pa-space-2);
  font-family: var(--pa-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pa-teal);
  margin: 0 0 var(--pa-space-4);
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: currentColor;
  display: inline-block;
}

.text-grad {
  background: var(--pa-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-teal  { color: var(--pa-teal); }
.text-gold  { color: var(--pa-gold); }
.text-slate { color: var(--pa-slate); }
.text-muted { color: var(--pa-text-muted); }
.text-soft  { color: var(--pa-text-soft); }

/* ── Layout primitives ────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--pa-container);
  margin: 0 auto;
  padding-inline: var(--pa-gutter);
}
.container-lg { max-width: var(--pa-container-lg); }
.container-sm { max-width: var(--pa-container-sm); }
.container-narrow { max-width: var(--pa-container-narrow); }

.section {
  padding-block: clamp(4rem, 8vw, 8rem);
  position: relative;
}
.section--tight { padding-block: clamp(3rem, 5vw, 5rem); }
.section--hero  { padding-block: clamp(6rem, 10vw, 10rem); padding-top: calc(var(--pa-header-h) + clamp(3rem, 6vw, 6rem)); }
.section--dark  { background: var(--pa-bg-dark); color: var(--pa-text-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section--dark .lead, .section--dark .text-muted { color: #C0CCD9; }
.section--soft  { background: var(--pa-bg-soft); }

.grid { display: grid; gap: var(--pa-space-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-feature { grid-template-columns: repeat(12, 1fr); gap: var(--pa-space-6); }
@media (max-width: 880px) { .grid-feature { grid-template-columns: 1fr; } }

.flex { display: flex; }
.row  { display: flex; align-items: center; }
.gap-2 { gap: var(--pa-space-2); }
.gap-3 { gap: var(--pa-space-3); }
.gap-4 { gap: var(--pa-space-4); }
.gap-5 { gap: var(--pa-space-5); }
.gap-6 { gap: var(--pa-space-6); }
.wrap  { flex-wrap: wrap; }

.stack > * + * { margin-top: var(--pa-space-5); }
.stack-tight > * + * { margin-top: var(--pa-space-3); }
.stack-loose > * + * { margin-top: var(--pa-space-7); }

.hide-mobile { }
.hide-desktop { display: none !important; }
@media (max-width: 880px) {
  .hide-mobile { display: none !important; }
  .hide-desktop { display: revert !important; }
}

.center  { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ── Header offset for fixed header anchor navigation ─────────────────────── */
[id] { scroll-margin-top: calc(var(--pa-header-h) + 24px); }

/* ── Skip-to-content (a11y) ───────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  z-index: calc(var(--pa-z-header) + 10);
  padding: 0.7rem 1.1rem;
  background: var(--pa-slate);
  color: #fff;
  border-radius: var(--pa-r-pill);
  font-family: var(--pa-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top var(--pa-dur-base) var(--pa-ease);
  box-shadow: var(--pa-shadow-md);
}
.skip-link:focus,
.skip-link:focus-visible { top: 14px; outline: 3px solid var(--pa-teal); outline-offset: 2px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ── Mobile responsive polish ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* The CTA-band 2-column grid on home/services/pricing collapses on mobile. */
  .cta-band > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: var(--pa-space-5) !important;
  }
  /* Sticky compare-table header doesn't make sense on tiny screens — it overlaps the floating header. */
  .compare-table th { position: static !important; }

  /* Inline 2-col grids on cards/CTAs that don't already stack */
  .grid-feature > [style*="grid-column: span"] { grid-column: 1 / -1 !important; }

  /* Section padding tighter on small viewports to free vertical space */
  .section { padding-block: clamp(2.75rem, 8vw, 5rem); }
  .section--tight { padding-block: clamp(2rem, 6vw, 3.5rem); }
  .section--hero { padding-block: clamp(4rem, 10vw, 6rem); padding-top: calc(var(--pa-header-h) + clamp(2.5rem, 6vw, 4rem)); }

  /* Heading down-scale a touch so long titles don't dominate the viewport */
  h1, .h1 { font-size: clamp(2rem, 6.5vw + 0.5rem, 3rem); }
  h2, .h2 { font-size: clamp(1.7rem, 5vw + 0.5rem, 2.4rem); }
  h3, .h3 { font-size: clamp(1.45rem, 4vw + 0.5rem, 2rem); }
  .display { font-size: clamp(2.5rem, 9vw, 4.5rem); }

  /* Hero-style buttons stack full-width when wrapped */
  .btn--lg { padding: 1rem 1.4rem; font-size: 0.95rem; }
}

@media (max-width: 480px) {
  /* Tighter gutter on tiny screens so cards have more room */
  :root { --pa-gutter: 1rem; }

  /* Buttons go full-width when there are 2+ stacked in a wrap container */
  .hero__cta .btn,
  .ctas .btn,
  [data-pa-cta-stack] .btn { width: 100%; }

  /* Card padding shrinks on tight screens */
  .card, .card--feature { padding: var(--pa-space-5); }

  /* Pricing card padding reduces */
  .price-card { padding: var(--pa-space-5) !important; }

  /* Step / accordion / general padding tweaks */
  .step { padding: var(--pa-space-5); }
  .accordion summary { font-size: 1rem; gap: var(--pa-space-3); }
  .accordion summary::after { width: 26px; height: 26px; font-size: 1.05rem; }

  /* Form quality-of-life on tight screens */
  .field label { font-size: 0.82rem; }
  .input, .textarea, .select { padding: 0.85rem 0.95rem; font-size: 16px; /* prevent iOS zoom */ }
  .radio-cards { grid-template-columns: 1fr 1fr; }
  .radio-card span { padding: 0.85rem 0.9rem; font-size: 0.85rem; }

  /* Quote block padding reduces */
  .quote { padding: var(--pa-space-5); padding-top: var(--pa-space-6); }
  .quote::before { font-size: 5rem; top: 0; left: 16px; }

  /* Crumbs wrap cleanly */
  .crumbs { font-size: 0.78rem; }

  /* Stat block shrinks slightly */
  .stat .num { font-size: var(--pa-fs-2xl); }

  /* Dark CTA bands lose their giant inner padding */
  [class*="cta-band"], section .reveal[style*="border-radius"] {
    /* keep the inline padding clamps already in markup; nothing to override here. */
  }
}

@media (max-width: 360px) {
  /* Last-ditch: keep hero readable on very narrow phones */
  h1, .h1 { font-size: 1.85rem; }
  .display { font-size: 2.4rem; }
}

/* Make sure no overflow leaks horizontally. */
html, body { overflow-x: hidden; max-width: 100%; }
img, video, canvas { max-width: 100%; }
table { max-width: 100%; }

/* Long URLs / words should never burst out of small containers */
.post-body, .legal-body, .answer { overflow-wrap: anywhere; word-break: break-word; }
