/* =========================================================
   Belay — style.css
   All colors, sizes, and spacing are set via variables in :root.
   Change them in one place, the whole page follows.
   ========================================================= */

:root {
  /* --- Base palette --- */
  --paper:      #E4E7E8;   /* page background, cool gray */
  --surface:    #F3F5F5;   /* cards, tables, code blocks */
  --surface-2:  #DADEDF;   /* secondary fill */
  --ink:        #121A1F;   /* primary text */
  --ink-soft:   #4C585F;   /* secondary text */
  --ink-faint:  #5F6569;   /* small captions — darkened from the original #7C888E to clear 4.5:1 on paper */
  --ink-wisp:   #ADB3B8;   /* pure wayfinding (section ordinals) — intentionally below 4.5:1; it sits beside a fully-legible heading, not standalone content */
  --rule:       #C2C8CA;   /* hairline */
  --rule-soft:  #D5DADB;

  /* --- Belay risk status colors. Used consistently across the page.
         Red is reserved for genuine emergencies only — everything else
         escalates through safe → caution before it ever gets there. --- */
  --belay-safe:         #0F6E56;   /* teal — healthy position */
  --belay-caution:      #BA7517;   /* amber — watch / trim */
  --belay-danger:       #A32D2D;   /* red — emergency only */
  --belay-frozen:       #185FA5;   /* blue — oracle frozen / market closed (a fact, not a warning) */
  --belay-caution-text: color-mix(in srgb, var(--belay-caution), black 25%); /* darkened for AA text contrast on light backgrounds */

  /* --- Typography --- */
  --font-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  /* --- Layout sizes --- */
  --nav-w:     264px;
  --col-w:     68ch;    /* reading column width, capped at 68 characters */
  --gutter:    2.5rem;
}

/* ---------------------------------------------------------
   Light reset
   --------------------------------------------------------- */
*, *::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: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-feature-settings: "onum" 1;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a { color: inherit; }

::selection { background: var(--belay-frozen); color: #fff; }

:focus-visible {
  outline: 2px solid var(--belay-frozen);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Skip link
   --------------------------------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; z-index: 200;
  font-family: var(--font-head); font-size: .8rem;
}
.skip:focus { left: 0; }

/* =========================================================
   BRAND LOCKUP
   Mark and wordmark sit side by side. Gap = 40% of the mark's
   width. The mark is always monochrome — never tint it with an
   accent color.
   ========================================================= */
.brand {
  display: flex;
  align-items: center;
  gap: .64rem;
  color: var(--ink);
  margin-bottom: 1.75rem;
}
.brand__mark { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }
.brand__word {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -.01em;
}

/* =========================================================
   DOC BANNER (mechanics page only)
   ========================================================= */
.doc-banner {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-head);
  font-size: .82rem;
  text-align: center;
  padding: .65rem var(--gutter);
}
.doc-banner a { text-decoration: underline; font-weight: 600; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  border-bottom: 1px solid var(--rule);
  padding: 3.25rem var(--gutter) 0;
  background:
    linear-gradient(to bottom, #EDEFF0 0%, var(--paper) 100%);
}

.hero__inner { max-width: 68rem; margin: 0 auto; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.4rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--ink-faint);
  margin-bottom: 2.75rem;
}
.hero__meta span { white-space: nowrap; }
.hero__meta em {
  font-style: normal;
  color: var(--ink);
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: .98;
  letter-spacing: -.028em;
  margin: 0 0 1.25rem;
  max-width: 16ch;
}

.hero__lede {
  max-width: 40rem;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 3rem;
}

/* --- Week strip: the document's core visual --- */
.week {
  margin: 0 0 2.25rem;
}

.week__caption {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-soft);
  margin-bottom: .85rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}

.week__grid {
  display: grid;
  grid-template-columns: 3.4rem repeat(7, 1fr);
  gap: 0 3px;
  height: 246px;
  position: relative;
}

.week__hours {
  position: relative;
  font-family: var(--font-mono);
  font-size: .64rem;
  color: var(--ink-faint);
}
.week__hours i {
  position: absolute;
  right: .55rem;
  font-style: normal;
  transform: translateY(-50%);
}

.day {
  position: relative;
  background: var(--surface-2);
  overflow: hidden;
}

