@import url("../fonts/fonts.css");

/* ============================================================
   Intuition Machine
   Palette is drafting stock rather than white: a technical
   document that happens to be a website. Teal is the brand
   mark's own colour, used only as a signal.
   ============================================================ */

:root {
  --paper:      #e7e4dc;
  --paper-hi:   #f3f1eb;
  --paper-sunk: #dedad0;
  --ink:        #14171a;
  --ink-2:      #5a6068;
  --rule:       #c8c4b9;
  --signal:     #0f6e63;
  --signal-lit: #43c4b0;
  --deep:       #0d1214;
  --deep-2:     #182124;
  --deep-rule:  #2b383c;
  /* Text on the dark bands. --ink-2 is tuned for paper and drops to ~3:1
     against near-black, so dark grounds get their own secondary tone. */
  --on-deep:    #d3dadb;
  --on-deep-2:  #9fabad;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 64ch;
  --max: 1240px;

  --step: clamp(3.25rem, 5.5vw, 5.5rem); /* vertical rhythm between sections */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, .38vw + .95rem, 1.16rem);
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

::selection { background: var(--signal); color: var(--paper-hi); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- shared primitives ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

/* Mono utility type: eyebrows, labels, captions, figure numbers. */
.label {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink-2);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); letter-spacing: -.014em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------- header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  margin-right: auto;
}
.brand__mark { width: auto; height: 30px; flex: none; }
.brand b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: -.024em;
}

.nav { display: flex; gap: 1.6rem; align-items: center; }
.nav a {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--signal); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* One nav that wraps to a second row on narrow screens, rather than a
   duplicate mobile list or a menu that needs JavaScript. */
@media (max-width: 760px) {
  .masthead__inner { flex-wrap: wrap; padding-bottom: .55rem; }
  .nav {
    width: 100%;
    gap: .5rem 1.15rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--rule);
    padding-top: .55rem;
  }
}

/* ---------- hero ---------- */

.hero { padding-top: clamp(2.4rem, 5vw, 4.2rem); }

/* Publisher lockup. The company owns the work, so its name sits above the
   title like a journal masthead rather than hiding in the nav. */
.lockup {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}
/* The artwork carries the wordmark, so it has to be sized for the wordmark to
   read - not for the cube. Height is set from the whole lockup, which is about
   1.8:1, so the type inside lands near the size it had as live text. */
.lockup__logo {
  width: auto;
  height: clamp(72px, 11vw, 140px);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  flex: none;
}
.lockup i {
  font-family: var(--mono);
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-left: auto;
  text-align: right;
  line-height: 1.5;
}
@media (max-width: 620px) { .lockup i { display: none; } }

.hero__eyebrow { display: block; margin-bottom: 1.4rem; }

.hero h1 {
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .98;
  max-width: 16ch;
}
.hero h1 sup {
  font-size: .3em;
  font-weight: 600;
  vertical-align: super;
  letter-spacing: 0;
}

.hero__sub {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: clamp(1.12rem, .6vw + 1rem, 1.4rem);
  color: var(--ink-2);
  line-height: 1.45;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2.2rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .85rem 1.4rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-hi);
  transition: background .18s, color .18s, border-color .18s;
}
.btn:hover { background: var(--signal); border-color: var(--signal); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }

.btn--lit { background: var(--signal-lit); border-color: var(--signal-lit); color: var(--deep); }
.btn--lit:hover { background: var(--paper-hi); border-color: var(--paper-hi); color: var(--deep); }

/* ---------- figure: the signature plate ---------- */

.plate { margin-top: clamp(2.5rem, 5vw, 4rem); }

.plate__frame {
  position: relative;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-hi), var(--paper-sunk));
  overflow: hidden;
}
.plate__frame canvas { display: block; width: 100%; height: auto; }

