﻿:root {
  color-scheme: dark;
  --background: linear-gradient(180deg, #02060f 0%, #040b16 100%);
  --surface: rgba(10, 23, 40, 0.92);
  --surface-strong: rgba(8, 16, 30, 0.98);
  --surface-light: rgba(255, 255, 255, 0.08);
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --accent: #7c3aed;
  --accent-strong: #f59e0b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(56, 189, 248, 0.15);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --card: rgba(6, 15, 31, 0.84);
  --background-surface: rgba(255, 255, 255, 0.92);
  --text-inverted: #020617;
  --muted-light: #4b5563;
}

body.light {
  color-scheme: light;
  --background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --surface-light: rgba(15, 23, 42, 0.04);
  --primary: #0f172a;
  --primary-strong: #334155;
  --accent: #7c3aed;
  --accent-strong: #fb7185;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
  --card: rgba(255, 255, 255, 0.88);
  --background-surface: rgba(248, 250, 252, 0.9);
  --text-inverted: #ffffff;
  --muted-light: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 18%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.10), transparent 20%),
    linear-gradient(180deg, #02060f 0%, #040b16 100%);
  color: var(--text);
}

body:before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 18%),
    radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.06), transparent 16%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding: 24px 24px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 11, 22, 0.8);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin: -24px -24px 24px;
  padding: 16px 24px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand,
.brand-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark,
.brand-footer .brand-mark {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(0, 242, 195, 0.16);
  color: #00f2c3;
  font-size: 1.2rem;
}

.brand strong,
.brand-footer .brand-title-footer {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.topnav a:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button,
input {
  font: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  background: var(--background);
  color: var(--text);
}

.pill-btn,
.ghost-btn,
.primary-btn,
.secondary-btn,
.theme-toggle-btn {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pill-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pill-btn:hover,
.ghost-btn:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 20px;
}

.primary-btn {
  background: linear-gradient(135deg, #00f2c3, #1ddcba);
  color: #07101d;
  padding: 14px 24px;
  font-weight: 700;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 14px 24px;
}

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 76px 0 64px;
  text-align: center;
}

.hero-copy {
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(3.4rem, 6vw, 6.2rem);
  line-height: 0.95;
  margin: 0 0 24px;
  letter-spacing: -0.05em;
}

.hero-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 2rem;
  margin-bottom: 28px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-description {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-visual {
  min-height: 520px;
  border-radius: 36px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.3), transparent 32%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(12, 23, 46, 0.95), rgba(2, 6, 15, 0.95));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-visual::before {
  content: '';
  position: absolute;
  left: 40%;
  top: 24%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  filter: blur(18px);
}

.hero-visual::after {
  content: '';
  position: absolute;
  right: 10%;
  bottom: 10%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  filter: blur(18px);
}

.hero-visual:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 24%);
}

.stats,
.feature-grid,
.tool-grid,
.premium-grid,
.premium-features,
.footer-grid {
  display: grid;
  gap: 18px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 42px 0 36px;
}

.stat-card,
.feature-card,
.tool-card,
.premium-card,
.feature-box {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);
  padding: 28px;
}

.stat-card {
  text-align: center;
}

.stat-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.14);
  color: var(--primary);
  font-size: 1.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.section {
  margin-bottom: 42px;
}

#compass {
  position: relative;
  overflow: hidden;
}

.section-orbit {
  position: absolute;
  right: 4%;
  top: 30px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 195, 0.16);
  box-shadow: inset 0 0 30px rgba(0, 242, 195, 0.08);
  animation: softFloat 7s ease-in-out infinite;
  pointer-events: none;
}

.section-header,
.tools-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.section-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.section h2,
.premium-card h3,
.feature-box h4 {
  margin: 0;
}

.section h2 {
  font-size: clamp(2rem, 2.25vw, 2.8rem);
}

.section p {
  color: var(--muted);
  line-height: 1.8;
}

.feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-head span {
  font-size: 1.4rem;
}

.tool-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.tool-card p {
  color: var(--muted);
  margin: 0;
}

.tool-card input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.tool-card input::placeholder {
  color: rgba(226, 232, 240, 0.55);
}

