:root {
  --theme-bg: #ffffff;
  --theme-text: #080808;
  --theme-muted: #5e5a65;
  --theme-panel: #ffffff;
  --theme-border: #ead9f5;
  --theme-purple: #af62e7;
  --theme-purple-strong: #7412f4;
  --theme-deep-panel: #170025;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #000000;
  --theme-text: #ffffff;
  --theme-muted: #d8d1df;
  --theme-panel: #000000;
  --theme-border: #6c348d;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .screen-three {
  color: var(--theme-text);
  background: var(--theme-bg);
}

.theme-toggle {
  justify-self: center;
  width: 42px;
  aspect-ratio: 1;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line, var(--purple-line, var(--theme-border)));
  border-radius: 50%;
  color: var(--ink, var(--theme-text));
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transform: translateX(20px);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  transform: translate(20px, -1px);
}

.theme-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.menu-toggle,
.mobile-contact-link {
  display: none;
}

.menu-toggle {
  justify-self: end;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line, var(--purple-line, var(--theme-border)));
  border-radius: 50%;
  color: var(--ink, var(--theme-text));
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-header,
.contact-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.52);
  border-color: rgba(234, 217, 245, 0.72);
  box-shadow:
    0 18px 60px rgba(87, 26, 146, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}

.is-menu-open .menu-toggle span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.is-menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.is-menu-open .menu-toggle span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-icon-moon {
  display: block;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle {
  color: #ffffff;
  background: #090909;
  border-color: var(--theme-border);
}

html[data-theme="dark"] .menu-toggle {
  color: #ffffff;
  background: #090909;
  border-color: var(--theme-border);
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .contact-header {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(38, 0, 62, 0.72), rgba(0, 0, 0, 0.46)),
    rgba(0, 0, 0, 0.54);
  border-color: rgba(181, 104, 237, 0.42);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}

html[data-theme="dark"] .brand-logo-light {
  display: none;
}

html[data-theme="dark"] .brand-logo-dark {
  display: block;
}

html[data-theme="dark"] .nav-links,
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .nav-trigger {
  color: #ffffff;
}

html[data-theme="dark"] .nav-dropdown {
  background: rgba(10, 0, 16, 0.96);
  border-color: var(--theme-border);
  box-shadow: 0 22px 50px rgba(130, 38, 238, 0.2);
}

html[data-theme="dark"] .nav-dropdown a {
  color: #ffffff;
}

html[data-theme="dark"] .nav-dropdown a:hover {
  color: #ffffff;
  background: #230039;
}

html[data-theme="dark"] .copy-hero h2 {
  color: transparent;
  background: linear-gradient(105deg, #f2d9ff 0%, #b568ed 42%, #7412f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="dark"] .hero-title {
  color: transparent;
  background: linear-gradient(105deg, #f2d9ff 0%, #b568ed 42%, #7412f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="dark"] .copy-hero p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .result-row p,
html[data-theme="dark"] .data-card p,
html[data-theme="dark"] .intro,
html[data-theme="dark"] .contact-copy p,
html[data-theme="dark"] .impact-copy p,
html[data-theme="dark"] .saving-copy p,
html[data-theme="dark"] .tech-hero p,
html[data-theme="dark"] .network-band p {
  color: var(--theme-muted);
}

html[data-theme="dark"] .stats-grid span,
html[data-theme="dark"] .detail-row p {
  color: #beb6c6;
}

html[data-theme="dark"] .detail-row a,
html[data-theme="dark"] .detail-row span {
  color: #ffffff;
}

html[data-theme="dark"] .ring {
  color: #080808;
}

html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .result-row h2,
html[data-theme="dark"] .data-card h2,
html[data-theme="dark"] .precision-section h2,
html[data-theme="dark"] .testimonies h2,
html[data-theme="dark"] .ladder-section h2,
html[data-theme="dark"] .feature-copy h3,
html[data-theme="dark"] .feature-copy p,
html[data-theme="dark"] .testimony-card h3,
html[data-theme="dark"] .testimony-card p,
html[data-theme="dark"] .impact-copy h1,
html[data-theme="dark"] .saving-copy h1,
html[data-theme="dark"] .hero-copy h1,
html[data-theme="dark"] .contact-form h2,
html[data-theme="dark"] .contact-form label {
  color: #ffffff;
}

html[data-theme="dark"] .feature-panel,
html[data-theme="dark"] .saving-panel {
  background: #000000;
  border-color: #4b4b4b;
}

html[data-theme="dark"] .feature-visual,
html[data-theme="dark"] .saving-visual,
html[data-theme="dark"] .hero-phones::before,
html[data-theme="dark"] .hero-phone-wrap::before {
  background: linear-gradient(90deg, #000 0 24%, #0c0016 48%, #5400b9 100%);
}

html[data-theme="dark"] .tech-pill.is-active {
  background: #000000;
}

html[data-theme="dark"] .feature-arrow,
html[data-theme="dark"] .testimony-arrow {
  color: #ffffff;
  background: #000000;
}

html[data-theme="dark"] .feature-next,
html[data-theme="dark"] .testimony-next {
  background: var(--theme-purple-strong);
}

html[data-theme="dark"] .saving-level:not(.is-active) {
  color: #080808;
  background: #f4eaff;
}

html[data-theme="dark"] .data-card {
  color: #ffffff;
  background: #18002c;
  border-color: var(--theme-purple);
}

html[data-theme="dark"] .line-main,
html[data-theme="dark"] .line-soft,
html[data-theme="dark"] .tooltip-line {
  stroke: #bf78ff;
}

html[data-theme="dark"] .network-band {
  color: #080808;
  background: linear-gradient(108deg, #fff 0 39%, #f3e8ff 57%, #7d1df2 100%);
}

html[data-theme="dark"] .network-band h2,
html[data-theme="dark"] .network-band p {
  color: #080808;
}

html[data-theme="dark"] .contact-form {
  background: #ffffff;
  color: #080808;
}

html[data-theme="dark"] .contact-form h2,
html[data-theme="dark"] .contact-form label {
  color: #17131c;
}

html[data-theme="dark"] .contact-form input,
html[data-theme="dark"] .contact-form textarea {
  color: #080808;
}

html[data-theme="dark"] .site-footer {
  color: #ffffff;
  background: linear-gradient(90deg, #7b12f4, #8f1dff);
}

html[data-theme="dark"] .site-footer p {
  color: #eadcff;
}

html[data-theme="dark"] .social-links a {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] .footer-icon {
  color: #ffffff;
}

@media (max-width: 980px) {
  .site-header,
  .contact-header {
    position: relative;
  }

  .theme-toggle {
    width: 38px;
  }

  .menu-toggle {
    width: 38px;
    display: inline-grid;
  }

  .site-header > .contact-button,
  .contact-header > .contact-button {
    display: none;
  }

  .mobile-contact-link {
    display: flex;
  }

  .site-header .nav-links,
  .contact-header .nav-links {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    z-index: 40;
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line, var(--purple-line, var(--theme-border)));
    border-radius: 24px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.56)),
      rgba(255, 255, 255, 0.68);
    box-shadow:
      0 22px 50px rgba(87, 26, 146, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    backdrop-filter: blur(20px) saturate(165%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  html[data-theme="dark"] .site-header .nav-links,
  html[data-theme="dark"] .contact-header .nav-links {
    background:
      linear-gradient(135deg, rgba(38, 0, 62, 0.82), rgba(0, 0, 0, 0.58)),
      rgba(0, 0, 0, 0.68);
    border-color: rgba(181, 104, 237, 0.42);
  }

  .site-header.is-menu-open .nav-links,
  .contact-header.is-menu-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-header .nav-links > a,
  .contact-header .nav-links > a,
  .site-header .nav-trigger,
  .contact-header .nav-trigger {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0 14px;
    border-radius: 14px;
  }

  .site-header .nav-links > a:hover,
  .contact-header .nav-links > a:hover,
  .site-header .nav-trigger:hover,
  .contact-header .nav-trigger:hover {
    background: #f8efff;
  }

  html[data-theme="dark"] .site-header .nav-links > a:hover,
  html[data-theme="dark"] .contact-header .nav-links > a:hover,
  html[data-theme="dark"] .site-header .nav-trigger:hover,
  html[data-theme="dark"] .contact-header .nav-trigger:hover {
    background: #230039;
  }

  .site-header .mobile-contact-link,
  .contact-header .mobile-contact-link {
    justify-content: center;
    margin-top: 6px;
    color: #ffffff;
    background: linear-gradient(90deg, var(--theme-purple-strong), var(--theme-purple));
    font-weight: 800;
  }

  .site-header .nav-menu,
  .contact-header .nav-menu {
    display: grid;
    min-height: 0;
  }

  .site-header .nav-dropdown,
  .contact-header .nav-dropdown {
    position: static;
    min-width: 0;
    padding: 0 0 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .site-header .nav-dropdown a,
  .contact-header .nav-dropdown a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: inherit;
    font-size: 0.95em;
  }
}
