:root {
  --relay-ink: #14211c;
  --relay-paper: #f4f0e7;
  --relay-mint: #b7f0d1;
  --relay-lime: #d9ff77;
  --relay-coral: #ff745f;
  --relay-line: rgba(20, 33, 28, 0.18);
  --relay-muted: #5d6a64;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--relay-paper); color: var(--relay-ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select { font: inherit; }
.relay-shell { min-height: 100vh; overflow: hidden; }
.relay-topbar { background: rgba(244, 240, 231, 0.94); border-bottom: 1px solid var(--relay-line); }
.relay-topbar a { color: var(--relay-ink); }

.relay-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr); gap: clamp(2rem, 6vw, 7rem); padding: clamp(4.5rem, 10vw, 9rem) max(5vw, calc((100vw - 1280px) / 2)); position: relative; }
.relay-hero::before { content: ""; position: absolute; width: 32rem; height: 32rem; border-radius: 50%; background: var(--relay-lime); filter: blur(1px); right: -13rem; top: -11rem; z-index: -1; }
.relay-kicker, .relay-section-heading > p, .relay-architecture > div > p { margin: 0 0 1rem; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.relay-hero h1 { max-width: 900px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.6rem, 8.6vw, 8.6rem); font-weight: 400; letter-spacing: -.065em; line-height: .83; }
.relay-hero h1 em { color: #16714c; font-weight: 400; }
.relay-hero__lede { max-width: 750px; margin: 2rem 0 0; font-size: clamp(1.1rem, 1.7vw, 1.45rem); line-height: 1.55; color: #435149; }
.relay-hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.relay-button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.2rem; padding: .8rem 1.25rem; border: 1px solid var(--relay-ink); border-radius: 999px; color: var(--relay-ink); font-weight: 800; text-decoration: none; }
.relay-button--primary { background: var(--relay-ink); color: white; }
.relay-button--ghost { background: transparent; }
.relay-button:hover, .relay-button:focus-visible { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(20, 33, 28, .13); }

.relay-proof-card { align-self: end; padding: 1.5rem; border: 1px solid var(--relay-ink); border-radius: 1.4rem; background: #fffdf8; box-shadow: 10px 10px 0 var(--relay-mint); }
.relay-proof-card > strong { display: block; margin: 1rem 0 1.4rem; font-family: Georgia, serif; font-size: 1.9rem; line-height: 1; }
.relay-live-dot { display: flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.relay-live-dot::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #0ea66c; box-shadow: 0 0 0 5px rgba(14, 166, 108, .12); }
.relay-proof-card dl { margin: 0; border-top: 1px solid var(--relay-line); }
.relay-proof-card dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--relay-line); }
.relay-proof-card dt { color: var(--relay-muted); }
.relay-proof-card dd { margin: 0; font-weight: 800; text-align: right; }
.relay-proof-card p { margin: 1rem 0 0; color: var(--relay-muted); font-size: .85rem; line-height: 1.5; }

.relay-invariant { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--relay-ink); color: white; }
.relay-invariant > div { min-height: 10rem; padding: 1.4rem; border-right: 1px solid rgba(255,255,255,.16); display: flex; flex-direction: column; justify-content: flex-end; }
.relay-invariant span { margin-bottom: auto; color: var(--relay-lime); font-size: .75rem; font-weight: 800; }
.relay-invariant strong { font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.relay-invariant small { margin-top: .35rem; color: rgba(255,255,255,.62); }

.relay-workbench { padding: clamp(4rem, 8vw, 8rem) max(3vw, calc((100vw - 1440px) / 2)); background: #e4ebdf; }
.relay-section-heading { max-width: 880px; margin-bottom: 2.3rem; }
.relay-section-heading h2, .relay-architecture h2, .relay-footer-cta h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 400; letter-spacing: -.04em; line-height: .96; }
.relay-section-heading > span { display: block; margin-top: 1rem; color: var(--relay-muted); font-size: 1rem; }
.relay-workbench__grid { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(300px, .9fr) minmax(380px, 1.4fr); border: 1px solid var(--relay-ink); border-radius: 1.6rem; overflow: hidden; background: #fffef9; box-shadow: 0 22px 70px rgba(20,33,28,.13); }
.relay-control-panel, .relay-case-panel, .relay-output-panel { min-width: 0; padding: 1.2rem; }
.relay-control-panel, .relay-case-panel { border-right: 1px solid var(--relay-line); }
.relay-panel-heading { min-height: 3.8rem; display: flex; flex-direction: column; gap: .25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--relay-line); }
.relay-panel-heading span, .relay-intent-card span, .relay-result span, .relay-citations > span { color: var(--relay-muted); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.relay-panel-heading--output { flex-direction: row; align-items: flex-start; justify-content: space-between; }
.relay-panel-heading--output div { display: flex; gap: .4rem; }
.relay-panel-heading button { border: 1px solid var(--relay-line); border-radius: 999px; background: transparent; padding: .35rem .65rem; font-size: .72rem; font-weight: 800; }
.relay-panel-heading button:disabled { opacity: .35; }
.relay-scenario-list { display: grid; gap: .6rem; margin-top: 1rem; }
.relay-scenario-list button { display: grid; gap: .18rem; width: 100%; padding: .85rem; border: 1px solid var(--relay-line); border-radius: .85rem; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.relay-scenario-list button[aria-pressed="true"] { border-color: var(--relay-ink); background: var(--relay-lime); box-shadow: 4px 4px 0 var(--relay-ink); transform: translate(-2px,-2px); }
.relay-scenario-list span, .relay-scenario-list small { color: var(--relay-muted); font-size: .7rem; }
.relay-field { display: grid; gap: .5rem; margin-top: 1.4rem; }
.relay-field > span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.relay-field select { width: 100%; padding: .8rem; border: 1px solid var(--relay-line); border-radius: .7rem; background: white; color: var(--relay-ink); }
.relay-run { width: 100%; margin-top: 1rem; padding: .9rem; border: 1px solid var(--relay-ink); border-radius: .8rem; background: var(--relay-ink); color: white; cursor: pointer; }
.relay-run span, .relay-run small { display: block; }
.relay-run span { font-weight: 800; }
.relay-run small { margin-top: .25rem; color: rgba(255,255,255,.62); }
.relay-run:disabled { cursor: wait; opacity: .65; }
.relay-status { min-height: 2.8rem; margin: .8rem 0 0; color: var(--relay-muted); font-size: .76rem; line-height: 1.4; }

.relay-patient-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.relay-patient-row > div { padding: .8rem; border-radius: .75rem; background: #f0f2eb; }
.relay-patient-row span, .relay-patient-row strong { display: block; }
.relay-patient-row span { margin-bottom: .3rem; color: var(--relay-muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.relay-patient-row strong { font-size: .83rem; }
.relay-fact-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.relay-fact-list li { display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start; }
.relay-fact-list li > span { padding: .28rem .4rem; border: 1px solid var(--relay-line); border-radius: .35rem; font: 700 .65rem ui-monospace, monospace; color: #16714c; }
.relay-fact-list strong { font-size: .8rem; }
.relay-fact-list p { margin: .2rem 0 0; color: var(--relay-muted); font-size: .8rem; line-height: 1.45; }
.relay-intent-card { margin-top: 1rem; padding: 1rem; border: 1px dashed var(--relay-ink); border-radius: .8rem; }
.relay-intent-card p { margin: .45rem 0 0; font-family: Georgia, serif; font-size: 1.05rem; line-height: 1.35; }

.relay-empty { min-height: 31rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.relay-empty > span { display: grid; place-items: center; width: 4.2rem; height: 4.2rem; margin-bottom: 1rem; border-radius: 50%; background: var(--relay-mint); color: var(--relay-ink); font-size: 2rem; }
.relay-empty strong { font-family: Georgia, serif; font-size: 1.5rem; }
.relay-empty p { max-width: 330px; margin: .6rem 0 0; color: var(--relay-muted); line-height: 1.5; }
.relay-result { padding-top: 1rem; }
.relay-result p { margin: .45rem 0 0; line-height: 1.45; }
.relay-result__summary { padding: 1rem; border-radius: .85rem; background: var(--relay-ink); color: white; }
.relay-result__summary span { color: var(--relay-mint); }
.relay-result__summary p { font-family: Georgia, serif; font-size: 1.25rem; }
.relay-result__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: .65rem; }
.relay-result__grid article { min-height: 8rem; padding: .85rem; border: 1px solid var(--relay-line); border-radius: .75rem; }
.relay-result__grid .relay-next-step { background: var(--relay-lime); border-color: var(--relay-ink); }
.relay-result__grid p, .relay-result__grid li { font-size: .82rem; }
.relay-result__grid ul { margin: .45rem 0 0; padding-left: 1.1rem; }
.relay-citations { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; padding: .75rem; border-radius: .7rem; background: #eef1eb; }
.relay-citations div { display: flex; flex-wrap: wrap; gap: .35rem; }
.relay-citations code { padding: .25rem .4rem; border-radius: .3rem; background: white; color: #16714c; font-size: .68rem; }
.relay-receipt-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: .7rem; border: 1px solid var(--relay-line); border-radius: .7rem; overflow: hidden; }
.relay-receipt-strip > div { min-width: 0; padding: .55rem; border-right: 1px solid var(--relay-line); }
.relay-receipt-strip > div:last-child { border-right: 0; }
.relay-receipt-strip span, .relay-receipt-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relay-receipt-strip span { color: var(--relay-muted); font-size: .58rem; text-transform: uppercase; }
.relay-receipt-strip strong { margin-top: .2rem; font-size: .68rem; }

.relay-architecture { padding: clamp(4rem, 8vw, 8rem) max(5vw, calc((100vw - 1280px) / 2)); }
.relay-architecture > div { display: grid; grid-template-columns: .35fr 1fr; gap: 2rem; align-items: start; }
.relay-architecture ol { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 3rem 0 0; padding: 0; list-style: none; border: 1px solid var(--relay-ink); }
.relay-architecture li { min-height: 12rem; padding: 1rem; border-right: 1px solid var(--relay-ink); display: flex; flex-direction: column; }
.relay-architecture li:last-child { border-right: 0; }
.relay-architecture li > span { color: #16714c; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.relay-architecture strong { margin-top: auto; font-family: Georgia, serif; font-size: 1.3rem; }
.relay-architecture small { margin-top: .45rem; color: var(--relay-muted); line-height: 1.4; }
.relay-footer-cta { padding: clamp(4rem, 8vw, 8rem) max(5vw, calc((100vw - 1280px) / 2)); background: var(--relay-coral); }
.relay-footer-cta > span { display: block; margin-bottom: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.relay-footer-cta h2 { max-width: 950px; }
.relay-footer-cta .relay-button { margin-top: 2rem; }
.relay-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem 5vw; background: var(--relay-ink); color: rgba(255,255,255,.65); font-size: .78rem; }
.relay-footer a { color: var(--relay-lime); }

@media (max-width: 1080px) {
  .relay-workbench__grid { grid-template-columns: 1fr 1fr; }
  .relay-output-panel { grid-column: 1 / -1; border-top: 1px solid var(--relay-line); }
  .relay-case-panel { border-right: 0; }
  .relay-empty { min-height: 18rem; }
  .relay-architecture ol { grid-template-columns: repeat(3, 1fr); }
  .relay-architecture li:nth-child(3) { border-right: 0; }
  .relay-architecture li:nth-child(n+4) { border-top: 1px solid var(--relay-ink); }
}

@media (max-width: 760px) {
  .relay-hero { grid-template-columns: 1fr; padding-top: 6.25rem; }
  .relay-hero h1 { font-size: clamp(3.4rem, 18vw, 5.8rem); }
  .relay-invariant { grid-template-columns: 1fr 1fr; }
  .relay-invariant > div:nth-child(2) { border-right: 0; }
  .relay-invariant > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.16); }
  .relay-workbench { padding-inline: 1rem; }
  .relay-workbench__grid { grid-template-columns: 1fr; }
  .relay-control-panel, .relay-case-panel { border-right: 0; border-bottom: 1px solid var(--relay-line); }
  .relay-result__grid { grid-template-columns: 1fr; }
  .relay-receipt-strip { grid-template-columns: 1fr 1fr; }
  .relay-receipt-strip > div { border-bottom: 1px solid var(--relay-line); }
  .relay-architecture > div { grid-template-columns: 1fr; gap: .5rem; }
  .relay-architecture ol { grid-template-columns: 1fr; }
  .relay-architecture li { min-height: 8rem; border-right: 0; border-bottom: 1px solid var(--relay-ink); }
  .relay-architecture li:nth-child(n+4) { border-top: 0; }
  .relay-architecture li:last-child { border-bottom: 0; }
  .relay-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .relay-button { transition: none; } }
