:root {
  --bg: #080808;
  --ink: #EDEDED;
  --ink-dim: #888888;
  --accent: #FF3300;
  /* International Orange */
  --line: #222222;
  --panel: #111111;
  --font-serif: 'Newsreader', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --spacing-section: 160px;
  --container-width: 960px;
}

/* ANIMATION UTILS */
.line-parent {
  overflow: hidden;
  /* For line reveals */
}

.char {
  transform: translateY(110%);
  transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.reveal-active .char {
  transform: translateY(0%);
}

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* TYPOGRAPHY */

h1,
h2,
h3,
blockquote {
  font-family: var(--font-serif);
  font-weight: 300;
  margin: 0;
  letter-spacing: -0.02em;
}

h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  margin: 0 0 1rem 0;
  color: var(--ink-dim);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 8px;
  display: inline-block;
  margin-right: 8px;
}

p {
  margin: 0 0 1.5rem 0;
  color: #ccc;
}

strong {
  color: #fff;
  font-weight: 500;
}

/* LAYOUT UTILS */

.manifesto {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--spacing-section) 0;
  position: relative;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-bottom: 2rem;
  border-top: 1px solid var(--accent);
  padding-top: 1rem;
  display: inline-block;
  width: 100%;
  max-width: 200px;
}

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

/* HERO */

.hero {
  padding-top: 200px;
  padding-bottom: 120px;
}

.hero__meta {
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2rem, 8vw, 6rem);
  line-height: 1.3;
  margin-bottom: 4rem;
  padding-bottom: 8rem;
  color: #fff;
}

.hero__lede {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: 4rem;
  font-family: var(--font-serif);
}

.hero__question blockquote {
  font-size: 1.8rem;
  line-height: 1.3;
  color: var(--ink);
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}

.hero__question p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}


/* SECTION I:*/
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-width: var(--container-width);
  margin: 0 auto;
  z-index: 100;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 16px;
}

.nav__link,
.nav__cta {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.nav__link:hover,
.nav__cta:hover {
  color: #fff;
}

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

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.modal[open] {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111;
  border: 1px solid #333;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-title {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.modal-bio {
  color: #ccc;
  font-size: 1rem;
  line-height: 1.6;
}

.modal-note {
  font-family: var(--font-mono);
  color: var(--ink-dim);
  font-size: 0.8rem;
  margin-top: 1.5rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.modal-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.modal-links a {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}

/* THE CHAIN */

.chain-visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 2rem 0;
  border-left: 1px solid var(--line);
  padding-left: 2rem;
}

.chain-step {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  padding: 1rem 0;
  color: #fff;
}

.chain-arrow {
  color: var(--ink-dim);
  padding-left: 0.5rem;
}

.step-num {
  color: var(--accent);
  margin-right: 12px;
}

.act-2 .step-name {
  color: #ccc;
}

.act-3 .step-name {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem;
  margin-top: 2rem;
}

/* SECTION II: PRIMITIVES */

.section#primitives h2 {
  font-size: 3rem;
  margin-bottom: 3rem;
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.list-cross,
.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-cross li::before {
  content: '×';
  color: var(--ink-dim);
  margin-right: 12px;
  font-weight: 300;
}

.list-check li::before {
  content: '→';
  color: var(--accent);
  margin-right: 12px;
  font-weight: 700;
}

.list-cross li,
.list-check li {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 12px;
}

.list-check li {
  color: #fff;
  border-bottom-color: #333;
}

/* SECTION III: RADAR */

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  position: relative;
  /* For scan line */
  overflow: hidden;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.radar-item {
  background: var(--bg);
  padding: 24px;
  transition: background 0.2s;
}

.radar-item:hover {
  background: #111;
}

.radar-item h4 {
  color: var(--accent);
  margin-bottom: 8px;
}

.radar-item p {
  font-size: 0.9rem;
  margin: 0;
  color: #ccc;
}

.section-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-dim);
  text-align: right;
}

/* SECTION IV: POWERS */

.section#powers h2 {
  font-size: 3rem;
  margin-bottom: 3rem;
}

.data-table {
  border-top: 2px solid #fff;
}

