:root {
  --bg: #f7f7f3;
  --panel: #ffffff;
  --panel-alt: #fffdf8;
  --panel-alt-2: #f8f4ea;
  --ink: #182b46;
  --ink-soft: #334a67;
  --muted: #5b6c7f;
  --line: #e1e6ef;
  --brand: #003594;
  --brand-strong: #002a74;
  --brand-soft: #f8f2dc;
  --accent: #ffb81c;
  --accent-soft: rgba(255, 184, 28, 0.14);
  --shadow: 0 16px 34px rgba(0, 32, 91, 0.12);
  --glow: 0 0 0 1px rgba(255,255,255,0.2), 0 12px 24px rgba(0, 53, 148, 0.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 53, 148, 0.07), transparent 22%),
    radial-gradient(circle at top right, rgba(255, 184, 28, 0.12), transparent 18%),
    linear-gradient(180deg, #f6f8fb 0%, #fcfbf7 100%);
  color: var(--ink);
  line-height: 1.6;
}

img {
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  position: relative;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 30px 10% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 53, 148, 0.08), transparent 62%);
  pointer-events: none;
}

.masthead {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 55%, #0050b8 100%);
  color: white;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  padding: 28px 28px 22px;
}

.masthead::before {
  content: "";
  position: absolute;
  right: 3%;
  top: 50%;
  width: min(32vw, 260px);
  height: min(32vw, 260px);
  transform: translateY(-50%);
  background-image: url("imgs/tex.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.8;
  pointer-events: none;
}

.masthead-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.masthead::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.065);
  border: 1px solid rgba(255,255,255,0.12);
  width: 170px;
  height: 170px;
  left: 60%;
  bottom: -52px;
}

.brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.external-nav {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  color: var(--brand-strong);
  background: var(--accent);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.external-nav:hover,
.external-nav:focus-visible {
  color: var(--brand-strong);
  text-decoration: none;
  background: #f7c33e;
}

.masthead-logo {
  display: none;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tab {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.tab:hover,
.tab:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 184, 28, 0.12);
  border-color: rgba(255, 184, 28, 0.9);
  outline: none;
  box-shadow: var(--glow);
}

.tab.is-active {
  background: linear-gradient(180deg, var(--accent) 0%, #f7c33e 100%);
  color: var(--brand-strong);
  border-color: rgba(255, 184, 28, 0.9);
  box-shadow: 0 10px 18px rgba(255, 184, 28, 0.2);
}

.content-wrap {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(243,248,255,0.97));
  border: 1px solid rgba(160, 182, 204, 0.72);
  border-top: none;
  border-radius: 0 0 22px 22px;
  box-shadow: var(--shadow);
  padding: 30px 24px 40px;
}

.content-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(103, 184, 219, 0.04), transparent 40%, rgba(122, 168, 216, 0.06));
  pointer-events: none;
}

.tab-panel,
.panel-header,
.lead,
.schedule-table-wrap,
.syllabus-grid,
.card-grid {
  position: relative;
  z-index: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.panel-header {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.panel-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 92px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 184, 28, 0.25));
}

.kicker {
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
}

.books-details {
  margin: 0 0 20px;
  border: 1px solid rgba(0, 53, 148, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(240, 245, 250, 0.96));
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 32, 91, 0.05);
}

.books-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: white;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand), #0a4fc7);
  border: none;
  border-radius: 0;
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.books-details summary::-webkit-details-marker {
  display: none;
}

.books-details summary::before {
  content: "▸";
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.books-details[open] summary {
  background: linear-gradient(135deg, #002b73, #003594, #0056d2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 8px 18px rgba(0, 53, 148, 0.12);
}

.books-details[open] summary::before {
  content: "▾";
}

.books-details summary:hover,
.books-details summary:focus-visible {
  filter: brightness(1.04);
  transform: translateY(-1px);
  outline: none;
}

.books-details > p,
.books-details > ul,
.books-details > ol {
  margin: 0;
  padding: 16px 18px 18px;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.schedule-table-wrap {
  overflow-x: auto;
}

.info-table-wrap {
  overflow-x: auto;
  margin: 14px 0 28px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.info-table th,
.info-table td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
}

.info-table th {
  background: var(--panel-alt-2);
  color: var(--brand-strong);
  font-weight: 700;
  white-space: nowrap;
}

.info-table td {
  background: var(--panel);
  color: var(--ink-soft);
}

.info-table tr:last-child th,
.info-table tr:last-child td {
  border-bottom: 0;
}

.info-table th:last-child,
.info-table td:last-child {
  border-right: 0;
}

.staff-table {
  min-width: 760px;
}

.schedule-table,
.tab-panel table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.schedule-table th,
.schedule-table td,
.tab-panel table th,
.tab-panel table td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
}

.schedule-table th,
.tab-panel table th {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand), #0a4fc7);
  color: white;
  font-weight: 700;
}

.schedule-table td,
.tab-panel table td {
  background: white;
  color: var(--ink-soft);
}

.tab-panel table tr:nth-child(even) td {
  background: #f3f6fb;
}

.tab-panel table tr:hover td {
  background: rgba(0, 53, 148, 0.12);
}

.syllabus-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.info-card,
.course-card {
  background: linear-gradient(180deg, rgba(250,251,253,0.98) 0%, rgba(240,244,249,0.98) 100%);
  border: 1px solid rgba(90, 110, 130, 0.18);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 18px rgba(0, 32, 91, 0.04);
}

.info-card.wide {
  grid-column: 1 / -1;
}

.info-card h3,
.course-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
}

.course-card p,
.course-card ul,
.course-card li {
  margin: 0 0 8px;
  color: var(--muted);
}

.course-card ul {
  padding-left: 18px;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px 10px 32px;
  }

  .masthead {
    padding: 20px 18px 16px;
    border-radius: 18px 18px 0 0;
  }

  .masthead-top {
    align-items: flex-start;
  }

  .brand-block {
    align-items: flex-start;
  }

  .masthead-logo {
    width: 110px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    font-size: 0.8rem;
  }

  .content-wrap {
    padding: 22px 14px 26px;
  }
}
