/* ==========================================================================
   IEE — Immersive Experience Economy
   Dark, typographic-first theme
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #161616;
  --text: #e0e0e0;
  --text-muted: #888888;
  --text-bright: #ffffff;
  --accent: #00d4aa;
  --accent-dim: #00a885;
  --border: #222222;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --max-width: 900px;
  --max-width-wide: 1100px;
}

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

/* ---------- Base ---------- */
html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1 { font-size: 2.8rem; margin-bottom: 0.5em; }
h2 { font-size: 1.8rem; margin-bottom: 0.6em; }
h3 { font-size: 1.3rem; margin-bottom: 0.5em; }
h4 { font-size: 1.1rem; margin-bottom: 0.4em; }

p {
  margin-bottom: 1.2em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-bright);
}

strong {
  color: var(--text-bright);
  font-weight: 600;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--accent);
}

pre {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 2rem 0;
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

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

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

/* ---------- Header ---------- */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width-wide);
}

.site-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-logo:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-bright);
}

/* ---------- Hero ---------- */
.hero {
  padding: 8rem 0 6rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.hero-version {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2rem;
}

/* ---------- Sections ---------- */
.section {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.section-dark {
  background: var(--bg-elevated);
}

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 2.5rem;
}

.section-content {
  max-width: 700px;
}

.section-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 2rem;
}

.section-cta {
  margin-top: 3rem;
  text-align: center;
}

.lead {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

/* ---------- Metric Cards ---------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color 0.3s;
}

.metric-card:hover {
  border-color: var(--accent-dim);
}

.metric-unit {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.metric-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.metric-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0;
}

/* ---------- Master Metrics ---------- */
.master-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  margin-bottom: 2rem;
}

.master-metric {
  text-align: center;
}

.formula {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.formula-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.master-metric p {
  font-size: 0.95rem;
  text-align: left;
  color: var(--text);
}

/* ---------- White Paper CTA ---------- */
.whitepaper-cta {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.whitepaper-cta p {
  text-align: left;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s;
}

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

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

.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--bg);
}

/* ---------- Author Block ---------- */
.author-block {
  max-width: 600px;
}

.author-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.author-link {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Page Layout ---------- */
.page {
  padding: 4rem 0 6rem;
}

.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.page-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Page Content ---------- */
.page-content h2 {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.page-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-content h3 {
  margin-top: 2rem;
}

.page-content ul,
.page-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content .metric-inline {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95em;
}

/* ---------- Derivation Blocks ---------- */
.derivation {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}

.derivation-formula {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  padding: 1.5rem 0;
  margin: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.derivation-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ---------- Changelog ---------- */
.changelog-entry {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-version {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}

.changelog-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 1rem;
}

/* ---------- Whitepaper Sections ---------- */
.wp-section {
  margin-bottom: 4rem;
}

.wp-section-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  display: block;
}

/* ---------- Scenario Blocks ---------- */
.scenario {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 6px 6px 0;
}

.scenario-title {
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

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

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-framework {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .hero {
    padding: 5rem 0 4rem;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .section {
    padding: 4rem 0;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .master-metrics {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .formula {
    font-size: 1.8rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.75rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .derivation-formula {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .site-nav {
    gap: 0.75rem;
  }
}
