@import 'utilities.css';

:root {
  /* Color Palette - Graphite / Charcoal / Trust */
  --bg-body: #121212;
  /* Deep Graphite */
  --bg-surface: rgba(255, 255, 255, 0.05);
  /* Subtle Surface */
  --bg-surface-hover: rgba(255, 255, 255, 0.08);

  --primary: #60A5FA;
  /* Muted Blue 400 */
  --primary-glow: rgba(96, 165, 250, 0.4);
  --secondary: #A78BFA;
  /* Muted Violet 400 */

  --text-main: #F1F5F9;
  /* Slate 100 */
  --text-muted: #94A3B8;
  /* Slate 400 */
  --text-accent: #93C5FD;
  /* Blue 300 */

  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(96, 165, 250, 0.3);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;

  --container-width: 1200px;
  --nav-height: 80px;

  /* Component Backgrounds */
  --bg-header: rgba(18, 18, 18, 0.8);
  --bg-input: rgba(11, 17, 33, 0.8);
  --bg-pre: #0F1623;
  --bg-code: rgba(255, 255, 255, 0.1);

  /* Button Variables */
  --btn-secondary-bg: rgba(255, 255, 255, 0.05);
  --btn-secondary-color: #fff;
  --btn-hover-bg: rgba(255, 255, 255, 0.1);

  /* Theme Transition */
  --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] {
  --bg-body: #F8FAFC;
  /* Slate 50 */
  --bg-surface: rgba(255, 255, 255, 0.7);
  --bg-surface-hover: rgba(255, 255, 255, 0.9);

  --primary: #2563EB;
  /* Blue 600 */
  --primary-glow: rgba(37, 99, 235, 0.3);
  --secondary: #7C3AED;
  /* Violet 600 */

  --text-main: #0F172A;
  /* Slate 900 */
  --text-muted: #475569;
  /* Slate 600 */
  --text-accent: #2563EB;
  /* Blue 600 */

  --border-color: rgba(148, 163, 184, 0.2);
  --border-hover: rgba(37, 99, 235, 0.2);

  /* Component Overrides for Light Mode */
  --bg-header: rgba(255, 255, 255, 0.8);
  --bg-input: #ffffff;
  --bg-pre: #F1F5F9;
  --bg-code: rgba(0, 0, 0, 0.05);

  /* Button Overrides */
  --btn-secondary-bg: rgba(0, 0, 0, 0.05);
  /* Light gray for visibility */
  --btn-secondary-color: #2563EB;
  /* Hardcoded Primary Blue */
  --btn-hover-bg: rgba(0, 0, 0, 0.1);
  /* Darker gray hover */
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  /* Subtle mesh gradient background */
  background-image:
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: var(--transition-theme);
}

html {
  scroll-padding-top: var(--nav-height);
  scroll-behavior: smooth;
}

/* Fix Nav Toggle on Desktop */
.nav__toggle {
  display: none;
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 1rem;
  padding: 8px;
}

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

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hide/Show Icons based on theme */
[data-theme="dark"] .icon-sun {
  display: block;
}

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

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* Default (if no attribute) matches dark */
.icon-sun {
  display: block;
}

.icon-moon {
  display: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* ... existing styles ... */

.plan-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1rem 0 0.5rem;
}

/* ... existing styles ... */

.card h3 {
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

/* ... existing styles ... */

.comparison-table th {
  color: var(--text-main);
  font-weight: 600;
  background: var(--bg-surface);
}

/* ... existing styles ... */

.footer h3 {
  color: #fff;
}

h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  background: linear-gradient(to right, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

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

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary);
}

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

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

/* Site Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  /* Semi-transparent background */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

/* ... existing styles ... */

pre {
  background: var(--bg-pre);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  /* Changed from fixed color to adapt */
  font-family: var(--font-mono);
  font-size: 0.9em;
  margin: 1.5rem 0;
}

code {
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--primary);
  /* Changed to primary for better readability in both */
}

