/* Tidewater Clinical Research: plain CSS, no framework.
   Structure follows the "photo hero with a solid title plate" layout.
   Everything visual is driven by the tokens on :root. Text colours were
   checked against the surfaces they sit on to WCAG AA (4.5:1 body text,
   3:1 large text and focus rings). */
:root {
  /* palette */
  --paper: #ffffff;
  --cream: #f7f5ef;
  --mist: #e3f0ef;
  --teal: #0d5c63;
  --teal-dark: #0a474d;
  --deep: #12263a;
  --deep-2: #1b3550;
  --coral: #e07a5f;
  --coral-light: #f0957c;
  --coral-dark: #a8482f;
  --coral-tint: #fde5dd;
  --ink: #1f2328;
  --muted: #4f5662;
  --line: #d9e2e4;
  --line-strong: #b9c7ca;
  --on-dark: #ffffff;
  --on-dark-muted: #c9d6da;
  --focus: #0d5c63;
  --focus-on-dark: #f4b9a8;

  /* status badges (text on tint, all above 4.5:1) */
  --status-recruiting-bg: var(--coral-tint);
  --status-recruiting-fg: #973f28;
  --status-progress-bg: var(--mist);
  --status-progress-fg: var(--teal-dark);
  --status-completed-bg: #eceef1;
  --status-completed-fg: #4a515c;

  /* type */
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1.0625rem;
  --text-md: 1.15rem;
  --text-lg: 1.3rem;
  --text-xl: clamp(1.5rem, 2.6vw, 2rem);
  --text-2xl: clamp(2rem, 4.2vw, 3rem);
  --leading: 1.65;
  --leading-tight: 1.2;
  --measure: 68ch;
  --measure-lede: 60ch;

  /* spacing scale */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section: clamp(2.5rem, 5vw, 4rem);

  /* shape */
  --radius: 12px;
  --radius-sm: 6px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(18, 38, 58, .06), 0 8px 24px rgba(18, 38, 58, .08);
  --shadow-hover: 0 2px 4px rgba(18, 38, 58, .08), 0 14px 32px rgba(18, 38, 58, .14);
  --wrap: 1140px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --tap: 44px;
}

/* base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--text-base); line-height: var(--leading); }
main { flex: 1 0 auto; padding-bottom: var(--section); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.demo :focus-visible, .hero :focus-visible, .site-footer :focus-visible, .path.p3:focus-visible { outline-color: var(--focus-on-dark); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: var(--leading-tight); color: var(--deep); margin: 0 0 var(--space-3); text-wrap: balance; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); color: var(--teal); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--deep); color: var(--on-dark); padding: var(--space-3) var(--space-4); z-index: 100; }
.skip:focus { left: var(--space-4); top: var(--space-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* demo banner */
.demo { background: var(--deep); color: var(--on-dark-muted); font-size: var(--text-sm); line-height: 1.4; padding: var(--space-2) 0; }
.demo .wrap { display: flex; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; }
.demo-tag { flex: none; background: var(--coral); color: var(--deep); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: var(--pill); padding: .1rem .55rem; }

