/* =====================================================================
   CIP-aligned Academic Taxonomy — course catalogue stylesheet
   Covers every class emitted by build_courses_site.sh (v2 generator).

   Sections
     1.  Design tokens
     2.  Reset and base
     3.  Typography
     4.  Layout (wrap, band)
     5.  Skip link
     6.  Topbar / brand / nav
     7.  Breadcrumb
     8.  Hero
     9.  Buttons
     10. Section heads
     11. Cards
     12. Module grid
     13. Stats grid
     14. Tags
     15. Badges
     16. Tables
     17. Two-column
     18. Lists
     19. Pagination
     20. Callouts
     21. Footer
     22. Utilities
     23. Responsive
     24. Dark mode
     25. Print
     26. Reduced motion
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------- */
:root {
  /* Brand */
  --c-brand:        #2f3d7a;   /* deep indigo */
  --c-brand-hi:     #3d4f9e;
  --c-brand-lo:     #1f2955;
  --c-brand-soft:   #eef1fb;   /* very light wash */
  --c-brand-tint:   #dbe2f8;

  /* Accent (used sparingly) */
  --c-accent:       #b8741e;   /* amber */
  --c-accent-soft:  #fbeed8;

  /* Neutral ramp (warm) */
  --c-bg:           #faf9f6;
  --c-bg-alt:       #f2f1ec;
  --c-surface:      #ffffff;
  --c-surface-2:    #f7f6f2;
  --c-border:       #e2ded3;
  --c-border-strong:#c9c3b4;

  /* Text */
  --c-text:         #1c1b18;
  --c-text-2:       #45423a;
  --c-text-3:       #7a766a;
  --c-text-inverse: #ffffff;

  /* Status */
  --c-success:      #2f6a3d;
  --c-success-soft: #e3f1e6;
  --c-warning:      #8a5a13;
  --c-warning-soft: #fbecd3;
  --c-danger:       #8a2d2d;
  --c-danger-soft:  #f8e1e1;
  --c-info:         #2a5a8a;
  --c-info-soft:    #e3eef8;

  /* Tag tints (per category) */
  --c-tag-bg:       #f0efe9;
  --c-tag-fg:       #55524a;
  --c-tag-keyword:  #eef1fb;
  --c-tag-topic:    #f4eef8;
  --c-tag-assess:   #e9f3ee;
  --c-tag-delivery: #fbf3e2;
  --c-tag-lang:     #e9eef5;
  --c-tag-vocab:    #f2efe6;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --fs-50:  0.75rem;    /* 12px */
  --fs-100: 0.8125rem;  /* 13px */
  --fs-200: 0.875rem;   /* 14px */
  --fs-300: 1rem;       /* 16px */
  --fs-400: 1.125rem;   /* 18px */
  --fs-500: 1.25rem;    /* 20px */
  --fs-600: 1.5rem;     /* 24px */
  --fs-700: 1.875rem;   /* 30px */
  --fs-800: 2.25rem;    /* 36px */
  --fs-900: 2.75rem;    /* 44px */

  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-base:  1.55;

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radii / shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(20, 20, 20, 0.05),
              0 1px 3px rgba(20, 20, 20, 0.04);
  --shadow-2: 0 2px 6px rgba(20, 20, 20, 0.06),
              0 6px 18px rgba(20, 20, 20, 0.06);
  --shadow-focus: 0 0 0 3px rgba(61, 79, 158, 0.35);

  /* Layout */
  --wrap-max: 1100px;
  --topbar-h: 64px;
}