/* ... existing styles ... */

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s;
}

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

.nav__brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

/* Hero Section */
.hero {
  padding: 6rem 0;
  /* Reduced top padding since nav is now separate */
  position: relative;
  overflow: hidden;
}

/* Hero Variants */
.hero__content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 50ch;
  margin-bottom: 2.5rem;
}

.hero__cta {
  display: flex;
  gap: 1rem;
}

/* Hero Variants */
.hero--centered .hero__content {
  grid-template-columns: 1fr;
  text-align: center;
  gap: 3rem;
  justify-items: center;
}

.hero--centered .lead {
  margin-left: auto;
  margin-right: auto;
}

.hero--centered .hero__cta {
  justify-content: center;
}

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

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Visual Placeholder Animation */
.hero__visual {
  position: relative;
}

.hero__visual img {
  filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.2));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 4px 20px -5px var(--primary-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px var(--primary-glow);
}

.btn--secondary,
.btn--ghost {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn--secondary:hover,
.btn--ghost:hover {
  background: var(--btn-hover-bg);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Features Grid */
.features,
.about,
.waitlist {
  padding: 6rem 0;
  border-top: 1px solid var(--border-color);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.card::before {
  /* Glow effect on top border */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

/* About Section */
.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.checklist li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  font-weight: 500;
}

.checklist li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 800;
}

/* Docs Styling */
.docs-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 4rem;
}

.docs-nav {
  position: sticky;
  top: 2rem;
  height: fit-content;
  border-right: 1px solid var(--border-color);
  padding-right: 2rem;
}

.docs-nav a {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  /* default */
  padding-left: 1rem;
  margin-left: -1rem;
  /* Adjust alignment to left */
}

/* Active or hover state for doc links */
.docs-nav a:hover,
.docs-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

.docs-content {
  min-width: 0;
  /* Preven overflow */
}

.docs-content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.docs-content h2,
.docs-content h3 {
  margin-top: 2rem;
  color: var(--text-main);
}

pre {
  background: var(--bg-pre);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9em;
  margin: 1.5rem 0;
}

code {
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--primary);
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Waitlist Form */
.waitlist__form {
  background: var(--bg-surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.form-field {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-footer {
  margin-top: 2rem;
}

/* Footer */
.footer {
  padding: 4rem 0;
  background: #080C17;
  border-top: 1px solid var(--border-color);
}

.footer__layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer__brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer ul li {
  margin-bottom: 0.75rem;
}

.footer__copyright {
  grid-column: 1 / -1;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.875rem;
  color: #94A3B8;
  /* Force slate-400 */
}

.footer p,
.footer a,
.footer li {
  color: #94A3B8;
  /* Force slate-400 */
}

.footer a:hover {
  color: #fff;
}

/* Animations - Reveal on Scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

/* Wide viewport — expand container on very large screens */
@media (min-width: 1440px) {
  :root {
    --container-width: 1360px;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

  .hero__content,
  .about__content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero__visual {
    order: -1;
  }

  .nav__toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .nav__links {
    display: none;
    position: fixed;
    /* Changed from absolute to fixed to escape hero overflow */
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    /* Increased z-index */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .nav__links.is-open {
    display: flex;
    animation: slideDown 0.3s ease-out forwards;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .docs-container {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    display: none;
    /* Hide sidebar on mobile for simplicity */
  }
}

/* Narrow phones — tighten horizontal padding */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

/* ============================================================
   DOCS NEXT/PREV NAVIGATION
   ============================================================ */
.docs-next-prev {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
}

.docs-next-prev__prev,
.docs-next-prev__next {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.docs-next-prev__prev:hover,
.docs-next-prev__next:hover {
  color: var(--primary);
  border-color: var(--border-hover);
}

.docs-next-prev span.docs-next-prev__prev,
.docs-next-prev span.docs-next-prev__next {
  visibility: hidden;
  pointer-events: none;
}
