/* CSS Reset & Variables */
:root {
  /* Light theme (default) */
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --surface-hover: #f1f5f9;
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --nav-bg: rgba(248, 250, 252, 0.9);
  --h1-from: #1e293b;
  --h1-to: #6366f1;
  --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);

  --font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --container-max: 1200px;
  --transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #0b0f19;
    --surface-color: #1a2235;
    --surface-hover: #252f48;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --nav-bg: rgba(11, 15, 25, 0.8);
    --h1-from: #ffffff;
    --h1-to: #a5b4fc;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
}

/* JS-driven dark mode (overrides media query) */
[data-theme="dark"] {
  --bg-color: #0b0f19;
  --surface-color: #1a2235;
  --surface-hover: #252f48;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --nav-bg: rgba(11, 15, 25, 0.8);
  --h1-from: #ffffff;
  --h1-to: #a5b4fc;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  filter: brightness(1.2);
}

img,
iframe {
  max-width: 100%;
  border-radius: 12px;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--h1-from), var(--h1-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 767px) {
  .container {
    padding: 0 1.25rem;
  }
}

.section {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

@media (max-width: 767px) {
  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

.grid {
  display: grid;
  gap: 3rem;
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  -webkit-text-fill-color: initial;
  background: none;
}

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a:not(.btn) {
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links a:not(.btn):hover {
  color: var(--text-main);
}

/* Ensure primary button in nav always shows white text */
.nav-links .btn-primary {
  color: #fff;
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background-color: var(--surface-hover);
  border-color: var(--primary-color);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .icon-sun {
  display: none;
}

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

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

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

/* Mobile menu theme toggle */
.mobile-theme-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1.25rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

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

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

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

.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 250px;
  height: 100vh;
  background-color: var(--surface-color);
  z-index: 100;
  padding: 2rem;
  transition: right 0.3s ease;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu a {
  font-size: 1.25rem;
  color: var(--text-main);
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 90;
  display: none;
  backdrop-filter: blur(4px);
}

.mobile-overlay.active {
  display: block;
}

.close-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  align-self: flex-end;
  cursor: pointer;
}

/* Sections */
.hero {
  padding-top: 8rem;
  padding-bottom: 4rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.video-wrapper {
  position: relative;
  padding-bottom: 100%;
  /* 1:1 aspect ratio - matches the square Vimeo videos */
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

@media (min-width: 600px) {

  /* On wider screens, cap at a reasonable square size */
  .video-wrapper {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    /* Recalculate padding for capped width - use a fixed height instead */
    padding-bottom: min(100%, 500px);
  }
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
}

.feature-img {
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Pricing */
.pricing-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pricing-card.highlight {
  border-color: var(--primary-color);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.pricing-card.highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--primary-color);
}

.pricing-price {
  font-size: 3rem;
  font-weight: 700;
  margin: 1.5rem 0;
  color: var(--text-main);
}

.pricing-features {
  list-style: none;
  margin: 2rem 0;
  text-align: left;
}

.pricing-features li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pricing-features li svg {
  color: var(--primary-color);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  background-color: var(--surface-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links h4 {
  font-size: 1.125rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
}

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