/* ═══════════════════════════════════════════
   DESIGN SYSTEM — Custom Properties
   ═══════════════════════════════════════════ */

:root {
  /* Color Palette */
  --bg-primary:       #0A0A0A;
  --bg-secondary:     #111111;
  --bg-card:          #141414;
  --accent-primary:   #00FF88;
  --accent-secondary: #0066FF;
  --text-primary:     #F0F0F0;
  --text-secondary:   #888888;
  --text-muted:       #444444;
  --border-subtle:    #1E1E1E;

  /* Spacing — base unit 8px */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-7:  56px;
  --space-8:  64px;
  --space-9:  72px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;
  --space-20: 160px;

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  cursor: none;
  overflow-x: hidden;
}

/* Hide scrollbar — all browsers */
html {
  scrollbar-width: none;           /* Firefox */
  -ms-overflow-style: none;        /* IE / Edge */
}
html::-webkit-scrollbar {
  display: none;                   /* Chrome / Safari / Opera */
}

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

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: none;
}

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


/* ═══════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

code, .mono {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent-primary);
}

.phase-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

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

.accent-secondary {
  color: var(--accent-secondary);
}


/* ═══════════════════════════════════════════
   CUSTOM CURSOR
   ═══════════════════════════════════════════ */

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
  mix-blend-mode: difference;
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
  #cursor {
    display: none;
  }
  body {
    cursor: auto;
  }
}


/* ═══════════════════════════════════════════
   SECTION — Base
   ═══════════════════════════════════════════ */

.section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: var(--space-16) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.section__inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}


/* ═══════════════════════════════════════════
   HERO — Phase Entry
   ═══════════════════════════════════════════ */

.section--hero {
  height: 100vh;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--bg-primary);
  padding: 0 var(--space-5);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.hero__headline {
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.05;
  color: var(--text-primary);
}

.hero__subheadline {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 540px;
  opacity: 0;                       /* animated in via JS */
}

.hero__descriptor {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  opacity: 0;                       /* animated in via JS */
}


/* ═══════════════════════════════════════════
   SCROLL INDICATOR
   ═══════════════════════════════════════════ */

.scroll-indicator {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.scroll-indicator__line {
  width: 2px;
  height: 40px;
  background-color: var(--text-muted);
  animation: pulse-line 2s ease-in-out infinite;
}

.scroll-indicator__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

@keyframes pulse-line {
  0%   { opacity: 1; }
  50%  { opacity: 0.2; }
  100% { opacity: 1; }
}


/* ═══════════════════════════════════════════
   SYSTEM REALITY — Phase 02
   ═══════════════════════════════════════════ */

.section--system-reality {
  background-color: var(--bg-secondary);
  padding: 120px var(--space-5);
}

.system-reality__grid {
  display: grid !important;
  grid-template-columns: 60% 40% !important;
  gap: var(--space-8);
  align-items: center;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.system-reality__heading {
  font-size: clamp(32px, 5vw, 56px);
  margin-bottom: var(--space-4);
}

.system-reality__body {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: var(--space-6);
}

/* Stat blocks — horizontal row */
.stat-blocks {
  display: flex;
  gap: var(--space-5);
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-block__number {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 400;
  color: var(--accent-primary);
  line-height: 1;
}

.stat-block__label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Right column — visual */
.system-reality__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.cache-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 16px) !important;
  grid-template-rows: repeat(4, 16px) !important;
  gap: 8px;
}

.cache-grid__cell {
  width: 16px;
  height: 16px;
  background-color: var(--border-subtle);
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.cache-grid__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}


/* ═══════════════════════════════════════════
   TURNING POINT — Phase 03
   ═══════════════════════════════════════════ */

.section--turning-point {
  background-color: var(--bg-primary);
  min-height: 80vh;
  padding: 120px var(--space-3);
}

.turning-point__content {
  max-width: 640px;
  margin: 0 auto;
}

.turning-point__heading {
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: var(--space-5);
}

.turning-point__narrative {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);             /* 32px between paragraphs */
}

