:root {
  --navy-950: #071426;
  --navy-900: #0b1f38;
  --navy-800: #12304e;
  --ink: #132238;
  --muted: #617086;
  --line: #dce5ef;
  --paper: #ffffff;
  --page: #f4f7fb;
  --turquoise: #17bebb;
  --turquoise-dark: #087e86;
  --coral: #f05d5e;
  --yellow: #f7c948;
  --shadow-sm: 0 8px 24px rgba(20, 39, 65, .08);
  --shadow-lg: 0 22px 54px rgba(20, 39, 65, .14);
  --radius-lg: 26px;
  --radius-md: 18px;
  --content: 1480px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 9%, rgba(23, 190, 187, .08), transparent 25rem),
    radial-gradient(circle at 96% 24%, rgba(240, 93, 94, .065), transparent 28rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

a { color: inherit; }

.color-ribbon {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  height: 7px;
  overflow: hidden;
}

.color-ribbon span:nth-child(4n + 1) { background: #e94c4c; }
.color-ribbon span:nth-child(4n + 2) { background: #f5c342; }
.color-ribbon span:nth-child(4n + 3) { background: #2da7df; }
.color-ribbon span:nth-child(4n) { background: #20ad79; }

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 229, 239, .9);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content), calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-950);
  text-decoration: none;
}

.brand img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.brand-name {
  display: block;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -.035em;
}

.brand-name strong { color: #d13d42; }

.brand-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #5d6c80;
  font-size: 14px;
  font-weight: 750;
}

.breadcrumbs a {
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  outline: none;
  color: var(--turquoise-dark);
  background: #e7f8f7;
}

.breadcrumbs .separator { color: #b1bdca; }

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 18%, rgba(83, 224, 219, .22), transparent 24rem),
    radial-gradient(circle at 82% 12%, rgba(248, 207, 90, .18), transparent 28rem),
    linear-gradient(128deg, #071426 0%, #0c2943 55%, #0a4150 100%);
  color: #fff;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.hero::before { width: 440px; height: 440px; top: -270px; left: 42%; }
.hero::after { width: 320px; height: 320px; right: -120px; bottom: -210px; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  align-items: center;
  width: min(var(--content), calc(100% - 40px));
  min-height: 390px;
  margin: 0 auto;
  gap: clamp(30px, 5vw, 86px);
  padding: 54px 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 8px 13px;
  border: 1px solid rgba(103, 232, 249, .28);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(14, 116, 144, .18);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, .12);
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(38px, 5vw, 70px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero h1 span { color: #67e8f9; }

.hero-description {
  max-width: 700px;
  margin: 22px 0 0;
  color: #c8d8e8;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 13px;
  color: #e6f0fa;
  background: rgba(255, 255, 255, .07);
  font-size: 13px;
  font-weight: 780;
}

.stat-pill strong { color: #fff; font-size: 15px; }

.hero-visual {
  position: relative;
  align-self: stretch;
  min-height: 280px;
}

.hero-picture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 34px;
  background: #dff7f5;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
  transform: rotate(1.5deg);
}

.hero-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-picture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7, 20, 38, .24));
  pointer-events: none;
}

.hero-float {
  position: absolute;
  z-index: 2;
  right: -12px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px;
  color: var(--navy-950);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 850;
}

.hero-float span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #064e57;
  background: #b9f4ef;
  font-size: 18px;
}

.filter-dock {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid rgba(210, 222, 235, .9);
  background: rgba(247, 250, 253, .92);
  box-shadow: 0 8px 30px rgba(20, 39, 65, .07);
  backdrop-filter: blur(18px);
}

.filter-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  align-items: center;
  width: min(var(--content), calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  gap: 20px;
}

.theme-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 10px 2px;
  scrollbar-width: none;
}

.theme-tabs::-webkit-scrollbar { display: none; }

