:root {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-deep: #103572;
  --surface-navy: #103572;
  --text: #1f2328;
  --text-soft: #39424e;
  --text-muted: #5c6673;
  --text-inverse: #ffffff;
  --line: rgba(57, 66, 78, 0.2);
  --accent: #c81e3a;
  --accent-dark: #7f1d4e;
  --gold: #f2c300;
  --gold-soft: #f7edbf;
  --rose-soft: #f8e5e8;
  --lavender-soft: #eadbe7;
  --blue-soft: #e5ebf5;
  --shadow: 0 24px 60px rgba(16, 53, 114, 0.1);
  --focus-ring: #7f1d4e;
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Lato", sans-serif;
  color: var(--text);
  background: #f5f7fa;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
iframe:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.hero {
  margin-top: 0.75rem;
  padding: 0;
  border: 1px solid #d9e1ea;
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.announcement-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid #e0e6ed;
  background: #f8fafc;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.announcement-bar a {
  color: var(--surface-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
}

.topbar,
.hero-grid,
.catalog-layout {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.5rem 1rem;
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: min(100%, 168px);
  height: auto;
  display: block;
  filter: none;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar-links a {
  padding: 0.7rem 1rem;
  border: 1px solid #d9e1ea;
  border-radius: 999px;
  background: white;
  color: var(--text-soft);
}

.topbar-links a:hover,
.topbar-links a:focus-visible {
  border-color: #aab7c6;
  color: var(--surface-deep);
}

.topbar-links .topbar-cta {
  background: var(--gold);
  border-color: var(--gold);
  color: #1f2328;
}

.topbar-links .topbar-cta:hover,
.topbar-links .topbar-cta:focus-visible {
  background: #ddb100;
  border-color: #ddb100;
  color: #111418;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
  padding: 1.4rem 1.5rem 1.5rem;
}

.hero-copy {
  padding: 1rem 0.4rem 2rem;
  color: var(--text);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-small {
  margin-bottom: 0.65rem;
  color: var(--surface-deep);
}

.hero-copy h1,
.filters-head h2,
.results-head h2,
.trust-copy h2,
.empty-state h3 {
  margin: 0;
  font-family: "Merriweather", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.hero-copy h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 5.9rem);
}

.hero-text {
  max-width: 57ch;
  margin: 1.35rem 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-actions,
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--gold);
  color: #1f2328;
  font-weight: 700;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #ddb100;
  color: #111418;
}

.button-secondary {
  border: 1px solid #cfd8e3;
  background: white;
  color: var(--text-soft);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: #97a6b7;
  color: var(--surface-deep);
  background: #f8fafc;
}

.button-block {
  width: 100%;
}

.hero-panel,
.filters-panel,
.results-panel,
.course-card {
  backdrop-filter: none;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.2rem;
  border: 1px solid #e0e6ed;
  border-radius: 16px;
  background: #f8fafc;
}

.stat-card {
  padding: 1.2rem;
  border: 1px solid #e0e6ed;
  border-radius: 14px;
  background: white;
  color: var(--text);
}

.stat-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  font-family: "Merriweather", serif;
  font-size: 2.35rem;
  line-height: 1;
}

.hero-note {
  padding: 1rem 1.15rem;
  border: 1px solid #e0e6ed;
  border-radius: 14px;
  background: white;
  color: var(--text-muted);
  line-height: 1.7;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.6rem;
}

.filters-panel,
.results-panel {
  border: 1px solid #d9e1ea;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.filters-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  padding: 1.45rem;
}

.filters-head p:last-child {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.filters-head h2,
.results-head h2 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.filters-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 3.3rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
}

.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--surface-deep);
  background: #fff;
}

.field input::placeholder {
  color: var(--text-muted);
}

.results-panel {
  padding: 1.45rem;
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding-bottom: 1.2rem;
}

.results-meta {
  display: grid;
  gap: 0.25rem;
  justify-items: end;
  text-align: right;
}

.results-meta strong {
  font-size: 1.15rem;
}

.results-meta span {
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-height: 2.4rem;
  padding-bottom: 1.1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  background: var(--lavender-soft);
  color: #2d2230;
  font-size: 0.88rem;
  font-weight: 700;
}

.filter-chip button {
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 53, 114, 0.12);
  color: #1f2328;
  cursor: pointer;
}

.filter-chip button:hover,
.filter-chip button:focus-visible {
  background: rgba(16, 53, 114, 0.22);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.course-card {
  display: grid;
  gap: 1rem;
  min-height: 100%;
  padding: 1.2rem;
  border: 1px solid #d9e1ea;
  border-radius: 14px;
  background: white;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.course-card:hover,
.course-card:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 53, 114, 0.08);
}

.card-topline,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.card-badge,
.card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.card-badge {
  background: #eef3f8;
  color: var(--surface-deep);
}

.course-card h3 {
  margin: 0;
  font-family: "Merriweather", serif;
  font-size: 1.55rem;
  line-height: 1.12;
}

