/* =====================================================
   Math OCR — Landing Page Styles
   ===================================================== */

/* CSS Variables (Design Tokens) */
:root {
  /* Colors */
  --color-primary: #4f6bed;
  --color-primary-light: rgba(79, 107, 237, 0.1);
  --color-primary-dark: #3d56c9;
  --color-accent: #6b7fed;
  
  --color-background: #f8f9fc;
  --color-foreground: #1a1f36;
  --color-card: #ffffff;
  --color-muted: #f1f3f9;
  --color-muted-foreground: #6b7280;
  --color-border: #e5e7f0;
  
  --color-destructive: #ef4444;
  --color-destructive-light: rgba(239, 68, 68, 0.1);
  
  --color-yellow: #f59e0b;
  --color-yellow-light: rgba(245, 158, 11, 0.1);
  --color-blue: #3b82f6;
  --color-blue-light: rgba(59, 130, 246, 0.1);
  --color-green: #22c55e;
  --color-green-light: rgba(34, 197, 94, 0.1);
  --color-emerald: #10b981;
  --color-emerald-light: rgba(16, 185, 129, 0.1);
  --color-purple: #a855f7;
  --color-purple-light: rgba(168, 85, 247, 0.1);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --container-max: 1200px;
  --container-narrow: 800px;
  --section-padding: 3.5rem;
  --section-padding-lg: 4.75rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 10px 40px -10px rgba(79, 107, 237, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-foreground);
  background-color: var(--color-background);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* =====================================================
   Typography
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-foreground);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
}