.week__axis {
  display: grid;
  grid-template-columns: 3.4rem repeat(7, 1fr);
  gap: 0 3px;
  margin-top: .4rem;
  font-family: var(--font-head);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}
.week__axis .is-closed { color: var(--belay-frozen); }

.band {
  position: absolute;
  left: 0; right: 0;
  z-index: 1;
}
.band--regular   { background: var(--belay-safe); }
.band--extended  { background: color-mix(in srgb, var(--belay-safe), white 30%); }
.band--overnight { background: var(--belay-caution); }
.band--frozen    { background: var(--belay-frozen); }
.band--frozen::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,.16) 0 2px,
    transparent 2px 9px
  );
}

.day--closed { background: var(--belay-frozen); }
.day--closed::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,.16) 0 2px,
    transparent 2px 9px
  );
}

.day__frozen {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .06em;
  color: #fff;
  z-index: 2;
}

/* event marker */
.mark {
  position: absolute;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: .66rem;
  line-height: 1.3;
  color: var(--ink);
  pointer-events: none;
}
.mark::before {
  content: "";
  position: absolute;
  left: -.55rem; top: .28rem;
  width: .42rem; height: .42rem;
  background: var(--belay-caution);
}
.mark--danger::before { background: var(--belay-danger); }

.mark__rule {
  position: absolute;
  height: 1px;
  background: var(--ink);
  z-index: 4;
}

/* one-time sweep on page load */
.week__sweep {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--ink);
  opacity: 0;
  z-index: 5;
  pointer-events: none;
}
.week__grid.is-playing .week__sweep {
  animation: sweep 2.6s cubic-bezier(.4,0,.2,1) .5s 1 forwards;
}
@keyframes sweep {
  0%   { left: 3.4rem; opacity: 0; }
  8%   { opacity: .85; }
  92%  { opacity: .85; }
  100% { left: 100%; opacity: 0; }
}

/* legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  font-size: .8rem;
  color: var(--ink-soft);
  padding-bottom: 3.25rem;
}
.legend b {
  display: inline-block;
  width: .72rem; height: .72rem;
  margin-right: .45rem;
  vertical-align: -1px;
}

/* =========================================================
   PAGE SHELL
   ========================================================= */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  max-width: 78rem;
  margin: 0 auto;
}

/* --- Side navigation --- */
.nav {
  border-right: 1px solid var(--rule);
  font-family: var(--font-head);
}

.nav__inner {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 2.75rem 1.25rem 3rem var(--gutter);
}

.nav__title {
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0 0 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--rule);
}

.nav ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: sec -1;
}
.nav li { counter-increment: sec; }

.nav a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: .35rem;
  padding: .3rem 0;
  font-size: .8125rem;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 2px;
}
.nav a::before {
  content: counter(sec);
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-wisp);
  padding-top: .1em;
}
.nav a:hover { color: var(--ink); }
.nav a.is-current { color: var(--ink); font-weight: 600; }
.nav a.is-current::before { color: var(--ink); }

.nav__foot {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: .72rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.nav__foot button {
  font: inherit;
  font-family: var(--font-head);
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: .35rem .6rem;
  cursor: pointer;
  margin-bottom: .75rem;
}
.nav__foot button:hover { border-color: var(--ink); color: var(--ink); }

/* --- Content column --- */
.main {
  padding: 2.75rem var(--gutter) 6rem;
  min-width: 0;
}
.main > * { max-width: var(--col-w); }
.main > .wide { max-width: 56rem; }

/* =========================================================
   SECTIONS & HEADINGS
   ========================================================= */
.sec {
  padding-top: 3.5rem;
  scroll-margin-top: 1.5rem;
}
.sec:first-of-type { padding-top: .5rem; }

.sec > h2 {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.018em;
  line-height: 1.12;
  margin: 0 0 1.4rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: baseline;
}
.sec > h2 .num {
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 400;
  color: var(--ink-wisp); /* wayfinding, not content — the heading text beside it carries full contrast */
}

h3 {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.008em;
  margin: 2.25rem 0 .75rem;
}

h4 {
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 600;
  margin: 1.75rem 0 .5rem;
}

p { margin: 0 0 1.1rem; }

.main ul, .main ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }
.main li { margin-bottom: .45rem; }
.main li::marker { color: var(--ink-faint); }

strong { font-weight: 700; }

