@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Light Theme Default */
  --bg-color: #ffffff;
  --surface-color: #f8fafc;
  --surface-hover: #f1f5f9;
  --text-main: #000000;
  --text-dim: #475569;
  --primary: #ff0000; /* Red from the logo */
  --primary-hover: #cc0000;
  --primary-glow: rgba(255, 0, 0, 0.15);
  --secondary: #000212; /* Very dark navy / Black */
  --border-color: #e2e8f0;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #000000;
  --surface-color: #0a0a0a;
  --surface-hover: #171717;
  --text-main: #ffffff;
  --text-dim: #a1a1aa;
  --primary: #ff0000;
  --primary-hover: #ff3333;
  --primary-glow: rgba(255, 0, 0, 0.4);
  --secondary: #ffffff;
  --border-color: #27272a;
  --glass-bg: rgba(0, 0, 0, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(80px + 0.75rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .animate-up {
    animation: none;
    opacity: 1;
  }
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-left));
  padding-right: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-right));
}

/* Typography Enhancements */
h1, h2, h3, h4, .logo-text {
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
}

/* Base Components */
.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px var(--primary-glow);
}

@media (min-width: 480px) {
  .btn-primary {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 480px) {
  .btn-outline {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.btn-outline:hover {
  border-color: var(--text-main);
  background: var(--surface-hover);
}

/* Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: background 0.3s ease;
}

.nav-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 80px;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.nav-toggle {
  order: 2;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}

.nav-toggle:hover {
  background: var(--surface-hover);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.logo-display {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-icon path, .logo-icon circle {
  stroke: var(--text-main);
}
.logo-icon path.pin {
  stroke: none;
  fill: var(--primary);
}

.logo-text {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-text .geo { color: var(--text-main); }
.logo-text .tailor { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  order: 3;
  flex: 0 1 auto;
}

.nav-links a.nav-item {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-links a.nav-item:hover,
.nav-links a.nav-item.active {
  color: var(--text-main);
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

/* Background grid for aesthetic */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: 
    linear-gradient(to right, var(--border-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  z-index: 0;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  z-index: 1;
  position: relative;
}

.hero h1 {
  font-size: clamp(2.125rem, 5vw + 1rem, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
}

.highlight-red {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero p {
  font-size: clamp(1rem, 1.5vw + 0.85rem, 1.3rem);
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  font-weight: 400;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

/* How It Works Section */
.py-section {
  padding: clamp(3.5rem, 8vw, 8rem) 0;
}
.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: clamp(1rem, 1vw + 0.9rem, 1.15rem);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  max-width: 600px;
  margin-inline: auto;
  padding: 0 0.25rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  position: relative;
}

.step-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 40px var(--primary-glow);
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.feature-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: left;
}

.feature-card:hover { border-color: var(--text-main); }
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-hover);
  color: var(--primary);
}

.feature-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.feature-card p { color: var(--text-dim); }

/* Documentation Snippet Section */
.doc-section {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.doc-content {
  min-width: 0;
}

.doc-content h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  margin-bottom: 1.5rem;
}
.doc-content p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  font-size: clamp(1rem, 0.5vw + 0.95rem, 1.1rem);
}

.code-mockup {
  background: #1e1e1e;
  border-radius: 12px;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  border: 1px solid #333;
  max-width: 100%;
  min-width: 0;
}
.code-mockup-header {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}
.code-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }
.code-text {
  color: #d4d4d4;
  font-family: monospace;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  max-width: 100%;
}
.code-text .keyword { color: #569cd6; }
.code-text .string { color: #ce9178; }
.code-text .function { color: #dcdcaa; }
.code-text .comment { color: #6a9955; font-style: italic; }

/* FAQ Section */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  cursor: pointer;
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 600;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-dim);
  margin-top: 0;
}
.faq-item.active .faq-answer {
  max-height: 500px;
  margin-top: 1rem;
}
.faq-icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
  color: var(--primary);
}
.faq-item.active .faq-icon { transform: rotate(45deg); }

/* Pricing Section */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 3rem 2rem;
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 40px var(--primary-glow);
}

.pricing-card.popular {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.pricing-badge {
  position: absolute;
  top: 1rem;
  right: -2.5rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 3rem;
  transform: rotate(45deg);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.pricing-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.pricing-price span {
  font-size: 1.25rem;
  color: var(--text-dim);
  font-weight: 400;
}

.pricing-desc {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

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

.pricing-features li {
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-dim);
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.pricing-card .btn-primary, .pricing-card .btn-outline {
  width: 100%;
  justify-content: center;
}

/* Privacy Policy Layout */
.page-header {
  padding: 12rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(ellipse at top, var(--surface-color) 0%, transparent 70%);
}
.page-header h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.5rem);
  margin-bottom: 1rem;
}
.content-section { padding: 4rem 0; max-width: 800px; margin: 0 auto; }
.content-section h2 { font-size: 2rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-main); }
.content-section p, .content-section ul { margin-bottom: 1.5rem; color: var(--text-dim); font-size: 1.1rem; }
.content-section a { color: var(--primary); text-decoration: none; }

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

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 0;
  transition: color 0.3s ease;
  font-weight: 500;
}

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

.copyright {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-up { opacity: 0; animation: fadeInUp 0.8s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* Responsive */
@media (min-width: 901px) {
  .nav-container {
    flex-wrap: nowrap;
  }

  .nav-links {
    margin-left: auto;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero h1 {
    letter-spacing: -0.5px;
  }

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

  .doc-grid {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2rem);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: 1 1 100%;
    gap: 0;
    padding: 0;
    margin: 0;
  }

  .nav-links.is-open {
    display: flex;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--glass-border);
  }

  .nav-links a.nav-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a.nav-item:last-of-type {
    border-bottom: none;
  }

  .nav-links .theme-toggle {
    align-self: flex-start;
    margin-top: 0.5rem;
  }

  .nav-links .btn-primary {
    margin-top: 0.75rem;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    /* Extra space below fixed nav + notches on phones */
    padding-top: calc(80px + env(safe-area-inset-top, 0px) + 1.25rem);
    padding-bottom: clamp(3rem, 10vw, 5rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-outline {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

  .faq-question {
    font-size: clamp(1rem, 2vw + 0.85rem, 1.25rem);
    gap: 1rem;
  }

  .page-header {
    padding-top: clamp(7rem, 18vw, 12rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: clamp(1.35rem, 5vw, 1.7rem);
  }

  .pricing-card {
    padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem);
  }

  .pricing-badge {
    right: -2rem;
    font-size: 0.72rem;
  }
}
