/* ==========================================================================
   TestVibe design system — shared across the marketing site (index, /blog/).
   Modal.com-inspired system on the TestVibe blue: monochrome-hue ramps,
   floating pill nav, one .btn system, flat 12px cards, alpha hairlines,
   Outfit display type over Inter UI. Both themes via html[data-theme].
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* neutrals (product @gray-* ramp) */
  --gray-900: #101729;
  --gray-800: #1f2738;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  /* surfaces */
  --app-bg:  #ffffff;
  --card:    #ffffff;
  --shell:   #f7f8fb;
  --overlay: #ffffff;
  --hover:   #eef0f5;

  /* brand / primary */
  --primary:        #2563eb;
  --primary-strong: #1d4ed8;   /* primary button hover */
  --primary-soft:   #eff6ff;
  --primary-tint:   rgba(37, 99, 235, 0.10);
  --on-primary:     #ffffff;   /* text on primary buttons */

  /* status (test outcomes) */
  --pass:    #16a34a;  --pass-bg:  #e8f6ed;
  --fail:    #dc2626;  --fail-bg:  #fdeaea;
  --warn:    #d97706;
  --running: #2563eb;

  /* alpha hairline system — text color at low alpha */
  --line-1: rgba(16, 23, 41, 0.08);   /* dividers, hairlines */
  --line-3: rgba(16, 23, 41, 0.22);   /* interactive outlines (ghost buttons, idle pills) */
  --border-c:  #e5e7eb;               /* legacy component borders (tour frame etc.) */
  --hairline:  #eceef2;
  --surface-line: #e7eaf0;            /* flat-card edge (transparent in dark) */

  /* nav */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-line: rgba(16, 23, 41, 0.10);

  /* light band (full-bleed contrast section) */
  --band-bg: #eef3fb;

  /* brand "vibe" gradient (signature accent — hero span, glows, 2 keylines) */
  --vibe-blue:    #0e8fd6;
  --vibe-indigo:  #3a2c8f;
  --vibe-violet:  #6d2c92;
  --vibe-magenta: #d6286b;
  --vibe-orange:  #f2922e;
  --vibe-red:     #ed2d3f;
  --vibe-gradient: linear-gradient(115deg,
      var(--vibe-blue) 0%, var(--vibe-indigo) 26%, var(--vibe-violet) 48%,
      var(--vibe-magenta) 68%, var(--vibe-red) 84%, var(--vibe-orange) 100%);

  /* bounded decorative glows (replace the old fixed background art):
     2-3 vibe stops at low opacity, blurred into soft blobs */
  --glow-a: rgba(14, 143, 214, 0.13);   /* vibe-blue */
  --glow-b: rgba(109, 44, 146, 0.09);   /* vibe-violet */
  --glow-c: rgba(214, 40, 107, 0.06);   /* vibe-magenta */

  /* type */
  --font-display: "Outfit", "Inter", "Segoe UI", sans-serif;
  --font-ui:      "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* radii */
  --radius-pill:  999px;
  --radius-shell: 16px;
  --radius-card:  12px;
  --radius-tile:  8px;
  --radius-field: 7px;

  /* elevation — kept only for floating chrome (tooltips, popovers) */
  --shadow-tile: 0 1px 2px rgba(16, 23, 41, 0.05);
  --shadow-card: 0 1px 3px rgba(16, 23, 41, 0.07);
  --shadow-pop:  0 8px 28px rgba(16, 23, 41, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-btn: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme — pure-black page, every "white" is a blue-tinted near-white,
   every "gray" a desaturated step of the same blue. */
html[data-theme="dark"] {
  color-scheme: dark;

  --app-bg:  #000000;
  --card:    #101420;
  --shell:   #0a0d14;
  --overlay: #161c2c;
  --hover:   rgba(220, 232, 255, 0.07);

  --gray-900: #dce8ff;   /* near-white with blue tint — never #fff */
  --gray-800: #c3d3f2;
  --gray-700: #a6bade;   /* soft copy */
  --gray-600: #8296bd;   /* muted body */
  --gray-500: #6a7da3;   /* captions / whispers */
  --gray-400: #4c5a7a;
  --gray-300: #2b3450;
  --gray-200: #1e2536;
  --gray-100: #161c2a;
  --gray-50:  #101420;

  --primary:        #5c8dff;                 /* brightened brand blue for black canvas */
  --primary-strong: #7da5ff;                 /* hover BRIGHTENS (signature move) */
  --primary-soft:   rgba(92, 141, 255, 0.16);
  --primary-tint:   rgba(92, 141, 255, 0.14);
  --on-primary:     #071022;                 /* near-black text on the bright blue */

  --pass-bg: rgba(22, 163, 74, 0.18);
  --fail-bg: rgba(220, 38, 38, 0.18);

  --line-1: rgba(220, 232, 255, 0.10);
  --line-3: rgba(220, 232, 255, 0.28);
  --border-c:  rgba(220, 232, 255, 0.14);
  --hairline:  rgba(220, 232, 255, 0.08);
  --surface-line: transparent;               /* flat dark cards: separation via surface, not borders */

  --nav-bg: rgba(17, 22, 36, 0.88);
  --nav-line: rgba(220, 232, 255, 0.10);

  --band-bg: #dce7fa;

  /* lifted vibe stops so the gradient stays vibrant on black */
  --vibe-blue:    #2ba6ee;
  --vibe-indigo:  #6457d8;
  --vibe-violet:  #a456cf;
  --vibe-magenta: #f0518f;
  --vibe-red:     #ff5566;
  --vibe-orange:  #ffa94d;

  --glow-a: rgba(43, 166, 238, 0.18);   /* vibe-blue */
  --glow-b: rgba(164, 86, 207, 0.13);   /* vibe-violet */
  --glow-c: rgba(240, 81, 143, 0.08);   /* vibe-magenta */

  --shadow-tile: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.50);
  --shadow-pop:  0 8px 28px rgba(0, 0, 0, 0.62);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  /* Clip (not hidden) so decorative bleed (glows, full-bleed band) can't
     expand the mobile layout viewport without creating a scroll container. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-ui);
  background-color: var(--app-bg);
  color: var(--gray-900);
  min-height: 100dvh;
  line-height: 1.6;
  letter-spacing: -0.011em;
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}

img { max-width: 100%; }

/* Page container */
.shell {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Typography primitives — eyebrow → display H2 → lede, repeated everywhere
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-600);
}