code {
  font-family: var(--font-mono);
  font-size: .84em;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  padding: .05em .32em;
  white-space: nowrap;
}

/* =========================================================
   CODE BLOCKS
   ========================================================= */
pre {
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.62;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-soft);
  padding: 1.05rem 1.15rem;
  margin: 0 0 1.4rem;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
pre code {
  background: none; border: 0; padding: 0;
  font-size: inherit; white-space: pre;
}

/* =========================================================
   TABLE
   ========================================================= */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  line-height: 1.45;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: .6rem .8rem .6rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .78rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding-bottom: .5rem;
}
tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
td code { white-space: normal; }

.t-num { font-family: var(--font-mono); font-size: .8rem; }

/* =========================================================
   CALLOUT
   ========================================================= */
.note {
  border-left: 3px solid var(--ink-soft);
  background: var(--surface);
  padding: 1rem 1.15rem;
  margin: 0 0 1.4rem;
  font-size: .95rem;
}
.note > :last-child { margin-bottom: 0; }
.note__head {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: .4rem;
}
.note--danger { border-left-color: var(--belay-danger); }
.note--danger .note__head { color: var(--belay-danger); }
.note--warn { border-left-color: var(--belay-caution); }
.note--warn .note__head { color: var(--belay-caution-text); }
.note--rule { border-left-color: var(--belay-frozen); }
.note--rule .note__head { color: var(--belay-frozen); }

/* =========================================================
   RISK STATUS LADDER
   ========================================================= */
.ladder { margin: 0 0 1.6rem; border-top: 1px solid var(--rule); }

.rung {
  display: grid;
  grid-template-columns: .55rem 7.5rem 1fr;
  gap: 0 .9rem;
  align-items: start;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.rung__chip { align-self: stretch; background: var(--ink-faint); }
.rung__hf {
  font-family: var(--font-mono);
  font-size: .78rem;
  padding-top: .15rem;
  color: var(--ink-soft);
}
.rung__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  display: block;
  margin-bottom: .12rem;
}
.rung__do { font-size: .875rem; color: var(--ink-soft); }

.rung--healthy  .rung__chip { background: var(--belay-safe); }
.rung--watch    .rung__chip { background: color-mix(in srgb, var(--belay-safe), var(--belay-caution) 45%); }
.rung--trim     .rung__chip { background: var(--belay-caution); }
.rung--derisk   .rung__chip { background: color-mix(in srgb, var(--belay-caution), var(--belay-danger) 55%); }
.rung--emergency .rung__chip { background: var(--belay-danger); }
.rung--emergency .rung__name { color: var(--belay-danger); }

/* =========================================================
   LATENCY BUDGET
   ========================================================= */
.budget { margin: 0 0 1.5rem; }
.budget__bar {
  display: flex;
  height: 2.1rem;
  border: 1px solid var(--rule);
  margin-bottom: .7rem;
}
.budget__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: #fff;
  border-right: 1px solid var(--paper);
  overflow: hidden;
}
.budget__seg:last-child { border-right: 0; }
/* caution's amber is too light for white text at 4.5:1 — use ink instead on that segment only */
.budget__seg--on-caution { color: var(--ink); }
.budget__key {
  display: flex; flex-wrap: wrap; gap: .3rem 1.3rem;
  font-size: .8rem; color: var(--ink-soft);
}
.budget__key b {
  display: inline-block; width: .7rem; height: .7rem;
  margin-right: .4rem; vertical-align: -1px;
}

/* =========================================================
   ROADMAP
   ========================================================= */
.road { margin: 0 0 1.5rem; border-top: 1px solid var(--ink); }
.phase {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0 1.4rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.phase__when {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--ink-faint);
  padding-top: .18rem;
}
.phase h4 { margin: 0 0 .4rem; font-size: 1rem; }
.phase ul { margin: 0; padding-left: 1.15rem; font-size: .9rem; }
.phase li { margin-bottom: .3rem; }

/* =========================================================
   PRODUCT VERSION CARD
   ========================================================= */
.stage {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  background: var(--surface);
  padding: 1.15rem 1.25rem;
  margin: 0 0 1.1rem;
}
.stage--now { border-top-color: var(--belay-frozen); }
.stage__tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: .25rem;
}
.stage h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.stage > :last-child { margin-bottom: 0; }
.stage ul { font-size: .92rem; }

