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

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:       #0f0f0f;
  --text:     #f0f0f0;
  --accent:   #2563eb;
  --yellow:   #e8a800;
  --border:   #272727;
  --bg-dark:  #000000;
  --bg-warm:  #181818;
  --bg-mid:   #1e1e1e;
  --font:     'JetBrains Mono', 'Courier New', 'Lucida Console', monospace;
  --font-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --max-w:    1100px;
  --pad-x:    1.5rem;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

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

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

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

/* ============================================================
   PAGE LAYOUT (flex column so footer sticks to bottom)
   ============================================================ */
.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  padding: 0.575rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.btn-primary:hover {
  opacity: 0.82;
}

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.575rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

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

/* ============================================================
   NAV
   ============================================================ */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.9rem var(--pad-x);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.wordmark {
  font-family: var(--font);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  line-height: 1;
}

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

.cursor::after {
  content: '\25AE';
  font-size: 0.85em;
  color: var(--yellow);
  animation: blink 1.1s step-end 3;
  margin-left: 2px;
  vertical-align: baseline;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.75;
  transition: opacity 0.15s ease;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  opacity: 1;
}

.nav .btn-outline {
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
}

/* ============================================================
   WELCOME BAR
   ============================================================ */
.welcome-bar {
  background: var(--bg-dark);
  color: var(--text);
  padding: 2.75rem 0;
}

.welcome-bar .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.welcome-left p {
  font-size: 1.0625rem;
  line-height: 1.8;
  opacity: 0.88;
}

.welcome-right p {
  font-size: 1rem;
  line-height: 1.85;
  opacity: 0.7;
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

/* ============================================================
   MANIFESTO
   ============================================================ */
.manifesto {
  padding: 5.5rem 0 5rem;
}

.manifesto .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.manifesto-headline {
  font-size: 3.375rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 1.375rem;
}

.manifesto-sub {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.78;
  margin-bottom: 2.25rem;
  max-width: 34ch;
}

.manifesto-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Definition panels */
.definition-panels {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.def-panel {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

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

.def-label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.def-text {
  font-size: 0.9375rem;
  line-height: 1.75;
  opacity: 0.85;
}

/* ============================================================
   DIAGRAM SECTION  (graph-paper grid via CSS)
   ============================================================ */
.diagram-section {
  background-color: var(--bg-warm);
  background-image:
    repeating-linear-gradient(
      rgba(37, 99, 235, 0.04) 0 1px,
      transparent 1px 100%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.04) 0 1px,
      transparent 1px 100%
    ),
    repeating-linear-gradient(
      rgba(37, 99, 235, 0.09) 0 1px,
      transparent 1px 100%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.09) 0 1px,
      transparent 1px 100%
    );
  background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}

.diagram-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.diagram-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.diagram-tag {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.diagram-title {
  font-size: 0.875rem;
  opacity: 0.6;
  text-align: right;
}

.beam-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram-note {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-strip {
  padding: 1.875rem 0;
  border-bottom: 1px solid var(--border);
}

.stats-strip .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat-item {
  padding: 0.75rem 1.5rem;
  border-right: 1px solid var(--border);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  display: block;
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 0.2rem;
  letter-spacing: -0.025em;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.7;
  line-height: 1.55;
}

/* ============================================================
   MODULES SECTION
   ============================================================ */
.modules-section {
  padding: 4.5rem 0;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.75;
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
}

.module-card {
  background: var(--bg);
  padding: 2.375rem 2rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
}

a.module-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.module-card:hover {
  background: var(--bg-mid);
}

a.module-card:hover .module-link {
  opacity: 1;
  text-decoration: underline;
}

.module-number {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.55;
  margin-bottom: 0.625rem;
}

.module-title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.875rem;
  line-height: 1.3;
}

.module-desc {
  font-size: 0.9375rem;
  line-height: 1.75;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.875rem;
}

.tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  padding: 0.175rem 0.55rem;
  background: var(--bg-warm);
  color: var(--text);
  opacity: 0.68;
}

.module-link {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease;
}

.module-link:hover {
  opacity: 0.65;
  text-decoration: underline;
}

/* ============================================================
   BUILT BY / ABOUT
   ============================================================ */
.built-by {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.built-by-inner {
  display: flex;
  gap: 2.25rem;
  align-items: flex-start;
}

.avatar-circle {
  width: 54px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-warm);
  color: var(--text);
  letter-spacing: 0.05em;
}

.built-by-text p {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.8;
  margin-bottom: 1.25rem;
  max-width: 64ch;
}

.credential-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.credential {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.2rem 0.55rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.125rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  opacity: 0.6;
}

/* ============================================================
   MODULE PLACEHOLDER PAGES
   ============================================================ */
.module-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem var(--pad-x);
}

.module-placeholder-inner {
  max-width: 520px;
  width: 100%;
}

.module-ph-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.module-ph-title {
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.375rem;
}

.module-ph-divider {
  width: 36px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 1.375rem;
}

.module-ph-message {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.78;
  margin-bottom: 2.25rem;
  border-left: 2px solid var(--border);
  padding-left: 1.125rem;
}

.module-ph-back {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.module-ph-back:hover {
  opacity: 0.65;
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE — TABLET + MOBILE
   ============================================================ */
@media (max-width: 860px) {
  .manifesto-headline {
    font-size: 2.75rem;
  }
}

@media (max-width: 768px) {
  /* Nav — hide text links on small screens */
  .nav-links {
    display: none;
  }

  /* Welcome bar */
  .welcome-bar .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .welcome-right p {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(240, 235, 227, 0.15);
    padding-top: 1.375rem;
  }

  /* Manifesto */
  .manifesto {
    padding: 3.5rem 0;
  }

  .manifesto .container {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .manifesto-headline {
    font-size: 2.25rem;
  }

  .manifesto-sub {
    max-width: none;
  }

  /* Stats */
  .stats-strip .container {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-left: 0;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  /* Modules */
  .modules-grid {
    grid-template-columns: 1fr;
  }

  /* Built by */
  .built-by-inner {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 0.375rem;
    text-align: center;
  }

  /* Module placeholder */
  .module-ph-title {
    font-size: 1.625rem;
  }
}

@media (max-width: 480px) {
  :root {
    --pad-x: 1rem;
  }

  .manifesto-headline {
    font-size: 1.9375rem;
  }

  .manifesto-ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-outline {
    text-align: center;
    width: fit-content;
  }

  .diagram-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
