:root {
  --ink: #102b2a;
  --muted: #536764;
  --paper: #f7f3e9;
  --card: #fffdf7;
  --line: #cdd6cd;
  --green: #0e5b4b;
  --green-dark: #083d34;
  --green-soft: #dcebe1;
  --lime: #d7e99b;
  --amber: #9b681b;
  --amber-soft: #f6e7c8;
  --blue-soft: #dfe9ed;
  --shadow: 0 18px 50px rgba(16, 43, 42, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(16, 43, 42, .13);
  background: rgba(247, 243, 233, .95);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 780;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-size: 22px;
}
nav { display: flex; gap: clamp(16px, 3vw, 36px); }
nav a { color: var(--muted); font-size: .88rem; font-weight: 720; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }

main { min-height: 70vh; }
.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .45fr);
  gap: clamp(38px, 8vw, 120px);
  align-items: end;
  padding: clamp(52px, 7vw, 90px) 6vw 46px;
}
.eyebrow {
  margin: 0 0 11px;
  color: var(--green);
  font-size: .72rem;
  font-weight: 840;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; line-height: 1.08; letter-spacing: -.035em; }
h1 {
  max-width: 900px;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5.4vw, 5.4rem);
  font-weight: 500;
}
.lede { max-width: 820px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.25rem); }
.back-link { color: var(--green); font-weight: 760; text-underline-offset: 5px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 6vw;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.summary-strip article {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  justify-content: center;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.summary-strip article:last-child { border-right: 0; }
.summary-strip strong { color: var(--green); font-family: Georgia, serif; font-size: 2.25rem; font-weight: 500; }
.summary-strip span { color: var(--muted); font-size: .8rem; font-weight: 700; }

.view-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
  gap: 40px;
  align-items: end;
  padding: 54px 6vw 34px;
}
.view-tabs { display: flex; flex-wrap: wrap; gap: 9px; }
.view-tabs button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}
.view-tabs button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.view-tabs button:hover, .view-tabs button:focus-visible { border-color: var(--green); }
#view-description { margin: 0; color: var(--muted); }

.catalog-section {
  padding: 38px 6vw clamp(72px, 8vw, 110px);
  border-block: 1px solid var(--line);
  background: #edf0e7;
}
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.catalog-heading h2, .explain-section h2, .data-section h2 {
  max-width: 830px;
  margin-bottom: 0;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 3.7vw, 4rem);
  font-weight: 500;
}
#result-count { color: var(--muted); font-size: .88rem; font-weight: 760; }
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(180px, .55fr) minmax(210px, .65fr) auto;
  gap: 12px;
  align-items: end;
  margin: 32px 0 26px;
}
.filters label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 800; }
.filters input, .filters select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
}
.filters input:focus, .filters select:focus, .reset-button:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 91, 75, .13); }
.reset-button {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: transparent;
  color: var(--green);
  font-weight: 780;
}
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card {
  display: flex;
  min-height: 510px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(16, 43, 42, .045);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-code { color: var(--green); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86rem; font-weight: 850; }
.state-badge { padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: #245748; font-size: .67rem; font-weight: 820; }
.state-badge.production { background: var(--amber-soft); color: #76501a; }
.course-card h3 { margin: 23px 0 10px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.topic { margin: 0 0 14px; color: var(--green); font-size: .75rem; font-weight: 760; }
.outcome { margin: 0 0 18px; color: var(--muted); font-size: .88rem; }
.prerequisites { margin: 0 0 17px; font-size: .8rem; }
.prerequisites strong { display: block; margin-bottom: 4px; color: var(--muted); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
.view-panel { display: flex; flex-direction: column; gap: 11px; margin-top: auto; padding-top: 17px; border-top: 1px solid var(--line); }
.status-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: .78rem; }
.status-line span:first-child { color: var(--muted); }
.status-line strong { text-align: right; }
.feature-list, .component-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.feature-list li, .component-list li { padding: 5px 8px; border-radius: 7px; background: var(--blue-soft); font-size: .68rem; font-weight: 720; }
.component-list li { background: #eee9d9; }
.resource-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.resource-list a { color: var(--green); font-size: .75rem; font-weight: 760; text-underline-offset: 4px; }
.empty-note { margin: 0; color: var(--muted); font-size: .78rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.card-actions a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-size: .72rem;
  font-weight: 780;
  text-decoration: none;
}
.card-actions a.primary { background: var(--green); color: white; }
.card-actions a:hover, .card-actions a:focus-visible { background: var(--green-dark); color: white; }
.no-results { grid-column: 1 / -1; padding: 48px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; color: var(--muted); }

.explain-section, .data-section {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);
  padding: clamp(68px, 8vw, 110px) 6vw;
}
.explain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.explain-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.explain-grid h3 { margin-bottom: 9px; font-size: 1rem; letter-spacing: -.015em; }
.explain-grid p { margin: 0; color: var(--muted); font-size: .84rem; }
.data-section { border-top: 1px solid var(--line); background: var(--ink); color: white; }
.data-section .eyebrow { color: var(--lime); }
.data-section p { color: #bdcac6; }
.data-links { display: grid; align-content: start; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.data-links a { padding: 17px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: white; font-weight: 720; text-decoration: none; }
.data-links a:hover, .data-links a:focus-visible { border-color: var(--lime); color: var(--lime); }

footer { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 46px 6vw; background: #09201f; color: #dce5e1; }
footer p { margin: 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;
}
footer p[lang="en"] { color: #91a6a0; font-size: .78rem; text-align: right; }

@media (max-width: 1080px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .reset-button { width: 100%; }
}
@media (max-width: 780px) {
  body { font-size: 16px; }
  .topbar nav { display: none; }
  .topbar { padding-inline: 20px; }
  .workspace-heading, .view-switcher, .explain-section, .data-section { grid-template-columns: 1fr; padding-inline: 20px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); margin-inline: 20px; }
  .summary-strip article:nth-child(2) { border-right: 0; }
  .summary-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .catalog-section { padding-inline: 20px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .explain-grid, .data-links { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; padding-inline: 20px; }
  footer p[lang="en"] { text-align: left; }
}
@media (max-width: 560px) {
  h1 { font-size: 2.65rem; }
  .brand span:last-child { max-width: 190px; line-height: 1.12; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: 470px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