/* header and navigation */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.header-top { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--deep); text-decoration: none; }
.brand:hover { color: var(--deep); }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 9px; }
.brand-text { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.brand small { display: block; margin-top: .15rem; font-family: var(--sans); font-size: var(--text-xs); color: var(--muted); letter-spacing: .02em; }
.nav-bar { border-top: 1px solid var(--line); }
.nav { display: flex; flex-wrap: wrap; list-style: none; margin: 0 calc(var(--space-3) * -1); padding: 0; }
.nav > li { position: relative; }
.nav a { display: flex; align-items: center; min-height: var(--tap); padding: var(--space-2) var(--space-3); color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav > li > a { min-height: 52px; box-shadow: inset 0 -3px 0 transparent; }
.nav > li > a:hover { color: var(--teal); box-shadow: inset 0 -3px 0 var(--line-strong); }
.nav > li > a[aria-current="page"] { color: var(--teal); font-weight: 600; box-shadow: inset 0 -3px 0 var(--coral); }
.nav a:focus-visible { outline-offset: -3px; }
.nav .sub { position: absolute; top: 100%; left: 0; min-width: 17rem; list-style: none; margin: 0; padding: var(--space-2) 0; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--coral); border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: var(--shadow-hover); z-index: 40; display: none; }
.nav .sub a { padding: var(--space-2) var(--space-4); }
.nav .sub a:hover { background: var(--mist); color: var(--deep); }
.nav > li:hover > .sub, .nav > li:focus-within > .sub { display: block; }
@media (max-width: 760px) {
  .header-top { padding-top: var(--space-3); padding-bottom: var(--space-3); }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: 1.15rem; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; margin: 0; column-gap: var(--space-4); }
  .nav > li > a, .nav a { min-height: var(--tap); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
  .nav > li:nth-last-child(-n+1) > a { border-bottom: 0; }
  .nav > li > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--coral); padding-left: var(--space-3); }
  .nav > li > a:hover { box-shadow: none; }
  .nav .sub { display: none !important; }
}

/* hero */
.hero { position: relative; background: linear-gradient(120deg, var(--deep), var(--teal)); overflow: hidden; }
.hero .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 38, 58, .55), rgba(18, 38, 58, 0) 70%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: flex; align-items: center; min-height: 420px; padding-top: var(--space-7); padding-bottom: var(--space-8); }
.hero .plate { background: var(--deep); color: var(--on-dark); width: 100%; max-width: 640px; padding: clamp(1.5rem, 4vw, 2.75rem); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0, 0, 0, .18); }
.hero .eyebrow { color: var(--coral-light); text-transform: uppercase; letter-spacing: .2em; font-size: var(--text-xs); font-weight: 700; margin: 0; }
.hero h1 { color: var(--on-dark); margin: var(--space-3) 0 var(--space-4); }
.hero p { color: #d5e4e6; margin-bottom: 0; }
.hero.small .hero-inner { min-height: 0; padding-top: var(--space-6); padding-bottom: var(--space-6); }
.hero.small h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: .6rem 1.4rem; border-radius: var(--pill); border: 1px solid transparent; font-weight: 600; text-decoration: none; font-size: .95rem; line-height: 1.2; }
.btn.primary { background: var(--coral); color: var(--deep); }
.btn.primary:hover { background: var(--coral-light); color: var(--deep); }
.btn.ghost { border-color: rgba(255, 255, 255, .6); color: var(--on-dark); }
.btn.ghost:hover { border-color: var(--on-dark); background: rgba(255, 255, 255, .08); color: var(--on-dark); }
.btn-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }

/* sections and text */
section { padding: var(--section) 0 0; }
.breadcrumb + section, .wrap > section:first-child { padding-top: var(--space-6); }
section > h2 { margin-bottom: var(--space-5); }
section > h2 + p { max-width: var(--measure); margin-top: calc(var(--space-3) * -1); color: var(--muted); }
.lede { color: var(--muted); max-width: var(--measure-lede); font-size: var(--text-md); }
.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.55rem; margin-top: var(--space-6); }
.prose h2:first-child { margin-top: 0; }
.prose ul:not(.tags), .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: var(--space-1); }
.prose img { width: 100%; border-radius: var(--radius); margin: var(--space-5) 0; }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: var(--text-xs); font-weight: 700; color: var(--teal); margin-bottom: var(--space-2); }
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }

/* grids: three across by default, four for the theme cards */
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); list-style: none; padding: 0; margin: 0; }
.grid.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.grid > li { display: flex; min-width: 0; }
.grid > li > * { flex: 1; min-width: 0; }
.grid.people { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.grid.people.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--space-4); }