.tool-card button {
  width: fit-content;
  padding: 12px 20px;
}

.tool-result {
  color: var(--text);
  font-weight: 600;
  margin: 0;
}

.compass-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(300px, 1fr);
  gap: 32px;
  align-items: center;
  padding: 30px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(0, 242, 195, 0.08), rgba(56, 189, 248, 0.06) 42%, rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.14);
  box-shadow: var(--shadow);
}

.compass-frame {
  display: flex;
  justify-content: center;
  perspective: 900px;
}

.compass-ring {
  width: min(380px, 82vw);
  height: min(380px, 82vw);
  border-radius: 50%;
  border: 2px solid rgba(0, 242, 195, 0.34);
  background:
    radial-gradient(circle at center, rgba(0, 242, 195, 0.16), transparent 18%),
    radial-gradient(circle at center, rgba(56, 189, 248, 0.08), transparent 42%),
    conic-gradient(from 0deg, rgba(56, 189, 248, 0.16), rgba(0, 242, 195, 0.08), rgba(124, 58, 237, 0.16), rgba(56, 189, 248, 0.16)),
    rgba(1, 12, 28, 0.98);
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 28px 70px rgba(0, 0, 0, 0.26), 0 0 40px rgba(0, 242, 195, 0.10);
  animation: compassGlow 4.8s ease-in-out infinite;
}

.compass-ring::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 242, 195, 0.26);
}

.compass-ring::after {
  content: '';
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(2, 6, 15, 0.34);
}

.compass-ticks {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(226, 232, 240, 0.6) 0deg 1deg, transparent 1deg 15deg),
    repeating-conic-gradient(from 0deg, rgba(0, 242, 195, 0.9) 0deg 2deg, transparent 2deg 45deg);
  mask: radial-gradient(circle, transparent 62%, black 63% 68%, transparent 69%);
  opacity: 0.8;
}

.compass-label {
  position: absolute;
  color: var(--muted);
  font-weight: 700;
  z-index: 2;
  font-size: 0.9rem;
}

.compass-label.north { top: 18px; left: 50%; transform: translateX(-50%); color: #f8fafc; font-size: 1.1rem; }
.compass-label.east { right: 20px; top: 50%; transform: translateY(-50%); }
.compass-label.south { bottom: 18px; left: 50%; transform: translateX(-50%); }
.compass-label.west { left: 20px; top: 50%; transform: translateY(-50%); }
.compass-label.ne { right: 23%; top: 22%; }
.compass-label.se { right: 23%; bottom: 22%; }
.compass-label.sw { left: 23%; bottom: 22%; }
.compass-label.nw { left: 23%; top: 22%; }

.compass-needle {
  width: 18px;
  height: 43%;
  background: linear-gradient(180deg, #fffbeb 0%, #f59e0b 44%, #00f2c3 45%, #38bdf8 100%);
  clip-path: polygon(50% 0, 100% 100%, 50% 86%, 0 100%);
  position: absolute;
  top: 10%;
  left: 50%;
  transform-origin: center bottom;
  transform: translateX(-50%) rotate(0deg);
  z-index: 3;
  filter: drop-shadow(0 0 16px rgba(0, 242, 195, 0.36));
}

.compass-center {
  position: absolute;
  z-index: 4;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #00f2c3;
  border: 4px solid rgba(2, 6, 15, 0.96);
  box-shadow: 0 0 24px rgba(0, 242, 195, 0.58);
  animation: centerPulse 2.6s ease-in-out infinite;
}

.compass-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.compass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compass-actions .secondary-btn {
  border: 1px solid rgba(0, 242, 195, 0.14);
}

.heading-display {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: rgba(2, 6, 15, 0.44);
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(0, 242, 195, 0.18);
}

.compass-needle {
  transition: transform 0.4s ease;
}

.heading-display span {
  color: var(--muted);
}

.heading-display strong {
  font-size: 2.2rem;
  color: var(--text);
}

.heading-display em {
  font-style: normal;
  color: #00f2c3;
  font-weight: 800;
  letter-spacing: 0;
}

.compass-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compass-hints span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(0, 242, 195, 0.09);
  border: 1px solid rgba(0, 242, 195, 0.16);
  color: var(--muted);
  font-size: 0.85rem;
}

.compass-slider {
  width: min(100%, 520px);
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.compass-slider input {
  width: 100%;
  accent-color: #00f2c3;
}

.compass-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 520px);
}