.turning-point__narrative p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.8;
}

.turning-point__divider {
  border: none;
  height: 1px;
  background-color: var(--border-subtle);
  width: 100%;
  margin: var(--space-6) 0;        /* 48px top/bottom */
}


/* ═══════════════════════════════════════════
   PROJECT CHAPTERS — Shared
   ═══════════════════════════════════════════ */

.project-chapter {
  position: relative;
  min-height: 100vh;
  padding: 120px var(--space-5);
}

#project-swarm       { background-color: var(--bg-card); }
#project-multiplayer { background-color: var(--bg-secondary); }
#project-gpudb       { background-color: var(--bg-card); }

.project-chapter__number {
  position: absolute;
  top: var(--space-8);
  left: var(--space-5);
  font-family: var(--font-mono);
  font-size: 120px;
  font-weight: 400;
  line-height: 1;
  color: var(--border-subtle);
  pointer-events: none;
  user-select: none;
}

.project-chapter__grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: var(--space-8);
  align-items: start;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Reverse column order for alternating chapters */
.project-chapter--reverse .project-chapter__grid {
  direction: rtl;
}
.project-chapter--reverse .project-chapter__grid > * {
  direction: ltr;
}

/* Content column */
.project-chapter__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--accent-primary);
  letter-spacing: 0.08em;
}

.project-chapter__title {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: var(--space-1);
}

.project-chapter__callout {
  border-left: 2px solid var(--accent-primary);
  padding-left: var(--space-2);
  margin: var(--space-2) 0;
  font-style: italic;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Fields / definition list */
.project-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.project-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-field dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-field dd {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Links */
.project-links {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.project-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-primary);
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.7;
}

/* Tech pills */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-1) 0;
}

.tech-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Visual column */
.project-chapter__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 320px;
}

.visual-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}


/* ═══════════════════════════════════════════
   DOT GRID — Swarm Visual
   ═══════════════════════════════════════════ */

.dot-grid {
  display: grid;
  grid-template-columns: repeat(20, 4px);
  grid-template-rows: repeat(20, 4px);
  gap: 6px;
}

.dot-grid__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--border-subtle);
}


/* ═══════════════════════════════════════════
   NET DIAGRAM — Multiplayer Visual
   ═══════════════════════════════════════════ */

.net-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 320px;
}

.net-node {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.net-line {
  flex: 1;
  height: 1px;
  border-top: 1px dashed var(--text-muted);
  position: relative;
  min-width: 80px;
}

.net-dot {
  position: absolute;
  top: -4px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-secondary);
}

.net-latency {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.net-latency__raw,
.net-latency__comp {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-primary);
  opacity: 0;                       /* animated in via JS */
}


/* ═══════════════════════════════════════════
   PIPELINE — GPU DB Visual
   ═══════════════════════════════════════════ */

.pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 280px;
}

.pipeline__stage {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  transition: border-color 0.3s ease;
}

#project-gpudb .pipeline__stage {
  background: var(--bg-primary);
}

.pipeline__arrow {
  display: block;
  margin: 4px 0;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   NAVIGATION BAR
   ═══════════════════════════════════════════ */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 9000;
  transition: border-color 0.3s ease;
}

#nav.nav--scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  gap: var(--space-4);
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--text-primary);
}


/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-primary);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9001;
}


/* ═══════════════════════════════════════════
   CONFLICT — Phase 05
   ═══════════════════════════════════════════ */

.section--conflict {
  background-color: var(--bg-primary);
  min-height: 70vh;
  padding: 120px var(--space-3);
}

.conflict__content {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.conflict__heading {
  font-size: clamp(24px, 3.5vw, 40px);
  max-width: 520px;
}

.conflict__body {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.conflict__comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-3) 0;
}

.conflict__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.conflict__col-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conflict__col-label--strong  { color: var(--accent-primary); }
.conflict__col-label--building { color: var(--accent-secondary); }

