/* base.css — reset, ambient atmosphere, shared primitives
 * Load after tokens.css. Component files live in css/components/.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--qi-bg);
  color: var(--qi-text);
  font-family: var(--qi-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(102, 252, 241, 0.25); }

a { color: var(--qi-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--qi-accent);
  outline-offset: 2px;
  border-radius: var(--qi-radius-sm);
}

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }

/* ── Ambient atmosphere (QI signature) ──────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--qi-bg);
  pointer-events: none;
}
.ambient::before, .ambient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: ambient-breathe 9s ease-in-out infinite;
}
.ambient::before {
  width: 620px; height: 620px; top: -12%; left: -6%;
  background: radial-gradient(circle, var(--qi-glow), transparent 70%);
}
.ambient::after {
  width: 520px; height: 520px; bottom: -12%; right: -6%;
  background: radial-gradient(circle, color-mix(in srgb, var(--qi-trust) 30%, transparent), transparent 70%);
  animation-delay: 4.5s; opacity: 0.6;
}
.ambient__orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.22; will-change: transform;
}
.ambient__orb--1 { width: 220px; height: 220px; background: var(--qi-energy); top: 18%; left: 8%; animation: orb-a 22s ease-in-out infinite; }
.ambient__orb--2 { width: 280px; height: 280px; background: var(--qi-trust); top: 62%; left: 72%; animation: orb-b 26s ease-in-out infinite; }
.ambient__orb--3 { width: 170px; height: 170px; background: color-mix(in srgb, var(--qi-accent) 55%, transparent); top: 74%; left: 14%; animation: orb-c 19s ease-in-out infinite; }
.ambient__waves { position: fixed; bottom: -4rem; left: 0; width: 100%; height: 20rem; opacity: 0.10; pointer-events: none; }
.ambient__wave { fill: none; stroke: var(--qi-accent); stroke-width: 1.5; }
.ambient__wave--1 { animation: wave-drift 18s ease-in-out infinite; }
.ambient__wave--2 { animation: wave-drift 24s ease-in-out infinite reverse; opacity: 0.7; }
.ambient__wave--3 { animation: wave-drift 30s ease-in-out infinite; opacity: 0.45; }
@keyframes wave-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-3rem); }
}

@keyframes ambient-breathe {
  0%, 100% { opacity: 0.28; transform: scale(1); }
  50% { opacity: 0.42; transform: scale(1.08); }
}
@keyframes orb-a {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(120px, 80px); }
  50% { transform: translate(60px, 160px); }
  75% { transform: translate(-40px, 100px); }
}
@keyframes orb-b {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-100px, -60px); }
  66% { transform: translate(80px, -120px); }
}
@keyframes orb-c {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(140px, -100px); }
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--qi-space-sm);
  font-weight: 600;
  font-size: 0.95rem;
  padding: var(--qi-space-md) var(--qi-space-xl);
  border-radius: var(--qi-radius-pill);
  border: 0.5px solid transparent;
  cursor: pointer;
  transition: all var(--qi-dur-fast) var(--qi-ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--qi-accent); color: var(--qi-bg); }
.btn--primary:hover { background: var(--qi-energy); }
.btn--ghost {
  background: var(--qi-glass);
  color: var(--qi-text);
  border-color: var(--qi-glass-border);
}
.btn--ghost:hover { background: var(--qi-glass-hover); }
.btn .arrow { transition: transform var(--qi-dur-fast); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Section scaffolding (shared across pages) ──────── */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
/* Alt sections get a SOLID elevated background — glass-on-glass reads muddy,
 * so cards inside alt sections switch to flat surfaces (no blur stack). */
.section--alt { background: var(--qi-bg-elevated); }
.section--alt .card,
.section--alt .vs,
.section--alt .pulse,
.section--alt .pipe,
.section--alt .approval-demo,
.section--alt .feature-row__visual,
.section--alt .mission__form {
  background: var(--qi-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.section__head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__eyebrow {
  font: var(--qi-font-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--qi-energy);
  margin-bottom: var(--qi-space-md);
  display: flex; align-items: center; gap: var(--qi-space-sm);
}
.section__eyebrow::before {
  content: ''; width: 1.75rem; height: 1px; background: var(--qi-energy); display: inline-block;
}
.section h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--qi-space-md);
}
.section h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: var(--qi-space-sm); }
.section__lede { color: var(--qi-text-muted); max-width: 58ch; font-size: clamp(0.95rem, 1.2vw, 1.05rem); }
.section__lede a { font-weight: 600; }

/* Interior page hero (products/services/about pages) */
.page-hero { padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 4vw, 3rem); }
.page-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--qi-space-lg);
  max-width: 22ch;
}
.page-hero__lede { color: var(--qi-text-muted); max-width: 58ch; font-size: clamp(1rem, 1.35vw, 1.15rem); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

/* ── Motion safety + responsive ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 56rem) {
  .split { grid-template-columns: 1fr; }
}

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

/* skip-link: visually hidden until focused — keyboard users jump to <main> */
.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -110%);
  z-index: 200; background: var(--qi-accent); color: var(--qi-bg);
  font: var(--qi-font-caption); font-weight: 600;
  padding: var(--qi-space-sm) var(--qi-space-lg);
  border-radius: 0 0 var(--qi-radius-md) var(--qi-radius-md);
  text-decoration: none; transition: transform .15s ease;
}
.skip-link:focus-visible { transform: translate(-50%, 0); }