/* list of things not to build */
.avoid { list-style: none; padding-left: 0; }
.avoid li {
  padding-left: 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: .5rem;
  margin-bottom: .5rem;
}
.avoid li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: .85rem; height: 2px;
  background: var(--belay-danger);
}

/* =========================================================
   CLOSING SUMMARY
   ========================================================= */
.closing {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 2.1rem;
  margin: 1rem 0 0;
}
.closing h3 {
  color: #fff;
  margin: 1.6rem 0 .5rem;
  font-size: 1rem;
}
.closing h3:first-child { margin-top: 0; }
.closing p { color: #C7CFD3; margin-bottom: 0; font-size: .98rem; }
.closing strong { color: #fff; }

.disclaimer {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* =========================================================
   ARCHITECTURE DIAGRAM (wide pre)
   ========================================================= */
.diagram {
  font-size: .68rem;
  line-height: 1.45;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left-color: var(--rule);
}

/* Narrow-viewport replacement for the ASCII diagram — a pre block should
   never be the only way to read this on a small screen. Hidden above
   900px; .diagram (the pre) is hidden below it. See the 900px media
   query further down. */
.diagram-stack { display: none; }
.diagram-stack__layer {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: .9rem 1rem;
  font-size: .84rem;
}
.diagram-stack__layer h4 {
  margin: 0 0 .4rem;
  font-size: .82rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .01em;
}
.diagram-stack__layer p { margin: 0 0 .5rem; font-size: .82rem; color: var(--ink-soft); }
.diagram-stack__layer ul { margin: 0; padding-left: 1.1rem; font-size: .8rem; }
.diagram-stack__layer li { margin-bottom: .25rem; }
.diagram-stack__arrow {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: .95rem;
  padding: .2rem 0;
}
.diagram-stack__aside {
  margin: .6rem 0 0 .5rem;
  border-left: 2px solid var(--rule);
  padding-left: .75rem;
}

/* =========================================================
   BACK-TO-TOP BUTTON
   ========================================================= */
.top {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  z-index: 60;
  font-family: var(--font-head);
  font-size: .74rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: .55rem .8rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.top.is-shown { opacity: 1; pointer-events: auto; }

/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */
.nav-toggle { display: none; }

@media (max-width: 900px) {
  :root { --gutter: 1.35rem; }

  .shell { grid-template-columns: 1fr; }

  .nav {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav__inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1.5rem var(--gutter);
  }

  .week__axis { grid-template-columns: 2.6rem repeat(7, 1fr); font-size: .68rem; }

  .nav-toggle {
    display: block;
    position: sticky;
    top: 0;
    z-index: 80;
    width: 100%;
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 600;
    text-align: left;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    padding: .8rem var(--gutter);
    cursor: pointer;
  }

  .main { padding-top: 1.75rem; }

  .week__grid { height: 190px; grid-template-columns: 2.6rem repeat(7, 1fr); }
  .day__frozen { font-size: .58rem; }
  .mark { display: none; }
  .mark__rule { display: none; }

  .rung { grid-template-columns: .5rem 1fr; }
  .rung__hf { grid-column: 2; }
  .phase { grid-template-columns: 1fr; gap: .4rem; }
  .closing { padding: 1.5rem 1.35rem; }

  .diagram { display: none; }
  .diagram-stack { display: grid; gap: .5rem; }
  .main > .wide { max-width: 100%; }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
  :root { --paper: #fff; --surface: #fff; }
  body { font-size: 10.5pt; }
  .nav, .nav-toggle, .top, .week__sweep { display: none !important; }
  .shell { display: block; max-width: none; }
  .main { padding: 0; }
  .main > * { max-width: none; }
  .sec { page-break-inside: avoid; padding-top: 1.5rem; }
  pre, table, .note { page-break-inside: avoid; }
  .closing { background: #fff; color: #000; border: 1px solid #000; }
  .closing p, .closing h3 { color: #000; }
  a { text-decoration: none; }
}

/* =========================================================
   NOTES BELOW THE WEEK STRIP
   ========================================================= */
.week__notes {
  display: grid;
  grid-template-columns: 3.4rem repeat(7, 1fr);
  gap: 0 3px;
  margin-top: .5rem;
  align-items: start;
}
.week__note {
  font-size: .76rem;
  line-height: 1.35;
  color: var(--ink-soft);
  padding-top: .55rem;
  border-top: 2px solid var(--belay-caution);
}
.week__note b {
  display: block;
  font-family: var(--font-head);
  font-size: .74rem;
  font-weight: 700;
  color: var(--belay-caution-text);
  margin-bottom: .1rem;
}
.week__note--danger { border-top-color: var(--belay-danger); }
.week__note--danger b { color: var(--belay-danger); }

@media (max-width: 900px) {
  .week__notes {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .week__note { grid-column: 1 !important; grid-row: auto !important; }
}

/* =========================================================
   LANDING PAGE (/)
   Self-contained — prefixed lp- throughout so nothing here
   collides with the mechanics page's design system, even
   though both pages share this one stylesheet.
   ========================================================= */
:root {
  --landing-neutral: #888780; /* neutral gray for the overnight band on the landing chart only */
}

.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--gutter);
  max-width: 68rem;
  margin: 0 auto;
}
.lp-header .brand { margin-bottom: 0; }
.lp-header__link {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .1rem;
}
.lp-header__link:hover { color: var(--ink); border-color: var(--ink); }

.lp-hero {
  padding: 1rem var(--gutter) 3.5rem;
  max-width: 68rem;
  margin: 0 auto;
}
.lp-hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -.024em;
  margin: 0 0 1.1rem;
  max-width: 18ch;
}
.lp-hero__sub {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 2rem;
}
/* Hero actions.
   Both actions share one row so they read as a pair, with the reassurance
   line directly beneath and flush with the primary button's left edge. The
   line answers the first objection to a form asking for a wallet address, at
   the moment somebody decides whether to click — the "never holds your keys"
   section is far too late to do that work, so this stays. */
.lp-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Tight: the line belongs to the buttons above it, not to a new block. */
  gap: .65rem;
}

.lp-hero__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.lp-cta-note {
  font-family: var(--font-head);
  font-size: .82rem;
  color: var(--ink-faint);
}

/* It is a <p> now, so it arrives with margins it does not want. */
.lp-hero__actions .lp-cta-note { margin: 0; max-width: 46ch; }

@media (max-width: 600px) {
  /* Same order, stacked: primary, secondary, then the reassurance line. */
  .lp-hero__row {
    flex-direction: column;
    align-items: flex-start;
    gap: .95rem;
  }
}
.lp-cta-note--dark { color: #9AA5AB; }

.btn-primary {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: .85rem 1.5rem;
  border-radius: 3px;
}
.btn-primary:hover { background: var(--ink-soft); }

.lp-link {
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .1rem;
}
.lp-link:hover { color: var(--ink); border-color: var(--ink); }

.lp-section {
  padding: 3.5rem var(--gutter);
  max-width: 68rem;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}
.lp-section__head { max-width: 60ch; margin: 0 0 2rem; }
.lp-section h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -.016em;
  margin: 0 0 .6rem;
}
.lp-section__dek { color: var(--ink-soft); font-size: 1.02rem; max-width: 60ch; margin: 0; }

/* --- Weekend-gap chart section --- */
.lp-gap .week { margin: 0; }
.lp-gap .week__caption { border-bottom: 0; padding-bottom: 0; }
.week--landing .band--overnight { background: var(--landing-neutral); }
.week__lines { display: block; pointer-events: none; }
.lp-gap__line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
  font-size: .8rem;
  color: var(--ink-soft);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}
.lp-gap__line-legend svg { vertical-align: -3px; margin-right: .4rem; }

/* --- Three cards: what Belay does --- */
.lp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.lp-card {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.5rem 1.4rem;
}
.lp-card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 .65rem;
}
.lp-card p { font-size: .92rem; color: var(--ink-soft); margin: 0 0 .6rem; max-width: 38ch; }
.lp-card p:last-child { margin-bottom: 0; }

/* --- Watch-my-position form --- */
.watch {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.5rem 1.6rem;
  max-width: 40rem;
}
.watch__form { display: grid; gap: 1rem; }
.watch__row { display: grid; gap: .3rem; }
.watch label { font-family: var(--font-head); font-size: .82rem; font-weight: 600; }
.watch input,
.watch select {
  font: inherit;
  font-family: var(--font-mono);
  font-size: .88rem;
  padding: .6rem .7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  width: 100%;
  max-width: 100%;
}
.watch__hint { font-size: .76rem; color: var(--ink-faint); }
.watch__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .2rem; }
.watch__result {
  margin-top: 1.1rem;
  padding: .85rem 1rem;
  border-left: 3px solid var(--belay-safe);
  background: var(--paper);
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.watch__result--error { border-left-color: var(--belay-danger); }
.watch__result[hidden] { display: none; }

/* The sentence above the submit button. It carries the difference between a
   stored address and a watched one, so it is not fine print: it sits at body
   size, in ink rather than grey, with a rule to separate it from the field. */
.watch__state {
  margin: .1rem 0 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  max-width: 68ch;
  color: var(--ink);
}

.watch__gate-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  margin: 0 0 .7rem;
}
#watchGate p { font-size: .93rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 .8rem; max-width: 60ch; }
#watchGate p:last-child { margin-bottom: 0; }
.watch__gate-foot { border-top: 1px solid var(--rule); padding-top: .8rem; }

.watch__link { margin-top: 1.1rem; }
.watch__link[hidden] { display: none; }
.watch__link .watch__hint { display: block; margin-top: .6rem; max-width: 46ch; }

.best-effort {
  font-size: .85rem;
  line-height: 1.55;
  color: var(--ink-soft);
  border-left: 3px solid var(--belay-frozen);
  background: var(--surface);
  padding: .75rem .95rem;
  max-width: 62ch;
  margin: 1.25rem 0 0;
}

/* --- How it works: stage diagram --- */
.how-diagram { display: block; width: 100%; height: auto; max-width: 60rem; }
.how-diagram--stacked { display: none; width: 100%; height: auto; max-width: 21rem; }
@media (max-width: 700px) {
  .how-diagram { display: none; }
  .how-diagram--stacked { display: block; }
}
.how-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.how-legend b {
  display: inline-block;
  width: .85rem; height: .85rem;
  border: 2px solid var(--ink-faint);
  background: var(--surface);
  margin-right: .45rem;
  vertical-align: -2px;
}
.how-legend .is-belay b { border-color: var(--belay-safe); }
.how-legend .is-unbuilt b {
  border-color: var(--belay-safe);
  border-style: dashed;
  background: repeating-linear-gradient(45deg,
    var(--surface) 0 2px, var(--rule) 2px 4px);
}

/* Stages that are designed but not built: hatch + dashed outline, never
   color alone — the pattern and the stage label both carry the meaning. */
.how-diagram .how-box--unbuilt { fill: url(#hatchWide); }
.how-diagram--stacked .how-box--unbuilt { fill: url(#hatchStack); }
.how-box--unbuilt { stroke-dasharray: 5 4; }
.how-hatch-bg { fill: var(--surface); }
.how-hatch-line { stroke: var(--rule); stroke-width: 2; }
.how-stage--unbuilt { fill: var(--ink-soft); }

/* SVG internals for both diagram variants */
.how-box { fill: var(--surface); stroke: var(--ink-faint); stroke-width: 2; }
.how-box--belay { stroke: var(--belay-safe); }
.how-t {
  fill: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  text-anchor: middle;
}
.how-s {
  fill: var(--ink-soft);
  font-family: var(--font-body);
  text-anchor: middle;
}
.how-stage {
  fill: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  text-anchor: start;
}
.how-stage--belay { fill: var(--belay-safe); }
.how-arrow { stroke: var(--ink-faint); stroke-width: 2; fill: none; }
.how-arrowhead { fill: var(--ink-faint); }
.how-loop {
  fill: var(--ink-faint);
  font-family: var(--font-mono);
  text-anchor: middle;
}

.how-prose { margin-top: 2.5rem; max-width: 68ch; }
.how-prose p { font-size: 1rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 1.1rem; }
.how-prose strong { color: var(--ink); }

.how-ai {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 68ch;
}
.how-ai h3 { font-family: var(--font-head); font-size: 1.1rem; margin: 0 0 .7rem; }
.how-ai p { font-size: .98rem; line-height: 1.62; color: var(--ink-soft); margin: 0 0 1rem; }
.how-ai p:last-child { margin-bottom: 0; }
.how-ai strong { color: var(--ink); }

/* --- Status: what isn't built yet --- */
.status-list { list-style: none; margin: 0; padding: 0; max-width: 62ch; }
.status-list li {
  display: grid;
  grid-template-columns: 6rem 1fr; /* fixed so every row's body starts at the same x */
  gap: .35rem .9rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.status-list li:last-child { border-bottom: 0; }
.status-list__tag {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--belay-frozen);
  border: 1px solid var(--belay-frozen);
  padding: .12rem .3rem;
  white-space: nowrap;
}
.status-list__tag--live { color: var(--belay-safe); border-color: var(--belay-safe); }
.status-list__body strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1rem;
  margin-bottom: .2rem;
}
.status-list__body span { display: block; color: var(--ink-soft); font-size: .92rem; }

@media (max-width: 560px) {
  .status-list li { grid-template-columns: 1fr; }
  .status-list__tag { justify-self: start; }
}

/* --- Product proof mock --- */
.lp-proof__frame {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  max-width: 30rem;
  box-shadow: 0 12px 32px -16px rgba(18,26,31,.25);
}
.lp-proof__bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface-2);
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--rule);
}
.lp-proof__dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--rule); display: inline-block; }
.lp-proof__url {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--ink-soft); /* ink-faint fails 4.5:1 specifically against surface-2 */
  margin-left: .5rem;
}
.lp-proof__badge {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--belay-frozen);
  color: #fff;
  padding: .2rem .5rem;
  border-radius: 2px;
}
.lp-proof__app { background: var(--paper); padding: 1.25rem 1.4rem 1.5rem; }
.lp-proof__row--head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 1rem;
}
.lp-proof__pill {
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 99px;
  color: #fff;
}
.lp-proof__pill--watch { background: color-mix(in srgb, var(--belay-safe), var(--belay-caution) 45%); }
.lp-proof__hf { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.lp-proof__hf-num { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 500; color: var(--ink); }
.lp-proof__hf-label { font-size: .78rem; color: var(--ink-faint); }
.lp-proof__meter {
  height: .4rem;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.lp-proof__meter span {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--belay-safe), var(--belay-caution) 45%);
  border-radius: 99px;
}
.lp-proof__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1rem;
  margin: 0 0 1.1rem;
  padding: 0;
}
.lp-proof__stats dt { font-size: .7rem; color: var(--ink-faint); margin: 0; }
.lp-proof__stats dd { font-family: var(--font-mono); font-size: .85rem; margin: .1rem 0 0; }
.lp-alert {
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--belay-caution);
  padding: .9rem 1rem;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.lp-proof__log {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  padding: .55rem .7rem;
}

