/* ADAPTS portal — single stylesheet. Colors come from the ADAPTS logo. */

:root {
  --navy: #12324f;
  --navy-2: #1b4569;
  --teal: #1f8a8a;
  --green: #6a9a3a;
  --gold: #e3a933;

  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #eef1f2;
  --text: #13212e;
  --muted: #55626e;
  --line: #dde2e5;
  --accent: var(--teal);
  --accent-ink: #ffffff;
  --hero-bg: var(--navy);
  --hero-text: #ffffff;
  --shadow: 0 1px 2px rgba(18, 50, 79, .06), 0 6px 24px rgba(18, 50, 79, .06);

  --st-cataloged: #2f7d3b;
  --st-harmonizing: #b07a10;
  --st-onboarding: #5a6b7a;

  --radius: 14px;
  --max: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Manrope", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1620;
    --surface: #14202c;
    --surface-2: #1a2938;
    --text: #e7edf2;
    --muted: #9aabb9;
    --line: #26384a;
    --accent: #3fb3b0;
    --accent-ink: #062022;
    --hero-bg: #0f2a43;
    --shadow: none;
    --st-cataloged: #6cc47a;
    --st-harmonizing: #e5b34a;
    --st-onboarding: #9aabb9;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1620;
  --surface: #14202c;
  --surface-2: #1a2938;
  --text: #e7edf2;
  --muted: #9aabb9;
  --line: #26384a;
  --accent: #3fb3b0;
  --accent-ink: #062022;
  --hero-bg: #0f2a43;
  --shadow: none;
  --st-cataloged: #6cc47a;
  --st-harmonizing: #e5b34a;
  --st-onboarding: #9aabb9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.section { padding: 64px 0; }
.section.alt { background: var(--surface-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }

/* ── announcement + header ── */
.announce { background: var(--navy); color: #fff; font-size: .85rem; text-align: center; padding: 7px 16px; }
.announce a { color: #fff; font-weight: 600; }
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 44px; width: auto; border-radius: 8px; background: #f7f6f2; padding: 2px 6px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .btn { margin-left: 6px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ── buttons ── */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 11px 20px; font: 600 .95rem var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; background: var(--accent); color: var(--accent-ink); transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.gold { background: var(--gold); color: #1d1a10; }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── hero ── */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-text); padding: 84px 0 96px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(4px); opacity: .9; pointer-events: none; }
.hero::before { width: 520px; height: 520px; right: -120px; top: -160px; background: radial-gradient(circle at 35% 35%, #2bb3a8, var(--teal) 55%, transparent 72%); }
.hero::after { width: 420px; height: 420px; right: 140px; bottom: -220px; background: radial-gradient(circle at 50% 40%, var(--gold), #c98a1b 50%, transparent 72%); opacity: .55; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; }
.hero p { color: #d3e0ea; font-size: 1.15rem; max-width: 56ch; margin-bottom: 1.8em; }
.hero .btn.ghost { color: #fff; }
.hero.compact { padding: 56px 0 60px; }
.hero.compact h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 22ch; }

/* ── stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: -48px; position: relative; z-index: 2; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat b { display: block; font: 800 2.4rem/1 var(--font-head); color: var(--navy); }
:root[data-theme="dark"] .stat b { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat b { color: var(--text); } }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* ── cards & grids ── */
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card p { color: var(--muted); margin-bottom: 0; }
.card .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-weight: 800; margin-bottom: 12px; }
.card.link { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .more { margin-top: auto; padding-top: 14px; font-weight: 600; color: var(--accent); }

.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); margin: 0 6px 6px 0; }
.pid { font: 700 .78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); letter-spacing: .02em; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.cataloged, .status.live { color: var(--st-cataloged); }
.status.harmonizing { color: var(--st-harmonizing); }
.status.onboarding, .status.planned { color: var(--st-onboarding); }

/* ── projects page ── */
.project { scroll-margin-top: 90px; }
.project + .project { margin-top: 22px; }
.project-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; justify-content: space-between; }
.project h2 { font-size: 1.35rem; margin: 6px 0 12px; }
.project .cols { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 860px) { .project .cols { grid-template-columns: 1.4fr 1fr; } }
.project h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.project ol { margin: 0; padding-left: 1.2em; color: var(--text); }
.project ol li { margin-bottom: 6px; }
.people { list-style: none; padding: 0; margin: 0 0 16px; }
.people li { padding: 3px 0; }
.people small { color: var(--muted); margin-left: 6px; font-weight: 600; }

/* ── data browser ── */
.browser { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .browser { grid-template-columns: 250px 1fr; } }
.filters { align-self: start; }
@media (min-width: 960px) { .filters { position: sticky; top: 90px; } }
.filters fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.filters legend { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px; font: 600 .82rem var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { opacity: .65; margin-left: 4px; font-weight: 500; }
.search { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search:focus, .chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .92rem; }
.linkish { background: none; border: 0; color: var(--accent); font: 600 .9rem var(--font); cursor: pointer; padding: 0; }

.ds { display: flex; flex-direction: column; gap: 8px; }
.ds h3 { margin: 0; font-size: 1.02rem; }
.ds .meta { font-size: .85rem; color: var(--muted); }
.ds .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* modality bar summary */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 130px 1fr 28px; gap: 10px; align-items: center; font-size: .88rem; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar b { text-align: right; }

/* timeline */
.timeline { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; border-top: 4px solid var(--line); }
.tl.live { border-top-color: var(--st-cataloged); }
.tl strong { display: block; font-family: var(--font-head); font-size: 1.1rem; }
.tl small { color: var(--muted); display: block; margin: 4px 0 8px; line-height: 1.4; }

/* ── split / CTA band ── */
.band { background: var(--navy); color: #fff; border-radius: 20px; padding: 36px; display: grid; gap: 20px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .band { grid-template-columns: 1.6fr auto; padding: 44px; } }
.band p { color: #cfdde8; margin: 0; }
.band h2 { margin-bottom: .3em; }

.check { list-style: none; padding: 0; margin: 0; }
.check li { padding: 6px 0 6px 28px; position: relative; }
.check li::before { content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 8px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; }
details p { color: var(--muted); margin: 10px 0 0; }

/* ── forms / modal ── */
.form { display: grid; gap: 14px; }
.form .row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form .row { grid-template-columns: 1fr 1fr; } }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.form input, .form select, .form textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 400 .95rem var(--font); }
.form textarea { min-height: 110px; resize: vertical; }
.form .hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.form-msg { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(8, 20, 32, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 22px 24px 0; }
.dlg-head h2 { font-size: 1.3rem; margin: 0; }
.dlg-body { padding: 16px 24px 24px; max-height: 75vh; overflow: auto; }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* ── footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: .9rem; margin-top: 40px; }
.site-footer .wrap { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .site-footer .wrap { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h4 { color: var(--text); margin: 0 0 8px; font-size: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 3px 0; }
.site-footer a { color: var(--muted); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .85rem; cursor: pointer; margin-top: 10px; }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 720px) {
  .hero { padding: 56px 0 72px; }
  .hero::before { width: 320px; height: 320px; right: -160px; top: -120px; opacity: .55; }
  .hero::after { width: 260px; height: 260px; right: -60px; bottom: -180px; opacity: .35; }
}
