/*!
 * base.css — shared design system for gokulmc-sites
 * =================================================
 * One file, no build step, no external requests. Shared verbatim across every
 * sibling site. The ONLY thing a sibling site should override is the accent
 * token block (--accent / --accent-2 / --accent-3 / --accent-fg) — do that in
 * the site's own assets/theme.css or a small <style> block, never in here.
 *
 * Contents
 *   1.  Reset
 *   2.  Design tokens (dark default + light theme + first-paint media query)
 *   3.  Base element styles
 *   4.  Layout primitives (container, section rhythm, grid)
 *   5.  Backgrounds: mesh glow + noise overlay
 *   6.  Nav
 *   7.  Buttons
 *   8.  Hero
 *   9.  Section header
 *   10. Cards / feature grid
 *   11. Stats
 *   12. Terminal / code block
 *   13. Chips, tags, badges
 *   14. Gauge / progress / counter primitives
 *   15. Compare (estimate vs. reality) primitive
 *   16. Log / step list
 *   17. Pull quote
 *   18. Toggle switch
 *   19. Footer
 *   20. Scroll-reveal + motion utilities
 *   21. Accessibility & focus
 *   22. Reduced motion
 *   23. Responsive breakpoints
 */

/* ===========================================================================
   1. Reset
   =========================================================================== */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[class], ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

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

/* ===========================================================================
   2. Design tokens
   =========================================================================== */

:root {
  color-scheme: dark;

  /* ---- Accent tokens — THE ONLY THING SIBLING SITES OVERRIDE ---- */
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --accent-3: #34c759;
  --accent-fg: #ffffff;

  /* ---- Semantic state colors — universal, identical across every site ---- */
  --success: #34c759;
  --warning: #ff9f0a;
  --danger: #ff3b30;

  /* ---- Neutrals: dark theme (default) ---- */
  --bg: #0a0a0c;
  --bg-raised: #131316;
  --bg-overlay: #1b1b1f;
  --bg-sunken: #000000;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f3f5;
  --text-secondary: rgba(243, 243, 245, 0.66);
  --text-tertiary: rgba(243, 243, 245, 0.42);
  --text-inverse: #0a0a0c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.36), 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* ---- Typography ---- */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Code", monospace;

  --text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.32rem + 0.8vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.55rem + 1.4vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.7rem + 2.4vw, 3.375rem);
  --text-5xl: clamp(2.75rem, 1.9rem + 3.8vw, 4.5rem);
  --text-hero: clamp(2.75rem, 1.5rem + 5.6vw, 5.25rem);

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-normal: 1.6;

  --tracking-tight: -0.03em;
  --tracking-tighter: -0.045em;
  --tracking-wide: 0.06em;
  --tracking-wider: 0.12em;

  /* ---- Spacing scale (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Radii ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 450ms;
  --dur-slower: 700ms;

  /* ---- Layout ---- */
  --content-width: 1180px;
  --content-width-narrow: 760px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-height: 68px;
}

/* Explicit light theme — applied either by system preference (first paint,
   before JS runs) or by the manual toggle setting data-theme="light". */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #fbfbfd;
    --bg-raised: #ffffff;
    --bg-overlay: #f2f2f5;
    --bg-sunken: #eceef1;
    --border: rgba(10, 10, 20, 0.08);
    --border-strong: rgba(10, 10, 20, 0.14);
    --text: #0e0e12;
    --text-secondary: rgba(14, 14, 18, 0.64);
    --text-tertiary: rgba(14, 14, 18, 0.42);
    --text-inverse: #ffffff;
    --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.06);
    --shadow-md: 0 8px 24px rgba(20, 20, 40, 0.08), 0 2px 6px rgba(20, 20, 40, 0.05);
    --shadow-lg: 0 24px 64px rgba(20, 20, 40, 0.12), 0 8px 24px rgba(20, 20, 40, 0.06);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfd;
  --bg-raised: #ffffff;
  --bg-overlay: #f2f2f5;
  --bg-sunken: #eceef1;
  --border: rgba(10, 10, 20, 0.08);
  --border-strong: rgba(10, 10, 20, 0.14);
  --text: #0e0e12;
  --text-secondary: rgba(14, 14, 18, 0.64);
  --text-tertiary: rgba(14, 14, 18, 0.42);
  --text-inverse: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 40, 0.08), 0 2px 6px rgba(20, 20, 40, 0.05);
  --shadow-lg: 0 24px 64px rgba(20, 20, 40, 0.12), 0 8px 24px rgba(20, 20, 40, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ===========================================================================
   3. Base element styles
   =========================================================================== */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { color: var(--text-secondary); }

a { transition: color var(--dur-fast) var(--ease-out); }

code, pre, kbd {
  font-family: var(--font-mono);
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}

/* ===========================================================================
   4. Layout primitives
   =========================================================================== */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--content-width-narrow);
}