.row {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.row.head {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  padding-bottom: 1rem;
}

.row:not(.head) span:first-child {
  font-family: var(--font-mono);
  color: var(--accent);
}

.row:not(.head) span:last-child {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #fff;
}

/* SECTION V: BEHAVIOR */

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.clean-list {
  list-style: none;
  padding: 0;
}

.clean-list li {
  font-size: 1.25rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.clean-list.warning li {
  color: #ffcccc;
}

.clean-list.warning li::after {
  content: ' [BREAKS]';
  font-family: var(--font-mono);
  font-size: 0.6em;
  color: var(--accent);
  opacity: 0.6;
  margin-left: 8px;
  vertical-align: middle;
}

.block h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  opacity: 0.7;
  margin-bottom: 2rem;
}

/* SECTION VI: UNIT OF WORK */

.equation {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.equation.highlight {
  font-size: 1.8rem;
  color: #fff;
  border-left: 4px solid var(--accent);
  padding-left: 2rem;
}

/* SECTION VII: INSTITUTION */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.card {
  border: 1px solid var(--line);
  padding: 2rem;
  background: var(--panel);
}

.card ul {
  padding-left: 1.2rem;
  margin-top: 1rem;
}

.card li {
  margin-bottom: 0.5rem;
  color: #ddd;
}

.matrix-box {
  border: 1px solid var(--line);
  padding: 2rem;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.matrix-grid div {
  display: flex;
  flex-direction: column;
}

.matrix-grid span {
  font-weight: 700;
  color: #fff;
}

.matrix-grid small {
  color: var(--ink-dim);
  font-family: var(--font-serif);
  font-style: italic;
}

/* SECTION VIII: MULTIPLEXING */

.text-block {
  font-size: 2rem;
  line-height: 1.4;
  font-family: var(--font-serif);
  max-width: 800px;
}

/* SECTION IX: PLAYBOOK */

.timeline {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--line);
}

.time-step {
  display: grid;
  grid-template-columns: 160px 1fr;
  padding: 2rem 0 2rem 2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.time-step::before {
  content: '';
  width: 12px;
  height: 1px;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 2.8rem;
}

.time-meta {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  padding-top: 4px;
}

.time-content h4 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.time-content p {
  font-family: var(--font-serif);
  color: #aaa;
  font-size: 1.1rem;
  margin: 0;
}

/* SECTION X: TERMINAL */

.terminal-section {
  padding-bottom: 100px;
}

.terminal {
  background: #000;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  overflow: hidden;
}

.terminal-header {
  background: #1a1a1a;
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #333;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}

.dot.yellow {
  background: #ffbd2e;
}

.dot.green {
  background: #27c93f;
}

.terminal-header .title {
  margin-left: 12px;
  color: #666;
  font-size: 0.8rem;
}

.terminal-body {
  padding: 24px;
  min-height: 300px;
  color: #eaeaea;
  font-size: 0.95rem;
}

.prompt {
  color: var(--accent);
  margin-right: 8px;
}

.cmd {
  color: #fff;
}

.log {
  color: #888;
  display: block;
  margin-bottom: 1rem;
}

.cli-form {
  display: flex;
  align-items: center;
}

.cli-form input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  flex: 1;
  outline: none;
  caret-color: var(--accent);
}

.cli-result {
  margin-top: 2rem;
  border-top: 1px dashed #333;
  padding-top: 1rem;
}

.cli-result h4 {
  color: #fff;
  margin-top: 1.5rem;
  font-size: 0.8rem;
}

.cli-result .tag {
  display: inline-block;
  border: 1px solid #444;
  color: var(--accent);
  padding: 2px 8px;
  margin-right: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* FOOTER */

.footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.footer__links a {
  color: var(--ink);
  margin-left: 20px;
  text-decoration: none;
}

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

/* RESPONSIVE */

@media (max-width: 768px) {
  .hero__title {
    font-size: 3rem;
  }

  .split-layout,
  .dual-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .time-step {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .time-step::before {
    display: none;
  }

  .time-step {
    padding-left: 0;
  }

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

  .row:not(.head) span:first-child {
    margin-bottom: 0.5rem;
    display: block;
  }
}

/* TLDR MODE OVERRIDES */
body.tldr-mode {
  --bg: #ffffff;
  --ink: #111111;
  --ink-dim: #555555;
  --line: #e0e0e0;
  --panel: #f4f4f4;
  --font-serif: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body.tldr-mode .hero__title,
body.tldr-mode h1,
body.tldr-mode h2,
body.tldr-mode h3,
body.tldr-mode p,
body.tldr-mode .char,
body.tldr-mode .word {
  color: #111111 !important;
  opacity: 1 !important;
  transform: none !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 500;
}

body.tldr-mode .scan-line {
  display: none;
}

body.tldr-mode .modal-content {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.tldr-mode .modal-title,
body.tldr-mode .modal-bio {
  color: #111;
}

body.tldr-mode .topbar .brand,
body.tldr-mode .nav__link,
body.tldr-mode .nav__cta {
  color: #111;
}

body.tldr-mode .nav__cta {
  color: var(--accent);
}