p {
  color: var(--color-muted-foreground);
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

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

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

.container.narrow {
  max-width: var(--container-narrow);
}

.two-col {
  display: grid;
  gap: 3rem;
}

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

/* =====================================================
   Buttons
   ===================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.button-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.button-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.button-secondary {
  background-color: transparent;
  color: var(--color-foreground);
  border-color: var(--color-border);
}

.button-secondary:hover {
  background-color: var(--color-muted);
  border-color: var(--color-muted-foreground);
}

.button-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* =====================================================
   Header
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--color-border);
  background-color: rgba(248, 249, 252, 0.95);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
}

.brand-name {
  font-weight: 600;
  color: var(--color-foreground);
}

.header-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
}

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

.header-nav a:not(.button) {
  color: var(--color-muted-foreground);
  transition: color var(--transition-fast);
}

.header-nav a:not(.button):hover {
  color: var(--color-foreground);
}

.header-cta {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

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

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-foreground);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* Mobile Menu Open State */
@media (max-width: 767px) {
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    display: none;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-nav a:not(.button) {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .header-nav .button {
    margin-top: 0.5rem;
    width: 100%;
  }
}

/* =====================================================
   Section Base
   ===================================================== */
.section {
  padding: var(--section-padding) 0;
}

@media (min-width: 1024px) {
  .section {
    padding: var(--section-padding-lg) 0;
  }
}

.section-head {
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-head p {
  font-size: 1.125rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.section h2 {
  margin-bottom: 1rem;
}

/* =====================================================
   Hero Section
   ===================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.75rem 0 3rem;
}

@media (min-width: 1024px) {
  .hero {
    padding: 5.5rem 0 4.5rem;
  }
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.hero-glow-left {
  top: 0;
  left: 15%;
  width: 24rem;
  height: 24rem;
  background-color: var(--color-primary-light);
}

.hero-glow-right {
  bottom: 0;
  right: 15%;
  width: 20rem;
  height: 20rem;
  background-color: rgba(107, 127, 237, 0.05);
}

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

.hero-copy {
  max-width: 56rem;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
}

.eyebrow-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero h1 span {
  color: var(--color-primary);
}

.hero-lead {
  font-size: 1.125rem;
  max-width: 40rem;
  margin: 0 auto 0.75rem;
}

@media (min-width: 768px) {
  .hero-lead {
    font-size: 1.25rem;
  }
}

.hero-note {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
  }
}

.hero-actions .button {
  padding: 1rem 2rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

.badge-chip::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--color-green);
  border-radius: 50%;
}

/* Hero Demo */
.hero-demo {
  margin-top: 2.5rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.window-frame {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 80px -20px rgba(79, 107, 237, 0.15);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}

.window-dots {
  display: flex;
  gap: 0.375rem;
}

.window-dots span {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.window-dots span:nth-child(1) { background-color: #f87171; }
.window-dots span:nth-child(2) { background-color: #fbbf24; }
.window-dots span:nth-child(3) { background-color: #4ade80; }

.window-title {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  margin-left: 0.5rem;
}

.window-body {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .window-body {
    padding: 2.5rem;
  }
}

.window-subtitle {
  text-align: center;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.demo-grid {
  display: grid;
  gap: 2rem;
}

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

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

.demo-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted-foreground);
}

.demo-image-frame {
  aspect-ratio: 4/3;
  background-color: var(--color-muted);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.demo-image-frame img {
  max-height: 100%;
  border-radius: var(--radius-sm);
}

.demo-result-frame {
  aspect-ratio: 4/3;
  background-color: rgba(241, 243, 249, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow: auto;
}

.demo-result-title {
  color: var(--color-foreground);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.demo-result-list {
  list-style: decimal;
  list-style-position: inside;
  color: var(--color-muted-foreground);
}

.demo-result-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.demo-math {
  color: var(--color-primary);
  font-weight: 500;
  display: inline;
}

.demo-result-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
  font-size: 0.6875rem;
}

/* =====================================================
   Problem Section
   ===================================================== */
.section-problem {
  background-color: var(--color-card);
}

.section-problem .container.narrow {
  text-align: center;
  margin-bottom: 3rem;
}

.problem-stats {
  display: grid;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

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

.problem-card {
  padding: 1.5rem;
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: all var(--transition-slow);
}

.problem-card:hover {
  border-color: var(--color-destructive);
  box-shadow: var(--shadow-lg);
}

.problem-card strong {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  color: var(--color-foreground);
  margin-bottom: 0.5rem;
}

.problem-card strong::before {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--color-destructive-light);
  border: 2px solid var(--color-destructive);
  border-radius: 50%;
}

.problem-card span {
  display: block;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  line-height: 1.5;
}

/* =====================================================
   Solution Section
   ===================================================== */
.section-solution h2 {
  margin-bottom: 1rem;
}

.section-solution p {
  font-size: 1.125rem;
}

.steps-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.step-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
}

.step-item:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.step-item strong {
  display: block;
  color: var(--color-foreground);
  margin-bottom: 0.25rem;
}

.step-item p {
  font-size: 0.875rem;
  margin: 0;
}

/* =====================================================
   Benefits Section
   ===================================================== */
.section-benefits {
  background-color: var(--color-card);
}

.feature-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
}

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

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

.feature-card {
  padding: 1.5rem;
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all var(--transition-slow);
}

.feature-card:hover {
  border-color: rgba(79, 107, 237, 0.3);
  box-shadow: var(--shadow-lg), 0 0 30px -10px rgba(79, 107, 237, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-xl);
  transition: transform var(--transition-base);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.feature-card:nth-child(1) .feature-icon {
  background-color: var(--color-yellow-light);
  color: var(--color-yellow);
}

.feature-card:nth-child(2) .feature-icon {
  background-color: var(--color-blue-light);
  color: var(--color-blue);
}

.feature-card:nth-child(3) .feature-icon {
  background-color: var(--color-green-light);
  color: var(--color-green);
}

.feature-card:nth-child(4) .feature-icon {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =====================================================
   Formats Section
   ===================================================== */
.format-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

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

.format-card {
  padding: 1.5rem;
  border: 2px solid;
  border-radius: var(--radius-xl);
  transition: all var(--transition-slow);
}

.format-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.format-card:nth-child(1) {
  background-color: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
}

.format-card:nth-child(2) {
  background-color: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}

.format-card:nth-child(3) {
  background-color: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.2);
}

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

.format-card p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =====================================================
   Audience Section
   ===================================================== */
.section-audience {
  background-color: var(--color-card);
}

.audience-grid {
  display: grid;
  gap: 2rem;
  max-width: 64rem;
  margin: 0 auto;
}

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

.audience-card {
  padding: 1.5rem;
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: all var(--transition-slow);
}

.audience-card:hover {
  border-color: rgba(79, 107, 237, 0.3);
  box-shadow: var(--shadow-xl), 0 0 40px -10px rgba(79, 107, 237, 0.1);
}

.audience-card h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.audience-card h3::before {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.audience-card p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =====================================================
   Result Section
   ===================================================== */
.section-result {
  text-align: center;
}

.result-summary {
  font-size: 1.125rem;
  max-width: 40rem;
  margin: 0 auto;
}

/* =====================================================
   Important Section
   ===================================================== */
.section-important .two-col {
  gap: 1.5rem;
}

.notice-card {
  padding: 1.5rem;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.notice-card .section-tag {
  margin-bottom: 1rem;
}

.notice-card h3 {
  margin-bottom: 0.5rem;
}

.notice-card p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =====================================================
   CTA Section
   ===================================================== */
.section-cta {
  padding: var(--section-padding) 0;
}

.cta-panel {
  position: relative;
  text-align: center;
  padding: 2rem;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

@media (min-width: 768px) {
  .cta-panel {
    padding: 3rem;
  }
}

.cta-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(79, 107, 237, 0.03);
  z-index: -1;
}

.cta-panel::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 16rem;
  height: 16rem;
  background-color: var(--color-primary-light);
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
}

.cta-panel .section-tag {
  margin-bottom: 1rem;
}

.cta-panel h2 {
  margin-bottom: 1rem;
}

.cta-panel > p {
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.cta-panel .button {
  padding: 1rem 2rem;
}

/* =====================================================
   Footer
   ===================================================== */
.site-footer {
  padding: 2.25rem 0;
  background-color: var(--color-card);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand {
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 0.5rem;
}

.footer-text {
  font-size: 0.875rem;
  max-width: 20rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--color-muted-foreground);
  transition: color var(--transition-fast);
}

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

/* =====================================================
   Utilities
   ===================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
