:root {
  --ink: #102b4e;
  --muted: #5d7189;
  --line: #dce9f3;
  --surface: #ffffff;
  --wash: #f4f9fc;
  --blue: #1368a8;
  --blue-dark: #0d4d80;
  --sky: #d9f2f8;
  --shadow: 0 18px 45px rgba(29, 70, 103, .10);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--wash); }
a { color: inherit; }
.skip-link { position: absolute; left: 16px; top: -50px; z-index: 5; padding: 10px 14px; background: #fff; color: var(--blue-dark); border-radius: 8px; }
.skip-link:focus { top: 16px; }
.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; }
.resources-header { background: linear-gradient(135deg, #d9f2f8 0%, #e9f6f1 68%, #fff 100%); border-bottom: 1px solid rgba(35, 101, 133, .12); }
.topbar { width: min(1120px, calc(100% - 40px)); margin: 0 auto; min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 134px; height: auto; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.back-link { text-decoration: none; font-weight: 700; color: var(--blue-dark); }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }
.language-picker { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.language-picker select, .filter-field select { border: 1px solid #bad1df; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; padding: 9px 30px 9px 10px; }
.hero-content { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 64px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 16px; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.03; letter-spacing: 0; }
.hero-copy { max-width: 650px; margin-bottom: 28px; color: #44647c; font-size: 1.08rem; line-height: 1.65; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--blue-dark); font-size: .86rem; }
.hero-meta span { padding: 9px 13px; border-radius: 99px; background: rgba(255,255,255,.72); }
.hero-meta strong { margin-right: 4px; }
main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 72px; }
.resource-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
.resource-toolbar h2 { margin-bottom: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.controls { display: flex; align-items: center; gap: 10px; }
.search-field { min-width: min(280px, 42vw); position: relative; }
.search-field input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 13px 14px 13px 40px; color: var(--ink); font: inherit; outline: none; }
.search-field input:focus, .filter-field select:focus, .language-picker select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19, 104, 168, .14); }
.search-icon { position: absolute; left: 14px; top: 10px; color: var(--muted); font-size: 1.35rem; pointer-events: none; }
.filter-field select { padding-top: 12px; padding-bottom: 12px; }
.results-count { min-height: 22px; margin-bottom: 18px; color: var(--muted); font-size: .9rem; }
.module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.module-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 25px rgba(29, 70, 103, .06); transition: transform .2s ease, box-shadow .2s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-top { display: grid; grid-template-columns: 132px 1fr; min-height: 170px; }
.module-image { display: flex; align-items: center; justify-content: center; padding: 15px; background: #edf7fa; }
.module-image img { width: 100%; max-height: 140px; object-fit: contain; }
.module-summary { display: flex; flex-direction: column; justify-content: center; padding: 22px 22px 18px; }
.module-kicker { margin-bottom: 7px; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.module-summary h3 { margin-bottom: 8px; font-size: 1.2rem; line-height: 1.18; }
.module-summary p { margin-bottom: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.module-card.is-linked { display: block; text-decoration: none; }
.module-card.is-linked:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.badge { padding: 4px 9px; border-radius: 5px; font-size: .66rem; font-weight: 800; letter-spacing: .06em; }
.badge.is-video { background: #eaf6ee; color: #146c45; }
.badge.is-hex { background: #e8f2fb; color: var(--blue-dark); }
.badge.is-wiring { background: #f3f1fa; color: #4b4083; }
.card-footer { display: flex; align-items: center; gap: 6px; margin: 0; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--blue-dark); font-size: .88rem; font-weight: 800; }
.card-footer a { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; color: var(--blue-dark); text-decoration: none; }
.card-footer a:hover, .card-footer a:focus-visible { text-decoration: underline; }
.other-section { margin-top: 44px; }
.section-divider { margin-bottom: 18px; padding-top: 26px; border-top: 1px solid var(--line); }
.section-divider h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 1.35rem; }
.section-count { padding: 3px 10px; border-radius: 99px; background: var(--sky); color: var(--blue-dark); font-size: .8rem; font-weight: 800; }
.section-divider p { margin-bottom: 0; color: var(--muted); font-size: .92rem; }
.empty-state { padding: 40px; border: 1px dashed #b8cfdc; border-radius: 10px; text-align: center; color: var(--muted); }
.resource-note { display: flex; gap: 16px; margin-top: 48px; padding: 24px; border-radius: 10px; background: var(--sky); }
.note-mark { flex: 0 0 28px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; }
.resource-note h2 { margin-bottom: 8px; font-size: 1.08rem; }
.resource-note p { margin-bottom: 0; color: #426276; line-height: 1.6; }
.site-footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 40px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .82rem; }
.site-footer p { margin-bottom: 0; }
.site-footer a { color: var(--blue-dark); font-weight: 700; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; }
.site-footer span { padding: 0 8px; }
@media (max-width: 760px) {
  .topbar, .hero-content, main, .site-footer { width: min(100% - 28px, 1120px); }
  .topbar { min-height: 76px; }
  .brand img { width: 112px; }
  .topbar-actions { gap: 12px; }
  .back-link { font-size: .86rem; }
  .hero-content { padding: 40px 0 48px; }
  .resource-toolbar { align-items: stretch; flex-direction: column; gap: 18px; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-field { min-width: 0; }
  .module-list { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 470px) {
  .language-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .hero-meta { display: grid; }
  .module-top { grid-template-columns: 104px 1fr; min-height: 145px; }
  .module-image { padding: 10px; }
  .module-image img { max-height: 115px; }
  .module-summary { padding: 16px 15px; }
  .module-summary h3 { font-size: 1.05rem; }
  .card-footer { padding: 12px 15px; }
  .resource-note { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .module-card { transition: none; }
}
