/* HOME Radiology — site styles
   Palette is cool and neutral, like a reading room's light box.
   The one bold element is the grayscale step wedge in each page header. */

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: local("IBM Plex Sans"), local("IBMPlexSans"),
       url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-display: swap;
  src: local("IBM Plex Sans Medium"), local("IBMPlexSans-Medium"),
       url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-display: swap;
  src: local("IBM Plex Sans SemiBold"), local("IBMPlexSans-SemiBold"),
       url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}

:root {
  --ground: #f3f5f7;
  --surface: #ffffff;
  --ink: #14181d;
  --graphite: #4a5460;
  --rule: #d3d9df;
  --accent: #0a5872;
  --accent-hover: #07445a;
  --accent-ink: #ffffff;
  --focus: #0a5872;
  --ok: #1d6b3f;
  --error: #a3261d;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale: 1.25 ratio from 17px body */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2.0625rem;
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);

  --measure: 38rem;
  --wrap: 72rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --radius-control: 6px;
  --radius-panel: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101317;
    --surface: #171b20;
    --ink: #e8ecf0;
    --graphite: #a9b3bd;
    --rule: #2c333b;
    --accent: #6cc3df;
    --accent-hover: #93d5ea;
    --accent-ink: #0b1a20;
    --focus: #6cc3df;
    --ok: #6fd09a;
    --error: #ff8f86;
  }
}
:root[data-theme="dark"] {
  --ground: #101317;
  --surface: #171b20;
  --ink: #e8ecf0;
  --graphite: #a9b3bd;
  --rule: #2c333b;
  --accent: #6cc3df;
  --accent-hover: #93d5ea;
  --accent-ink: #0b1a20;
  --focus: #6cc3df;
  --ok: #6fd09a;
  --error: #ff8f86;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-control);
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-word b { font-weight: 600; }
.brand-word span { font-weight: 400; color: var(--graphite); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--graphite);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
  border-radius: var(--radius-control);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .nav-cta {
  margin-left: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 1rem;
}
.site-nav .nav-cta:hover { background: var(--accent-hover); color: var(--accent-ink); }

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 4.25rem;
    background: var(--ground);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1rem;
    z-index: 5;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { font-size: var(--step-0); padding: 0 0.25rem; }
  .site-nav .nav-cta { margin: 0.5rem 0 0; justify-content: center; }
  .site-header { position: relative; }
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -0.032em; max-width: 18ch; }
h2 { font-size: var(--step-3); max-width: 24ch; }
h3 { font-size: var(--step-1); line-height: 1.3; letter-spacing: -0.012em; }

p { margin: 0; max-width: var(--measure); }
p + p { margin-top: 1em; }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--graphite);
  max-width: 34rem;
}