.compass-metrics div {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(2, 6, 15, 0.42);
  border: 1px solid rgba(0, 242, 195, 0.13);
}

.compass-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.compass-metrics strong {
  color: var(--text);
}

.premium-section {
  position: relative;
  padding: 46px 0 30px;
  overflow: hidden;
}

.premium-section::before {
  content: '';
  position: absolute;
  inset: 0 -24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 20%, rgba(245, 158, 11, 0.16), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(0, 242, 195, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(56, 189, 248, 0.05), transparent);
  pointer-events: none;
  z-index: -1;
}

.premium-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.premium-particles span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f2c3;
  box-shadow: 0 0 24px rgba(0, 242, 195, 0.74);
  opacity: 0.55;
  animation: particleRise 8s ease-in-out infinite;
}

.premium-particles span:nth-child(1) { left: 8%; bottom: 12%; }
.premium-particles span:nth-child(2) { left: 42%; bottom: 4%; animation-delay: 1.4s; background: #fbbf24; }
.premium-particles span:nth-child(3) { right: 14%; bottom: 18%; animation-delay: 2.2s; }
.premium-particles span:nth-child(4) { right: 34%; bottom: 8%; animation-delay: 3.1s; background: #38bdf8; }

.premium-banner {
  display: inline-flex;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(0, 242, 195, 0.18));
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: var(--text);
  font-weight: 700;
  margin-bottom: 18px;
}

.premium-hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(3, 20, 40, 0.94), rgba(8, 16, 30, 0.98)),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 32%);
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow: var(--shadow);
}

.premium-intro h2 {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 2.5vw, 3.2rem);
}

.premium-intro p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.9;
}

.premium-price {
  font-size: 2rem;
  font-weight: 800;
  color: #fbbf24;
}

.premium-price-card {
  min-width: 260px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.13), rgba(0, 242, 195, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.premium-price-card span,
.premium-price-card small,
.premium-note {
  color: var(--muted);
}

.premium-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.premium-cta {
  box-shadow: 0 18px 42px rgba(0, 242, 195, 0.18);
  animation: ctaBreath 2.8s ease-in-out infinite;
}

.premium-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.premium-card {
  background: linear-gradient(180deg, rgba(3, 20, 40, 0.92), rgba(5, 10, 22, 0.95));
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.premium-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 242, 195, 0.24);
  box-shadow: 0 34px 86px rgba(0, 242, 195, 0.08);
}

.premium-list,
.premium-calculator,
.premium-advanced {
  border: 1px solid rgba(56, 189, 248, 0.14);
}

.premium-list {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 28px 80px rgba(245, 158, 11, 0.08);
}

.premium-card-badge {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.85rem;
}

.premium-list h3 {
  margin: 0;
  color: var(--primary);
}

.premium-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.premium-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
}

.premium-list li:before {
  content: '✓';
  color: #00f2c3;
  line-height: 1.2;
  font-weight: 800;
}

.full-width {
  display: inline-flex;
  width: 100%;
  justify-content: center;
}

.premium-calculator {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.premium-calculator-showcase {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 242, 195, 0.26);
  background:
    radial-gradient(circle at 82% 14%, rgba(0, 242, 195, 0.16), transparent 26%),
    radial-gradient(circle at 16% 90%, rgba(245, 158, 11, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(3, 20, 40, 0.96), rgba(5, 10, 22, 0.98));
}

.premium-calculator-showcase::before {
  content: '';
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 180deg, transparent, rgba(0, 242, 195, 0.12), transparent 34%);
  animation: calcSweep 8s linear infinite;
  opacity: 0.75;
  pointer-events: none;
}

.premium-calculator-showcase > * {
  position: relative;
  z-index: 1;
}