.section {
  position: relative;
  padding-block: var(--space-24);
}

@media (max-width: 640px) {
  .section { padding-block: var(--space-16); }
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-direction: row; align-items: center; }

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.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 {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  z-index: 1000;
  background: var(--accent);
  color: var(--accent-fg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ===========================================================================
   5. Backgrounds: mesh glow + noise overlay
   =========================================================================== */

.glow-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-mesh::before,
.glow-mesh::after {
  content: "";
  position: absolute;
  width: min(70vw, 900px);
  height: min(70vw, 900px);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.glow-mesh::before {
  top: -20%;
  left: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: drift-a 22s var(--ease-in-out) infinite alternate;
}

.glow-mesh::after {
  top: -10%;
  right: -15%;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  animation: drift-b 26s var(--ease-in-out) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4%, 6%) scale(1.08); }
}

@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.05); }
  to   { transform: translate(-5%, 4%) scale(0.96); }
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ===========================================================================
   6. Nav
   =========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-tight);
}

.nav-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-raised);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* On the narrowest phones (down to 360px) the nav bar has only room for the
   brand, theme toggle and hamburger — the inline Download button gets tight
   against the icon. Drop it here; the mobile nav-panel dropdown always
   repeats the primary CTA in full, so nothing is lost, just decluttered. */
@media (max-width: 480px) {
  .nav-actions > .btn {
    display: none;
  }
}

/* Mobile nav dropdown panel, toggled via app.js's initMobileNav(). Hidden on
   desktop; on mobile it renders as a full-width sheet under the nav bar. */
.nav-panel {
  display: none;
}

@media (max-width: 760px) {
  .nav-panel.is-open {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: var(--space-6) var(--gutter);
    box-shadow: var(--shadow-md);
  }

  .nav-panel .nav-link {
    font-size: var(--text-base);
  }

  .nav-panel .btn {
    width: 100%;
  }
}

/* ===========================================================================
   7. Buttons
   =========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 46px;
  padding-inline: var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 100%, white 6%), var(--accent) 60%);
  color: var(--accent-fg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 14px 28px color-mix(in srgb, var(--accent) 45%, transparent);
}

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-strong));
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover { color: var(--text); }

.btn-sm { height: 38px; padding-inline: var(--space-4); font-size: var(--text-xs); }
.btn-lg { height: 54px; padding-inline: var(--space-8); font-size: var(--text-base); }

.btn-icon {
  width: 16px;
  height: 16px;
}

/* ===========================================================================
   8. Hero
   =========================================================================== */

.hero {
  position: relative;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-16);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.hero-title {
  font-size: var(--text-hero);
  letter-spacing: var(--tracking-tighter);
  line-height: 1.03;
  font-weight: 680;
}

.hero-title .accent-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 620px;
  line-height: var(--leading-snug);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.hero-centerpiece {
  position: relative;
  z-index: 1;
  margin-top: var(--space-20);
}

/* ===========================================================================
   9. Section header
   =========================================================================== */

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-12);
}

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

.section-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: block;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.section-lead {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* ===========================================================================
   10. Cards / feature grid
   =========================================================================== */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-bottom: var(--space-5);
}

.card-icon svg { width: 20px; height: 20px; }

.card-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* ===========================================================================
   11. Stats
   =========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8);
}

.stat {
  text-align: left;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  background: linear-gradient(160deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ===========================================================================
   12. Terminal / code block
   =========================================================================== */

.terminal {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--bg-raised) 60%, var(--bg-sunken));
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.85;
}