/* Corner ticks - drafting registration marks. */
.plate__frame::before,
.plate__frame::after {
  content: "";
  position: absolute;
  width: 11px; height: 11px;
  border: 1px solid var(--signal);
  opacity: .55;
  pointer-events: none;
}
.plate__frame::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.plate__frame::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }

.plate__caption {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  justify-content: space-between;
  padding-top: .7rem;
}
.plate__caption span:last-child { color: var(--ink); }

/* ---------- the matrix controls ---------- */

.plate__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.2rem;
  padding: .7rem .9rem;
  border: 1px solid var(--rule);
  border-top: 0;
  background: var(--paper-hi);
}

/* The word being executed, one letter per box, current letter lit. */
.plate__word {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: auto;
  font-variant-numeric: lining-nums;
}
.plate__word .ltr {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1;
  padding: .42rem .5rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.plate__word .ltr.is-on {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--paper-hi);
}
/* ▼ marks the audit computation, not a move, so it never lights. */
.plate__word .ltr.is-mark { border-style: dashed; color: var(--rule); }

.plate__buttons { display: flex; gap: .5rem; }
.plate__bar button {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  min-height: 30px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.plate__bar button:hover { background: var(--ink); color: var(--paper-hi); }

.loop-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: .7rem;
}
.loop-picker button {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 600;
  padding: .45rem .7rem;
  min-height: 30px;
  border: 1px solid var(--rule);
  background: var(--paper-hi);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.loop-picker button:hover { border-color: var(--signal); color: var(--signal); }
.loop-picker button[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--paper-hi);
}

.plate__status {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  align-items: baseline;
  margin: .8rem 0 0;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-2);
}
.verdict { font-weight: 600; }
.verdict.is-ok { color: var(--signal); }
.verdict.is-bad { color: #a33a2a; }

/* ---------- run your own word ---------- */

.lab { margin-top: 1rem; border-top: 1px solid var(--rule); }
.lab summary {
  cursor: pointer;
  list-style: none;
  padding: .8rem 0;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
}
.lab summary::-webkit-details-marker { display: none; }
.lab summary::before { content: "+ "; }
.lab[open] summary::before { content: "\2212 "; }

.lab form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .7rem;
  padding-bottom: .9rem;
}
.lab label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.lab select, .lab input {
  font-family: var(--mono);
  font-size: .82rem;
  padding: .55rem .6rem;
  border: 1px solid var(--rule);
  background: var(--paper-hi);
  color: var(--ink);
  min-height: 34px;
}
.lab input { flex: 1 1 12rem; letter-spacing: .12em; text-transform: uppercase; }
.lab select:focus-visible, .lab input:focus-visible { border-color: var(--signal); }
.lab .btn { padding: .6rem 1.1rem; }
.lab p {
  font-size: .88rem;
  color: var(--ink-2);
  max-width: 62ch;
  padding-bottom: 1rem;
}

/* ---------- generic section ---------- */

.section { padding-block: var(--step); }

/* A hairline between sections reads as document structure, and makes the
   whitespace look measured rather than merely empty. */
.section--ruled { border-top: 1px solid var(--rule); }
.section__head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section__head .label { display: block; margin-bottom: 1.1rem; }
.section__head h2 { max-width: 20ch; }

.lede {
  font-size: clamp(1.06rem, .3vw + 1rem, 1.2rem);
  color: var(--ink-2);
}