.calculator-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.calc-kicker {
  display: block;
  margin-bottom: 6px;
  color: #00f2c3;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calc-live-badge {
  padding: 8px 12px;
  border-radius: 999px;
  color: #07101d;
  background: linear-gradient(135deg, #fbbf24, #00f2c3);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 242, 195, 0.18);
}

.calc-visual {
  height: 86px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 242, 195, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 242, 195, 0.06) 1px, transparent 1px),
    rgba(2, 6, 15, 0.38);
  background-size: 24px 24px;
  border: 1px solid rgba(0, 242, 195, 0.18);
}

.calc-visual span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00f2c3;
  box-shadow: 0 0 22px rgba(0, 242, 195, 0.75);
  animation: calcPulse 2.6s ease-in-out infinite;
}

.calc-visual span:nth-child(2) {
  width: 86px;
  height: 86px;
  border: 1px solid rgba(0, 242, 195, 0.28);
  background: transparent;
  animation-delay: 0.22s;
}

.calc-visual span:nth-child(3) {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(245, 158, 11, 0.20);
  background: transparent;
  animation-delay: 0.45s;
}

.calculator-display-wrap {
  border-radius: 20px;
  padding: 12px;
  background: rgba(2, 6, 15, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.calculator-display-wrap small {
  display: block;
  margin: 0 0 8px 6px;
  color: var(--muted);
  font-weight: 700;
}

.calculator-display {
  min-height: 68px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 242, 195, 0.12), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(0, 242, 195, 0.18);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 2rem;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.03em;
}

.calc-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.calc-shortcuts span {
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
  font-weight: 700;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sci-btn {
  border: none;
  border-radius: 14px;
  padding: 18px 0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(124, 58, 237, 0.16));
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sci-btn:hover {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 10px 24px rgba(0, 242, 195, 0.10);
}

.sci-btn:active {
  transform: translateY(1px) scale(0.98);
}

.sci-btn:nth-child(1),
.sci-btn:nth-child(2),
.sci-btn:nth-child(23),
.sci-btn:nth-child(27) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(0, 242, 195, 0.14));
  color: #f8fafc;
}

.premium-advanced {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.premium-advanced input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.premium-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.premium-features {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.feature-box {
  padding: 24px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.07), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.feature-box h4 {
  margin: 0 0 10px;
  color: #dbeafe;
}

.feature-box p {
  color: var(--muted);
  margin: 0;
  line-height: 1.8;
}

@keyframes calcSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes calcPulse {
  0%, 100% {
    transform: scale(0.82);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes compassGlow {
  0%, 100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 28px 70px rgba(0, 0, 0, 0.26), 0 0 34px rgba(0, 242, 195, 0.10);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 28px 70px rgba(0, 0, 0, 0.26), 0 0 54px rgba(0, 242, 195, 0.22);
  }
}

@keyframes centerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

@keyframes softFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.42; }
  50% { transform: translateY(18px) rotate(8deg); opacity: 0.72; }
}

@keyframes particleRise {
  0% { transform: translateY(40px) scale(0.7); opacity: 0; }
  35% { opacity: 0.68; }
  100% { transform: translateY(-180px) scale(1.15); opacity: 0; }
}

@keyframes ctaBreath {
  0%, 100% { box-shadow: 0 18px 42px rgba(0, 242, 195, 0.16); }
  50% { box-shadow: 0 22px 54px rgba(0, 242, 195, 0.28); }
}

.footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer-grid h4 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--primary);
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.footer-grid a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer-note {
  text-align: center;
  color: var(--muted);
  margin-top: 32px;
}

.caption {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.assistant-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-inverted);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 60;
}

.assistant-panel {
  position: fixed;
  right: 26px;
  bottom: 100px;
  width: min(420px, calc(100% - 32px));
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.assistant-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.assistant-header h3 {
  margin: 0;
  font-size: 1rem;
}

.assistant-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.assistant-close {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

.assistant-msgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.assistant-message {
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
}

.assistant-message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.assistant-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(124, 58, 237, 0.18));
  color: var(--text);
}