.theme-tab {
  --tab-color: #0f7990;
  position: relative;
  flex: 0 0 auto;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #d8e3ed;
  border-radius: 13px;
  color: var(--tab-color);
  background: color-mix(in srgb, var(--tab-color) 9%, #fff);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .035em;
  transition: transform 150ms ease, color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.theme-tab .tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  color: #617086;
  background: #edf2f7;
  font-size: 10px;
}

.theme-tab:hover,
.theme-tab:focus-visible {
  outline: none;
  border-color: var(--tab-color);
  color: var(--tab-color);
  background: color-mix(in srgb, var(--tab-color) 15%, #fff);
  transform: translateY(-2px);
}

.theme-tab.active {
  color: #fff;
  border-color: var(--tab-color);
  background: var(--tab-color);
  box-shadow: 0 9px 22px color-mix(in srgb, var(--tab-color) 24%, transparent);
}

.theme-tab.active .tab-count {
  color: var(--tab-color);
  background: rgba(255, 255, 255, .92);
}

.theme-tab[data-theme="all"] { --tab-color: #0b1f38; }
.theme-tab[data-theme="1"] { --tab-color: #0d8e99; }
.theme-tab[data-theme="2"] { --tab-color: #d75555; }
.theme-tab[data-theme="3"] { --tab-color: #5069b4; }
.theme-tab[data-theme="4"] { --tab-color: #8a5a3b; }
.theme-tab[data-theme="5"] { --tab-color: #2e8b57; }
.theme-tab[data-theme="6"] { --tab-color: #d16a20; }
.theme-tab[data-theme="7"] { --tab-color: #8e4cad; }
.theme-tab[data-theme="8"] { --tab-color: #287b76; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #738196;
  stroke-width: 2;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 45px;
  padding: 10px 42px 10px 43px;
  border: 1px solid #d8e3ed;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(18, 48, 78, .02);
}

.search-box input:focus {
  border-color: #14a8ab;
  box-shadow: 0 0 0 4px rgba(20, 168, 171, .12);
}

.search-clear {
  position: absolute;
  right: 8px;
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #65748a;
  background: #edf2f7;
  cursor: pointer;
  font-size: 18px;
}

.search-clear.visible { display: grid; place-items: center; }

.library-main {
  width: min(var(--content), calc(100% - 40px));
  min-height: 460px;
  margin: 0 auto;
  padding: 44px 0 70px;
}

.results-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.results-eyebrow {
  margin: 0 0 6px;
  color: var(--turquoise-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.results-title {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.result-count {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #d8e3ed;
  border-radius: 12px;
  color: #536176;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.theme-section + .theme-section { margin-top: 62px; }

.theme-heading {
  --theme-color: #0d8e99;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
}

.theme-number {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #fff;
  background: var(--theme-color);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--theme-color) 22%, transparent);
  font-size: 19px;
  font-weight: 950;
}

.theme-heading h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 25px;
  letter-spacing: -.025em;
}

.theme-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.theme-count {
  margin-left: auto;
  color: #7b889a;
  font-size: 12px;
  font-weight: 800;
}

.theme-section[data-theme="1"] .theme-heading { --theme-color: #0d8e99; }
.theme-section[data-theme="2"] .theme-heading { --theme-color: #d75555; }
.theme-section[data-theme="3"] .theme-heading { --theme-color: #5069b4; }
.theme-section[data-theme="4"] .theme-heading { --theme-color: #8a5a3b; }
.theme-section[data-theme="5"] .theme-heading { --theme-color: #2e8b57; }
.theme-section[data-theme="6"] .theme-heading { --theme-color: #d16a20; }
.theme-section[data-theme="7"] .theme-heading { --theme-color: #8e4cad; }
.theme-section[data-theme="8"] .theme-heading { --theme-color: #287b76; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.group-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  color: var(--navy-800);
  font-size: 19px;
  font-weight: 900;
}

.group-divider::before {
  content: "";
  width: 30px;
  height: 4px;
  border-radius: 999px;
  background: var(--turquoise);
}

.group-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #dce5ef;
}

.resource-card {
  --card-accent: #0d8e99;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(210, 222, 235, .9);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.resource-card:hover,
.resource-card:focus-within {
  z-index: 2;
  border-color: color-mix(in srgb, var(--card-accent) 42%, #d8e3ed);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.resource-link {
  display: flex;
  min-height: 138px;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.resource-link.has-thumbnail {
  display: grid;
  grid-template-columns: 25% minmax(0, 1fr);
}

.card-thumbnail {
  min-width: 0;
  min-height: 138px;
  overflow: hidden;
  border-right: 1px solid rgba(210, 222, 235, .9);
  background: #e8eef4;
}

.card-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 350ms cubic-bezier(.2, .8, .2, 1);
}

.resource-card:hover .card-thumbnail img,
.resource-card:focus-within .card-thumbnail img { transform: scale(1.035); }

.card-content {
  display: flex;
  min-width: 0;
  min-height: 138px;
  flex: 1;
  flex-direction: column;
  padding: 14px 15px 13px;
}

.card-art {
  position: relative;
  overflow: hidden;
  min-height: 166px;
  height: 100%;
  background: #dff4f4;
}

.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(.2, .8, .2, 1);
}

.resource-card:hover .card-art img,
.resource-card:focus-within .card-art img { transform: scale(1.045); }

.card-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(7, 20, 38, .28));
  pointer-events: none;
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 24%, #d8e3ed);
  border-radius: 999px;
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 9%, #fff);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.theme-badge {
  color: #fff;
  border-color: transparent;
  background: var(--card-accent);
}

.card-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 0;
}

.card-copy h3 {
  margin: 13px 0 0;
  color: var(--navy-950);
  font-size: 15px;
  line-height: 1.34;
  letter-spacing: -.015em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--card-accent);
  font-size: 12px;
  font-weight: 900;
}

.card-arrow {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #fff;
  background: var(--card-accent);
  transition: transform 180ms ease;
}

.resource-card:hover .card-arrow,
.resource-card:focus-within .card-arrow { transform: translateX(3px); }

.resource-card[data-theme="1"] { --card-accent: #0d8e99; }
.resource-card[data-theme="2"] { --card-accent: #d75555; }
.resource-card[data-theme="3"] { --card-accent: #5069b4; }
.resource-card[data-theme="4"] { --card-accent: #8a5a3b; }
.resource-card[data-theme="5"] { --card-accent: #2e8b57; }
.resource-card[data-theme="6"] { --card-accent: #d16a20; }
.resource-card[data-theme="7"] { --card-accent: #8e4cad; }
.resource-card[data-theme="8"] { --card-accent: #287b76; }

.empty-theme,
.no-results,
.load-error {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 34px;
  border: 2px dashed #cfdce8;
  border-radius: var(--radius-lg);
  color: #69778a;
  background: rgba(255, 255, 255, .65);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 13px;
  border-radius: 20px;
  color: #0d7d83;
  background: #d9f4f2;
  font-size: 27px;
}

.empty-theme h3,
.no-results h3,
.load-error h3 { margin: 0 0 7px; color: var(--navy-900); font-size: 19px; }
.empty-theme p,
.no-results p,
.load-error p { margin: 0; line-height: 1.55; }

.site-footer {
  color: #b9c7d6;
  background: var(--navy-950);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content), calc(100% - 40px));
  min-height: 112px;
  margin: 0 auto;
  gap: 30px;
  padding: 26px 0;
}

.footer-brand {
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.footer-copy { margin-top: 5px; font-size: 12px; line-height: 1.55; }

.footer-links { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-links a {
  padding: 9px 11px;
  border-radius: 10px;
  color: #d9e7f2;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}
.footer-links a:hover,
.footer-links a:focus-visible { outline: none; color: #fff; background: rgba(255, 255, 255, .08); }

@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: minmax(0, 1fr) 400px; }
}

@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding: 46px 0; }
  .hero-copy { max-width: 760px; }
  .hero-visual { min-height: 310px; }
  .hero-picture { inset: 0 6%; }
  .hero-float { right: 3%; }
  .filter-inner { grid-template-columns: 1fr; gap: 0; padding: 9px 0 12px; }
  .theme-tabs { padding-bottom: 8px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  .header-inner,
  .hero-inner,
  .filter-inner,
  .library-main,
  .footer-inner { width: min(100% - 24px, var(--content)); }

  .header-inner { min-height: 67px; }
  .brand img { width: 39px; height: 39px; }
  .brand-name { font-size: 18px; }
  .brand-note { display: none; }
  .breadcrumbs .hide-mobile,
  .breadcrumbs .separator { display: none; }
  .breadcrumbs a { padding: 8px; font-size: 13px; }

  .hero h1 { font-size: clamp(36px, 12vw, 52px); }
  .hero-description { font-size: 15px; }
  .hero-visual { min-height: 245px; }
  .hero-picture { inset: 0; border-radius: 24px; }
  .hero-float { right: 8px; bottom: 12px; }

  .filter-dock { position: relative; }
  .theme-tabs { margin-right: -12px; padding-right: 12px; }
  .theme-tab { min-height: 41px; padding: 8px 12px; }

  .library-main { padding-top: 32px; }
  .results-bar { align-items: flex-start; }
  .result-count { margin-top: 3px; }
  .theme-section + .theme-section { margin-top: 48px; }
  .theme-heading { align-items: flex-start; }
  .theme-count { display: none; }
  .theme-number { width: 44px; height: 44px; border-radius: 14px; }
  .theme-heading h2 { font-size: 22px; }

  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .resource-card { border-radius: 17px; }
  .resource-link { min-height: 126px; }
  .card-content { min-height: 126px; padding: 12px 13px 11px; }
  .card-thumbnail { min-height: 126px; }
  .card-copy { padding: 0; }
  .card-copy h3 { font-size: 15px; }
  .card-badges { gap: 6px; }
  .card-badge { min-height: 22px; padding: 3px 7px; font-size: 8px; letter-spacing: .025em; }
  .card-footer { padding-top: 10px; }
  .card-arrow { width: 28px; height: 28px; }
  .group-divider { margin-top: 10px; font-size: 17px; }

  .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .card-copy h3 { font-size: 14px; }
  .card-footer { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  .filter-dock, .hero-visual, .search-box, .site-footer { display: none !important; }
  .hero { color: #111; background: #fff; }
  .hero-inner { display: block; min-height: 0; padding: 24px 0; }
  .hero h1 span { color: #111; }
  .hero-description { color: #333; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .resource-card { break-inside: avoid; box-shadow: none; }
}
