/* Page shell: phase rail, headline, footer, heat strip. */

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

body {
  background: var(--basalt);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* Preview index stacks pages with a gap; single-page files have one .page. */
body.preview { background: #0f0e0d; padding-block: 24px; }
body.preview .page { margin: 0 auto 24px; }

.page {
  position: relative;
  width: var(--page-w);
  min-height: var(--page-min-h);
  display: flex;
  flex-direction: column;
  padding: var(--top) calc(var(--gutter) + var(--strip-w)) 20px var(--gutter);
  background: var(--basalt);
  overflow: hidden;
}

/* ---- Heat strip: the document warming up as you read ---- */
.heat {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--strip-w);
  background: var(--ash);
}
.heat::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--heat, 0) * 100%);
  background: linear-gradient(to bottom, var(--slate), var(--ember));
}
.page--rebuild .heat::after { height: 100%; background: var(--sun); }

/* ---- Phase rail: Diagnose / Release / Rebuild ---- */
.rail {
  display: flex;
  gap: 4px;
  margin: 0 0 var(--s5);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.rail__seg {
  flex: 1;
  padding: 6px 7px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.rail__seg--diagnose { color: var(--slate); }
.rail__seg--rebuild  { color: var(--sun); }
.rail__seg--release  {
  flex: 1.7;
  color: var(--basalt);
  background: var(--ember);
  border-color: var(--ember);
}
.page--rebuild .rail__seg--release { color: var(--ember); background: none; }
.page--rebuild .rail__seg--rebuild { color: var(--basalt); background: var(--sun); border-color: var(--sun); }

/* ---- Headlines ---- */
.h1 {
  margin: 0 0 var(--s4);
  font-family: var(--f-display);
  font-stretch: 62%;
  font-weight: 850;
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.h1--m { font-size: var(--t-h1); }
.h2 {
  margin: var(--s5) 0 var(--s2);
  font-family: var(--f-display);
  font-stretch: 72%;
  font-weight: 750;
  font-size: var(--t-h2);
  line-height: 1.05;
}
.lead {
  margin: 0 0 var(--s4);
  font-size: var(--t-lead);
  line-height: 1.38;
}

p { margin: 0 0 var(--s3); }
.body > :last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--slate); text-underline-offset: 2px; }

/* Arrow glyph (neither font ships U+2192) */
.arw {
  display: inline-block;
  width: 0.95em;
  height: 0.62em;
  vertical-align: 0.06em;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ---- Footer ---- */
.foot {
  margin-top: auto;
  padding-top: var(--s5);
}
.foot__inner {
  display: flex;
  align-items: flex-end;
  gap: var(--s3);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
  font-size: 10px;
  line-height: 1.4;
  color: var(--bone-dim);
}
.foot__text { flex: 1; }
.foot__n {
  font-family: var(--f-display);
  font-stretch: 62%;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}

/* ---- Draft-only review markers (never in release builds) ---- */
.draft-flag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px dashed var(--slate);
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--slate);
  vertical-align: 0.2em;
}