.assistant-form {
  display: flex;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.assistant-form input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.assistant-form button {
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-inverted);
  border: none;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .compass-panel {
    grid-template-columns: 1fr;
  }

  .premium-grid,
  .premium-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .stats,
  .feature-grid,
  .tool-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .topnav {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 48px;
  }

  .hero-visual {
    min-height: 320px;
  }

  .tool-card,
  .premium-list,
  .premium-calculator,
  .premium-advanced,
  .feature-box {
    padding: 24px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .pill-btn {
    width: 100%;
    text-align: center;
  }
}

/* Professional polish and functional states */
:root {
  --success: #22c55e;
  --danger: #fb7185;
}

body {
  background:
    radial-gradient(circle at top left, rgba(0, 242, 195, 0.12), transparent 22%),
    radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.10), transparent 20%),
    var(--background);
}

.topbar {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}

.brand-mark,
.brand-footer .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.topnav a {
  border-radius: 10px;
}

.hero {
  min-height: 78vh;
}

.hero-badge {
  border: 1px solid rgba(0, 242, 195, 0.22);
}

.hero h1 {
  letter-spacing: 0;
  color: #f8fafc;
  text-shadow: 0 0 32px rgba(56, 189, 248, 0.22);
}

.hero-visual {
  border-radius: 28px;
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.hero-visual::before {
  inset: 26px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 72%);
  filter: none;
  width: auto;
  height: auto;
  left: 26px;
  top: 26px;
}

.hero-visual::after {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(0, 242, 195, 0.28);
  background: transparent;
  box-shadow: inset 0 0 0 34px rgba(56, 189, 248, 0.05), 0 0 42px rgba(0, 242, 195, 0.16);
  filter: none;
}

.stat-card,
.feature-card,
.tool-card,
.premium-card,
.feature-box {
  border-radius: 18px;
}

.tool-card {
  min-height: 100%;
}

.tool-card input,
.premium-advanced input,
.assistant-form input,
.auth-form input,
.payment-form input {
  border-radius: 12px;
}

.tool-card input:focus,
.premium-advanced input:focus,
.assistant-form input:focus,
.auth-form input:focus,
.payment-form input:focus {
  border-color: rgba(0, 242, 195, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 242, 195, 0.10);
}

.compass-needle::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #00f2c3;
  box-shadow: 0 0 22px rgba(0, 242, 195, 0.55);
}

.calculator-display {
  overflow: hidden;
  word-break: break-all;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(460px, 100%);
  position: relative;
  background: var(--surface-strong);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
}

.auth-form,
.payment-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form input,
.payment-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  background: rgba(3, 20, 40, 0.96);
  color: var(--text);
  border: 1px solid rgba(0, 242, 195, 0.28);
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.payment-summary {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 242, 195, 0.10), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(0, 242, 195, 0.22);
}

.payment-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.payment-row strong {
  color: var(--text);
}

