/* HL7 Endpoint — shared styles for every page (2026-11 redesign draft).
   Same family as dexzyle.com, dcscoutpro.com, airgaphealth.com and milehighfactory.ai:
   slate page, white surfaces, hairline rules, left-aligned type, one accent.
   The one thing that is this site's own: real HL7 text, set in mono. */

:root {
  --page: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef4fb;
  --ink: #0f172a;
  --heading: #10243f;
  --muted: #475569;
  --dim: #64748b;
  --rule: #d7e1ec;
  --rule-strong: #b7c3d4;
  --accent: #1c5fb8;
  --accent-dark: #164a91;
  --accent-dim: rgba(28, 95, 184, 0.10);
  --accent-glow: rgba(28, 95, 184, 0.28);
  --mark: #fbe27a;
  --ok: #15803d;
  --error: #b91c1c;
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
  --font-heading: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;
  --measure: 62ch;
  --wrap: 1160px;
  --gutter: clamp(20px, 5vw, 48px);
}

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

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

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 200; }
.skip-link:focus { left: 8px; top: 8px; }

/* ── Header ── */

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 100; }
.site-nav { display: flex; align-items: center; gap: 24px; min-height: 68px; }

.logo {
  margin-right: auto;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--heading);
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { color: var(--heading); }
.logo .dots { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.nav-links a.btn { color: #fff; font-size: 15px; padding: 10px 16px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 7px 12px;
  cursor: pointer;
}

/* ── Type ── */

h1, h2, h3 { font-family: var(--font-heading); color: var(--heading); line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.8vw, 52px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; max-width: 18ch; }
h2 { font-size: clamp(26px, 3.3vw, 34px); font-weight: 700; letter-spacing: -0.015em; margin-bottom: 14px; max-width: 26ch; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 6px; }
p { max-width: var(--measure); }
.lede { font-size: clamp(18px, 2vw, 20px); color: var(--muted); }

/* ── Buttons ── */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  padding: 13px 22px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 8px 20px var(--accent-glow); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: var(--surface); color: var(--heading); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn.ghost:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-md); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 30px; }

/* ── Home hero ── */

.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h2 { font-size: clamp(19px, 2.1vw, 22px); font-weight: 600; letter-spacing: -0.005em; color: var(--accent); margin: 18px 0 0; max-width: none; }
.hero-copy > p { color: var(--muted); font-size: 18px; margin-top: 14px; }

.checks { list-style: none; margin-top: 22px; }
.checks li { position: relative; padding: 6px 0 6px 28px; max-width: 54ch; }
.checks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.85em;
  width: 12px;
  height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* The HL7 message viewer */
.msg { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden; }
.msg-tabs { display: flex; border-bottom: 2px solid var(--ink); }
.msg-tab {
  flex: 1;
  background: none;
  border: 0;
  border-right: 1px solid var(--rule);
  padding: 13px 14px 11px;
  text-align: left;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.msg-tab:last-child { border-right: 0; }
.msg-tab b { display: block; font: 700 15px var(--mono); color: var(--heading); }
.msg-tab span { font-size: 13.5px; }
.msg-tab:hover { background: var(--page); }
.msg-tab[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--accent); }
.msg-tab[aria-selected="true"] b { color: var(--accent); }

.msg-body { padding: 6px 0; font: 13px/1.5 var(--mono); }
.msg-body[hidden] { display: none; }
.seg { display: grid; grid-template-columns: 52px 1fr; border-top: 1px solid var(--rule); }
.seg:first-child { border-top: 0; }
.seg dt { padding: 11px 0 11px 18px; font-weight: 700; color: var(--accent); }
.seg dd { padding: 11px 18px 11px 0; min-width: 0; }
.seg code { font: inherit; color: var(--ink); word-break: break-all; }
.seg small { display: block; margin-top: 2px; font: 13.5px/1.4 var(--font); color: var(--dim); }
.seg mark { background: linear-gradient(transparent 10%, var(--mark) 10%, var(--mark) 90%, transparent 90%); color: inherit; padding: 0 2px; }
.msg-foot { padding: 11px 18px; border-top: 1px solid var(--rule); background: var(--page); font-size: 13.5px; color: var(--dim); }

/* ── Sections ── */

.section { padding: 72px 0; border-top: 1px solid var(--rule); }
.section.alt { background: var(--surface); }
.section .lede { margin-bottom: 8px; }

.two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 56px; margin-top: 32px; }
.two > div { padding: 22px 0; border-top: 1px solid var(--rule); }
.two p { color: var(--muted); font-size: 16px; }

/* Message-type ledger */
.ledger { margin-top: 32px; background: var(--page); border: 1px solid var(--rule); border-radius: 6px; }
.ledger-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: baseline; padding: 20px 24px; border-top: 1px solid var(--rule); }
.ledger-row:first-child { border-top: 0; }
.ledger-row .code { font: 700 20px var(--mono); color: var(--accent); }
.ledger-row h3 { margin: 0; }
.ledger-row p { color: var(--muted); font-size: 16px; }

/* ── Inner pages ── */

.page-head { padding-top: 64px; padding-bottom: 44px; }
.page-head h1 { font-size: clamp(32px, 4.4vw, 46px); max-width: 22ch; }
.page-head p { font-size: clamp(18px, 2vw, 20px); color: var(--muted); margin-top: 18px; }

.prose { max-width: 760px; }
.prose > p { margin-top: 20px; }
.callout { padding: 22px 0; border-top: 1px solid var(--rule); }
.callout:first-child { border-top: 3px solid var(--accent); }
.callout h2 { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 6px; max-width: none; }
.callout h2 .code { font-family: var(--mono); color: var(--accent); margin-right: 10px; }
.callout p { color: var(--muted); }
.callout + p { padding-top: 24px; border-top: 1px solid var(--rule); margin-top: 0; }
.back-link { display: inline-block; margin-top: 32px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ── Contact ── */

.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-info { margin-top: 22px; font-weight: 600; }
.contact-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow-md); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--heading); }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-submit { width: 100%; }
.form-status { margin-top: 14px; font-size: 15.5px; min-height: 1.4em; }
.form-status.success { color: var(--ok); }
.form-status.error { color: var(--error); }

/* ── Footer ── */

.site-footer { background: var(--surface); border-top: 1px solid var(--rule); padding: 36px 0; font-size: 15px; color: var(--dim); }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: baseline; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { max-width: none; margin-top: 18px; }

/* ── Small screens ── */

@media (max-width: 920px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 72px 1fr; }
  .ledger-row p { grid-column: 2; }
}

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .hero { padding: 48px 0; }
  .section { padding: 52px 0; }
  .page-head { padding-top: 44px; padding-bottom: 32px; }

  .nav-toggle { display: inline-block; }
  .site-nav { flex-wrap: wrap; gap: 12px; }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 14px; }
  .site-nav.nav-open .nav-links { display: flex; }
  .nav-links a { display: block; padding: 11px 0; border-top: 1px solid var(--rule); }
  .nav-links a[aria-current="page"] { text-underline-offset: 5px; }
  .nav-links a.btn { margin-top: 10px; border-top: 0; padding: 12px 16px; }

  .two { grid-template-columns: 1fr; }
  .msg-tab span { display: none; }
  .seg { grid-template-columns: 46px 1fr; }
  .seg dt { padding-left: 14px; }
}
