:root {
    /* MUI-inspired blue palette */
    --primary: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --primary-contrast: #ffffff;
  }

  html[data-theme="light"] {
    --bg: #f4f6f8;
    --paper: #ffffff;
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.6);
    --divider: rgba(0, 0, 0, 0.12);
    --elevation-1: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
    --elevation-2: 0 3px 3px -2px rgba(0,0,0,.2), 0 3px 4px 0 rgba(0,0,0,.14), 0 1px 8px 0 rgba(0,0,0,.12);
    --elevation-8: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
    --appbar-bg: rgba(255,255,255,0.85);
    --hero-glow: rgba(25, 118, 210, 0.10);
  }

  html[data-theme="dark"] {
    --bg: #121212;
    --paper: #1e1e1e;
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.62);
    --divider: rgba(255, 255, 255, 0.12);
    --elevation-1: 0 2px 1px -1px rgba(0,0,0,.4), 0 1px 1px 0 rgba(0,0,0,.28), 0 1px 3px 0 rgba(0,0,0,.24);
    --elevation-2: 0 3px 3px -2px rgba(0,0,0,.4), 0 3px 4px 0 rgba(0,0,0,.28), 0 1px 8px 0 rgba(0,0,0,.24);
    --elevation-8: 0 5px 5px -3px rgba(0,0,0,.4), 0 8px 10px 1px rgba(0,0,0,.28), 0 3px 14px 2px rgba(0,0,0,.24);
    --appbar-bg: rgba(30,30,30,0.85);
    --hero-glow: rgba(66, 165, 245, 0.14);
  }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: 'Prompt', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color .3s ease, color .3s ease;
    -webkit-font-smoothing: antialiased;
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
  }

  .container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

  /* ---------- AppBar ---------- */
  .appbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--appbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--elevation-2);
    transition: background-color .3s ease;
  }
  .appbar .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; }
  .brand-mark {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem;
    box-shadow: var(--elevation-1);
  }
  .brand-logo { height: 40px; width: auto; display: block; }
  .footer-logo { height: 38px; width: auto; display: block; }
  html[data-theme="light"] .logo-dark { display: none; }
  html[data-theme="dark"]  .logo-light { display: none; }
  .appbar-actions { display: flex; align-items: center; gap: 8px; }

  .nav-links { display: flex; gap: 4px; }
  .nav-links a {
    color: var(--text-secondary); text-decoration: none; font-weight: 500;
    font-size: .95rem; padding: 8px 14px; border-radius: 8px;
    transition: background-color .2s, color .2s;
  }
  .nav-links a:hover { background: var(--hero-glow); color: var(--primary); }

  /* Theme toggle (MUI IconButton style) */
  .icon-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: none; cursor: pointer; background: transparent;
    color: var(--text-primary); display: grid; place-items: center;
    transition: background-color .2s;
  }
  .icon-btn:hover { background: var(--hero-glow); }
  .icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .icon-btn svg { width: 24px; height: 24px; }
  html[data-theme="light"] .icon-moon { display: block; }
  html[data-theme="light"] .icon-sun  { display: none; }
  html[data-theme="dark"]  .icon-moon { display: none; }
  html[data-theme="dark"]  .icon-sun  { display: block; }

  /* ---------- Buttons (MUI contained/outlined) ---------- */
  .btn {
    font-family: inherit; font-weight: 500; font-size: .95rem;
    letter-spacing: .02em; border-radius: 8px; cursor: pointer;
    padding: 11px 24px; border: none; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background-color .2s, box-shadow .2s, transform .05s;
  }
  .btn:active { transform: translateY(1px); }
  .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .btn-contained {
    background: var(--primary); color: var(--primary-contrast);
    box-shadow: var(--elevation-2);
  }
  .btn-contained:hover { background: var(--primary-dark); box-shadow: var(--elevation-8); }
  .btn-outlined {
    background: transparent; color: var(--primary);
    border: 1px solid var(--primary);
  }
  .btn-outlined:hover { background: var(--hero-glow); }
  .btn-lg { padding: 14px 32px; font-size: 1rem; }

  /* ---------- Hero ---------- */
  .hero { position: relative; padding: 96px 0 80px; overflow: hidden; }
  .hero::before {
    content: ''; position: absolute; top: -120px; right: -80px;
    width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, var(--hero-glow) 0%, transparent 70%);
    pointer-events: none;
  }
  .hero-inner { position: relative; max-width: 720px; }
  .hero-logo {
    height: 92px; width: auto; display: block; margin-bottom: 28px;
    filter: drop-shadow(0 6px 16px var(--hero-glow));
  }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--hero-glow); color: var(--primary);
    font-size: .82rem; font-weight: 500; padding: 6px 14px;
    border-radius: 100px; margin-bottom: 24px;
  }
  .hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700;
    line-height: 1.2; margin-bottom: 20px; letter-spacing: -0.01em;
  }
  .hero h1 .accent { color: var(--primary); }
  .hero p.lead {
    font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-secondary);
    font-weight: 300; margin-bottom: 36px; max-width: 620px;
  }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

  /* ---------- Section ---------- */
  section { padding: 72px 0; }
  .section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
  .eyebrow {
    color: var(--primary); font-weight: 600; font-size: .9rem;
    letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px;
  }
  .section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 600; margin-bottom: 12px; }
  .section-head p { color: var(--text-secondary); font-weight: 300; }

  /* ---------- Cards ---------- */
  .card {
    background: var(--paper); border-radius: 16px; padding: 32px;
    box-shadow: var(--elevation-1);
    transition: box-shadow .25s, transform .25s;
    border: 1px solid var(--divider);
  }
  .card:hover { box-shadow: var(--elevation-8); transform: translateY(-4px); }

  .features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .feature-icon {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--hero-glow); color: var(--primary);
    display: grid; place-items: center; margin-bottom: 18px;
  }
  .feature-icon svg { width: 28px; height: 28px; }
  .card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
  .card p { color: var(--text-secondary); font-weight: 300; font-size: .96rem; }

  /* ---------- Pricing ---------- */
  #pricing { background: var(--paper); }
  html[data-theme="light"] #pricing { background: #eef3f8; }
  .pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
  .price-card { display: flex; flex-direction: column; }
  .price-card.featured { border: 2px solid var(--primary); position: relative; }
  .price-badge {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; font-size: .78rem; font-weight: 500;
    padding: 5px 16px; border-radius: 100px; box-shadow: var(--elevation-2);
    white-space: nowrap;
  }
  .price-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
  .price-card .price-sub { color: var(--text-secondary); font-size: .9rem; font-weight: 300; margin-bottom: 20px; }
  .price-amount { display: flex; align-items: baseline; gap: 6px; margin-bottom: 24px; }
  .price-amount .num { font-size: 2.6rem; font-weight: 700; color: var(--primary); line-height: 1; }
  .price-amount .unit { color: var(--text-secondary); font-weight: 400; }
  .price-list { list-style: none; margin-bottom: 28px; flex-grow: 1; }
  .price-list li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: .95rem; font-weight: 300; }
  .price-list li svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 3px; }
  .price-card .btn { width: 100%; justify-content: center; }

  /* ---------- Steps ---------- */
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .step { text-align: center; }
  .step-num {
    width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 600; font-size: 1.2rem;
    display: grid; place-items: center; box-shadow: var(--elevation-2);
  }
  .step h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
  .step p { color: var(--text-secondary); font-size: .92rem; font-weight: 300; }

  /* ---------- CTA band ---------- */
  .cta-band {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 24px; padding: 56px 40px; text-align: center; color: #fff;
    box-shadow: var(--elevation-8);
  }
  .cta-band h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 600; margin-bottom: 12px; }
  .cta-band p { opacity: .92; font-weight: 300; margin-bottom: 28px; }
  .cta-band .btn-contained { background: #fff; color: var(--primary); }
  .cta-band .btn-contained:hover { background: rgba(255,255,255,.9); }

  /* ---------- Footer ---------- */
  footer { padding: 48px 0 32px; border-top: 1px solid var(--divider); margin-top: 40px; }
  .footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
  footer .brand { font-size: 1.05rem; }
  .footer-contact { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
  .footer-contact a {
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--hero-glow); color: var(--primary);
    text-decoration: none;
    transition: background-color .2s, color .2s, transform .15s, box-shadow .2s;
  }
  .footer-contact a:hover {
    background: var(--primary); color: #fff;
    transform: translateY(-3px); box-shadow: var(--elevation-2);
  }
  .footer-contact a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .footer-contact svg { width: 22px; height: 22px; }
  .copyright { text-align: center; color: var(--text-secondary); font-size: .85rem; font-weight: 300; margin-top: 28px; }

  /* ---------- Speed scores ---------- */
  #speed { background: var(--paper); }
  html[data-theme="light"] #speed { background: #eef3f8; }
  .gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 36px; }
  .gauge { text-align: center; }
  .gauge-ring { position: relative; width: 132px; height: 132px; margin: 0 auto 14px; }
  .gauge-ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
  .gauge-ring .track { fill: none; stroke: var(--divider); stroke-width: 9; }
  .gauge-ring .bar {
    fill: none; stroke-width: 9; stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
  }
  .gauge-ring .val {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 2rem; font-weight: 700;
  }
  .gauge-label { font-weight: 500; font-size: .98rem; }
  .gauge-sub { color: var(--text-secondary); font-weight: 300; font-size: .82rem; }
  .speed-foot { text-align: center; }
  .speed-note { color: var(--text-secondary); font-weight: 300; font-size: .88rem; margin-top: 16px; }

  /* ---------- Mobile menu ---------- */
  .nav-toggle {
    display: none; width: 44px; height: 44px; border-radius: 50%;
    border: none; cursor: pointer; background: transparent;
    color: var(--text-primary); place-items: center; transition: background-color .2s;
  }
  .nav-toggle:hover { background: var(--hero-glow); }
  .nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .nav-toggle svg { width: 26px; height: 26px; }
  .mobile-menu { display: none; flex-direction: column; border-top: 1px solid var(--divider); }
  .mobile-menu a {
    padding: 15px 24px; text-decoration: none; color: var(--text-primary);
    font-weight: 500; border-bottom: 1px solid var(--divider); transition: background-color .2s, color .2s;
  }
  .mobile-menu a:hover, .mobile-menu a.active { background: var(--hero-glow); color: var(--primary); }

  /* ---------- Responsive ---------- */
  @media (max-width: 900px) {
    .features, .pricing-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .gauges { grid-template-columns: repeat(2, 1fr); }
    .nav-links { display: none; }
    .nav-toggle { display: grid; }
    .mobile-menu.open { display: flex; }
  }
  @media (max-width: 560px) {
    .steps { grid-template-columns: 1fr; }
    section { padding: 56px 0; }
    .cta-band { padding: 40px 24px; }
    .hero-logo { height: 66px; margin-bottom: 22px; }
  }
