:root {
  --bg: #f4f7fb;
  --bg-strong: #ebf1ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: #f8fafc;
  --line: #dbe3ee;
  --text: #0f172a;
  --muted: #5b687a;
  --brand: #1557d6;
  --brand-strong: #0f46b4;
  --brand-soft: #dce8ff;
  --good: #0f766e;
  --good-soft: #dcfce7;
  --warn: #92400e;
  --warn-soft: #ffedd5;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --radius: 1.35rem;
  --radius-sm: 0.9rem;
  --max: 72rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(circle at top right, rgba(21, 87, 214, 0.12), transparent 26rem),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 18rem),
    linear-gradient(180deg, var(--bg-strong), var(--bg));
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.skip-link:focus { top: 1rem; }

.shell { width: min(calc(100% - 1.25rem), var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 247, 251, 0.88);
  border-bottom: 1px solid rgba(219, 227, 238, 0.95);
  backdrop-filter: blur(16px);
}

.bar,
.footer,
.nav,
.chips,
.actions,
.stack,
.cards,
.meta,
.faq-list,
.semester-list { display: grid; gap: 0.85rem; }

.bar,
.footer {
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
}

.bar,
.footer,
.layout,
.hero-grid,
.cta,
.section-head { display: grid; gap: 1rem; }

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  text-align: center;
}

.nav a:hover,
.nav a:focus-visible,
.button:focus-visible,
.field input:focus,
.field select:focus,
.faq summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(21, 87, 214, 0.12);
}

.nav a.active {
  color: var(--brand);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(21, 87, 214, 0.16);
}

.hero { padding: 2.5rem 0 1.4rem; }

.hero h1,
.card h2 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero h1 { font-size: clamp(2rem, 6vw, 4.25rem); max-width: 13ch; }

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede,
.muted,
.note,
.message,
.fine-print { margin: 0; color: var(--muted); }

.chips span,
.badge {
  width: fit-content;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.chips span {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(219, 227, 238, 0.95);
}

.badge { background: var(--brand-soft); color: var(--brand); }

.card,
.semester-card,
.faq {
  background: var(--surface);
  border: 1px solid rgba(219, 227, 238, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.semester-card { padding: 1.1rem; }

.accent {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 12rem),
    var(--surface);
}

.section { padding-bottom: 1.8rem; }

.field,
.split,
.form-card,
.search-field { display: grid; gap: 0.65rem; }

.field span { font-weight: 700; }

.field input,
.field select {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.field input:focus,
.field select:focus { background: #fff; border-color: rgba(21, 87, 214, 0.55); }

.message[data-state="error"] { color: var(--danger); }

.button {
  border: 0;
  border-radius: 999px;
  min-height: 3rem;
  padding: 0.8rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.button:disabled { opacity: 0.45; cursor: not-allowed; }

.button.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
.button.secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--line); }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.text { background: transparent; color: var(--danger); min-height: auto; padding: 0; }

.between { align-items: center; }
.inline { justify-content: start; }

.search-field { position: relative; }

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.2rem);
  z-index: 5;
  max-height: 15rem;
  overflow: auto;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.search-results button {
  width: 100%;
  border: 0;
  border-radius: 0.8rem;
  padding: 0.8rem;
  background: transparent;
  text-align: left;
}

.search-results button:hover,
.search-results button:focus-visible { background: var(--brand-soft); outline: none; }

.search-results small { display: block; color: var(--muted); margin-top: 0.2rem; }

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.value {
  margin-top: 0.9rem;
  font-size: clamp(2.6rem, 10vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.07em;
  font-weight: 800;
}

.meta { margin-top: 1rem; }

.meta div {
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(219, 227, 238, 0.95);
  border-radius: var(--radius-sm);
}

.meta span,
.cards .eyebrow { display: block; }

.cards { grid-template-columns: 1fr; }

.cards > .card,
.cards > article.card { height: 100%; }

.table-wrap {
  overflow: auto hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(219, 227, 238, 0.95);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.table {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(219, 227, 238, 0.95);
  vertical-align: top;
}

.table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cta {
  background: linear-gradient(145deg, #0f172a, #18356a);
  color: #f8fafc;
}

.cta .eyebrow,
.cta .muted { color: rgba(248, 250, 252, 0.84); }

.faq { overflow: hidden; }

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-weight: 700;
}

.faq summary::-webkit-details-marker { display: none; }
.faq p { padding: 0 1.1rem 1rem; margin: 0; color: var(--muted); }

.site-footer {
  border-top: 1px solid rgba(219, 227, 238, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

.semester-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
  margin-bottom: 0.8rem;
}

.semester-head h3 { margin: 0; line-height: 1.15; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 30;
  width: min(calc(100% - 1rem), 24rem);
  padding: 0.9rem 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

@media (min-width: 40rem) {
  .shell { width: min(calc(100% - 2rem), var(--max)); }
  .split,
  .cards,
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { grid-auto-flow: column; justify-content: start; }
  .between { grid-template-columns: 1fr auto; }
  .bar,
  .footer { grid-auto-flow: column; }
  .nav { grid-auto-flow: column; grid-template-columns: none; justify-content: end; }
}

@media (min-width: 48rem) {
  .layout { grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr); align-items: start; }
  .result { position: sticky; top: 5rem; }
}

@media (min-width: 68rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