/* --- Never section --- */
.lp-never { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.lp-never li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0 .9rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.lp-never li:last-child { border-bottom: 0; padding-bottom: 0; }
.lp-never__mark {
  font-family: var(--font-mono);
  color: var(--belay-frozen);
  font-weight: 600;
}
.lp-never strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  margin-bottom: .3rem;
}
.lp-never span { color: var(--ink-soft); font-size: .92rem; max-width: 52ch; display: block; }

/* --- Eligibility --- */
.lp-eligibility {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--belay-frozen);
  background: var(--surface);
  padding: 1.5rem 1.6rem;
  font-size: 1rem;
  max-width: 60ch;
}
.lp-eligibility strong { display: block; font-family: var(--font-head); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--belay-frozen); margin-bottom: .5rem; }

/* --- Footer --- */
.lp-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem var(--gutter) 2rem;
}
.lp-footer__inner { max-width: 68rem; margin: 0 auto; }
.lp-footer__cta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #2A3339; }
.lp-footer__cta h2 { font-family: var(--font-head); font-size: 1.35rem; margin: 0; max-width: 24ch; }
.lp-footer__cta-action { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.lp-footer .btn-primary { background: var(--paper); color: var(--ink); }
.lp-footer .btn-primary:hover { background: #fff; }
.lp-footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: 1.5rem; }
.lp-footer__links a { color: var(--paper); text-decoration: none; border-bottom: 1px solid #3A444B; }
.lp-footer__links a:hover { border-color: var(--paper); }
.lp-footer__legal { font-size: .78rem; line-height: 1.6; color: #9AA5AB; max-width: 68ch; }

@media (max-width: 900px) {
  .lp-cards { grid-template-columns: 1fr; }
  .lp-footer__cta { flex-direction: column; align-items: flex-start; }
}
