/* ═══ LANDING — the first surface of the engraving ═══════════════════════════ */

/* The rosette is a fixed ground behind the document, not a child of it, so the
   page wrapper never has to clip a positioned element to contain the bleed. */
.page {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--paper);
}
body::after {
  content: '';
  position: fixed;
  inset: -40% -40%;
  z-index: -1;
  pointer-events: none;
  background-image: url('/assets/svg/rosette.svg');
  background-repeat: no-repeat;
  background-position: 105% -18%;
  background-size: min(86rem, 130vw);
  opacity: 0.05;
  filter: grayscale(1);
}

/* ── masthead ─────────────────────────────────────────────────────────────── */

.masthead {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem clamp(1.1rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}
.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.wordmark .sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  /* A sentence, not a serial: it reads "Payment Verification · Addis Ababa ·
     ETB", so it carries no tracking. Uppercase mono labels elsewhere do. */
  letter-spacing: normal;
  color: var(--ink-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav .cta { margin-left: 0.4rem; }
/* `.nav a` outranks `.btn-primary` on specificity, which left the primary CTA
   wearing muted ink on the viridian press. The button's own colours win. */
.nav .btn,
.nav a.btn { color: var(--paper-ink); }
.nav a.btn:hover { color: var(--paper-ink); }

.mast-menu-btn { display: none; background: none; border: 1px solid var(--rule); font: inherit; padding: 0.4rem 0.7rem; }

/* ── hero ─────────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding: clamp(2.6rem, 6vw, 5.4rem) clamp(1.1rem, 4vw, 2.6rem) clamp(3rem, 6vw, 5rem);
  max-width: 78rem;
  margin: 0 auto;
}

.hero-copy h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}
.hero-copy .lede {
  max-width: 52ch;
  font-size: 1.08rem;
  color: var(--ink-muted);
  margin: 0 0 1.7rem;
}
.hero-copy .lede strong { color: var(--ink); font-weight: 700; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  max-width: 46ch;
}
.hero-meta b { color: var(--ink); font-weight: 600; }

/* ── the verification bench (live demo) ───────────────────────────────────── */

.bench { position: relative; }
.bench .bench-stamp {
  position: absolute;
  top: -1.05rem;
  right: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.7rem;
  border: 1px solid var(--copper);
  background: var(--paper-ink);
  color: var(--copper-deep);
  text-transform: uppercase;
}

.bench-fields {
  display: grid;
  grid-template-columns: 1fr 8.5rem;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
/* Optional parameters are hidden until asked for. Keyed off the explicit hook
   rather than a child position, which silently stopped matching once the
   disclosure button joined the row. */
.bench-fields .field[data-optional] { display: none; }
.bench-fields.show-suffix .field[data-optional] { display: grid; }

/* the params disclosure sits on the field baseline, not floating above it */
.bench-params { align-self: end; display: inline-flex; align-items: center; gap: 0.4rem; }
.bi { width: 0.85rem; height: 0.85rem; display: block; }

.slip-wide { max-width: 78rem; margin-left: auto; margin-right: auto; }
.slip-note-tight { margin-top: 1.2rem; }

.bench .bench-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

.bench-budget {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.9rem;
}
.bench-budget .ticks { display: inline-flex; gap: 3px; align-items: center; }
.bench-budget .tick {
  width: 9px; height: 13px;
  border: 1px solid var(--rule);
  border-radius: 1px;
  background: transparent;
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.bench-budget .tick.on { background: var(--green); border-color: var(--green); }
.bench-budget .tick.spent { background: var(--red); border-color: var(--red); }

/* the press panel — the bench's own instrument. It appears when a request runs
   and stays on the record afterwards, because the run is the proof. */
.bench .bench-press {
  display: none;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-ink);
  box-shadow: var(--shadow-pressed);
  margin-top: 1.1rem;
  padding: 0.85rem 0.95rem 0.95rem;
}
.bench.working .bench-press,
.bench .bench-press[data-sealed="true"] { display: block; }
.bench.working .bench-press { animation: ink-in var(--dur-med) var(--ease-out); }

.bench .bench-wait {
  display: none;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.9rem;
}
.bench.waiting .bench-wait { display: flex; }
.bench.waiting .bench-actions .btn { opacity: 0.5; pointer-events: none; }
.bench.working .bench-wait { display: none; }
.spinner {
  width: 1.1rem; height: 1.1rem;
  border: 2px solid var(--rule);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-verified { position: relative; }
.result-verified .latent {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('/assets/svg/latent.svg');
  background-size: cover;
  background-position: center;
  opacity: 0.13;
  animation: latent-breathe 7s ease-in-out infinite alternate;
}
@keyframes latent-breathe {
  from { opacity: 0.07; }
  to   { opacity: 0.16; }
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  flex-wrap: wrap;
}
.result-verdict {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.result-verdict .seal { width: 2.3rem; height: 2.3rem; color: var(--green); }
.result-verdict[data-state="error"] { color: var(--red); }
.result-verdict[data-state="error"] .seal { color: var(--red); }

/* the seal's engraved rings, drawn once and struck on landing */
.result-verdict .seal-ring { fill: none; stroke: currentColor; }

.result-serial-row {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-align: right;
}

/* what the wait actually cost, measured rather than estimated */
.result-timing {
  position: relative;
  margin: 0.85rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  border-top: 1px dotted var(--rule);
  padding-top: 0.6rem;
}

.result-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem 1.2rem;
  margin-top: 0.9rem;
  position: relative;
}
.result-fields .rf { display: grid; grid-template-columns: 7.4rem 1fr; align-items: baseline; padding-bottom: 0.4rem; border-bottom: 1px dotted var(--rule); }
.result-fields .rf .k { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.result-fields .rf .v { font-family: var(--font-mono); font-size: 0.92rem; text-align: right; overflow-wrap: anywhere; }
.result-fields .rf .v.amount { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; }

/* a rejection is sealed and struck through, not flagged with a colour bar */
.result-error {
  position: relative;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--red);
}
.result-error p { margin: 0.2rem 0; color: var(--red); font-weight: 600; }
.result-error .err-code { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-muted); letter-spacing: 0.04em; }

/* ── rails plate ──────────────────────────────────────────────────────────── */

/* A plate is a bounded ground with a rule above and below it. Its content is
   inset from those rules so nothing sits flush against the boundary. */
.plate {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper-deep) 55%, transparent);
  padding: clamp(2.6rem, 5vw, 4.2rem) clamp(1.1rem, 4vw, 2.6rem);
  scroll-margin-top: 3rem;
}
.plate-inner { max-width: 78rem; margin: 0 auto; min-width: 0; }

.rails-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.8rem;
}
.rail {
  background: var(--paper);
  padding: 1.4rem 1.1rem 1.5rem;
  display: grid;
  gap: 0.7rem;
  align-content: start;
  min-height: 9.5rem;
  transition: background var(--dur-fast);
}
.rail:hover { background: var(--paper-ink); }
.rail .rail-medallion {
  width: 2.7rem; height: 2.7rem;
  border-radius: 50%;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, var(--paper) 0 55%, transparent 56%),
    url('/assets/svg/band.svg');
  background-size: auto, 2.7rem 2.7rem;
}
.rail .rail-medallion span { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; }
.rail .rail-name { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; line-height: 1.05; }
.rail .rail-note { font-size: 0.82rem; color: var(--ink-muted); }
.rail .rail-serial { font-family: var(--font-mono); font-size: 0.75rem; color: var(--copper-deep); letter-spacing: 0.06em; }

