/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fefdfb;
  --white: #ffffff;
  --dark: #292524;
  --dark-deep: #1c1917;
  --text-heading: #1c1917;
  --text-body: #78716c;
  --text-muted: #a8a29e;
  --accent: #ea580c;
  --accent-hover: #dc5209;
  --amber: #fbbf24;
  --border: #e7e5e4;
  --border-light: #f5f5f4;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.08), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.08), 0 1px 3px rgba(28, 25, 23, 0.04);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

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

/* ========================================
   LAYOUT
   ======================================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark);
  transition: box-shadow var(--transition);
}

.nav:hover {
  box-shadow: 0 2px 12px rgba(28, 25, 23, 0.25);
}

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

.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: -0.5px;
}

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

.nav-links a {
  color: #a8a29e;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
}

.nav-cta {
  background: var(--accent);
  color: #ffffff !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition);
}

.nav-cta:hover {
  background: var(--accent-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #a8a29e;
  margin: 5px 0;
  border-radius: 1px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: background var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-heading);
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border);
  transition: border-color var(--transition), background var(--transition);
}

.btn-secondary:hover {
  border-color: #d6d3d1;
  background: #f5f5f4;
}

/* Dark variant */
.btn-secondary-dark {
  color: #ffffff;
  border-color: #44403c;
}

.btn-secondary-dark:hover {
  border-color: #57534e;
  background: #353130;
}

/* ========================================
   HERO
   ======================================== */
.hero {
  padding: 64px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-headline {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-heading);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-body);
  margin-bottom: 32px;
  line-height: 1.7;
  max-width: 460px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero data panel */
.hero-panel {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card {
  background: #353130;
  border-radius: var(--radius);
  padding: 18px 20px;
}

.hero-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-family: 'IBM Plex Mono', monospace;
}

.hero-card-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-card-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-card-region {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-card-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: #ffffff;
  font-weight: 600;
}

.hero-card-unit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.hero-card-total {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  color: #ffffff;
  font-weight: 600;
}

.hero-card-breakdown {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* ========================================
   STATS BAR
   ======================================== */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
  background: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================
   SECTION HEADINGS
   ======================================== */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.section-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-body);
  max-width: 540px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* ========================================
   PAGE HERO (inner pages)
   ======================================== */
.page-hero {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
}

.page-hero .section-label {
  margin-bottom: 8px;
}

.page-hero .section-title {
  margin-bottom: 8px;
  font-size: 34px;
}

.page-hero .section-desc {
  margin-bottom: 0;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d6d3d1;
}

.card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.65;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.card-icon-amber { background: #fef3c7; color: #92400e; }
.card-icon-blue { background: #dbeafe; color: #1e40af; }
.card-icon-green { background: #d1fae5; color: #065f46; }
.card-icon-red { background: #fee2e2; color: #991b1b; }
.card-icon-purple { background: #ede9fe; color: #5b21b6; }
.card-icon-stone { background: #f5f5f4; color: #57534e; }

/* ========================================
   FEATURES GRID
   ======================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ========================================
   HOW IT WORKS
   ======================================== */
.how-section {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.step {
  text-align: center;
  padding: 0 12px;
}

.step-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-block;
  background: #fef2e8;
  padding: 4px 12px;
  border-radius: 20px;
}

.step h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.step p {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.65;
}

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

/* ========================================
   SOURCES
   ======================================== */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.source-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.source-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 14px;
}

/* ========================================
   SIMULATORS
   ======================================== */
.sim-section {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.sim-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.sim-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d6d3d1;
}

.sim-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.sim-card > p {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 20px;
}

.sim-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-features li {
  font-size: 14px;
  color: var(--text-body);
  padding-left: 20px;
  position: relative;
}

.sim-features li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ========================================
   CODE BLOCK / API
   ======================================== */
.api-section {
  background: var(--dark);
  padding: 80px 0;
}

.api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.api-text h2 {
  font-size: 28px;
  color: #ffffff;
  margin-bottom: 16px;
}

.api-text p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.code-block {
  background: var(--dark-deep);
  border: 1px solid #3a3633;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #3a3633;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3633;
}

.code-body {
  padding: 20px;
  overflow-x: auto;
}

.code-body pre {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #d6d3d1;
  white-space: pre;
  margin: 0;
}

.code-comment { color: #57534e; }
.code-string { color: #fbbf24; }
.code-key { color: #a8a29e; }
.code-number { color: #ea580c; }
.code-prompt { color: #57534e; user-select: none; }

/* ========================================
   DATA TABLE
   ======================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}

.data-table td.mono-val {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  color: var(--text-heading);
}

.data-table tr:hover td {
  background: var(--border-light);
}

/* ========================================
   DETAIL LIST
   ======================================== */
.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-list li {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.6;
  padding-left: 24px;
  position: relative;
}

.detail-list li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: var(--dark-deep);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 14px;
  color: #78716c;
  line-height: 1.65;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: #78716c;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: #d6d3d1;
}

.footer-bottom {
  border-top: 1px solid #292524;
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: #57534e;
}

/* ========================================
   UPDATE FREQUENCY GRID
   ======================================== */
.freq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.freq-item h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.freq-item p {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.65;
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
  background: var(--dark);
  padding: 64px 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 24px;
  color: #ffffff;
  margin-bottom: 24px;
}

/* ========================================
   RESPONSIVE — TABLET
   ======================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-headline {
    font-size: 34px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sources-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .api-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */
@media (max-width: 640px) {
  .section {
    padding: 56px 0;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 40px 0 56px;
  }

  .hero-headline {
    font-size: 28px;
  }

  .hero-sub {
    font-size: 15px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    text-align: center;
  }

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

  .stat-number {
    font-size: 26px;
  }

  .features-grid,
  .sources-grid {
    grid-template-columns: 1fr;
  }

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

  .step-connector {
    display: none;
  }

  .sim-grid,
  .freq-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 24px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .page-hero .section-title {
    font-size: 28px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-card-row {
    gap: 12px;
  }
}