/* ---------------------------------------------------------------------
   2. Reset and base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-300);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-8) 0;
}

a {
  color: var(--c-brand);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { color: var(--c-brand-hi); text-decoration: underline; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--r-sm);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.08em 0.4em;
  color: var(--c-text-2);
}

pre {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  overflow-x: auto;
}

/* ---------------------------------------------------------------------
   3. Typography
   --------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--c-text);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-3);
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-600); }
h3 { font-size: var(--fs-500); }
h4 { font-size: var(--fs-400); }
h5 { font-size: var(--fs-300); }
h6 { font-size: var(--fs-200); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-3); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

small, .small { font-size: var(--fs-200); }
strong, b { font-weight: 650; }

/* ---------------------------------------------------------------------
   4. Layout
   --------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.band {
  padding-block: var(--sp-8) var(--sp-12);
  background: var(--c-bg);
}
.band + .band { border-top: 1px solid var(--c-border); }

/* ---------------------------------------------------------------------
   5. Skip link
   --------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: 100;
  background: var(--c-brand);
  color: var(--c-text-inverse);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-200);
  transition: top 120ms ease;
}
.skip-link:focus { top: var(--sp-3); }

/* ---------------------------------------------------------------------
   6. Topbar / brand / nav
   --------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: saturate(1.1) blur(6px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--topbar-h);
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--c-text);
  text-decoration: none;
  font-weight: 600;
}
.brand:hover { text-decoration: none; color: var(--c-text); }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--c-brand);
  color: var(--c-text-inverse);
  font-weight: 700;
  font-size: var(--fs-200);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text b { font-size: var(--fs-300); }
.brand-text span {
  font-size: var(--fs-100);
  color: var(--c-text-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-200);
}
.topnav a { color: var(--c-text-2); }
.topnav a:hover { color: var(--c-brand); }

/* ---------------------------------------------------------------------
   7. Breadcrumb
   --------------------------------------------------------------------- */
.breadcrumb {
  font-size: var(--fs-200);
  color: var(--c-text-3);
  padding-block: var(--sp-4) var(--sp-2);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.breadcrumb li + li::before {
  content: "/";
  color: var(--c-border-strong);
  margin-inline: var(--sp-2);
}
.breadcrumb a { color: var(--c-text-3); }
.breadcrumb a:hover { color: var(--c-brand); }
.breadcrumb [aria-current="page"] { color: var(--c-text-2); font-weight: 500; }

/* ---------------------------------------------------------------------
   8. Hero
   --------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 20% -20%, var(--c-brand-soft), transparent 60%),
    linear-gradient(180deg, var(--c-surface), var(--c-bg));
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--sp-12) var(--sp-10);
}
.hero-compact { padding-block: var(--sp-8) var(--sp-6); }

.hero-inner { display: grid; gap: var(--sp-6); }
.hero-inner.single { grid-template-columns: 1fr; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-100);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-brand);
}
.hero-eyebrow .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-brand);
  box-shadow: 0 0 0 4px var(--c-brand-soft);
}

.hero h1 {
  margin: 0 0 var(--sp-4);
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero h1 .light {
  display: block;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: var(--sp-2);
}

.hero-lede {
  max-width: 68ch;
  font-size: var(--fs-400);
  color: var(--c-text-2);
  margin: 0;
}

/* ---------------------------------------------------------------------
   9. Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.55rem 0.95rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--c-brand);
  color: var(--c-text-inverse);
  font: inherit;
  font-size: var(--fs-200);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--c-brand-hi); color: var(--c-text-inverse); text-decoration: none; }
.btn:active { background: var(--c-brand-lo); }

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

.btn-sm { padding: 0.35rem 0.65rem; font-size: var(--fs-100); border-radius: var(--r-sm); }

/* ---------------------------------------------------------------------
   10. Section heads
   --------------------------------------------------------------------- */
.section-head { margin: 0 0 var(--sp-6); }
.section-head h2 { margin: 0 0 var(--sp-2); }
.section-head p { margin: 0; color: var(--c-text-2); max-width: 68ch; }

.section-kicker {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-100);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-brand);
}