.conflict__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.conflict__col li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.conflict__closing {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}


/* ═══════════════════════════════════════════
   FUTURE SIGNAL — Phase 06
   ═══════════════════════════════════════════ */

.section--future {
  background-color: var(--bg-secondary);
  min-height: 90vh;
  padding: 120px var(--space-3);
}

.future__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.future__heading {
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: var(--space-2);
}

.future__sublabel {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.future__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  max-width: 800px;
  margin: 0 auto;
}

.future-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.future-card__status {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
}

.future-card__title {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.future-card__signal {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ═══════════════════════════════════════════
   CLOSING — Phase 07
   ═══════════════════════════════════════════ */

.section--closing {
  background-color: var(--bg-primary);
  min-height: 100vh;
  padding: 120px var(--space-3);
  text-align: center;
}

.closing__content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.closing__heading {
  font-size: clamp(28px, 5vw, 52px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.closing__line1 {
  color: var(--text-primary);
}

.closing__line2 {
  color: var(--accent-primary);
}

.closing__divider {
  border: none;
  height: 1px;
  background-color: var(--border-subtle);
  width: 100%;
  margin: var(--space-6) 0;
}

.closing__cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.closing__link {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.closing__link:hover {
  color: var(--accent-primary);
}

.closing__spacer {
  color: var(--text-muted);
  font-size: 16px;
}

.closing__availability {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-8);
  letter-spacing: 0.02em;
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

#footer {
  background: #080808;
  padding: var(--space-4) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__name,
.footer__copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 768px)
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .section {
    padding: var(--space-10) var(--space-3);
  }

  .section--hero {
    padding: 0 var(--space-3);
  }

  .hero__headline {
    font-size: clamp(36px, 10vw, 64px);
  }

  .hero__subheadline {
    font-size: 16px;
    max-width: 360px;
  }

  .hero__descriptor {
    font-size: 12px;
  }

  .phase-label {
    font-size: 10px;
    margin-bottom: var(--space-4);
  }

  /* System Reality */
  .section--system-reality {
    padding: var(--space-10) var(--space-3);
  }

  .system-reality__grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
  }

  .stat-blocks {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .stat-block__number {
    font-size: 28px;
  }

  .system-reality__heading {
    font-size: clamp(28px, 7vw, 40px);
  }

  /* Turning Point */
  .section--turning-point {
    padding: var(--space-10) var(--space-3);
    min-height: auto;
  }

  .turning-point__heading {
    font-size: clamp(24px, 6vw, 36px);
  }

  .turning-point__narrative p {
    font-size: 15px;
  }

  /* Project chapters */
  .project-chapter {
    padding: var(--space-10) var(--space-3);
  }

  .project-chapter__number {
    font-size: 72px;
    top: var(--space-4);
    left: var(--space-3);
  }

  .project-chapter__grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
  }

  .project-chapter--reverse .project-chapter__grid {
    direction: ltr;
  }

  .project-chapter__title {
    font-size: clamp(24px, 6vw, 36px);
  }

  .dot-grid {
    grid-template-columns: repeat(15, 4px);
    grid-template-rows: repeat(15, 4px);
  }

  .net-diagram {
    max-width: 260px;
  }

  .pipeline {
    max-width: 100%;
  }

  /* Conflict */
  .section--conflict {
    padding: var(--space-10) var(--space-3);
    min-height: auto;
  }

  .conflict__comparison {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Future Signal */
  .section--future {
    padding: var(--space-10) var(--space-3);
    min-height: auto;
  }

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

  /* Closing */
  .section--closing {
    padding: var(--space-10) var(--space-3);
    min-height: 80vh;
  }

  .closing__heading {
    font-size: clamp(24px, 6vw, 40px);
  }

  /* Nav */
  #nav {
    padding: 0 var(--space-3);
  }

  .nav__links {
    gap: var(--space-2);
  }

  .nav__link {
    font-size: 10px;
  }

  /* Footer */
  #footer {
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
  }
}