@media (max-width: 860px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-toggle-btn,
  .pill-btn,
  .ghost-btn,
  .primary-btn,
  .secondary-btn {
    min-height: 48px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding: 18px 16px 28px;
  }

  .topbar {
    margin: -18px -16px 22px;
    padding: 14px 16px;
  }

  .hero {
    min-height: auto;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .pill-btn {
    justify-content: center;
  }

  .topnav a {
    flex: 1 1 42%;
    text-align: center;
  }

  .assistant-panel {
    right: 16px;
    bottom: 92px;
  }
}

/* Latest section refinements */
.hero {
  grid-template-columns: none;
}

.hero-visual {
  display: none;
}

.compass-needle::before {
  display: none;
}

@media (max-width: 900px) {
  .premium-hero-card {
    grid-template-columns: 1fr;
  }

  .premium-price-card {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .compass-panel,
  .premium-hero-card {
    padding: 22px;
  }

  .compass-controls {
    align-items: stretch;
  }

  .heading-display {
    justify-content: center;
  }

  .premium-actions-row .primary-btn {
    width: 100%;
  }
}

/* Light theme compass visibility */
body.light .compass-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(224, 242, 254, 0.88));
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

body.light .compass-ring {
  border-color: rgba(14, 116, 144, 0.48);
  background:
    radial-gradient(circle at center, rgba(14, 165, 233, 0.18), transparent 18%),
    radial-gradient(circle at center, rgba(20, 184, 166, 0.12), transparent 42%),
    conic-gradient(from 0deg, rgba(14, 165, 233, 0.18), rgba(20, 184, 166, 0.10), rgba(245, 158, 11, 0.14), rgba(14, 165, 233, 0.18)),
    #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 24px 54px rgba(15, 23, 42, 0.16), 0 0 34px rgba(14, 165, 233, 0.16);
}

body.light .compass-ring::before {
  border-color: rgba(14, 116, 144, 0.32);
}

body.light .compass-ring::after {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(15, 23, 42, 0.10);
}

body.light .compass-ticks {
  background:
    repeating-conic-gradient(from 0deg, rgba(15, 23, 42, 0.58) 0deg 1deg, transparent 1deg 15deg),
    repeating-conic-gradient(from 0deg, rgba(14, 116, 144, 0.95) 0deg 2deg, transparent 2deg 45deg);
}

body.light .compass-label {
  color: #334155;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.light .compass-label.north {
  color: #0f172a;
}

body.light .compass-needle {
  background: linear-gradient(180deg, #ef4444 0%, #f59e0b 44%, #0891b2 45%, #0f766e 100%);
  filter: drop-shadow(0 0 12px rgba(14, 116, 144, 0.32));
}

body.light .compass-center {
  background: #0891b2;
  border-color: #f8fafc;
  box-shadow: 0 0 22px rgba(14, 116, 144, 0.42);
}

body.light .heading-display,
body.light .compass-metrics div {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(14, 116, 144, 0.20);
}

body.light .heading-display strong,
body.light .compass-metrics strong,
body.light .tool-result {
  color: #0f172a;
}

body.light .heading-display em {
  color: #0f766e;
}

body.light .compass-hints span {
  background: rgba(14, 165, 233, 0.10);
  border-color: rgba(14, 116, 144, 0.18);
  color: #334155;
}

body.light .compass-actions .secondary-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border-color: rgba(14, 116, 144, 0.18);
}

body.light .compass-slider {
  color: #334155;
}

/* Light theme global readability */
body.light .topbar {
  background: rgba(248, 250, 252, 0.92);
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.light .brand strong,
body.light .brand-footer .brand-title-footer,
body.light .topnav a,
body.light .section h2,
body.light .hero h1,
body.light .tool-head h3,
body.light .premium-card h3,
body.light .footer-grid h4 {
  color: #0f172a;
}

body.light .hero h1 {
  text-shadow: 0 0 28px rgba(14, 165, 233, 0.22);
}

body.light .brand small,
body.light .section p,
body.light .caption,
body.light .footer-grid a,
body.light .footer-note,
body.light .premium-list li,
body.light .feature-box p {
  color: #475569;
}

body.light .topnav a:hover {
  color: #0f766e;
  background: rgba(14, 165, 233, 0.10);
}

body.light .pill-btn,
body.light .ghost-btn,
body.light .theme-toggle-btn,
body.light .secondary-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.light .stat-card,
body.light .feature-card,
body.light .tool-card,
body.light .premium-card,
body.light .feature-box {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.10);
}

body.light .premium-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.92));
}

body.light .premium-list {
  border-color: rgba(245, 158, 11, 0.32);
}

body.light .feature-box h4,
body.light .feature-title,
body.light .premium-list h3 {
  color: #0f766e;
}

