:root {
  --blue-950: #172554;
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --slate-950: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #fff;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-50: #fef2f2;
  --amber-500: #f59e0b;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--slate-800);
  background: var(--slate-50);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--blue-700); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--white); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.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; }

main.container { padding-block: 32px 56px; }
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(190px, 310px);
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 24px;
  color: var(--white);
  background: linear-gradient(120deg, var(--blue-950), var(--blue-800) 58%, #312e81);
  box-shadow: 0 22px 50px rgba(30, 58, 138, .22);
}
.eyebrow { display: inline-block; margin: 0 0 12px; padding: 5px 11px; border: 1px solid rgba(191, 219, 254, .38); border-radius: 999px; color: #bfdbfe; background: rgba(59, 130, 246, .18); font-size: .78rem; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(1.85rem, 4vw, 3rem); line-height: 1.12; }
.hero-subtitle { max-width: 680px; margin: 14px 0 0; color: #dbeafe; font-size: 1rem; }
.hero-logo { width: 100%; max-height: 160px; object-fit: contain; border-radius: 14px; background: var(--white); box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }

.controls { margin-block: 28px; padding: 22px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.controls-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 22px; }
.search-box label, .type-filters legend, .profiles-heading h3, .sort-control label { display: block; margin: 0 0 7px; color: var(--slate-600); font-size: .78rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; fill: none; stroke: var(--slate-500); stroke-width: 2; transform: translateY(-50%); }
.search-field input { width: 100%; min-height: 48px; padding: 11px 44px; border: 1px solid var(--slate-300); border-radius: 12px; color: var(--slate-800); background: var(--slate-50); }
.search-field input:focus { border-color: var(--blue-600); background: var(--white); }
.icon-button { position: absolute; right: 8px; top: 50%; width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--slate-600); background: transparent; font-size: 1.5rem; transform: translateY(-50%); }
.icon-button:hover { background: var(--slate-100); }
.type-filters { min-width: 330px; margin: 0; padding: 0; border: 0; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-100); }
.segmented button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 9px; color: var(--slate-600); background: transparent; font-size: .82rem; font-weight: 750; }
.segmented button.is-active { color: var(--blue-900); background: var(--white); box-shadow: 0 3px 10px rgba(15, 23, 42, .1); }
.segmented span { margin-left: 2px; }
.profiles-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--slate-100); }
.profiles-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profiles-heading h3 { margin: 0; }
.text-button { padding: 4px; border: 0; color: var(--blue-700); background: transparent; font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.profile-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-pill { padding: 7px 12px; border: 1px solid var(--slate-300); border-radius: 999px; color: var(--slate-700); background: var(--slate-50); font-size: .8rem; font-weight: 700; }
.profile-pill:hover { background: var(--slate-100); }
.profile-pill.is-active { border-color: var(--blue-900); color: var(--white); background: var(--blue-900); }

.results-header, .results-title, .sort-control { display: flex; align-items: center; }
.results-header { justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.results-title { gap: 12px; }
.results-title h2 { margin: 0; color: var(--slate-950); font-size: 1.35rem; }
.results-badge { padding: 5px 10px; border-radius: 999px; color: var(--blue-900); background: var(--blue-100); font-size: .78rem; font-weight: 800; }
.sort-control { gap: 8px; }
.sort-control label { margin: 0; white-space: nowrap; }
.sort-control select { min-height: 40px; padding: 7px 34px 7px 11px; border: 1px solid var(--slate-300); border-radius: 10px; color: var(--slate-700); background: var(--white); font-size: .82rem; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.resource-card { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; overflow: hidden; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); box-shadow: 0 4px 14px rgba(15, 23, 42, .04); transition: transform .18s ease, box-shadow .18s ease; }
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.format-badge, .profile-badge, .tag { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 750; }
.format-badge { padding: 5px 9px; border: 1px solid #fecaca; color: var(--red-700); background: var(--red-50); font-size: .72rem; }
.format-badge.video { border-color: var(--red-600); color: var(--white); background: var(--red-600); }
.card-actions { display: flex; align-items: center; gap: 5px; }
.profile-badge { max-width: 155px; padding: 4px 8px; color: var(--slate-600); background: var(--slate-100); font-size: .68rem; line-height: 1.25; text-align: center; }
.favorite-button { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 50%; color: var(--slate-300); background: transparent; font-size: 1.2rem; }
.favorite-button:hover { color: var(--amber-500); background: var(--slate-100); }
.favorite-button.is-favorite { color: var(--amber-500); }
.resource-card h3 { margin: 15px 0 8px; color: var(--slate-950); font-size: 1.02rem; line-height: 1.35; }
.resource-description { margin: 0; color: var(--slate-600); font-size: .84rem; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.tag { padding: 3px 7px; color: var(--slate-600); background: var(--slate-100); font-size: .66rem; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 12px 20px; border-top: 1px solid var(--slate-100); color: var(--slate-500); background: var(--slate-50); font-size: .76rem; }
.resource-link { border: 0; color: var(--blue-700); background: transparent; font-weight: 800; text-decoration: none; }
.resource-link:hover { color: var(--blue-900); text-decoration: underline; }
.video-link { color: var(--red-700); }
.status-message, .empty-state { margin: 26px auto; padding: 28px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); text-align: center; }
.status-message { color: var(--slate-700); }
.empty-state { max-width: 480px; }
.empty-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: var(--slate-600); background: var(--slate-100); font-size: 2rem; }
.empty-state h3 { margin: 0; }
.empty-state p { color: var(--slate-600); }
.primary-button, .download-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 9px; color: var(--white); background: var(--blue-700); font-weight: 750; text-decoration: none; }
.primary-button:hover, .download-button:hover { background: var(--blue-800); }

.pdf-dialog { width: min(1050px, calc(100% - 24px)); height: min(88vh, 850px); padding: 0; border: 0; border-radius: var(--radius); background: transparent; }
.pdf-dialog::backdrop { background: rgba(15, 23, 42, .84); backdrop-filter: blur(3px); }
.dialog-shell { display: grid; height: 100%; grid-template-rows: auto auto 1fr; overflow: hidden; border-radius: var(--radius); background: var(--white); box-shadow: 0 28px 80px rgba(0, 0, 0, .35); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 18px; color: var(--white); background: var(--slate-950); }
.dialog-label { display: inline-block; padding: 3px 7px; border-radius: 5px; background: var(--red-600); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.dialog-header h2 { margin: 7px 0 0; font-size: 1.03rem; }
.dialog-header p { margin: 3px 0 0; color: var(--slate-300); font-size: .76rem; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 9px; color: var(--white); background: rgba(255, 255, 255, .1); font-size: 1.6rem; }
.dialog-close:hover { background: rgba(255, 255, 255, .2); }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; color: var(--slate-300); background: var(--slate-800); font-size: .75rem; }
.download-button { min-height: 34px; padding: 5px 10px; font-size: .75rem; }
.pdf-dialog iframe { width: 100%; height: 100%; border: 0; background: var(--slate-100); }
.site-footer { border-top: 1px solid var(--slate-200); background: var(--white); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; color: var(--slate-500); font-size: .8rem; }
.footer-inner p { margin: 0; }
noscript { display: block; padding: 16px; color: var(--red-700); background: var(--red-50); text-align: center; }

@media (max-width: 960px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr 220px; }
  .controls-row { grid-template-columns: 1fr; }
  .type-filters { min-width: 0; }
}
@media (max-width: 680px) {
  .container { width: min(100% - 22px, 1180px); }
  main.container { padding-top: 12px; }
  .hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .hero-logo { max-width: 260px; }
  .controls { padding: 16px; }
  .resource-grid { grid-template-columns: 1fr; }
  .results-header { align-items: stretch; flex-direction: column; }
  .results-title { align-items: flex-start; flex-direction: column; }
  .sort-control { align-items: stretch; flex-direction: column; }
  .dialog-toolbar, .footer-inner { align-items: flex-start; flex-direction: column; }
  .pdf-dialog { width: calc(100% - 12px); height: 94vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
