@font-face {
  font-family: Archivo;
  src: url("../fonts/archivo-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

/* Three grounds, nothing in between. */

:root {
  --white: #f4f4f0;
  --black: #0a0d16;
  --blue: #2b49ff;
  --rule: 3px;
  --gutter: clamp(16px, 3vw, 44px);
  --bar: 56px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

.g-white { --ground: var(--white); --ink: var(--black); --accent: var(--blue); --soft: #3d4352; }
.g-black { --ground: var(--black); --ink: var(--white); --accent: #7f97ff; --soft: #b4bacb; }
.g-blue { --ground: var(--blue); --ink: var(--white); --accent: var(--black); --soft: #e3e8ff; }

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--bar);
  background: var(--white);
}

body {
  margin: 0;
  color: var(--black);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.modal-open { overflow: hidden; }

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
em { font-style: normal; }
sup { font-size: 0.7em; line-height: 0; }

.mono { font-family: var(--mono); font-size: 13px; line-height: 1.45; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.g-blue :focus-visible { outline-color: var(--white); }

/* The scene sits behind everything. Without it each chapter paints its own ground. */

#cosmos {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}
.has-scene #cosmos { display: block; }

main, footer { position: relative; z-index: 1; }

/* Top bar */

.top {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: var(--bar);
  background: var(--black);
  color: var(--white);
  border-bottom: var(--rule) solid var(--white);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: var(--gutter);
  font-size: 17px;
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wm-mark { width: 24px; height: 24px; }

.top nav { display: flex; }
.top nav a {
  display: flex;
  align-items: center;
  padding-inline: clamp(12px, 2vw, 26px);
  border-left: var(--rule) solid var(--white);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
.top nav a:hover { background: var(--white); color: var(--black); }
.top nav a:last-child { background: var(--blue); }
.top nav a:last-child:hover { background: var(--white); }

/* Chapters */

.chapter {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding-top: var(--bar);
  color: var(--ink);
  background: var(--ground);
}
.has-scene .chapter { background: none; }

/* Text sits on solid blocks of the chapter's ground, so the field is cut by them, never mixed with them. */
.block { background: var(--ground); color: var(--ink); }

.strip {
  display: grid;
  grid-template-columns: 64px minmax(0, 150px) minmax(0, 210px) minmax(0, 1fr);
  background: var(--ground);
  border-bottom: var(--rule) solid var(--ink);
}
.strip.three { grid-template-columns: 64px minmax(0, 230px) minmax(0, 1fr); }
.strip span { padding: 10px 14px; border-right: var(--rule) solid var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip span:first-child { background: var(--ink); color: var(--ground); font-weight: 700; text-align: center; }
.strip span:nth-child(2) { font-weight: 700; }
.strip span:last-child { border-right: 0; }

h1, h2 {
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.045em;
  line-height: 0.86;
}

h2 { font-size: clamp(34px, 5.4vw, 86px); }
h2.giant { font-size: clamp(38px, 13.4vw, 232px); letter-spacing: -0.06em; line-height: 0.8; }

h3 { font-size: clamp(21px, 1.9vw, 28px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.05; }

.lead { font-size: clamp(18px, 1.55vw, 23px); line-height: 1.38; font-weight: 500; max-width: 31em; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 28px;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--ground);
  font-size: 18px;
  font-weight: 800;
  font-stretch: 112%;
  cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }
.g-blue .btn:hover { color: var(--white); }

/* 01 */

.hero-head { align-self: start; justify-self: start; padding: clamp(18px, 3vw, 44px) var(--gutter) clamp(12px, 1.6vw, 24px); border-right: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); }

h1 { display: grid; justify-items: start; font-size: clamp(34px, 12.4vw, 216px); }
.h-direction { font-weight: 250; font-stretch: 62%; letter-spacing: -0.02em; line-height: 0.92; }
.h-then { margin: 0.5em 0 0.35em; padding: 3px 10px; background: var(--blue); color: var(--white); font-size: clamp(13px, 1.1vw, 17px); font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.h-magnitude { letter-spacing: -0.065em; line-height: 0.8; padding-bottom: 0.06em; }

.hero-foot { align-self: end; justify-self: start; }
.hero-foot .block { padding: clamp(18px, 2.2vw, 30px) var(--gutter); border-top: var(--rule) solid var(--ink); border-right: var(--rule) solid var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 22px; }
.note { color: var(--soft); }

/* 02 */

.manifesto { align-self: center; justify-self: start; max-width: min(900px, 68%); padding: clamp(22px, 3.4vw, 52px) var(--gutter); border-block: var(--rule) solid var(--ink); border-right: var(--rule) solid var(--ink); }
.big { font-size: clamp(25px, 3.3vw, 52px); font-weight: 700; font-stretch: 104%; letter-spacing: -0.03em; line-height: 1.06; }
.big em { background: var(--blue); color: var(--white); padding: 0 0.16em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* 03 and 07: a title and three columns */

.title-block { align-self: start; justify-self: start; padding: clamp(18px, 2.6vw, 38px) var(--gutter); border-right: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); }
.title-block.right { justify-self: end; border-right: 0; border-left: var(--rule) solid var(--ink); }

.cols { grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--rule) solid var(--ink); }
.cols li { display: grid; gap: 12px; align-content: start; padding: clamp(18px, 2.2vw, 32px) var(--gutter) clamp(24px, 3vw, 44px); border-right: var(--rule) solid var(--ink); }
.cols li:last-child { border-right: 0; }
.cols p { color: var(--soft); font-size: 17px; }

.steps { counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); font-size: clamp(64px, 8vw, 132px); font-weight: 900; font-stretch: 125%; letter-spacing: -0.06em; line-height: 0.8; color: var(--accent); }

/* 04 to 06: one word, very large, and what it means */

.cap .title-block { grid-row: 3; align-self: end; border-top: var(--rule) solid var(--ink); border-bottom: 0; padding-bottom: clamp(12px, 1.6vw, 24px); }
.cap .cap-body { grid-row: 2; align-self: start; justify-self: end; width: min(560px, 46%); padding: clamp(18px, 2.4vw, 34px) var(--gutter); border-left: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); }
.cap.flip .title-block { justify-self: end; border-right: 0; border-left: var(--rule) solid var(--ink); }
.cap.flip .cap-body { justify-self: start; border-left: 0; border-right: var(--rule) solid var(--ink); }

.tags { display: flex; flex-wrap: wrap; margin-top: 22px; border-top: var(--rule) solid var(--ink); border-left: var(--rule) solid var(--ink); }
.tags li { padding: 8px 12px; border-right: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); }

/* 08 */

.contact-foot { grid-row: 3; align-self: end; justify-self: start; max-width: 100%; }
.contact-foot .block { display: grid; gap: 22px; justify-items: start; padding: clamp(20px, 2.8vw, 40px) var(--gutter) clamp(26px, 3.4vw, 48px); border-top: var(--rule) solid var(--ink); border-right: var(--rule) solid var(--ink); }
h2.contact-lede { font-size: clamp(34px, 6.6vw, 116px); letter-spacing: -0.05em; line-height: 0.84; max-width: 7em; }
.contact-sub em { background: var(--black); color: var(--white); padding: 0 0.2em; }
.g-blue .btn { background: var(--white); border-color: var(--white); color: var(--black); }
.g-blue .btn:hover { background: var(--black); border-color: var(--black); color: var(--white); }

/* Footer */

footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--black);
  color: var(--white);
  border-top: var(--rule) solid var(--white);
}
footer span { padding: 16px var(--gutter); border-right: var(--rule) solid var(--white); }
footer span:last-child { border-right: 0; text-align: right; }

/* Contact dialog */

.cmodal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; visibility: hidden; opacity: 0; transition: opacity 0.15s linear, visibility 0s 0.15s; }
.cmodal.open { visibility: visible; opacity: 1; transition: opacity 0.15s linear; }
.cmodal-scrim { position: absolute; inset: 0; background: rgba(10, 13, 22, 0.82); }
.cmodal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100svh - 32px);
  overflow: auto;
  padding: clamp(22px, 4vw, 40px);
  background: var(--white);
  color: var(--black);
  border: var(--rule) solid var(--black);
  box-shadow: 12px 12px 0 var(--blue);
}
.cmodal-close { position: absolute; top: 0; right: 0; width: 52px; height: 52px; border: 0; border-left: var(--rule) solid var(--black); border-bottom: var(--rule) solid var(--black); background: var(--white); font-size: 28px; line-height: 1; cursor: pointer; }
.cmodal-close:hover { background: var(--black); color: var(--white); }
.cmodal-title { font-size: clamp(26px, 4vw, 40px); font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.95; padding-right: 48px; }
.cmodal-sub { margin-top: 12px; color: #3d4352; }

.contact-form { display: grid; gap: 12px; margin-top: 24px; }
.cf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cf-input { width: 100%; padding: 13px 14px; border: var(--rule) solid var(--black); border-radius: 0; background: var(--white); color: var(--black); font: inherit; font-size: 17px; }
.cf-input::placeholder { color: #5b6170; }
.cf-input:focus { outline: 0; border-color: var(--blue); box-shadow: 4px 4px 0 var(--blue); }
textarea.cf-input { min-height: 120px; resize: vertical; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form .btn { justify-self: start; background: var(--black); border-color: var(--black); color: var(--white); }
.contact-form .btn:hover { background: var(--blue); border-color: var(--blue); }
.contact-form .btn:disabled { opacity: 0.6; cursor: default; }
.cf-status { min-height: 1.5em; }
.cf-status.ok { color: #0b6b3a; font-weight: 700; }
.cf-status.err { color: #b42318; font-weight: 700; }

/* Narrow screens */

@media (max-width: 900px) {
  .strip { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.2fr); }
  .strip span:nth-child(3) { border-right: 0; }
  .strip span:last-child { grid-column: 1 / -1; border-top: var(--rule) solid var(--ink); white-space: normal; }
  .strip.three { grid-template-columns: 52px minmax(0, 1fr); }
  .strip.three span:nth-child(2) { border-right: 0; }
  .manifesto { max-width: 88%; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .cols li { border-right: 0; border-bottom: var(--rule) solid var(--ink); }
  .cols li:last-child { border-bottom: 0; }
  .steps li { grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; }
  .steps li::before { grid-row: 1 / 3; font-size: 64px; }
  .chapter { grid-template-rows: auto auto 1fr auto; }
  .chapter .cols, .cap .title-block, .contact-foot { grid-row: 4; }
  .cap .cap-body { width: min(560px, 86%); }
  .title-block.right { justify-self: start; border-left: 0; border-right: var(--rule) solid var(--ink); }
  .chapter:has(.cols) { min-height: 0; }
  .chapter:has(.cols) .title-block { margin-bottom: 42svh; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .top nav a:not(:last-child) { display: none; }
  .hero-foot .block, .contact-foot .block { border-right: 0; }
  footer { grid-template-columns: minmax(0, 1fr); }
  footer span { border-right: 0; border-bottom: var(--rule) solid var(--white); text-align: left; }
  footer span:last-child { border-bottom: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