/* cards */
.card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); transition: box-shadow .15s ease, border-color .15s ease; }
.card:hover, .card:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0; font-size: 1.25rem; color: var(--deep); }
.card h2 a, .card h3 a { color: var(--deep); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card p { color: var(--muted); font-size: .97rem; margin: 0; }
.card .meta { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--muted); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.card .tags + .meta, .card p + .meta { margin-top: auto; }
.card > p:not(.meta) + .meta { margin-top: auto; }
/* study cards reserve two lines of meta so the divider lines up across a row */
.card:has(.badge) .meta { min-height: 4.2rem; align-content: flex-start; }
.card .meta .cta { font-weight: 700; color: var(--coral-dark); text-decoration: none; }
.card .meta .cta:hover { text-decoration: underline; }
.card.with-art { padding: 0; overflow: hidden; }
.card.with-art img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--deep); }
.card.with-art .pad { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; width: 100%; }
.card > .tags { margin: var(--space-1) 0 var(--space-2); }

/* audience cards */
.paths { display: grid; gap: var(--space-5); grid-template-columns: repeat(3, 1fr); margin-top: calc(var(--space-7) * -1); position: relative; z-index: 2; }
.path { display: flex; flex-direction: column; border-radius: var(--radius); padding: var(--space-5); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow .15s ease, transform .15s ease; }
.path:hover { box-shadow: var(--shadow-hover); }
.path .who { text-transform: uppercase; letter-spacing: .16em; font-size: var(--text-xs); font-weight: 700; color: var(--teal); }
.path h2 { margin: var(--space-2) 0; font-size: var(--text-lg); color: inherit; }
.path p { margin: 0; font-size: .95rem; }
.path.p1 { background: var(--mist); color: var(--deep); }
.path.p2 { background: var(--cream); color: var(--deep); border: 1px solid var(--line); }
.path.p3 { background: var(--deep); color: #e8eef0; }
.path.p3 h2 { color: var(--on-dark); }
.path.p3 .who { color: var(--coral-light); }
.path:hover h2 { text-decoration: underline; }
@media (max-width: 820px) { .paths { grid-template-columns: 1fr; gap: var(--space-3); margin-top: calc(var(--space-6) * -1); } }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; padding: .2rem .65rem; border-radius: var(--pill); background: var(--status-progress-bg); color: var(--status-progress-fg); }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.badge.recruiting { background: var(--status-recruiting-bg); color: var(--status-recruiting-fg); }
.badge.completed { background: var(--status-completed-bg); color: var(--status-completed-fg); }
.badge.completed::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* theme and group tags */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-2) 0 0; font-size: .8rem; line-height: 1.3; }
.tags li { margin: 0; max-width: 100%; }
.tags a { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--pill); padding: .25rem .7rem; text-decoration: none; color: var(--teal-dark); }
.tags a:hover { border-color: var(--teal); color: var(--teal-dark); }

/* people */
.person { display: flex; gap: var(--space-4); align-items: flex-start; scroll-margin-top: var(--space-4); padding: var(--space-4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.person:target { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-tint); }
.avatar { flex: none; width: 88px; height: 88px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--deep)); color: var(--on-dark); display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; letter-spacing: .02em; object-fit: cover; }
.person-text { min-width: 0; }
.person h3 { font-size: 1.12rem; margin: var(--space-1) 0 .15rem; }
.person h3 a { color: var(--deep); text-decoration: none; }
.person h3 a:hover { text-decoration: underline; }
.person .role { color: var(--muted); font-size: var(--text-sm); line-height: 1.45; margin: 0; }
.person .bio { font-size: .93rem; margin-top: var(--space-3); }
.person .bio p { margin-bottom: var(--space-2); }
.person .links { font-size: var(--text-sm); display: flex; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-2) 0 0; }
.grid.compact .person { align-items: center; padding: var(--space-3); gap: var(--space-3); }
.grid.compact .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.grid.compact .person h3 { font-size: 1.02rem; margin-top: 0; }
.grid.compact .person .role { font-size: .82rem; }