body.light .tool-card input,
body.light .premium-advanced input,
body.light .assistant-form input,
body.light .auth-form input,
body.light .payment-form input {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body.light .tool-card input::placeholder,
body.light .premium-advanced input::placeholder {
  color: #64748b;
}

body.light .premium-calculator-showcase {
  background:
    radial-gradient(circle at 82% 14%, rgba(20, 184, 166, 0.16), transparent 26%),
    radial-gradient(circle at 16% 90%, rgba(245, 158, 11, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.94));
}

body.light .calculator-display-wrap,
body.light .calc-visual {
  background-color: rgba(248, 250, 252, 0.74);
  border-color: rgba(14, 116, 144, 0.18);
}

body.light .calculator-display {
  color: #0f172a;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(14, 165, 233, 0.08));
}

body.light .sci-btn {
  color: #0f172a;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(20, 184, 166, 0.12));
}

/* Creative motion layer */
.ocean-motion {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ocean-motion span {
  position: absolute;
  left: var(--x, 10%);
  bottom: -120px;
  width: var(--size, 46px);
  height: var(--size, 46px);
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 195, 0.16);
  background: rgba(56, 189, 248, 0.04);
  animation: bubbleRise var(--speed, 12s) ease-in infinite;
  opacity: 0;
}

.ocean-motion span:nth-child(1) { --x: 12%; --size: 34px; --speed: 10s; }
.ocean-motion span:nth-child(2) { --x: 58%; --size: 72px; --speed: 14s; animation-delay: 2s; }
.ocean-motion span:nth-child(3) { --x: 84%; --size: 46px; --speed: 12s; animation-delay: 4s; }

.page-shell {
  z-index: 1;
}

.hero {
  isolation: isolate;
}

.hero-wave {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(760px, 92vw);
  height: 70px;
  transform: translateX(-50%);
  opacity: 0.22;
  background:
    radial-gradient(50% 90% at 50% 100%, rgba(0, 242, 195, 0.32), transparent 62%),
    repeating-radial-gradient(ellipse at center, rgba(56, 189, 248, 0.28) 0 2px, transparent 3px 16px);
  border-radius: 50%;
  animation: waveDrift 5.5s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.hero-icons span {
  display: inline-block;
  animation: iconBob 3.6s ease-in-out infinite;
}

.hero-icons span:nth-child(2) { animation-delay: 0.35s; }
.hero-icons span:nth-child(3) { animation-delay: 0.7s; }

.primary-btn {
  position: relative;
  overflow: hidden;
}

.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: buttonShimmer 3.8s ease-in-out infinite;
  pointer-events: none;
}

.stat-card,
.feature-card,
.tool-card,
.feature-box {
  transform-style: preserve-3d;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.stat-card:hover,
.feature-card:hover,
.tool-card:hover,
.feature-box:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 195, 0.22);
  box-shadow: 0 34px 86px rgba(0, 242, 195, 0.08);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

body.light .ocean-motion span {
  border-color: rgba(14, 116, 144, 0.18);
  background: rgba(14, 165, 233, 0.07);
}

body.light .hero-wave {
  opacity: 0.32;
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  18% { opacity: 0.5; }
  100% { transform: translateY(-120vh) scale(1.18); opacity: 0; }
}

@keyframes waveDrift {
  0%, 100% { transform: translateX(-50%) scaleX(1); }
  50% { transform: translateX(-50%) scaleX(1.08) translateY(-6px); }
}

@keyframes iconBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes buttonShimmer {
  0%, 58% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .ocean-motion span,
  .hero-wave,
  .hero-icons span,
  .primary-btn::after,
  .premium-particles span,
  .premium-cta,
  .compass-ring,
  .compass-center,
  .premium-calculator-showcase::before,
  .calc-visual span {
    animation: none !important;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* Mobile navigation */
.topbar-menu {
  display: contents;
}

.mobile-menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 242, 195, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.topbar.menu-open .mobile-menu-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.menu-open .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
}

.topbar.menu-open .mobile-menu-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    font-size: 0.78rem;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar-menu {
    grid-column: 1 / -1;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: grid-template-rows 0.26s ease, opacity 0.2s ease;
  }

  .topbar.menu-open .topbar-menu {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-menu > * {
    min-height: 0;
  }

  .topnav,
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 12px;
  }

  .topnav a,
  .topbar-actions button {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 46px;
  }

  .topnav a {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .primary-btn {
    grid-column: 1 / -1;
  }

  body.light .mobile-menu-btn,
  body.light .topnav a {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.08);
  }
}

/* Final light theme polish */
body.light {
  --background: linear-gradient(180deg, #f7fbff 0%, #e7f7f8 52%, #f8fafc 100%);
  --card: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 18% 8%, rgba(20, 184, 166, 0.18), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(14, 165, 233, 0.16), transparent 26%),
    var(--background);
}

body.light::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.52), transparent 42%),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.08), transparent 22%);
}