/* ---------------------------------------------------------------------
   11. Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--sp-5);
}
.card:last-child { margin-bottom: 0; }
.card > h2, .card > h3 { margin-top: 0; }
.card > h3 { font-size: var(--fs-400); }

.card-lg { padding: var(--sp-6); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}
.card-head h2 { margin: 0; font-size: var(--fs-600); }

/* ---------------------------------------------------------------------
   12. Module grid
   --------------------------------------------------------------------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.module-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--c-border-strong);
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.module-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  font-weight: 600;
  color: var(--c-brand);
  background: var(--c-brand-soft);
  border: 1px solid var(--c-brand-tint);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.02em;
}

.module-count {
  font-size: var(--fs-100);
  color: var(--c-text-3);
  font-weight: 500;
  white-space: nowrap;
}

.module-card h3 {
  font-size: var(--fs-400);
  margin: 0 0 var(--sp-2);
  line-height: var(--lh-snug);
}
.module-card h3 a { color: var(--c-text); }
.module-card h3 a:hover { color: var(--c-brand); text-decoration: none; }

.module-card p {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-200);
  color: var(--c-text-2);
  flex-grow: 1;
}

.module-foot {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-200);
}
.module-foot a { font-weight: 600; }

/* ---------------------------------------------------------------------
   13. Stats grid
   --------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.stat-value {
  font-size: var(--fs-700);
  font-weight: 700;
  color: var(--c-brand);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-3);
  font-weight: 600;
}

/* ---------------------------------------------------------------------
   14. Tags
   --------------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--c-tag-bg);
  color: var(--c-tag-fg);
  font-size: var(--fs-100);
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag-keyword  { background: var(--c-tag-keyword);  color: var(--c-info); }
.tag-topic    { background: var(--c-tag-topic);    color: #6b3f8a; }
.tag-assessment { background: var(--c-tag-assess); color: var(--c-success); }
.tag-delivery { background: var(--c-tag-delivery); color: var(--c-accent); }
.tag-language { background: var(--c-tag-lang);     color: var(--c-info); }
.tag-vocab    { background: var(--c-tag-vocab);    color: var(--c-text-2); }

/* ---------------------------------------------------------------------
   15. Badges (status / level / alignment / relations)
   --------------------------------------------------------------------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-100);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
  white-space: nowrap;
}

.badge-status   { text-transform: capitalize; }
.badge-active    { background: var(--c-success-soft); color: var(--c-success); border-color: #c5e0cb; }
.badge-draft     { background: var(--c-warning-soft); color: var(--c-warning); border-color: #f0dcb3; }
.badge-deprecated{ background: var(--c-danger-soft);  color: var(--c-danger);  border-color: #ecc6c6; }

.badge-level {
  background: var(--c-brand-soft);
  color: var(--c-brand);
  border-color: var(--c-brand-tint);
  text-transform: capitalize;
}

.badge-align {
  background: var(--c-info-soft);
  color: var(--c-info);
  border-color: #c8dcf0;
  text-transform: capitalize;
}

.badge-rel {
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------
   16. Tables
   --------------------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-200);
  margin: 0;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.data-table thead th {
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  font-weight: 700;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border-strong);
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--c-surface-2); }
.data-table th { font-weight: 600; color: var(--c-text-2); width: 30%; }

.data-table code { background: transparent; border: 0; padding: 0; }

/* Legacy `terms` list, kept for safety */
.terms { margin: 0; }
.terms > div { display: grid; grid-template-columns: 30% 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); }
.terms > div:last-child { border-bottom: 0; }
.terms dt { font-weight: 600; color: var(--c-text-2); }
.terms dd { margin: 0; }

/* ---------------------------------------------------------------------
   17. Two-column
   --------------------------------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.two-col > .card { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   18. Lists
   --------------------------------------------------------------------- */
.outcomes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.outcomes-list li {
  position: relative;
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-2);
  color: var(--c-text-2);
}
.outcomes-list li:last-child { margin-bottom: 0; }
.outcomes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-soft);
}

/* ---------------------------------------------------------------------
   19. Pagination
   --------------------------------------------------------------------- */
.pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
}

.pagination a {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--c-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.pagination a:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-1);
  text-decoration: none;
}
.pagination .next { text-align: right; }
.pagination .dir {
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-3);
  font-weight: 700;
}
.pagination .title { font-weight: 600; color: var(--c-brand); }
.pagination .spacer { display: block; }

/* ---------------------------------------------------------------------
   20. Callouts
   --------------------------------------------------------------------- */
.callout {
  padding: var(--sp-5);
  background: var(--c-brand-soft);
  border: 1px solid var(--c-brand-tint);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--r-md);
  color: var(--c-text-2);
}
.callout h4 { margin: 0 0 var(--sp-2); color: var(--c-brand-lo); }
.callout p { margin: 0; }

/* ---------------------------------------------------------------------
   21. Footer
   --------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-12);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-200);
  color: var(--c-text-3);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-block: var(--sp-6);
}
.footer-bottom p { margin: 0; }

/* ---------------------------------------------------------------------
   22. Utilities
   --------------------------------------------------------------------- */
.muted { color: var(--c-text-3); }
.desc { color: var(--c-text-2); }

.alt-titles {
  font-size: var(--fs-200);
  color: var(--c-text-3);
  margin: var(--sp-2) 0 var(--sp-4);
}
.alt-titles .muted { font-weight: 600; }

