/* ==========================================================================
   Next90 — Official Static Site Design System (Symmetrical 8pt Grid Architecture)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  /* Dark Mode (Default — Rich Charcoal & Deep Indigo) */
  --bg-primary: #111318;
  --bg-secondary: #171A22;
  --bg-card: #1D212B;
  --bg-elevated: #252A37;
  --bg-glass: rgba(17, 19, 24, 0.84);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(99, 102, 241, 0.45);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --indigo: #4F46E5;
  --indigo-bright: #6366F1;
  --electric-blue: #38BDF8;
  --emerald: #10B981;
  --amber: #F59E0B;
  --danger: #EF4444;

  --shadow-card: 0 16px 32px -8px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-glass: rgba(248, 250, 252, 0.88);
  --border-subtle: #E2E8F0;
  --border-accent: rgba(79, 70, 229, 0.35);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  --indigo: #4F46E5;
  --indigo-bright: #4338CA;
  --electric-blue: #0284C7;
  --emerald: #059669;
  --amber: #D97706;
  --danger: #DC2626;

  --shadow-card: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tabular-nums, code, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

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

/* 8pt Container & Section Rhythm */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  max-width: 720px;
  margin: 0 auto 64px auto;
  text-align: center;
}

.section-header h2 {
  font-size: 40px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Pill Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-indigo {
  background: rgba(99, 102, 241, 0.14);
  color: var(--electric-blue);
  border-color: rgba(56, 189, 248, 0.35);
}

/* Sticky 72px Header (8pt Grid) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--electric-blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Buttons (48px & 40px Exact Heights) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}

.btn-sm {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--indigo);
  color: #FFFFFF;
  box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.45);
}

.btn-primary:hover {
  background: var(--indigo-bright);
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--emerald);
  color: #042F2E;
  font-weight: 700;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--electric-blue);
}

/* Bilateral 6+6 Hero Grid */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: 56px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.hero-title span {
  background: linear-gradient(135deg, var(--electric-blue), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.65;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

/* Symmetrical KPI Strip (4 Equal Columns) */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Symmetrical Bento Grids (2-Col and 3-Col) */
.bento-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid var(--border-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--electric-blue);
}

.bento-card h3 {
  font-size: 22px;
}

.bento-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Interactive 90-Day Chain Matrix Widget */
.chain-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.chain-dots-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.chain-dot {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
}

.chain-dot:hover {
  transform: scale(1.08);
}

.dot-excellent { background: #10B981; color: #042F2E; }
.dot-good { background: #F59E0B; color: #111318; }
.dot-current { background: #38BDF8; color: #0F172A; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35); }
.dot-future { background: var(--bg-elevated); color: var(--text-muted); }

/* Screenshot Showcase Grid (3x2 Symmetrical) */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.screenshot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.screenshot-card img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  display: block;
  margin-bottom: 16px;
}

.screenshot-card h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.screenshot-card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Legal & Policy Document Layout */
.legal-wrapper {
  max-width: 880px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-card);
}

.legal-wrapper h1 {
  font-size: 36px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.legal-meta {
  font-size: 14px;
  color: var(--text-muted);
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-wrapper h2 {
  font-size: 22px;
  color: var(--electric-blue);
  margin-top: 32px;
  margin-bottom: 16px;
}

.legal-wrapper p,
.legal-wrapper li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-wrapper ul,
.legal-wrapper ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.data-table th {
  background: var(--bg-elevated);
  color: var(--electric-blue);
  font-weight: 600;
}

/* Footer */
.site-footer {
  padding: 64px 0;
  background: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--electric-blue);
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .hero-grid,
  .bento-grid-3,
  .screenshot-grid,
  .kpi-grid-4,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-grid,
  .bento-grid-3,
  .bento-grid-2,
  .screenshot-grid,
  .kpi-grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 40px;
  }
  .legal-wrapper {
    padding: 24px;
  }
}