.muted { color: var(--graphite); }
.small { font-size: var(--step--1); }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.375rem;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: var(--step-0);
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--rule); }
.button-secondary:hover { border-color: var(--graphite); color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.hero h1 + .lede { margin-top: 1.5rem; }
.hero .actions { margin-top: 2.25rem; }

.page-hero { padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(2rem, 1.5rem + 2vw, 3rem); }
.page-hero h1 { font-size: var(--step-4); }
.page-hero h1 + .lede { margin-top: 1.25rem; }
.page-hero .actions { margin-top: 2rem; }

/* The step wedge: an 18-step grayscale ramp, like the TG18 test patterns
   radiologists see during display QA. Steps are set in CSS so they stay
   identical in light and dark themes. */
.wedge-figure { margin: 0; }
.wedge {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  height: clamp(56px, 4vw + 40px, 104px);
  border-radius: var(--radius-panel);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.wedge span { display: block; }
.wedge span:nth-child(1)  { background: #000000; }
.wedge span:nth-child(2)  { background: #0f0f0f; }
.wedge span:nth-child(3)  { background: #1e1e1e; }
.wedge span:nth-child(4)  { background: #2d2d2d; }
.wedge span:nth-child(5)  { background: #3c3c3c; }
.wedge span:nth-child(6)  { background: #4b4b4b; }
.wedge span:nth-child(7)  { background: #5a5a5a; }
.wedge span:nth-child(8)  { background: #696969; }
.wedge span:nth-child(9)  { background: #787878; }
.wedge span:nth-child(10) { background: #878787; }
.wedge span:nth-child(11) { background: #969696; }
.wedge span:nth-child(12) { background: #a5a5a5; }
.wedge span:nth-child(13) { background: #b4b4b4; }
.wedge span:nth-child(14) { background: #c3c3c3; }
.wedge span:nth-child(15) { background: #d2d2d2; }
.wedge span:nth-child(16) { background: #e1e1e1; }
.wedge span:nth-child(17) { background: #f0f0f0; }
.wedge span:nth-child(18) { background: #ffffff; }

.wedge-figure figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--graphite);
}

.wedge-slim .wedge { height: 14px; border-radius: 4px; }

/* One orchestrated moment: the wedge fills in step by step on load,
   the way a display warms through its grayscale during calibration. */
@media (prefers-reduced-motion: no-preference) {
  .js .wedge-animate .wedge span {
    opacity: 0;
    animation: step-in 360ms ease-out forwards;
    animation-delay: calc(var(--i) * 55ms + 150ms);
  }
}
@keyframes step-in { to { opacity: 1; } }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: clamp(1.75rem, 1rem + 2vw, 3rem); }
.section-head p { margin-top: 1rem; color: var(--graphite); }

/* Audience split: two paths, each with its own column */
.paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
}
.path { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.path h3 { font-size: var(--step-2); letter-spacing: -0.02em; }
.path p { margin-top: 0.75rem; color: var(--graphite); }
.path ul { margin: 1.25rem 0 1.5rem; padding-left: 1.125rem; }
.path li + li { margin-top: 0.375rem; }
.path a.more { font-weight: 500; }

@media (max-width: 46rem) { .paths { grid-template-columns: 1fr; } }

/* What you get: a definition grid, not cards */
.offer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.offer > div {
  padding: 1.5rem 1.5rem 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.offer > div:nth-child(odd) { padding-right: 2rem; }
.offer > div:nth-child(even) { padding-left: 2rem; border-left: 1px solid var(--rule); }
.offer dt { font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; }
.offer dd { margin: 0.5rem 0 0; color: var(--graphite); max-width: 30rem; }

@media (max-width: 46rem) {
  .offer { grid-template-columns: 1fr; }
  .offer > div:nth-child(odd), .offer > div:nth-child(even) { padding: 1.25rem 0 1.5rem; border-left: 0; }
}

/* Process: a real sequence, so it is numbered */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 1px solid var(--ink);
  font-weight: 500;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: var(--step-0); font-weight: 600; letter-spacing: 0; }
.steps p { margin-top: 0.375rem; color: var(--graphite); font-size: var(--step--1); line-height: 1.55; }

@media (max-width: 60rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .steps { grid-template-columns: 1fr; } }

/* Assurance: a quiet two-column list on a raised panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
}
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2.5rem;
}
.checks li { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.75rem; align-items: start; }
.checks svg { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--accent); }
.checks strong { display: block; font-weight: 600; }
.checks span { color: var(--graphite); font-size: var(--step--1); }
@media (max-width: 46rem) { .checks { grid-template-columns: 1fr; } }

/* Plans table */
.plans-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--surface); }
.plans { width: 100%; border-collapse: collapse; min-width: 34rem; font-size: var(--step--1); }
.plans caption { text-align: left; padding: 1rem 1.25rem; color: var(--graphite); caption-side: bottom; border-top: 1px solid var(--rule); }
.plans th, .plans td { padding: 0.875rem 1.25rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.plans thead th { font-size: var(--step-0); font-weight: 600; background: var(--ground); }
.plans thead th small { display: block; font-weight: 400; color: var(--graphite); font-size: var(--step--1); }
.plans tbody th { font-weight: 500; }
.plans td { color: var(--graphite); }
.plans .yes { color: var(--ink); }
.plans tr:last-child th, .plans tr:last-child td { border-bottom: 0; }

/* Two-column prose layout for inner pages */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(1.5rem, 1rem + 4vw, 5rem);
  align-items: start;
}
.split h2 { font-size: var(--step-2); }
.split .body > * + * { margin-top: 1rem; }
.split ul { margin: 0; padding-left: 1.125rem; max-width: var(--measure); }
.split li + li { margin-top: 0.5rem; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

/* FAQ */
.faq { border-top: 1px solid var(--rule); max-width: 48rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 0;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 1.5px solid var(--graphite);
  border-bottom: 1.5px solid var(--graphite);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 160ms ease;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq details p { padding-bottom: 1.25rem; color: var(--graphite); }

/* Closing call to action */
.cta-band .panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band h2 { font-size: var(--step-2); }
.cta-band p { margin-top: 0.5rem; color: var(--graphite); }

/* ---------- Forms ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}
@media (max-width: 52rem) { .contact-grid { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.25rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 34rem) { .form .row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.375rem; }
.field label, .field legend { font-weight: 500; font-size: var(--step--1); }
.field .hint { font-size: var(--step--1); color: var(--graphite); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="number"], .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--graphite); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field .error { color: var(--error); font-size: var(--step--1); }

fieldset.field { border: 0; padding: 0; margin: 0; }
.choices { display: grid; gap: 0.5rem; margin-top: 0.375rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--step-0);
  font-weight: 400;
}
.choice input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); }

.consent { display: flex; gap: 0.75rem; align-items: flex-start; font-size: var(--step--1); color: var(--graphite); }
.consent input { width: 1.125rem; height: 1.125rem; margin-top: 0.2rem; accent-color: var(--accent); flex: none; }

.form-status { font-size: var(--step-0); }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.aside > * + * { margin-top: 1.75rem; }
.aside h2 { font-size: var(--step-1); }
.aside p { margin-top: 0.5rem; color: var(--graphite); }
.aside .button { margin-top: 1rem; }

/* ---------- Legal pages ---------- */

.prose { max-width: 44rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose h2 + p, .prose h3 + p, .prose h2 + ul, .prose h3 + ul { margin-top: 0.75rem; }
.prose ul { padding-left: 1.125rem; max-width: var(--measure); }
.prose li + li { margin-top: 0.375rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); margin-top: 1rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.625rem 0.75rem 0.625rem 0; text-align: left; vertical-align: top; }
.note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--graphite);
  border-radius: var(--radius-control);
  font-size: var(--step--1);
  color: var(--graphite);
  max-width: 44rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 3rem 2.5rem;
  font-size: var(--step--1);
  color: var(--graphite);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2rem;
}
.footer-grid h2 { font-size: var(--step--1); font-weight: 600; color: var(--ink); letter-spacing: 0; margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li + li { margin-top: 0.25rem; }
.footer-grid a { color: var(--graphite); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.legal-line { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); max-width: none; }
@media (max-width: 46rem) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* Placeholder text you still need to replace */
.todo { background: #fff2b3; color: #3d3300; padding: 0 0.25em; border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