.canonical-id {
  font-size: var(--fs-100);
  color: var(--c-text-3);
  margin: var(--sp-2) 0 var(--sp-3);
  font-family: var(--font-mono);
}
.canonical-id code { background: transparent; border: 0; padding: 0; }

.code-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1em 0.45em;
  border-radius: var(--r-sm);
  background: var(--c-brand-soft);
  color: var(--c-brand);
  border: 1px solid var(--c-brand-tint);
  text-decoration: none;
  margin-right: var(--sp-1);
  margin-bottom: var(--sp-1);
}
.code-link:hover {
  background: var(--c-brand-tint);
  color: var(--c-brand-lo);
  text-decoration: none;
}

/* ---------------------------------------------------------------------
   23. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { padding-block: var(--sp-10) var(--sp-8); }
  .hero h1 { font-size: var(--fs-700); }
  .hero-lede { font-size: var(--fs-300); }
  .two-col { grid-template-columns: 1fr; }
  .pagination { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --wrap-max: 100%; }
  .wrap { padding-inline: var(--sp-4); }
  .band { padding-block: var(--sp-6) var(--sp-8); }
  .module-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { padding-inline: var(--sp-4); }
  .brand-text span { display: none; }
  .data-table th { width: 40%; }
  .data-table th, .data-table td { padding: var(--sp-2) var(--sp-3); }
  .card-lg { padding: var(--sp-5); }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------------------------------------------------------------------
   24. Dark mode
   --------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --c-brand:        #8fa3ff;
    --c-brand-hi:     #a8b8ff;
    --c-brand-lo:     #c6d0ff;
    --c-brand-soft:   #1b2145;
    --c-brand-tint:   #2a3266;

    --c-accent:       #e0a24b;
    --c-accent-soft:  #3a2c15;

    --c-bg:           #0f1016;
    --c-bg-alt:       #14161d;
    --c-surface:      #171923;
    --c-surface-2:    #1e2029;
    --c-border:       #2a2d38;
    --c-border-strong:#3b3f4c;

    --c-text:         #ecebe6;
    --c-text-2:       #b8b5ad;
    --c-text-3:       #85827a;
    --c-text-inverse: #0f1016;

    --c-success:      #7fc491;
    --c-success-soft: #1a3324;
    --c-warning:      #e0b567;
    --c-warning-soft: #3b2c12;
    --c-danger:       #f09292;
    --c-danger-soft:  #3b1c1c;
    --c-info:         #84b8e6;
    --c-info-soft:    #16293b;

    --c-tag-bg:       #22242e;
    --c-tag-fg:       #c8c5bd;
    --c-tag-keyword:  #1b2145;
    --c-tag-topic:    #2c1e3d;
    --c-tag-assess:   #1a3324;
    --c-tag-delivery: #3b2c12;
    --c-tag-lang:     #16293b;
    --c-tag-vocab:    #2a2925;

    --shadow-1: 0 1px 2px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
    --shadow-2: 0 2px 6px rgba(0,0,0,0.6), 0 6px 18px rgba(0,0,0,0.5);
    --shadow-focus: 0 0 0 3px rgba(143, 163, 255, 0.4);
  }

  code { background: #1a1c25; border-color: #2a2d38; color: #cfd3dd; }

  .hero {
    background:
      radial-gradient(1200px 400px at 20% -20%, var(--c-brand-soft), transparent 60%),
      linear-gradient(180deg, var(--c-surface), var(--c-bg));
  }
}

/* ---------------------------------------------------------------------
   25. Print
   --------------------------------------------------------------------- */
@media print {
  :root {
    --c-bg: #fff;
    --c-surface: #fff;
    --c-text: #000;
    --c-text-2: #222;
    --c-text-3: #444;
    --c-border: #ccc;
    --c-border-strong: #999;
    --c-brand: #000;
    --c-brand-soft: #f0f0f0;
    --c-brand-tint: #ddd;
  }
  .topbar, .skip-link, .pagination, .site-footer, .breadcrumb { display: none !important; }
  body { font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  .module-card, .card { box-shadow: none; border-color: #999; break-inside: avoid; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .hero { background: none; padding-block: 0.5in; border-bottom: 1px solid #999; }
  .data-table thead th { background: #eee; }
}

/* ---------------------------------------------------------------------
   26. Reduced motion
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .module-card:hover { transform: none; }
}