body.light .page-shell {
  color: #0f172a;
}

body.light .topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}

body.light .hero {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(180deg, rgba(207, 250, 254, 0.72), rgba(240, 253, 250, 0.44));
  border-radius: 0 0 32px 32px;
  margin: 0 -24px 36px;
  padding-left: 24px;
  padding-right: 24px;
}

body.light .hero-badge {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(14, 165, 233, 0.24);
  color: #0369a1;
  box-shadow: 0 18px 38px rgba(14, 165, 233, 0.08);
}

body.light .hero-subtitle {
  color: #0f172a;
}

body.light .hero-description {
  color: #475569;
}

body.light .secondary-btn:hover,
body.light .ghost-btn:hover,
body.light .pill-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  color: #0f172a;
}

body.light .stat-icon,
body.light .section-icon {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

body.light .stat-value {
  color: #0f766e;
}

body.light .stat-label,
body.light .tool-card p,
body.light .feature-card p,
body.light .premium-intro p {
  color: #475569;
}

body.light .feature-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 253, 245, 0.78));
}

body.light .tool-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
}

body.light .premium-section::before {
  background:
    radial-gradient(circle at 16% 20%, rgba(245, 158, 11, 0.12), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(20, 184, 166, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(14, 165, 233, 0.08), transparent);
}

body.light .premium-hero-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 158, 11, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.88));
  border-color: rgba(245, 158, 11, 0.26);
}

body.light .premium-price-card {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.86), rgba(236, 253, 245, 0.72));
  border-color: rgba(245, 158, 11, 0.30);
}

body.light .premium-price {
  color: #b45309;
}

body.light .premium-banner,
body.light .premium-card-badge {
  color: #92400e;
  background: rgba(254, 243, 199, 0.86);
  border-color: rgba(245, 158, 11, 0.34);
}

body.light .assistant-panel,
body.light .modal-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.12);
}

body.light .assistant-header,
body.light .assistant-form {
  border-color: rgba(15, 23, 42, 0.10);
}

body.light .assistant-message.bot {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.light .assistant-message.user {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(14, 165, 233, 0.12));
  color: #0f172a;
}

body.light .assistant-close {
  color: #0f172a;
}

body.light .footer {
  border-top-color: rgba(15, 23, 42, 0.10);
}

body.light .toast {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-color: rgba(20, 184, 166, 0.26);
}

@media (max-width: 620px) {
  body.light .hero {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Compact mobile header overlay */
@media (max-width: 760px) {
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 12px;
    border-radius: 0 0 18px 18px;
    background: rgba(4, 11, 22, 0.78);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  }

  body.light .topbar {
    background: rgba(255, 255, 255, 0.82);
  }

  .page-shell {
    padding-top: 0;
  }

  .topbar-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .brand-mark,
  .brand-footer .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand strong {
    font-size: 1rem;
  }

  .brand small {
    display: none;
  }

  .mobile-menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .topbar-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 80;
    border-radius: 18px;
    background: rgba(4, 11, 22, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
  }

  body.light .topbar-menu {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
  }

  .topnav,
  .topbar-actions {
    padding: 12px;
  }

  .topnav {
    padding-bottom: 0;
  }

  .topbar-actions {
    padding-top: 10px;
  }

  .hero {
    min-height: 100svh;
    padding-top: 82px;
  }

  .section,
  .stats {
    scroll-margin-top: 76px;
  }
}

/* Compass touch mobility */
.compass-ring {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.compass-ring:active,
.compass-ring.is-dragging {
  cursor: grabbing;
  transform: translateY(-2px) rotateX(2deg);
}

/* Logged-in account state */
.session-active {
  border-color: rgba(0, 242, 195, 0.45) !important;
  color: var(--accent) !important;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(244, 114, 182, 0.78)) !important;
  box-shadow: 0 14px 34px rgba(239, 68, 68, 0.20) !important;
}
