/* ============================================
   Neuraknow — Website Stylesheet
   Design System: ui-design.md
   ============================================ */

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

/* --- CSS Custom Properties (Light) --- */
:root {
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --divider: #E5E7EB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-soft: #EFF6FF;
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
  --neutral: #94A3B8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
}

/* --- Dark Mode (System) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220;
    --surface: #111827;
    --surface-subtle: #1E293B;
    --divider: #374151;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --primary: #60A5FA;
    --primary-hover: #93C5FD;
    --primary-soft: #1E3A5F;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* --- Dark Mode (Manual Override) --- */
[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111827;
  --surface-subtle: #1E293B;
  --divider: #374151;
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --primary: #60A5FA;
  --primary-hover: #93C5FD;
  --primary-soft: #1E3A5F;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Base Styles --- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* --- Typography --- */
.display {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.15;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1, .h1 {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}

h2, .h2 {
  font-size: 24px;
  line-height: 1.33;
  font-weight: 700;
  color: var(--text-primary);
}

h3, .h3 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.caption {
  font-size: 13px;
  line-height: 1.38;
  color: var(--text-tertiary);
}

.micro {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-tertiary);
}

/* --- Layout --- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

section {
  padding: clamp(48px, 8vw, 96px) 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
}

.header-logo img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: var(--text-primary);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px;
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-nav {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  padding: 16px 20px;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--divider);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover {
  color: var(--text-primary);
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 8vw, 96px);
}

.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  margin: 0 auto 32px;
  box-shadow: var(--shadow-md);
}

.hero .display {
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  max-width: 480px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-trust {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--divider);
}

.btn-secondary:hover {
  border-color: var(--text-tertiary);
}

.btn-subtle {
  background: transparent;
  color: var(--text-secondary);
  height: auto;
  padding: 8px 16px;
  font-weight: 500;
}

.btn-subtle:hover {
  color: var(--primary);
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* --- How It Works --- */
.how-it-works {
  background: var(--surface-subtle);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header p {
  margin-top: 8px;
  font-size: 17px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  text-align: center;
  padding: 32px 24px;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 22px;
}

.step-card h3 {
  margin-bottom: 8px;
}

.step-card p {
  font-size: 15px;
}

/* --- Features --- */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.feature-item h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 15px;
}

/* --- Memory States Visual --- */
.memory-states {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.memory-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.memory-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.memory-dot.new { background: #94A3B8; }
.memory-dot.fragile { background: #F59E0B; }
.memory-dot.stable { background: #3B82F6; }
.memory-dot.strong { background: #16A34A; }

/* --- Privacy Section --- */
.privacy-section {
  background: var(--surface-subtle);
}

.privacy-content {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.privacy-content h2 {
  margin-bottom: 16px;
}

.privacy-content > p {
  margin-bottom: 32px;
  font-size: 17px;
}

.privacy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.badge svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* --- Pricing --- */
.pricing {
  text-align: center;
}

.pricing h2 {
  margin-bottom: 12px;
}

.pricing > p {
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 17px;
}

/* --- CTA --- */
.cta {
  text-align: center;
  border-top: 1px solid var(--divider);
}

.cta h2 {
  margin-bottom: 8px;
}

.cta > p {
  margin-bottom: 32px;
  font-size: 17px;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cta .caption {
  display: block;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 16px;
}

.footer-logo-link img {
  border-radius: var(--radius-sm);
  opacity: 0.7;
}

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.footer-nav a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-bottom a {
  color: var(--text-tertiary);
}

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

/* --- Legal Pages (Privacy & Terms) --- */
.legal-page {
  padding: clamp(48px, 6vw, 80px) 0;
}

.legal-page h1 {
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal-page p {
  margin-bottom: 16px;
}

.legal-page ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-page li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.legal-page a {
  color: var(--primary);
}

.legal-contact {
  margin-top: 40px;
  padding: 24px;
  background: var(--surface-subtle);
  border-radius: var(--radius-lg);
}

.legal-contact p {
  margin-bottom: 0;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .header-nav {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

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

  .hero .display {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .feature-item {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

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

  .privacy-badges {
    flex-direction: column;
    align-items: center;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }
}
