/* ══════════════════════════════════════════════════════════════════
   ieatQR — Staging Design System (2026)
   Shared foundation for the new interactive frontend: re-tokens the
   existing component classes in style.css to a dark, monochrome-plus-
   one-accent palette, then layers on glass, glow, bento, reveal-on-
   scroll and magnetic-button utilities that any staging page can use.
   Load AFTER style.css and BEFORE any page-specific stylesheet.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Core accent — one accent, used with restraint */
  --ac: #38bdf8;
  --ac-dark: #0ea5e9;
  --ac-lite: rgba(56, 189, 248, 0.14);
  --ac-soft: rgba(56, 189, 248, 0.08);
  --ac-2: #a78bfa; /* secondary accent — gradients/glow only, never UI state */

  /* Monochrome base — near-black, not pure black */
  --tx: #f2f5fa;
  --tx2: #a3b1c9;
  --tx3: #677290;
  --ln: rgba(255, 255, 255, 0.09);
  --ln2: rgba(255, 255, 255, 0.15);
  --bg: #05070d;
  --bg2: #0c1120;
  --bg3: #121a2e;

  --muted: #a3b1c9; /* alias kept for a few legacy pages that reference var(--muted) directly */
  --success: #34d399;
  --success-lite: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-lite: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-lite: rgba(248, 113, 113, 0.14);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 12px 44px rgba(56, 189, 248, 0.12);

  /* Motion tokens */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.18s;
  --dur-med: 0.4s;
  --dur-slow: 0.8s;
}

/* ── Base repaint ── */
body {
  background: var(--bg);
  position: relative;
}

/* Fixed ambient gradient mesh + grain sit behind everything on every
   staging page. Cheap (no JS, no canvas), consistent, always-on depth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 12% -6%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(620px 480px at 108% 18%, rgba(167, 139, 250, 0.13), transparent 60%),
    radial-gradient(700px 520px at 50% 112%, rgba(56, 189, 248, 0.08), transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--ac); }

::selection { background: var(--ac); color: #05070d; }

/* ── Component safety overrides ──
   A few rules in style.css hard-code colors (not tokens) or rely on
   --tx/--bg being light-mode values. Re-pin them so nothing goes
   invisible (white-on-white) now that the tokens are dark-mode. */
.navbar {
  background: rgba(5, 7, 13, 0.72);
  border-bottom: 1px solid var(--ln);
}

.nav-menu.mobile-open { background: #0a0e19; }

.toast {
  background: #101a2e;
  border: 1px solid var(--ln2);
  box-shadow: var(--shadow-md);
}
.toast.success { background: var(--success); color: #052014; }
.toast.error { background: var(--danger); color: #2a0808; }

.cat-btn.active { background: var(--ac); color: #05070d; border-color: var(--ac); }
.color-swatch.active { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }

.badge-blue { background: var(--ac-lite); color: var(--ac); }
.badge-green { background: var(--success-lite); color: var(--success); }
.badge-amber { background: var(--warning-lite); color: var(--warning); }
.badge-red { background: var(--danger-lite); color: var(--danger); }

::placeholder { color: var(--tx3); }

/* qr-code-styling renders onto a plain white canvas by design — every
   preview frame keeps a solid white mat so codes stay scannable and
   read as deliberate "paper" objects floating on the dark UI. */
.hero-qr-frame,
.qr-preview-frame {
  background: #fff !important;
}

/* ── Glass surface ──
   Drop-in replacement look for `.card` and friends: translucent dark
   panel, blurred backdrop, soft inner highlight top edge. */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--ln2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card, .glass-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)), var(--bg2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Glow orbs — decorative, absolutely positioned blurred blobs used
   to add atmosphere behind hero/section content. Pure CSS, no assets. */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.glow-orb.ac { background: radial-gradient(circle, rgba(56,189,248,0.55), transparent 70%); }
.glow-orb.violet { background: radial-gradient(circle, rgba(167,139,250,0.5), transparent 70%); }

/* ── Gradient / kinetic text ── */
.gradient-text {
  background: linear-gradient(100deg, var(--ac), var(--ac-2) 65%, var(--ac));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kinetic-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(2deg);
  filter: blur(6px);
  animation: kineticIn var(--dur-slow) var(--ease-out) forwards;
}

@keyframes kineticIn {
  to { opacity: 1; transform: translateY(0) rotate(0deg); filter: blur(0); }
}

/* ── Reveal-on-scroll ──
   Add `data-reveal` (optionally data-reveal="up|scale") to any element;
   interactions.js toggles `.in-view` via IntersectionObserver. */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal="scale"] { transform: translateY(16px) scale(0.94); }
[data-reveal].in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .kinetic-word { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; transition: none !important; }
}

/* ── Magnetic buttons ──
   interactions.js applies the transform on pointermove; this just
   supplies the spring-back transition and a hover lift. */
.magnetic {
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  will-change: transform;
}
.magnetic:hover { box-shadow: var(--shadow-glow); }

/* ── Bento grid ──
   Variable-span tile system for feature/benefit sections. */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(150px, auto);
  gap: 16px;
}
.bento-item {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-fast);
}
.bento-item:hover { transform: translateY(-4px); border-color: var(--ac); }
.bento-item.span-2 { grid-column: span 2; }
.bento-item.row-2 { grid-row: span 2; }

.bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--ac-lite);
  color: var(--ac);
  flex-shrink: 0;
}

.bento-item h3 { font-size: 17px; margin-bottom: 8px; }
.bento-item p { font-size: 13.5px; line-height: 1.65; color: var(--tx2); }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-item.span-2 { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-item.span-2 { grid-column: span 1; }
}

/* ── Numbered step list (scrollytelling "how it works") ── */
.step-row {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--ln);
}
.step-row:last-child { border-bottom: none; }
.step-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--ac);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--ln2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-row h3 { margin-bottom: 6px; }
.step-row p { font-size: 14px; max-width: 46ch; }

/* ── Accordion (FAQ) ── */
.accordion-item {
  border: 1px solid var(--ln);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--tx);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.accordion-trigger svg { flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); color: var(--tx3); }
.accordion-item.open .accordion-trigger svg { transform: rotate(45deg); color: var(--ac); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-med) var(--ease-in-out);
}
.accordion-panel-inner { padding: 0 20px 18px; font-size: 14px; color: var(--tx2); line-height: 1.7; }

/* ── Marquee (trust bar) ── */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 40px;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── CTA banner ── */
.cta-banner {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  overflow: hidden;
  border: 1px solid var(--ln2);
  background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(167,139,250,0.1));
}

/* ── Section eyebrow polish ── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 0 4px var(--ac-soft);
}