.terminal-dot--red { background: #ff5f56; }
.terminal-dot--yellow { background: #ffbd2e; }
.terminal-dot--green { background: #27c93f; }

.terminal-title {
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.terminal-body {
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
}

.terminal-body .tok-comment { color: var(--text-tertiary); }
.terminal-body .tok-accent { color: var(--accent); }
.terminal-body .tok-success { color: var(--success); }
.terminal-body .tok-warning { color: var(--warning); }
.terminal-body .tok-text { color: var(--text); }

/* ===========================================================================
   13. Chips, tags, badges
   =========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-raised);
}

.chip--safe {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.chip--cleanable {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.chip--danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.chip--accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
}

/* ===========================================================================
   14. Gauge / progress / counter primitives
   =========================================================================== */

.gauge {
  --gauge-color: var(--danger);
}

/* Health-state modifiers — universal semantic coloring (disk pressure, quota
   meters, battery, anything with a critical/warning/healthy reading). */
.gauge--critical { --gauge-color: var(--danger); }
.gauge--warning { --gauge-color: var(--warning); }
.gauge--healthy { --gauge-color: var(--success); }

.gauge-track {
  position: relative;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gauge-color), color-mix(in srgb, var(--gauge-color) 70%, white 10%));
  box-shadow: 0 0 18px color-mix(in srgb, var(--gauge-color) 55%, transparent);
  transition: width 1.1s var(--ease-out), background var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
}

.gauge-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(255,255,255,0.25) 0%, transparent 35%);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.counter {
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width var(--dur-slow) var(--ease-out);
}

/* ===========================================================================
   15. Compare (estimate vs. reality) primitive
   =========================================================================== */

.compare {
  display: grid;
  gap: var(--space-5);
}

.compare-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  align-items: center;
  gap: var(--space-4);
}

.compare-row-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.compare-track {
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  overflow: hidden;
}

.compare-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 1s var(--ease-out);
}

.compare-fill--ghost {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--text-tertiary) 60%, transparent),
    color-mix(in srgb, var(--text-tertiary) 60%, transparent) 6px,
    transparent 6px,
    transparent 12px
  );
}

.compare-fill--real {
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
}

.compare-row-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 560px) {
  .compare-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .compare-row-value { text-align: left; }
}

/* ===========================================================================
   16. Log / step list
   =========================================================================== */

.log {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.log-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  color: var(--text-tertiary);
  opacity: 0.4;
  transform: translateX(-4px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
  border-bottom: 1px dashed var(--border);
}

.log-line:last-child { border-bottom: none; }

.log-line.is-active {
  color: var(--text);
  opacity: 1;
  transform: translateX(0);
}

.log-line.is-done {
  color: var(--text-secondary);
  opacity: 1;
  transform: translateX(0);
}

.log-line-marker {
  width: 16px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.log-line.is-done .log-line-marker { color: var(--success); }
.log-line.is-active .log-line-marker { color: var(--accent); }

.log-line-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text);
}

/* ===========================================================================
   17. Pull quote
   =========================================================================== */

.quote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 500;
  color: var(--text);
  line-height: var(--leading-snug);
}

.quote cite {
  display: block;
  margin-top: var(--space-4);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ===========================================================================
   18. Toggle switch
   =========================================================================== */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background-color var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}

.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring);
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"]::before {
  transform: translateX(18px);
}

/* ===========================================================================
   19. Footer
   =========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-16);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 650;
}

.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }

.footer-links {
  display: flex;
  gap: var(--space-10);
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.footer-col a:hover { color: var(--text); }

.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ===========================================================================
   20. Scroll-reveal + motion utilities
   =========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slower) var(--ease-out), transform var(--dur-slower) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-lift {
  transition: transform var(--dur-base) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-3px);
}

/* ===========================================================================
   21. Accessibility & focus
   =========================================================================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===========================================================================
   22. Reduced motion
   =========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .glow-mesh::before,
  .glow-mesh::after {
    animation: none;
  }

  .card:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .hover-lift:hover {
    transform: none;
  }
}

/* ===========================================================================
   23. Responsive breakpoints
   =========================================================================== */

@media (max-width: 640px) {
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
  .footer-top { flex-direction: column; }
  .compare-row { grid-template-columns: 1fr; }
}