/* Two-column: heading rail + prose. */
.split {
  display: grid;
  gap: clamp(1.6rem, 4vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* ---------- methodology pipeline (the one earned sequence) ---------- */

.cycle { position: relative; }

/* Six stages, so the column counts are explicit: auto-fit leaves a dead
   cell at most widths. 2 -> 3 -> 6 keeps every row full. */
.cycle__track {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 620px) {
  .cycle__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .cycle__track { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.stage {
  position: relative;
  background: var(--paper);
  padding: 1.5rem 1.3rem 1.9rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: background .2s;
}
.stage:hover, .stage:focus-within { background: var(--paper-hi); }

/* The node + connecting line that makes the sequence legible. */
.stage__node {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
}
.stage__dot {
  width: 9px; height: 9px;
  border: 1px solid var(--signal);
  background: var(--paper);
  border-radius: 50%;
  flex: none;
  transition: background .2s;
}
.stage:hover .stage__dot, .stage:focus-within .stage__dot { background: var(--signal); }
.stage__num {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--signal);
}
.stage__line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.stage h3 {
  font-size: 1.22rem;
  letter-spacing: -.012em;
}
.stage p {
  font-size: .9rem;
  line-height: 1.48;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- software: the two products ---------- */

.products {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 820px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.product {
  background: var(--paper);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.product__icon {
  width: 44px; height: 44px;
  color: var(--signal);
  margin-bottom: 1.4rem;
}
.product__abbr {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--signal);
}
.product h3 {
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  margin: .35rem 0 .5rem;
}
.product__role {
  font-style: italic;
  color: var(--ink-2);
  margin-bottom: 1.4rem;
}

.caps { list-style: none; margin: 0; padding: 0; }
.caps li {
  display: flex;
  gap: .8rem;
  padding: .7rem 0;
  border-top: 1px solid var(--rule);
  font-size: .97rem;
  line-height: 1.45;
}
.caps li::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  margin-top: .58em;
  background: var(--signal);
  transform: rotate(45deg);
}

/* ---------- evidence: real product screenshots ---------- */

.shots {
  display: grid;
  gap: clamp(1rem, 2vw, 1.6rem);
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(2rem, 4vw, 3rem);
}
@media (min-width: 820px) {
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.shot { margin: 0; }
.shot img {
  width: 100%;
  height: auto; /* the width/height attrs are for aspect ratio, not layout */
  border: 1px solid var(--rule);
  background: var(--paper-hi);
  filter: saturate(.72) contrast(1.02);
}
.shot figcaption { padding-top: .6rem; }

/* ---------- dark bands ---------- */

.band--deep {
  background: var(--deep);
  color: var(--paper-hi);
}
.band--deep h2 { color: var(--paper-hi); }
.band--deep .label { color: var(--signal-lit); }
.band--deep .lede { color: var(--on-deep); }
.band--deep .rule { border-top-color: var(--deep-rule); }
/* Two dark bands in a row need a seam, or they read as one long void. */
.band--deep + .band--deep > .section { border-top: 1px solid var(--deep-rule); }

/* ---------- team ---------- */

.person {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.person__portrait {
  width: 156px; height: 156px;
  flex: none;
  border: 1px solid var(--deep-rule);
  filter: grayscale(1) contrast(1.12) brightness(1.06);
  object-fit: cover;
}
.person h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.person__meta {
  margin: .5rem 0 1.1rem;
  color: var(--on-deep);
  font-style: italic;
}
.person__link {
  display: inline-block;
  padding-block: .4rem;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal-lit);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.person__link:hover { border-bottom-color: var(--signal-lit); }

/* ---------- closing call to action ---------- */

.cta { text-align: center; }
.cta h2 {
  max-width: 22ch;
  margin-inline: auto;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}
.cta .lede { margin: 1.3rem auto 0; max-width: 48ch; }
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
  margin-top: 2.4rem;
}

/* ---------- footer ---------- */

.foot {
  background: var(--deep-2);
  color: var(--on-deep);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  font-size: .9rem;
}
.foot a { color: var(--paper-hi); text-decoration: none; }
.foot a:hover { color: var(--signal-lit); }

.foot .brand__mark { height: 34px; }
.foot .brand b { font-size: 1.25rem; }

.foot__grid {
  display: grid;
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .foot .brand__mark { height: 34px; }
.foot .brand b { font-size: 1.25rem; }

.foot__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.foot h4 {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--on-deep-2);
  margin-bottom: .9rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .15rem; }
/* Inline links are ~20px tall, which is under the 24px touch minimum.
   Padding rather than font-size keeps the footer's scale intact. */
.foot li a { display: inline-block; padding-block: .3rem; }
.foot__base {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--deep-rule);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-deep-2);
}

/* ---------- article pages (Research Machine, About) ---------- */

.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -.032em;
  max-width: 18ch;
}
.page-head .label { display: block; margin-bottom: 1.4rem; }
.page-head .lede { margin-top: 1.4rem; max-width: 52ch; }

.steps { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.step { background: var(--paper); padding: clamp(1.5rem, 3vw, 2.2rem); }
.step__label { display: block; margin-bottom: .8rem; color: var(--signal); }
.step h3 { margin-bottom: .7rem; }
.step p { color: var(--ink-2); max-width: 62ch; }

.faq { border-top: 1px solid var(--rule); }
.faq details {
  border-bottom: 1px solid var(--rule);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.3rem 2.5rem 1.3rem 0;
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  letter-spacing: -.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: .2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--signal);
  transition: transform .2s;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--signal); }
.faq__body { padding: 0 0 1.6rem; color: var(--ink-2); max-width: var(--measure); }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.contact-cell { background: var(--paper); padding: clamp(1.4rem, 3vw, 2rem); }
.contact-cell .label { display: block; margin-bottom: .9rem; }
.contact-cell a {
  display: inline-block;
  padding-block: .25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.contact-cell a:hover { border-bottom-color: var(--signal); color: var(--signal); }

/* ---------- formal blocks ---------- */

/* The specification's own "technical mode": exact statements, set apart
   from the prose so a reader can skip them entirely. */
.code {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.65;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--signal);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.band--deep .code {
  background: var(--deep-2);
  border-color: var(--deep-rule);
  border-left-color: var(--signal-lit);
  color: #c6d0d1;
}

/* Healthy vs degraded, side by side: the whole pathology argument. */
.compare {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 820px) {
  .compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.compare__cell { background: var(--paper); padding: clamp(1.3rem, 2.6vw, 1.9rem); }
.compare__cell .label { display: block; margin-bottom: .9rem; }
.compare__cell .code { border-left-width: 2px; }
.compare__cell--bad .code { border-left-color: #a33a2a; }
.compare__cell--bad .label { color: #a33a2a; }
.compare__note { margin-top: 1rem; font-size: .95rem; color: var(--ink-2); }

/* Honesty labels: every claim in the spec carries one. */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: .28rem .55rem;
  border: 1px solid var(--rule);
  background: var(--paper-hi);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--axiom   { border-color: var(--ink); color: var(--ink); }
.chip--theorem {
  border-color: var(--signal);
  color: #094f46;
  background: color-mix(in srgb, var(--signal) 8%, var(--paper-hi));
}

/* The counted facts of the kernel. */
.figures {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 700px)  { .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .figures { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.figure-cell {
  background: var(--paper);
  padding: 1.3rem 1.1rem 1.5rem;
}
.figure-cell b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: lining-nums;
  margin-bottom: .5rem;
}
.figure-cell span {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.5;
  display: block;
}
.band--deep .figure-cell { background: var(--deep); }
.band--deep .figure-cell b { color: var(--signal-lit); }
.band--deep .figure-cell span { color: var(--on-deep-2); }
.band--deep .figures { background: var(--deep-rule); border-color: var(--deep-rule); }

/* A named failure, stated once, with its everyday case underneath. */
.failure { border-top: 1px solid var(--rule); padding-top: 1.4rem; margin-top: 1.4rem; }
.failure:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.failure h3 { margin-bottom: .5rem; }
.failure .label { display: block; margin-bottom: .7rem; }
.failure p { color: var(--ink-2); max-width: 62ch; }

.terms { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (min-width: 760px) { .terms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.term { background: var(--paper); padding: clamp(1.3rem, 2.6vw, 1.8rem); }
.term__glyph {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--signal);
  display: block;
  margin-bottom: .6rem;
}
.term h3 { font-size: 1.15rem; margin-bottom: .45rem; }
/* When a term heading is a link it still needs a 24px touch target. */
.term h3 a { display: inline-block; padding-block: .25rem; }
.term p { font-size: .93rem; line-height: 1.5; color: var(--ink-2); }

/* ---------- explanatory figures ---------- */

.fig { margin: clamp(2rem, 4vw, 3rem) 0 0; }
.fig svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
}
.fig figcaption { padding-top: .65rem; }

/* Figures sit on light stock even inside a dark band, so the drawing keeps
   its contrast without needing a second colourway. */
.band--deep .fig figcaption { color: var(--on-deep-2); }

/* ---------- video embed ---------- */

/* A click-to-load facade. The page makes no request to YouTube until the
   visitor presses play, which keeps the site's no-external-requests property
   intact for anyone who never watches, and keeps the poster fast. */
.embed { position: relative; }
.embed__poster {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--deep);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}
.embed__poster img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(.85) contrast(1.02);
  transition: transform .4s, filter .3s;
}
.embed__poster:hover img { transform: scale(1.014); filter: saturate(1) contrast(1.02); }

.embed__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.embed__play svg {
  filter: drop-shadow(0 2px 14px rgba(0,0,0,.45));
  transition: transform .25s;
}
.embed__poster:hover .embed__play svg { transform: scale(1.08); }

.embed__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.4rem 1.2rem .95rem;
  background: linear-gradient(180deg, transparent, rgba(6,10,11,.9));
  color: var(--paper-hi);
  pointer-events: none;
}
.embed__meta b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  letter-spacing: -.018em;
}
.embed__meta i {
  display: block;
  margin-top: .3rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--on-deep-2);
}

/* Once loaded, the iframe takes the same box. */
.embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
}