/* ── sections ─────────────────────────────────────────────────────────────── */

/* One heading scale for the whole page. `.plate` sections used to render their
   h2 at half the size of `.section` sections, which read as a broken hierarchy
   rather than a rhythm; both now take the same ramp. */
.section,
.plate {
  --h2-size: clamp(1.9rem, 3.6vw, 2.9rem);
}
.section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1.1rem, 4vw, 2.6rem);
  max-width: 78rem;
  margin: 0 auto;
  scroll-margin-top: 3rem;
}
.section h2,
.plate h2 {
  font-size: var(--h2-size);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.section .s-intro,
.plate .s-intro { max-width: var(--measure); color: var(--ink-muted); font-size: 1.02rem; margin: 0 0 2.2rem; }

.workings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.work {
  padding: 1.4rem 1.3rem 1.5rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}
.work .w-step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--copper-deep);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.work .w-step::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.work .w-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.work .w-body { font-size: 0.94rem; color: var(--ink-muted); }
.work .w-body code { font-family: var(--font-mono); font-size: 0.82rem; background: var(--paper-deep); padding: 0 0.3rem; border-radius: 1px; }

/* code slip */
.slip-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.slip {
  background: var(--green-ink);
  color: #DCE7DA;
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 10px 28px rgba(20,59,44,.3);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.slip::after {
  content: '';
  position: absolute;
  inset: -30% -20%;
  background-image: url('/assets/svg/latent.svg');
  background-size: 24rem;
  opacity: 0.05;
  pointer-events: none;
}
.slip .slip-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(220,231,218,.78);
  border-bottom: 1px solid rgba(220,231,218,.2);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}