.sec-head { max-width: 780px; margin-bottom: 2.75rem; }
.sec-head.center { margin-inline: auto; text-align: center; }

.sec-h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.2vw, 3.375rem);   /* → 54px */
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--gray-900);
  margin-top: 0.9rem;
}
.sec-h2.minor { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }  /* → 40px */
.sec-h2 .accent { color: var(--primary); }

/* Signature brand twist: the ONE highlighted phrase per hero headline gets the
   vibe gradient as a text fill. Use sparingly — everywhere else accents are
   solid --primary. */
.vibe-text {
  background: var(--vibe-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sec-sub {
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--gray-600);
  max-width: 42rem;
}
.sec-head.center .sec-sub { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Buttons — the one .btn system (primary / ghost pills)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.6rem 1.35rem;
  white-space: nowrap;
  transition: background 0.15s var(--ease-btn), border-color 0.15s var(--ease-btn),
              color 0.15s var(--ease-btn), transform 0.15s var(--ease-btn);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--primary-tint); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--gray-800); border-color: var(--line-3); }
.btn-ghost:hover { border-color: var(--gray-600); color: var(--gray-900); text-decoration: none; }

.btn-sm { padding: 0.42rem 1.05rem; font-size: 0.85rem; }
.btn-lg { padding: 0.82rem 1.75rem; font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Floating pill nav — sticky wrapper occupies 72px total (12 + 48 + 12);
   tour.js navH = 72 depends on this. Do not change without updating tour.js.
   -------------------------------------------------------------------------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  pointer-events: none;             /* page scrolls/clicks pass beside the pill */
}
.nav-pill {
  pointer-events: auto;
  width: min(1080px, 100%);
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--nav-bg);
  border: 1px solid var(--nav-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 7px 0 18px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 26px; width: auto; display: block; }

/* Theme-matched logo variants: dark wordmark SVG on light, white PNG on dark */
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; justify-self: center; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: color 0.15s var(--ease-btn), background 0.15s var(--ease-btn);
}
.nav-links a:hover { color: var(--gray-900); background: var(--hover); }
.nav-links a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.nav-right { display: flex; align-items: center; gap: 0.55rem; justify-self: end; }

/* Theme toggle (markup contract: .theme-toggle button[data-theme-value]) */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--line-1);
  border-radius: var(--radius-pill);
}
.theme-toggle button {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-pill); color: var(--gray-500);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle button:hover { color: var(--gray-900); }
.theme-toggle button svg { width: 14px; height: 14px; display: block; }
.theme-toggle button[aria-pressed="true"] { background: var(--hover); color: var(--primary); }
.theme-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-pill { grid-template-columns: auto 1fr; }
  .nav-right { grid-column: 2; }
}
@media (max-width: 480px) {
  .nav-cta { display: none; }   /* hero CTA is one swipe away on phones */
}