.embed__note {
  margin-top: .8rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--ink-2);
  max-width: 68ch;
}

/* ---------- playlist player ---------- */

.player {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .player { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
}
.player__stage { background: var(--deep); min-width: 0; }
.player__stage iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
.player__stage .embed__poster { border: 0; }

.player__bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .8rem;
  background: var(--deep-2);
  border-top: 1px solid var(--deep-rule);
}
.player__bar button {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .5rem .8rem;
  min-height: 32px;
  border: 1px solid var(--deep-rule);
  background: transparent;
  color: var(--on-deep);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.player__bar button:hover:not(:disabled) {
  background: var(--signal-lit); border-color: var(--signal-lit); color: var(--deep);
}
.player__bar button:disabled { opacity: .35; cursor: default; }

.player__now {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--on-deep-2);
  overflow: hidden;
}
.player__now b {
  display: block;
  font-family: var(--display);
  font-size: .92rem;
  font-weight: 600;
  color: var(--paper-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The episode rail. Scrolls independently beside the player on wide screens,
   and sits under it, capped, on narrow ones. */
.pl { background: var(--paper-hi); display: flex; flex-direction: column; min-width: 0; }
.pl__head {
  margin: 0;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper-hi);
}
.pl__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 22rem;
  counter-reset: none;
}
@media (min-width: 900px) { .pl__list { max-height: min(60vh, 30rem); } }

.pl__list button {
  display: flex;
  gap: .7rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: .7rem .9rem;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background .14s;
}
.pl__list button:hover { background: var(--paper-sunk); }
.pl__list button[aria-current="true"] { background: var(--signal); }
.pl__list button[aria-current="true"] .pl__t { color: var(--paper-hi); }
.pl__list button[aria-current="true"] .pl__n { color: var(--paper-hi); opacity: .8; }

.pl__n {
  flex: none;
  font-family: var(--mono);
  font-size: .68rem;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--signal);
}
.pl__t {
  font-family: var(--body);
  font-size: .92rem;
  line-height: 1.35;
  color: var(--ink);
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper-hi);
  padding: .8rem 1.2rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  text-decoration: none;
}
.skip:focus { left: .5rem; top: .5rem; }
