:root {
  --ink: #14272c;
  --muted: #587076;
  --paper: #f7f8f4;
  --white: #ffffff;
  --teal: #087e78;
  --teal-dark: #045d59;
  --coral: #dc6f5e;
  --yellow: #f0c55b;
  --line: #d8e1df;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.5; }
button, input { font: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; transform: translateY(-150%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 5px; }
.skip-link:focus { transform: translateY(0); }

.site-header { width: min(1280px, calc(100% - 48px)); height: 84px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-family: var(--serif); font-size: 21px; letter-spacing: 0; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: var(--white); background: var(--teal); border-radius: 7px; }
.brand-mark svg { width: 19px; }
nav { display: flex; align-items: center; gap: 28px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--teal-dark); }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); }

.hero { position: relative; isolation: isolate; min-height: 580px; overflow: hidden; color: var(--white); }
.hero-image, .hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { object-fit: cover; object-position: center; z-index: -2; }
.hero-overlay { z-index: -1; background: linear-gradient(90deg, rgba(7, 41, 43, .92) 0%, rgba(9, 54, 56, .72) 36%, rgba(6, 31, 32, .08) 70%); }
.hero-content { width: min(1280px, calc(100% - 48px)); margin: auto; padding: 114px 0 144px; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero .eyebrow { color: #9fe0d5; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
h1 { max-width: 720px; margin-bottom: 18px; font-size: clamp(52px, 7vw, 94px); line-height: .94; }
.hero-copy { max-width: 450px; margin-bottom: 30px; color: rgba(255,255,255,.84); font-size: 18px; }
.primary-action { display: inline-flex; align-items: center; gap: 9px; padding: 13px 16px; border-radius: 6px; color: var(--ink); background: var(--yellow); font-weight: 700; text-decoration: none; }
.primary-action:hover { background: #ffd66f; }
.primary-action svg { width: 18px; }
.hero-stats { position: absolute; bottom: 0; left: 50%; width: min(1280px, calc(100% - 48px)); margin: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); max-width: 520px; margin-left: -380px; }
.hero-stats div { padding: 20px 22px; border-left: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(10px); background: rgba(5, 34, 35, .36); }
.hero-stats div:last-child { border-right: 1px solid rgba(255,255,255,.3); }
.hero-stats dt { font: 600 28px/1 var(--serif); }
.hero-stats dd { margin: 3px 0 0; color: rgba(255,255,255,.74); font-size: 12px; }

.intro-band { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.intro-band p { max-width: 610px; margin: 0; font: 600 25px/1.22 var(--serif); }
.intro-band a { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-dark); font-size: 14px; font-weight: 700; white-space: nowrap; }
.intro-band svg { width: 16px; }

.content-section, .catalog-section { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 94px 0; }
.section-heading, .catalog-heading { display: grid; grid-template-columns: 1.4fr .7fr; align-items: end; gap: 40px; margin-bottom: 34px; }
.section-heading h2, .catalog-heading h2 { margin: 0; font-size: clamp(33px, 4vw, 52px); line-height: 1; }
.section-heading > p, .catalog-heading > p { margin: 0; color: var(--muted); font-size: 15px; }
.compact-heading { display: block; }

.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.featured-card, .category-card, .resource-card { position: relative; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.featured-card { min-height: 240px; padding: 23px; display: flex; flex-direction: column; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.featured-card:hover, .featured-card:focus-visible, .category-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(16, 55, 54, .1); }
.featured-number { color: var(--coral); font: 600 15px var(--serif); }
.featured-card h3 { margin: auto 0 9px; font: 600 25px/1.03 var(--serif); }
.featured-card p { margin: 0; color: var(--muted); font-size: 13px; }
.card-link-icon { position: absolute; top: 21px; right: 21px; color: var(--teal); }
.card-link-icon svg { width: 18px; }

.category-section { padding-top: 0; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.category-card { min-height: 134px; padding: 18px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.category-card button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.category-card h3 { margin: 34px 0 2px; font: 600 20px/1.1 var(--serif); }
.category-card p { margin: 0; color: var(--muted); font-size: 12px; }
.category-icon { color: var(--teal); }
.category-icon svg { width: 20px; }

.caution-note { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 35px; display: grid; grid-template-columns: auto 1fr; gap: 20px; border: 1px solid #edcf94; border-radius: 7px; background: #fff8e7; }
.note-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #7c4d00; background: #f4d38b; }
.note-icon svg { width: 21px; }
.caution-note .eyebrow { color: #8c5c08; }
.caution-note h2 { margin-bottom: 8px; font-size: 29px; }
.caution-note p:last-child { max-width: 780px; margin-bottom: 0; color: #624e2c; font-size: 14px; }

.catalog-section { padding-bottom: 100px; }
.catalog-heading { margin-bottom: 25px; }
#result-summary { color: var(--muted); text-align: right; }
.catalog-controls { display: grid; grid-template-columns: minmax(260px, .85fr) 1.15fr; gap: 18px; align-items: center; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 13px; border: 1px solid #b8cbca; border-radius: 6px; background: var(--white); color: var(--muted); }
.search-box:focus-within { border-color: var(--teal); outline: 3px solid rgba(8, 126, 120, .16); }
.search-box svg { width: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--paper); font-size: 10px; white-space: nowrap; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.filter-button { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); cursor: pointer; font-size: 12px; }
.filter-button:hover, .filter-button[aria-pressed="true"] { border-color: var(--teal); color: var(--white); background: var(--teal); }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 25px; }
.resource-card { min-height: 192px; padding: 18px; display: flex; flex-direction: column; }
.resource-card h3 { margin: 20px 0 8px; padding-right: 5px; font-size: 16px; line-height: 1.2; }
.resource-card h3 a { text-decoration: none; }
.resource-card h3 a:hover { color: var(--teal-dark); text-decoration: underline; }
.resource-card p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 15px; }
.resource-domain { max-width: 180px; overflow: hidden; color: var(--teal-dark); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.resource-category { color: var(--muted); font-size: 10px; }
.resource-caution { position: relative; flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #805300; background: #fff0c4; cursor: help; }
.resource-caution svg { width: 15px; }
.resource-caution::after { content: attr(data-tip); position: absolute; z-index: 5; right: 0; bottom: calc(100% + 8px); width: 260px; padding: 10px; border-radius: 5px; color: var(--white); background: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); font: 12px/1.35 var(--sans); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; }
.resource-caution:hover::after, .resource-caution:focus-visible::after { opacity: 1; transform: translateY(0); }
.load-more { display: flex; align-items: center; gap: 7px; margin: 28px auto 0; padding: 11px 15px; border: 1px solid var(--teal); border-radius: 6px; color: var(--teal-dark); background: transparent; font-weight: 700; cursor: pointer; }
.load-more:hover { color: var(--white); background: var(--teal); }
.load-more[hidden] { display: none; }
.empty-state { grid-column: 1 / -1; padding: 52px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

.site-footer { display: grid; grid-template-columns: .75fr 1fr 1fr; gap: 30px; padding: 46px max(24px, calc((100% - 1120px) / 2)); color: #d5e2df; background: var(--ink); }
.site-footer .brand { color: var(--white); }
.site-footer .brand small { color: #a8c2be; }
.site-footer p { margin: 0; font-size: 13px; }
.footer-note { color: #9eb5b2; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
@media (max-width: 820px) {
  .site-header { width: min(100% - 32px, 1280px); height: 72px; }
  nav { position: absolute; z-index: 10; top: 72px; left: 16px; right: 16px; display: none; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: 0 15px 35px rgba(15,45,45,.12); }
  nav.open { display: grid; gap: 14px; }
  .menu-button { display: grid; place-items: center; }
  .hero { min-height: 620px; }
  .hero-overlay { background: linear-gradient(90deg, rgba(7, 41, 43, .93), rgba(7, 41, 43, .50)); }
  .hero-content { width: min(100% - 32px, 1280px); padding-top: 100px; }
  .hero-stats { width: calc(100% - 32px); max-width: none; margin-left: 0; }
  .section-heading, .catalog-heading { grid-template-columns: 1fr; gap: 14px; }
  #result-summary { text-align: left; }
  .featured-grid, .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-controls { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero { min-height: 640px; }
  h1 { font-size: 53px; }
  .hero-content { padding-bottom: 170px; }
  .hero-stats div { padding: 16px 12px; }
  .hero-stats dt { font-size: 23px; }
  .intro-band { align-items: flex-start; flex-direction: column; }
  .intro-band p { font-size: 22px; }
  .content-section, .catalog-section { width: calc(100% - 32px); padding: 68px 0; }
  .featured-grid, .resource-grid, .category-grid { grid-template-columns: 1fr; }
  .caution-note { width: calc(100% - 32px); padding: 24px; }
  .resource-caution::after { right: -8px; width: min(260px, calc(100vw - 64px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