/* --------------------------------------------------------------------------
   Full-bleed light band — the one palette-flip section per page
   -------------------------------------------------------------------------- */
.band {
  margin-inline: calc(50% - 50vw);
  padding-inline: calc(50vw - 50%);
  background: var(--band-bg);
}
/* In dark theme the band flips to light: re-scope the ramp so children invert. */
html[data-theme="dark"] .band {
  --card:    #ffffff;
  --shell:   #eef2fb;
  --overlay: #ffffff;
  --hover:   #e3eaf8;
  --gray-900: #0b1220;
  --gray-800: #1c2740;
  --gray-700: #33415e;
  --gray-600: #54648a;
  --gray-500: #6b7a9e;
  --gray-400: #93a1c0;
  --gray-300: #c6d0e6;
  --gray-200: #d6ddef;
  --primary:        #2050d8;
  --primary-strong: #1a44b8;
  --primary-soft:   #e3ecff;
  --primary-tint:   rgba(32, 80, 216, 0.12);
  --on-primary:     #ffffff;
  --line-1: rgba(11, 18, 32, 0.08);
  --line-3: rgba(11, 18, 32, 0.24);
  --border-c: rgba(11, 18, 32, 0.14);
  --hairline: rgba(11, 18, 32, 0.08);
  --surface-line: rgba(11, 18, 32, 0.10);
  --shadow-tile: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow-card: 0 1px 3px rgba(11, 18, 32, 0.07);
  --shadow-pop:  0 8px 28px rgba(11, 18, 32, 0.14);
  color: var(--gray-900);
}

/* --------------------------------------------------------------------------
   Pre-footer CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  text-align: center;
  padding: 7rem 0 6rem;
}
/* Keyline #1 of 2: vibe-gradient hairline along the CTA band's top edge. */
.cta-band::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(560px, 80vw);
  height: 2px;
  border-radius: 2px;
  background: var(--vibe-gradient);
  opacity: 0.8;
}
/* Bounded pre-footer glow: 3 blurred vibe stops, never behind body text width. */
.cta-band::before {
  content: "";
  position: absolute;
  inset: auto 50% -4rem;
  transform: translateX(50%);
  width: min(820px, 94vw);
  height: 400px;
  background:
    radial-gradient(54% 58% at 42% 84%, var(--glow-a), transparent 72%),
    radial-gradient(44% 50% at 66% 92%, var(--glow-b), transparent 70%),
    radial-gradient(34% 40% at 84% 96%, var(--glow-c), transparent 70%);
  filter: blur(24px);
  pointer-events: none;
  z-index: -1;
}
.cta-band .sec-h2 { max-width: 22ch; margin-inline: auto; }
.cta-row {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  justify-content: center;
  margin-top: 2.1rem;
}
.cta-note {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  max-width: 46rem;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Footer — multi-column over transparent page bg, alpha hairline on top
   -------------------------------------------------------------------------- */
footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-1);
  background: transparent;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem clamp(1.25rem, 4vw, 3rem) 3rem;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2rem;
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.footer-brand .brand-logo { height: 28px; }
.footer-tag { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.35; color: var(--gray-800); }
.footer-tag .accent { color: var(--primary); }
.footer-copy { font-size: 0.8rem; color: var(--gray-500); }

.footer-col h4 {
  font-family: var(--font-ui);
  font-size: 0.85rem; font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.9rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a {
  font-size: 0.85rem;
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.15s var(--ease-btn);
}
.footer-col a:hover { color: var(--gray-900); text-decoration: none; }

/* Ice Tea Group ownership pill (contract: keep the link + logo) */
.ownership {
  font-family: var(--font-ui);
  font-size: 0.78rem; color: var(--gray-600);
  text-decoration: none;
  border: 1px solid var(--line-3); border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.ownership:hover { border-color: var(--gray-600); color: var(--gray-900); text-decoration: none; }
.ownership .swirl { flex-shrink: 0; display: block; object-fit: contain; border-radius: 50%; }
.ownership b { color: var(--gray-900); font-weight: 600; }
.ownership .out { color: var(--gray-400); font-size: 0.68rem; }

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* --------------------------------------------------------------------------
   Scroll reveal — IntersectionObserver adds .in; requires html.js
   (the head bootstrap adds the class, so no-JS visitors see everything).
   -------------------------------------------------------------------------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  .tour-shot, .tour-tip { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
