/* ============================================
   WriterIO.Space Pre-Launch Landing Page
   Design System matched from main web app
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800&display=swap');

/* CSS Variables - Matched from globals.css */
:root {
  --primary: #FACC15;
  --primary-rgb: 250, 204, 21;
  --accent: #16A34A;
  --accent-rgb: 22, 163, 74;
  --background: hsl(35, 30%, 96%);
  --background-alt: hsl(35, 30%, 93%);
  --foreground: #0F172A;
  --card-bg: hsl(35, 30%, 98%);
  --muted-fg: hsl(215, 25%, 27%);
  --muted-bg: hsl(210, 40%, 96.1%);
  --border: hsl(214.3, 31.8%, 91.4%);
  --destructive: #EF4444;
  --radius: 0.5rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

.dark {
  --background: hsl(222, 15%, 14%);
  --background-alt: hsl(222, 15%, 11%);
  --foreground: hsl(210, 40%, 98%);
  --card-bg: hsl(222, 15%, 16%);
  --muted-fg: hsl(215, 20.2%, 75%);
  --muted-bg: hsl(217.2, 32.6%, 17.5%);
  --border: hsl(217.2, 32.6%, 17.5%);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  background-image: radial-gradient(rgba(15, 23, 42, 0.15) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

.dark body {
  background-image: radial-gradient(rgba(210, 220, 240, 0.08) 1.5px, transparent 1.5px);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  letter-spacing: -0.025em;
  color: var(--foreground);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-sans);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 241, 234, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.dark .navbar {
  background: rgba(30, 33, 43, 0.85);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.5rem;
  font-family: var(--font-sans);
  letter-spacing: -0.025em;
}

.logo span.highlight {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--foreground);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: var(--primary);
  color: var(--foreground);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius);
  border: none;
  transition: all 0.2s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
}

.dark-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: 38px;
  height: 38px;
}

.dark-toggle:hover {
  color: var(--foreground);
  border-color: var(--muted-fg);
}

.mobile-nav-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.mobile-dark-toggle {
  display: none;
}

.mobile-nav-right {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.hamburger {
  display: none !important;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted-fg);
  padding: 0.5rem 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu-nav a {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--foreground);
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.mobile-menu-nav a:hover {
  background: var(--muted);
  color: var(--primary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: #0F172A;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.45);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.hero-version {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--muted-bg);
  color: var(--muted-fg);
  font-size: 0.75rem;
  border-radius: 9999px;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

.hero h1 .accent-text {
  color: var(--primary);
}

.hero h1 .green-text {
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--muted-fg);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  font-weight: 500;
}

.trust-item .icon-check {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* ============================================
   Section Shared
   ============================================ */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: rgba(var(--primary-rgb), 0.03);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-header h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--muted-fg);
  line-height: 1.7;
}

/* ============================================
   Problem Section
   ============================================ */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.problem-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.2s;
}

.problem-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.problem-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
}

.problem-card h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.problem-card p {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  line-height: 1.6;
}

/* ============================================
   Features Grid
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.feature-card:hover .feature-icon {
  background: rgba(var(--primary-rgb), 0.2);
}

.feature-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-core {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.tag-plus {
  background: rgba(var(--primary-rgb), 0.15);
  color: #b8960f;
}

.dark .tag-plus {
  color: var(--primary);
}

.tag-plusplus {
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
}

.dark .tag-plusplus {
  color: #c084fc;
}

.tag-new {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  transition: background 0.25s;
}

.feature-card h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  line-height: 1.6;
}

/* ============================================
   v2.0 Teaser Section
   ============================================ */
.v2-teaser {
  margin-top: 3rem;
  padding: 3rem;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  border: 2px dashed rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius);
  text-align: center;
}

.v2-teaser h3 {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.v2-teaser>p {
  font-size: 1.0625rem;
  color: var(--muted-fg);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, #fbbf24 100%);
  color: #0F172A;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulse-glow 2s ease-in-out infinite;
}

.v2-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: left;
}

.v2-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
  transition: all 0.2s;
}

.v2-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.v2-feature svg {
  flex-shrink: 0;
  color: var(--accent);
}

.v2-note {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  font-style: italic;
  margin-bottom: 0;
}

/* ============================================
   How It Works
   ============================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--border);
}

.step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #0F172A;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
}

.step-icon-wrap {
  padding: 1rem;
  background: var(--muted-bg);
  border-radius: 12px;
  margin-bottom: 1rem;
  display: inline-flex;
}

.step-icon-wrap svg {
  color: var(--primary);
}

.step h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.875rem;
  color: var(--muted-fg);
}

/* ============================================
   Who It's For
   ============================================ */
.personas-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.persona-card {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.persona-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--primary);
}

.persona-card svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin: 0 auto 0.75rem;
}

.persona-card h3 {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.persona-card p {
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

/* ============================================
   Beta CTA Section
   ============================================ */
.beta-cta {
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.beta-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06) 0%, rgba(var(--accent-rgb), 0.04) 100%);
  pointer-events: none;
}

.beta-box {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 2px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 16px;
  padding: 3.5rem 2.5rem;
  box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.08);
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.beta-box h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}

.beta-box p {
  font-size: 1.0625rem;
  color: var(--muted-fg);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.beta-perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.perk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
}

.perk svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--muted-fg);
  text-align: center;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  opacity: 0.7;
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(var(--primary-rgb), 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ============================================
   Performance Optimizations
   ============================================ */
.feature-card,
.problem-card,
.persona-card,
.step {
  will-change: transform;
  contain: layout style paint;
}

.fade-in {
  will-change: opacity, transform;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet and below (768px) - Show mobile navigation */
@media (max-width: 768px) {

  /* Hide desktop navigation */
  .nav-links,
  .nav-cta,
  .dark-toggle {
    display: none;
  }

  /* Show hamburger menu */
  .hamburger {
    display: flex !important;
  }

  /* Mobile menu styling */
  .mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    display: none !important;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .mobile-menu.open {
    display: flex !important;
  }

  /* Show mobile navigation elements */
  .mobile-nav-right {
    display: flex;
  }

  .mobile-dark-toggle {
    display: flex;
  }

  /* Mobile menu navigation links */
  .mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .mobile-menu-nav a {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--foreground);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
  }

  .mobile-menu-nav a:hover {
    background: var(--muted);
    color: var(--primary);
  }

  /* Content spacing adjustments */
  .hero {
    padding: 4rem 0 3rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  /* Grid adjustments */
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid::before {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .personas-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* CTA and spacing */
  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;

  }

  .beta-box {
    padding: 2.5rem 1.5rem;
  }

  .beta-perks {
    flex-direction: column;
    align-items: center;
  }
}

/* Small tablets and large phones (640px) */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  .hero-sub {
    font-size: 1rem;
    line-height: 1.6;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .v2-teaser {
    padding: 2rem 1.5rem;
  }
}

/* Mobile devices (480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .personas-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .beta-box {
    padding: 2rem 1.25rem;
  }
}

/* Extra small devices (375px) */
@media (max-width: 375px) {
  .container {
    padding: 0 1rem;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .personas-grid {
    grid-template-columns: 1fr;
  }

  .beta-box {
    padding: 1.75rem 1rem;
  }
}

/* Responsive button text */
.btn-text-mobile {
  display: none;
}

@media (max-width: 480px) {
  .btn-text-desktop {
    display: none;
  }

  .btn-text-mobile {
    display: inline;
  }
}