/* ============================================================
   MYTHIC WORLD MODEL — STYLESHEET
   Monochrome technical archive aesthetic.
   Black/white/grayscale base · restrained red accents
   ============================================================ */

/* ---- Variables ---- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-panel: #0f0f0f;

  /* Text */
  --text-primary: #e8e8e8;
  --text-secondary: #9a9a9a;
  --text-muted: #555555;

  /* Red — rare, intentional, like a marker in a research document */
  --accent: #c41818;
  --accent-dim: #8a1010;
  --accent-glow: rgba(196, 24, 24, 0.06);

  /* Borders */
  --border: #222222;
  --border-accent: #2a2a2a;

  /* Grid lines for archive paper feel */
  --grid-line: rgba(255, 255, 255, 0.015);

  --font-mono: 'IBM Plex Mono', 'Space Mono', 'Courier New', Courier, monospace;

  --section-gap: 140px;
}

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

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

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

/* Subtle archive grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Selection ---- */
::selection {
  background: var(--accent);
  color: #ffffff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.1em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================
   SECTIONS — BASE
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-gap) 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-number {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  font-weight: 600;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0 48px;
}

/* ============================================================
   SECTION 00 — HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  width: 100%;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.15;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.hero-line {
  display: block;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  font-style: italic;
}

.hero-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 500px;
}

.hero-cursor {
  position: absolute;
  bottom: 60px;
  left: 40px;
  font-size: 1.2rem;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

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

/* ---- Metadata Panel ---- */
.hero-panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.panel-header {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.panel-body {
  padding: 0;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

.panel-row:last-child {
  border-bottom: none;
}

.panel-label {
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-value {
  color: var(--text-secondary);
  text-align: right;
  max-width: 60%;
}

/* ============================================================
   CONTENT BLOCKS
   ============================================================ */
.content-block {
  margin-bottom: 32px;
}

.content-block p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 16px;
}

.content-block p:last-child {
  margin-bottom: 0;
}

.content-block em {
  color: var(--text-primary);
  font-style: italic;
}

/* ============================================================
   QUOTE BLOCKS
   ============================================================ */
.quote-block {
  border-left: 2px solid var(--accent);
  padding: 24px 32px;
  margin: 48px 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.8;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent-glow), transparent 40%);
}

.quote-block.large {
  font-size: 1.4rem;
  padding: 40px 48px;
  margin: 64px 0;
  text-align: center;
  border-left: none;
  border-top: 1px solid var(--border-accent);
  border-bottom: 1px solid var(--border-accent);
  background: linear-gradient(180deg, var(--accent-glow), transparent 50%, var(--accent-glow));
}

/* ============================================================
   FLOW DIAGRAM
   ============================================================ */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 48px 0;
  gap: 8px;
}

.flow-node {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--text-primary);
  padding: 12px 32px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  text-transform: uppercase;
  width: 280px;
  text-align: center;
}

.flow-arrow {
  display: flex;
  justify-content: center;
}

.arrow-down {
  font-size: 1rem;
  color: var(--accent);
}

/* ============================================================
   PHILOSOPHY GRID
   ============================================================ */
.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 48px 0;
}

.philosophy-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.philosophy-marker {
  font-size: 1.2rem;
  color: var(--accent);
  line-height: 1.6;
  flex-shrink: 0;
}

.philosophy-text h3 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.philosophy-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================================
   PIPELINE
   ============================================================ */
.pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 48px 0;
  gap: 4px;
}

.pipeline-node {
  width: 280px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.pipeline-node:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.pipeline-node.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 20px var(--accent-glow);
}

.pipeline-marker {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.pipeline-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

.pipeline-question {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pipeline-arrow {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

/* ---- Pipeline Detail ---- */
.pipeline-detail {
  margin: 32px auto;
  padding: 24px 32px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  max-width: 600px;
  text-align: center;
}

.detail-label {
  display: block;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.detail-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================================
   KNOWLEDGE GRAPH CANVAS
   ============================================================ */
.graph-container {
  margin: 48px 0;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  position: relative;
  height: 500px;
}

#knowledge-graph {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================================
   PROVENANCE CHAIN
   ============================================================ */
.provenance-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 48px 0;
  gap: 0;
}

.provenance-step {
  width: 240px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-align: center;
  transition: all 0.3s;
}

.provenance-step:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.provenance-level {
  font-size: 0.8rem;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

.provenance-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-style: italic;
}

.provenance-connector {
  display: flex;
  justify-content: center;
  height: 24px;
  position: relative;
}

.connector-line {
  width: 1px;
  height: 100%;
  background: var(--border);
}

.connector-dot {
  display: none;
}

/* ============================================================
   APPLICATIONS GRID
   ============================================================ */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.application-card {
  padding: 28px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  transition: all 0.3s;
}

.application-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px rgba(196, 24, 24, 0.08);
}

.application-icon {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.application-card h3 {
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.application-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================================
   STATUS PANEL
   ============================================================ */
.status-panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  margin-top: 48px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

.status-row:last-child {
  border-bottom: none;
}

.status-label {
  color: var(--accent);
  letter-spacing: 0.15em;
  font-weight: 600;
}

.status-value {
  color: var(--text-secondary);
  text-align: right;
  max-width: 60%;
}

.status-active {
  color: var(--accent);
  font-weight: 600;
  animation: pulse-text 3s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 48px 40px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-line {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============================================================
   FADE-IN ANIMATION
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .section {
    padding: 80px 24px;
  }

  .nav-inner {
    padding: 12px 24px;
  }

  .nav-links {
    gap: 16px;
  }

  .panel-row {
    flex-direction: column;
    gap: 4px;
  }

  .panel-value {
    text-align: left;
    max-width: 100%;
  }

  .status-row {
    flex-direction: column;
    gap: 4px;
  }

  .status-value {
    text-align: left;
    max-width: 100%;
  }

  .quote-block {
    padding: 20px 24px;
    font-size: 0.95rem;
  }

  .quote-block.large {
    font-size: 1.1rem;
    padding: 28px 24px;
  }

  .flow-node,
  .pipeline-node {
    width: 220px;
  }

  .provenance-step {
    width: 200px;
  }

  .graph-container {
    height: 350px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

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

  .hero-description {
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .section {
    padding: 60px 16px;
  }

  .nav-inner {
    padding: 10px 16px;
  }

  .nav-brand {
    font-size: 0.75rem;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    font-size: 0.65rem;
  }

  .nav-status {
    display: none;
  }

  .hero-panel {
    order: 1;
  }

  .hero-cursor {
    display: none;
  }

  .flow-node,
  .pipeline-node {
    width: 100%;
    max-width: 260px;
  }

  .provenance-step {
    width: 100%;
    max-width: 240px;
  }

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

  .application-card {
    padding: 20px;
  }

  .quote-block {
    padding: 16px 20px;
    font-size: 0.9rem;
    margin: 32px 0;
  }

  .quote-block.large {
    font-size: 1rem;
    padding: 20px 24px;
    margin: 40px 0;
  }

  .philosophy-item {
    padding: 16px;
  }

  .pipeline-detail {
    margin: 24px 16px;
    padding: 20px;
  }

  .graph-container {
    height: 300px;
  }

  .footer {
    padding: 32px 16px;
  }

  .footer-meta {
    flex-direction: column;
    gap: 4px;
  }
}