.slip pre { margin: 0; overflow-x: auto; position: relative; }
.slip .tok-com { color: rgba(220,231,218,.68); }
.slip .tok-str { color: #E5C08A; }
.slip .tok-key { color: #9FD0B0; }

.slip-note {
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.slip-note b { color: var(--ink); }

/* coverage table */
.cover-wrap { overflow-x: auto; }
.ledger.coverage th, .ledger.coverage td { white-space: nowrap; }
.ledger.coverage td.good::before { content: '●'; color: var(--green); margin-right: 0.45rem; font-size: 0.7rem; vertical-align: 1px; }
.ledger.coverage td.miss::before { content: '—'; color: var(--rule); margin-right: 0.45rem; }

/* pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.plan { display: flex; flex-direction: column; gap: 0.4rem; }
.plan .plan-price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; letter-spacing: 0.01em; }
.plan .plan-price small { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.04em; }
.plan.featured { border: 1px solid var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink); }
.plan .plan-list { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.55rem; font-size: 0.94rem; }
.plan .plan-list li::before { content: '—  '; color: var(--copper-deep); font-weight: 700; }
.plan .btn { margin-top: 1.2rem; align-self: flex-start; }
.plan .plan-note { font-size: 0.82rem; color: var(--ink-muted); }
.plan .plan-serial { font-family: var(--font-mono); font-size: 0.75rem; color: var(--copper-deep); letter-spacing: 0.06em; }

/* final cta */
.cta-band {
  position: relative;
  background: var(--ink);
  color: var(--paper-ink);
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.1rem, 4vw, 2.6rem);
  text-align: center;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: -20% -30%;
  background: url('/assets/svg/rosette.svg') no-repeat 50% 50% / 60rem;
  opacity: 0.1;
  pointer-events: none;
}
.cta-band h2 { color: var(--paper-ink); font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; margin: 0 auto 0.9rem; }
.cta-band p { color: rgba(248,244,232,.72); max-width: 46ch; margin: 0 auto 1.8rem; font-size: 1.02rem; }
.cta-band .btn-primary { background: var(--paper-ink); color: var(--ink); border-color: var(--paper-ink); }
.cta-band .btn-primary:hover { background: var(--watermark); }
.cta-serial { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; color: rgba(248,244,232,.72); margin-top: 1.6rem; }

/* footer */
.footer {
  border-top: 1px solid var(--rule);
  padding: 2.2rem clamp(1.1rem, 4vw, 2.6rem);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 78rem;
  margin: 0 auto;
}
.footer .f-note { max-width: 46ch; font-size: 0.86rem; color: var(--ink-muted); }
.footer .f-links { display: flex; gap: 1.4rem; font-size: 0.86rem; }
.footer .f-links a { color: var(--ink-muted); text-decoration: none; }
.footer .f-links a:hover { color: var(--ink); }

/* ── responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 64rem) {
  .rails-grid { grid-template-columns: repeat(3, 1fr); }
  .workings-grid, .pricing-grid { grid-template-columns: 1fr; max-width: 34rem; }
  .hero { grid-template-columns: 1fr; }
  .slip-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 44rem) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: calc(100% + 0.5rem); left: 1rem; right: 1rem; background: var(--paper-ink); border: 1px solid var(--ink); padding: 1rem; flex-direction: column; align-items: stretch; z-index: 20; box-shadow: var(--shadow-press); }
  .mast-menu-btn { display: inline-grid; place-items: center; }
  .rails-grid { grid-template-columns: repeat(2, 1fr); }
  .bench-fields { grid-template-columns: 1fr; }
  .result-fields { grid-template-columns: 1fr; }
  .result-fields .rf { grid-template-columns: 6.4rem 1fr; }
  .hero-meta { font-size: 0.75rem; }
  .press-clock { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
}