/* dated lists */
.ledger { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.ledger li { border-bottom: 1px solid var(--line); padding: var(--space-4) 0; display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--space-4); }
.ledger time { color: var(--muted); font-size: var(--text-sm); padding-top: .2rem; }
.ledger a { font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; text-decoration: none; }
.ledger a:hover { text-decoration: underline; }
.ledger p { margin: var(--space-1) 0 0; color: var(--muted); font-size: .95rem; max-width: var(--measure); }
.ledger + p { margin-top: var(--space-4); }
@media (max-width: 600px) { .ledger li { grid-template-columns: 1fr; gap: var(--space-1); } }

/* publications */
.pubs { list-style: none; padding: 0; margin: 0; max-width: 52rem; border-bottom: 1px solid var(--line); }
.pubs li { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.pubs .t { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.35; color: var(--deep); margin-bottom: var(--space-1); }
.pubs small, .paper small { color: var(--muted); display: block; font-size: var(--text-sm); line-height: 1.5; overflow-wrap: anywhere; }
.paper { border-left: 4px solid var(--coral); background: var(--cream); padding: var(--space-5); border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 var(--space-4); max-width: 52rem; }
.paper + .pubs { margin-top: var(--space-5); }
.paper h3 { font-size: 1.2rem; margin-bottom: var(--space-2); }
.paper .plain { margin: var(--space-3) 0 0; }
.paper .plain strong { color: var(--teal); }

/* study page */
.study-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; margin-top: var(--space-5); }
.study-head .badge, section > .badge { margin-bottom: var(--space-3); }
.study-aside { position: sticky; top: var(--space-4); background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); font-size: .95rem; }
.study-aside dl { margin: 0; }
.study-aside dt { font-weight: 700; color: var(--deep); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; }
.study-aside dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.study-aside dd { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.study-aside .tags { margin-top: var(--space-2); }
.docs { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-2); }
.docs li { position: relative; display: flex; flex-direction: column; padding: var(--space-2) var(--space-3) var(--space-2) 2.4rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.docs li::before { content: ""; position: absolute; left: .8rem; top: .7rem; width: .9rem; height: 1.1rem; border: 1.5px solid var(--teal); border-radius: 2px; background: linear-gradient(var(--teal), var(--teal)) center 40% / 50% 1.5px no-repeat, linear-gradient(var(--teal), var(--teal)) center 65% / 50% 1.5px no-repeat; }
.docs li:hover { border-color: var(--teal); }
.docs a { font-weight: 600; line-height: 1.35; text-decoration: none; }
.docs a::after { content: ""; position: absolute; inset: 0; }
.docs a:hover { text-decoration: underline; }
.docs small { color: var(--muted); font-size: .8rem; }
.notice { background: #fff6e0; border: 1px solid #e6c56a; border-left-width: 4px; border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: .95rem; color: #4a3b0c; }
.study-figure { margin: 0 0 var(--space-5); }
.study-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin: 0; }
@media (max-width: 820px) { .study-layout { grid-template-columns: 1fr; } .study-aside { position: static; } }

/* breadcrumb */
.breadcrumb { font-size: var(--text-sm); color: var(--muted); padding-top: var(--space-4); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal); }

/* footer */
.site-footer { flex: none; background: var(--deep); color: var(--on-dark-muted); font-size: .92rem; }
.footer-cols { padding-top: var(--space-7); padding-bottom: var(--space-7); display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.site-footer a { color: var(--on-dark); text-decoration-color: rgba(255, 255, 255, .4); }
.site-footer a:hover { color: var(--on-dark); text-decoration-color: var(--on-dark); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-footer li { line-height: 1.4; }
.site-footer h2 { color: var(--on-dark); font-size: 1rem; font-family: var(--sans); font-weight: 700; margin-bottom: var(--space-3); }
.site-footer p { margin-bottom: var(--space-3); }
@media (max-width: 600px) { .person { padding: var(--space-3); gap: var(--space-3); } .avatar { width: 64px; height: 64px; font-size: 1.25rem; } }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr; gap: var(--space-5); padding-top: var(--space-6); } }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .card, .path { transition: none; } }
