/* ==========================================================================
   RxChange — Upgraded SaaS Visual System
   Teal + clean, but bolder. Mesh, isometric, motion.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Accent — teal (matches current site) */
  --teal-50:  #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  --accent:        #0d9488;
  --accent-hover:  #0f766e;
  --accent-soft:   #ecfdf5;
  --accent-tint:   #f0fdfa;
  --accent-ink:    #115e59;
  --accent-ring:   rgba(13, 148, 136, 0.18);

  /* Surfaces */
  --bg:        #ffffff;
  --bg-soft:   #f7fafa;
  --bg-tint:   #ecfdf5;
  --panel:     #ffffff;
  --panel-2:   #f8fafc;

  /* Ink */
  --ink:       #0b1220;
  --ink-2:     #1f2937;
  --ink-3:     #475569;
  --muted:     #64748b;
  --muted-2:   #94a3b8;

  /* Lines */
  --line:      #e5e9ee;
  --line-soft: #eef1f5;
  --line-strong: #cbd5e1;

  /* Signal */
  --ok:    #10b981;
  --warn:  #f59e0b;
  --crit:  #ef4444;
  --info:  #3b82f6;

  /* Brand cue: maple red (subtle Canadian) */
  --maple: #d4282d;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Radii */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 20px;
  --r-5: 28px;
  --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.02);
  --sh-2: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --sh-3: 0 16px 32px -12px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.05);
  --sh-4: 0 28px 60px -20px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sh-glow: 0 30px 80px -30px rgba(13, 148, 136, 0.45);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-emph: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --max-w: 1240px;
  --gutter: 24px;
}

/* Dark mode token override (applied via [data-theme=dark]) */
[data-theme="dark"] {
  --bg:        #0a0f14;
  --bg-soft:   #0d141b;
  --bg-tint:   #0a1a18;
  --panel:     #0f1720;
  --panel-2:   #131c25;

  --ink:       #f4f7fa;
  --ink-2:     #d8dee6;
  --ink-3:     #94a3b8;
  --muted:     #7e8a99;
  --muted-2:   #5b6675;

  --line:      #1c2730;
  --line-soft: #161f28;
  --line-strong: #2a3744;

  --accent-soft: rgba(20, 184, 166, 0.10);
  --accent-tint: rgba(20, 184, 166, 0.06);
  --accent-ring: rgba(45, 212, 191, 0.25);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 4px 12px -2px rgba(0, 0, 0, 0.45);
  --sh-3: 0 16px 32px -12px rgba(0, 0, 0, 0.55);
  --sh-4: 0 28px 60px -20px rgba(0, 0, 0, 0.65);
  --sh-glow: 0 30px 80px -30px rgba(45, 212, 191, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

button {
  font: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

::selection {
  background: var(--teal-200);
  color: var(--teal-900);
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(72px, 9vw, 128px) 0;
  position: relative;
}

.section--tight { padding: clamp(56px, 7vw, 96px) 0; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 100%;
}
.eyebrow .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.eyebrow .dot {
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .eyebrow { white-space: normal; }
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.eyebrow .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Type ---------- */
.h-display {
  font-family: var(--font-sans);
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.h-display .em {
  color: var(--accent);
}
.h-display .it {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.h-1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0;
}
.h-2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
}
.h-3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0;
}
.h-4 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-weight: 600;
  margin: 0;
}

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 62ch;
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-2);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 22px -8px var(--accent-ring);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 16px 32px -10px var(--accent-ring);
}

.btn--ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--dark {
  background: var(--ink);
  color: var(--bg);
}
.btn--dark:hover { background: var(--ink-2); }

.btn .arrow {
  transition: transform .25s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-lg { padding: 16px 26px; font-size: 16px; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* ---------- Chip / tag ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--teal-100);
}
[data-theme="dark"] .chip { border-color: rgba(45,212,191,0.18); }

.chip--neutral {
  background: var(--panel-2);
  color: var(--ink-3);
  border-color: var(--line);
}
.chip--ok { background: rgba(16,185,129,0.12); color: var(--ok); border-color: rgba(16,185,129,0.25); }
.chip--warn { background: rgba(245,158,11,0.12); color: #b45309; border-color: rgba(245,158,11,0.25); }
.chip--crit { background: rgba(239,68,68,0.10); color: #b91c1c; border-color: rgba(239,68,68,0.22); }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 28px;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--sh-2);
}

.card--accent {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--panel) 60%);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.015em;
}
.nav__brand .rx {
  color: var(--accent);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__links a {
  padding: 8px 14px;
  border-radius: var(--r-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--panel-2); }
.nav__links a.is-active { color: var(--ink); }

.nav__cta {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 800px) {
  .nav__links { display: none; }
}

/* ---------- Brand mark ---------- */
.brand-mark {
  width: 32px;
  height: 32px;
  position: relative;
  display: inline-block;
}

/* ---------- Logo image (nav + footer) ---------- */
.nav__logo {
  height: 30px;
  width: auto;
  display: block;
}
[data-theme="dark"] .nav__logo {
  /* Logo has a white background — soften on dark mode */
  background: #ffffff;
  padding: 4px 6px;
  border-radius: 6px;
}

/* ---------- Feature kicker (replaces eyebrow pill) ----------
   A clean, flush kicker line — section number + label, no chip, no dot. */
.feat-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.feat-kicker__n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  line-height: 1;
}
.feat-kicker__t {
  color: var(--ink-3);
  white-space: normal;
}
/* When the kicker has no number, drop the divider */
.feat-kicker > .feat-kicker__t:only-child {
  padding-left: 0;
  border-left: 0;
}

/* ---------- Hero mesh / background ---------- */
.mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.mesh::before, .mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.mesh::before {
  width: 580px; height: 580px;
  background: radial-gradient(closest-side, var(--teal-200), transparent);
  top: -120px; left: -120px;
}
.mesh::after {
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, var(--teal-100), transparent);
  bottom: -260px; right: -160px;
}
[data-theme="dark"] .mesh::before { background: radial-gradient(closest-side, rgba(20,184,166,0.35), transparent); }
[data-theme="dark"] .mesh::after  { background: radial-gradient(closest-side, rgba(20,184,166,0.20), transparent); }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--line) 60%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--line) 60%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Misc utilities ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
.ink-3 { color: var(--ink-3); }
.accent-text { color: var(--accent); }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-3);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* Pulse animation for live indicators */
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 var(--accent-ring); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.pulse {
  animation: pulse-dot 1.8s infinite;
}

/* Subtle entrance — translate only; opacity stays at 1 so static snapshots work */
@keyframes rise {
  from { transform: translateY(14px); }
  to   { transform: none; }
}
.rise {
  animation: rise .6s var(--ease-emph) both;
}
.rise-2 { animation-delay: .08s; }
.rise-3 { animation-delay: .16s; }
.rise-4 { animation-delay: .24s; }

/* Reduce motion — skip entrance animation, show final state immediately */
@media (prefers-reduced-motion: reduce) {
  .rise, .rise-2, .rise-3, .rise-4 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Tweaks: custom accent swatches ---------- */
.rx-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.rx-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: left;
}
.rx-swatch:hover { border-color: var(--line-strong); }
.rx-swatch.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.rx-swatch__c {
  width: 16px; height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.rx-swatch__l {
  font-size: 12px;
}