.course-title-link {
  color: inherit;
  text-decoration: none;
}

.course-title-link:hover,
.course-title-link:focus-visible {
  color: var(--surface-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

.card-discipline {
  margin: -0.2rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.card-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta span {
  background: #f5f7fa;
  color: var(--text-soft);
}

.card-grades {
  padding-top: 0.15rem;
  border-top: 1px solid rgba(16, 35, 63, 0.08);
}

.grades-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-grades p {
  margin: 0;
  font-weight: 600;
}

.card-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.25rem;
}

.details-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: var(--surface-deep);
  color: white;
  font-size: 0.92rem;
  font-weight: 700;
}

.details-link:hover,
.details-link:focus-visible {
  background: #0b2a5a;
  border-color: #0b2a5a;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 2rem;
  border: 1px dashed rgba(16, 35, 63, 0.16);
  border-radius: 14px;
  text-align: center;
  background: #fafbfd;
}

.empty-state p {
  max-width: 42ch;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.detail-frame:focus-visible {
  border-color: var(--focus-ring);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 1.25rem;
  margin-top: 1.6rem;
}

.detail-hero {
  margin-top: 0.75rem;
  border: 1px solid #d9e1ea;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}

.detail-hero-grid,
.detail-layout {
  position: relative;
  z-index: 1;
}

.detail-hero-grid {
  padding: 1rem 1.5rem 1.75rem;
}

.detail-copy {
  color: var(--text);
  padding: 0.5rem 0.2rem 1.2rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.detail-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #d9e1ea;
  background: #f8fafc;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.6rem;
}

.detail-section {
  padding: 1.45rem;
  border: 1px solid #d9e1ea;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.detail-section[hidden] {
  display: none;
}

.section-head {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 35, 63, 0.08);
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
  font-family: "Merriweather", serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-body {
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 1.02rem;
}

.section-body p {
  margin: 0 0 1rem;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.section-body ul,
.section-body ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.section-body li {
  margin-bottom: 0.45rem;
  padding-left: 0.3rem;
}

.section-body li::marker {
  color: var(--surface-deep);
}

.section-body b,
.section-body strong {
  color: var(--text);
}

.section-body a {
  color: var(--surface-deep);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.section-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.section-body br + br {
  display: none;
}

.section-list {
  margin: 0;
  padding: 0 0 0 1.4rem;
  color: var(--text-soft);
  line-height: 1.75;
}

.section-list li {
  margin-bottom: 0.6rem;
  padding-left: 0.3rem;
}

.section-list li::marker {
  color: var(--surface-deep);
}

/* Module grid (module_list syllabus format) */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.15rem;
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  background: #f8fafc;
}

.module-number {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--surface-deep);
}

.module-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

/* Accordion (unit/week syllabus formats) */
.syllabus-accordion {
  display: grid;
  gap: 0.75rem;
}

.accordion-item {
  border: 1px solid #e0e6ed;
  border-radius: 14px;
  background: #fafbfd;
  overflow: hidden;
}

.accordion-item[open] {
  background: white;
  border-color: #cdd6e2;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header:hover {
  background: #f0f4f8;
}

.accordion-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.accordion-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--blue-soft);
  position: relative;
}

.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.6rem;
  height: 2px;
  background: var(--surface-deep);
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 200ms ease;
}

.accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion-item[open] .accordion-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.accordion-body {
  padding: 0 1.25rem 1.25rem;
}

.unit-description {
  margin: 0 0 1rem;
  color: var(--text-soft);
  line-height: 1.75;
}

.unit-texts {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.sub-list {
  margin-top: 1rem;
}

.sub-list h4 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--surface-deep);
}

.syllabus-note {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid #e0e6ed;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.syllabus-eq,
.syllabus-obj {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(16, 35, 63, 0.08);
}

.syllabus-eq h3,
.syllabus-obj h3 {
  margin: 0 0 0.75rem;
  font-family: "Merriweather", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.footer-brand,
.footer-trust {
  padding: 1.5rem;
  border: 1px solid #d9e1ea;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.footer-logo {
  width: min(100%, 220px);
  height: auto;
}

.footer-brand p {
  max-width: 40ch;
  margin: 1rem 0 0;
  color: var(--text-soft);
  line-height: 1.75;
}

.trust-copy h2 {
  max-width: 18ch;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}

.trust-badges img {
  height: 64px;
  width: auto;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .hero-grid,
  .catalog-layout,
  .course-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .results-head {
    align-items: start;
    flex-direction: column;
  }

  .results-meta {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--container));
    padding-bottom: 2rem;
  }

  .hero,
  .filters-panel,
  .results-panel {
    border-radius: 26px;
  }

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

  .announcement-bar {
    flex-direction: column;
  }

  .topbar-links {
    width: 100%;
  }

  .topbar-links a,
  .button,
  .button-block {
    width: 100%;
  }

  .hero-copy h1 {
    max-width: 13ch;
  }
}
