/* Global reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* ===== Theme Variables ===== */
:root {
  --bg: #060708;
  --card: #0c100e;
  --accent: #00503B;
  --accent-light: #00704f;
  --text: #F5F5F5;
  --muted: #A1A1AA;
  --border: rgba(255, 255, 255, 0.08);
  --border-green: rgba(0, 80, 59, 0.35);
  --glow: rgba(0, 80, 59, 0.25);
  --glow-strong: rgba(0, 80, 59, 0.18);

  --panel-bg: rgba(10, 16, 14, 0.9);
  --feature-card-bg: #0c110e;
  --feature-card-border: rgba(255, 255, 255, 0.07);
  --feature-card-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  --btn-bg: rgba(255, 255, 255, 0.04);
  --btn-bg-hover: rgba(255, 255, 255, 0.07);
  --btn-border-hover: rgba(255, 255, 255, 0.14);
  --appstore-bg: rgba(245, 245, 245, 0.1);
  --appstore-bg-hover: rgba(245, 245, 245, 0.15);
  --appstore-border: rgba(255, 255, 255, 0.18);
  --appstore-border-hover: rgba(255, 255, 255, 0.28);

  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-hover: rgba(255, 255, 255, 0.13);
  --glass-bg-active: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.18);
  --glass-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.38), 0 2px 6px rgba(0, 0, 0, 0.2);

  --legal-text: #C4C4CC;
  --legal-link: #6dcea0;
  --legal-accent: #6dcea0;

  --toggle-track: rgba(255, 255, 255, 0.06);
  --toggle-border: rgba(255, 255, 255, 0.12);
  --toggle-thumb: #eef1ef;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1ef;
  --card: #ffffff;
  --accent: #00503B;
  --accent-light: #00704f;
  --text: #0d1411;
  --muted: #566159;
  --border: rgba(0, 0, 0, 0.1);
  --border-green: rgba(0, 80, 59, 0.28);
  --glow: rgba(0, 80, 59, 0.14);
  --glow-strong: rgba(0, 80, 59, 0.1);

  --panel-bg: rgba(255, 255, 255, 0.96);
  --feature-card-bg: #ffffff;
  --feature-card-border: rgba(0, 0, 0, 0.08);
  --feature-card-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
  --btn-bg: rgba(0, 0, 0, 0.03);
  --btn-bg-hover: rgba(0, 0, 0, 0.06);
  --btn-border-hover: rgba(0, 0, 0, 0.16);
  --appstore-bg: rgba(13, 20, 17, 0.05);
  --appstore-bg-hover: rgba(13, 20, 17, 0.09);
  --appstore-border: rgba(0, 0, 0, 0.16);
  --appstore-border-hover: rgba(0, 0, 0, 0.28);

  --glass-bg: rgba(255, 255, 255, 0.52);
  --glass-bg-hover: rgba(255, 255, 255, 0.72);
  --glass-bg-active: rgba(255, 255, 255, 0.36);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
  --glass-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.06);

  --legal-text: #3b463f;
  --legal-link: #00704f;
  --legal-accent: #00704f;

  --toggle-track: rgba(0, 0, 0, 0.06);
  --toggle-border: rgba(0, 0, 0, 0.12);
  --toggle-thumb: #ffffff;

  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

#root {
  min-height: 100vh;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100;
  display: block;
  padding: 0;
  width: 72px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-track);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
  box-shadow: 0 0 16px var(--glow);
  border-color: var(--border-green);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* Inner box is 70 x 34 (72 x 36 minus the 1px border). */
.theme-toggle__track {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.theme-toggle__icon {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  z-index: 2;
  transition: color 0.3s ease;
}

/* sun center = 9 + 8 = 17px ; moon center = 70 - 9 - 8 = 53px */
.theme-toggle__icon--sun {
  left: 9px;
}

.theme-toggle__icon--moon {
  right: 9px;
}

.theme-toggle[data-state="dark"] .theme-toggle__icon--moon,
.theme-toggle[data-state="light"] .theme-toggle__icon--sun {
  color: var(--accent-light);
}

/* dark: thumb center = 39 + 14 = 53px (on moon)
   light: thumb center = 39 - 36 + 14 = 17px (on sun) */
.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 39px;
  translate: 0 -50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 10px var(--glow);
  transition: transform 0.35s cubic-bezier(0.4, 0.1, 0.2, 1), background 0.35s ease;
}

.theme-toggle[data-state="light"] .theme-toggle__thumb {
  transform: translateX(-36px);
}

@media (max-width: 600px) {
  .theme-toggle {
    top: 14px;
    right: 14px;
  }
}
