/* Resource Hub. Tokens shared with the TRACE Referral Guide (sibling site). */
:root {
  --canvas: #F4F2ED;
  --ink: #141414;
  --muted: #5B5B57;
  --surface: #FFFFFF;
  --dark: #141414;
  --on-dark: #F4F2ED;
  --on-dark-muted: #B9B6AE;
  --amber: #F2B33D;
  /* six TRACE-domain colors: soft backgrounds, always with ink text */
  --blue: #9FC5E8;
  --clay: #F3C9A0;
  --sage: #BFD8B8;
  --lilac: #D5C6F0;
  --butter: #F7E08A;
  --rose: #F4B6B6;
  --stone: #D9D6CE; /* Assessment and planning: Hub-only, deliberately not a domain color */
  --line: rgba(20, 20, 20, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: var(--amber); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--amber); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--amber); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- site bar: identical on the landing page, Referral Guide and Resource Hub ---------- */
.sitebar { position: sticky; top: 0; z-index: 50; background: rgba(244, 242, 237, .94); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid #DEDAD0; color: #141414; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
.sb-wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); height: 60px; display: flex; align-items: center; gap: clamp(10px, 2.4vw, 28px); }
.sb-home { display: flex; align-items: center; gap: 10px; font-family: "Inter Tight", "Inter", system-ui, sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: #141414; text-decoration: none; white-space: nowrap; }
.sb-home svg { flex: none; }
.sb-tabs { display: flex; gap: 4px; }
.sb-tabs a { padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: #5B5B57; text-decoration: none; white-space: nowrap; }
.sb-tabs a:hover { background: #E9E6DD; color: #141414; }
.sb-tabs a[aria-current="page"] { background: #141414; color: #F4F2ED; }
.sb-sections { margin-left: auto; }
.sb-sections ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.sb-sections a { display: block; padding: 7px 11px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: #5B5B57; text-decoration: none; white-space: nowrap; }
.sb-sections a:hover { background: #E9E6DD; color: #141414; }
.sitebar a:focus-visible { outline: 3px solid #141414; outline-offset: 2px; border-radius: 999px; }
@media (max-width: 1020px) { .sb-sections { display: none; } }
@media (max-width: 600px) { .sb-long { display: none; } .sb-tabs a { padding: 8px 12px; } }

/* ---------- hero ---------- */
.hero { background: var(--dark); color: var(--on-dark); padding: clamp(56px, 10vw, 128px) 0 clamp(48px, 7vw, 88px); }
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.9rem, 8.6vw, 8.25rem);
  line-height: .93; letter-spacing: -0.045em;
  margin: 0; max-width: 13ch;
}
.hero .lede { color: var(--on-dark-muted); font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 56ch; margin: 28px 0 0; }
.search {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 8px 8px 8px 24px;
  max-width: 760px;
}
.search svg { flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem); padding: 12px 4px;
}
.search:focus-within { box-shadow: 0 0 0 3px var(--amber); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--amber); color: var(--ink); border: 0; border-radius: var(--radius-sm);
  font-weight: 650; padding: 14px 26px; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.hero .stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--on-dark-muted); font-size: .98rem; }
.hero .stats b { color: var(--on-dark); font-weight: 650; }

/* six TRACE domains + assessment: the one bold element */
.domains { margin-top: clamp(48px, 7vw, 88px); }
.domains h2 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 16px; color: var(--on-dark); }
.domain-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.domain {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 210px; padding: 18px; border: 0; border-radius: var(--radius-md);
  color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  transition: transform .35s var(--ease);
}
.domain:hover { transform: translateY(-4px); }
.domain svg { width: 64px; height: 64px; }
.domain .d-name { font-family: var(--display); font-weight: 750; font-size: 1.15rem; line-height: 1.1; letter-spacing: -0.02em; }
.domain .d-count { font-size: .92rem; margin-top: 4px; }
.domain:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
@media (max-width: 1060px) { .domain-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .domain { min-height: 150px; padding: 14px; }
  .domain svg { width: 44px; height: 44px; }
  .domain:last-child { grid-column: 1 / -1; min-height: 120px; }
}

/* ---------- section scaffolding ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(24px, 4vw, 40px); }
.section h2.big {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.1rem, 5.2vw, 4.4rem); line-height: .98; letter-spacing: -0.04em; margin: 0; max-width: 18ch;
}
.section .sub { margin: 14px 0 0; max-width: 60ch; color: var(--muted); font-size: 1.08rem; }
.band-sage { background: var(--sage); }
.band-sage .sub, .band-butter .sub { color: var(--ink); }
.band-butter { background: var(--butter); }
.band-dark { background: var(--dark); color: var(--on-dark); }
.band-dark .sub { color: var(--on-dark-muted); }

/* ---------- rails ---------- */
.rail-wrap { position: relative; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 360px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain;
  padding: 6px var(--gutter) 22px; margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
.rail-controls { display: flex; gap: 8px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--canvas); display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border-radius: var(--radius-lg); padding: 24px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(20, 20, 20, .45); }
.card .top { display: flex; align-items: flex-start; gap: 14px; }
.card .glyph { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.card .glyph svg { width: 26px; height: 26px; }
.card h3 { font-family: var(--display); font-weight: 750; font-size: 1.32rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.card .pub { color: var(--muted); font-size: .92rem; margin: 4px 0 0; }
.card .desc { margin: 0; }
.card details { border-top: 1px solid var(--line); padding-top: 10px; }
.card summary {
  cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px;
  min-height: 32px;
}
.card summary::-webkit-details-marker { display: none; }
.card summary .chev { transition: transform .25s var(--ease); }
.card details[open] summary .chev { transform: rotate(90deg); }
.card details p { margin: 8px 0 0; font-size: .98rem; overflow-wrap: anywhere; }
/* card labels are plain text, not pills, so they don't read as clickable filters */
.dtags { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: .85rem; font-weight: 600; }
.dtag { display: inline-flex; align-items: center; gap: 6px; }
.dtag .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(20,20,20,.25); }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: .85rem; color: var(--muted); }
.card .meta .m { display: inline-flex; align-items: center; gap: 5px; }
.card .meta svg, .card summary svg { width: 14px; height: 14px; flex: none; }
.guide-link { font-weight: 650; font-size: .92rem; text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.link-ok { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.link-warn {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 650;
  background: var(--amber); color: var(--ink); padding: 5px 10px; border-radius: var(--radius-sm);
}
.open-link { font-weight: 650; font-size: .95rem; }
.warn-note { font-size: .88rem; margin: 0; padding: 10px 12px; border-radius: 12px; background: #FBEBC6; }

/* ---------- browse ---------- */
.browse { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.filters { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.filters fieldset { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.filters legend { font-family: var(--display); font-weight: 750; font-size: 1.02rem; letter-spacing: -0.01em; margin-bottom: 8px; padding: 0; }
.filters .hint { font-size: .86rem; color: var(--muted); margin: -2px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip label {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.2;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .15s ease;
}
.chip label .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.chip label .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(20,20,20,.25); }
.chip input:checked + label { background: var(--ink); color: var(--canvas); box-shadow: none; }
.chip input:checked + label .n { color: var(--on-dark-muted); }
.chip input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip input:disabled + label { opacity: .4; cursor: not-allowed; }
.chip input.zero:not(:checked) + label { opacity: .5; }
.gated {
  background: var(--surface); border-radius: var(--radius-md); padding: 16px 16px 6px;
  box-shadow: inset 0 0 0 1.5px var(--ink); margin-bottom: 22px;
}
.gated .gate-title svg { width: 18px; height: 18px; flex: none; }
.gated .gate-title { display: flex; gap: 8px; align-items: center; font-family: var(--display); font-weight: 750; margin: 0 0 4px; }
.gated .hint { margin: 0 0 14px; }
.gated fieldset { margin-bottom: 14px; }
.gated.is-off { opacity: .55; }
.more { border-top: 1px solid var(--line); padding-top: 14px; }
.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 750; font-size: 1.02rem; margin-bottom: 14px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary .chev { transition: transform .25s var(--ease); }
.more[open] > summary .chev { transform: rotate(90deg); }
.more-n { font-family: var(--body); font-weight: 500; font-size: .88rem; color: var(--muted); }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.count { font-family: var(--display); font-weight: 750; font-size: clamp(1.3rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; margin: 0; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.active-chips button {
  border: 0; cursor: pointer; background: var(--ink); color: var(--canvas);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center;
}
.gate-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: var(--lilac); font-size: .95rem; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.empty { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; }
.empty h3 { font-family: var(--display); margin: 0 0 6px; font-size: 1.4rem; letter-spacing: -0.02em; }
.filter-toggle { display: none; }
.browse-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--radius-sm); padding: 4px 6px 4px 16px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 16px; }
.browse-search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; padding: 10px 0; }
.browse-search:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; overflow: visible; display: none; padding: 0; }
  .filters.open { display: block; }
  .filter-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .results { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .rail { grid-auto-columns: 84%; }
  .search { padding-left: 16px; }
  .search .btn { padding: 12px 16px; }
}

/* ---------- footer ---------- */
.footer { background: var(--canvas); padding: 48px 0 64px; border-top: 1px solid var(--line); font-size: .95rem; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.footer p { margin: 0 0 8px; color: var(--muted); }
.footer .ftitle { font-family: var(--display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--ink); }
@media (max-width: 720px) { .footer .wrap { grid-template-columns: 1fr; } }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.hero .rise { opacity: 0; transform: translateY(24px); animation: rise .9s var(--ease) forwards; }
.hero .rise:nth-child(2) { animation-delay: .08s; }
.hero .rise:nth-child(3) { animation-delay: .16s; }
.hero .rise:nth-child(4) { animation-delay: .24s; }
.domain { animation: tile .8s var(--ease) both; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes tile { from { opacity: 0; transform: translateY(30px) scale(.97); } }
html.static .reveal, html.static .hero .rise, html.static .domain { opacity: 1; transform: none; animation: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hero .rise, .domain { opacity: 1; transform: none; animation: none; transition: none; }
  .card, .domain, .btn { transition: none; }
  .card:hover, .domain:hover, .btn:hover { transform: none; }
}
