:root {
  color-scheme: dark;
  --bg: #050b14;
  --panel: rgba(10, 19, 34, .88);
  --panel-strong: #0e1929;
  --panel-soft: rgba(20, 31, 49, .82);
  --line: rgba(180, 204, 239, .17);
  --line-hover: rgba(139, 208, 255, .48);
  --text: #eff5ff;
  --muted: rgba(239, 245, 255, .7);
  --muted-soft: rgba(239, 245, 255, .48);
  --blue: #8bd0ff;
  --gold: #f2c671;
  --green: #82dfc1;
  --purple: #b9a7ff;
  --radius: 30px;
  --shadow: 0 24px 72px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 13% 8%, rgba(42, 124, 205, .18), transparent 28rem),
    radial-gradient(circle at 88% 34%, rgba(111, 73, 210, .12), transparent 32rem),
    linear-gradient(180deg, #030811 0, #07111d 52%, #040812 100%);
  font: 16px/1.55 "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .23;
  background-image:
    linear-gradient(rgba(139, 208, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 208, 255, .04) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  color: #06101c;
  background: var(--blue);
  border-radius: 999px;
  font-weight: 800;
}

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

.site-header,
main,
footer {
  width: min(1480px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 88px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  color: var(--gold);
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid rgba(242, 198, 113, .4);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(242, 198, 113, .08);
  font: 800 1.35rem/1 Georgia, serif;
}

.header-links { display: flex; align-items: center; gap: 1.25rem; }
.header-links a { color: var(--muted); font-size: .88rem; font-weight: 700; }
.header-links a:hover, .header-links a:focus-visible { color: var(--blue); }

.study-summary {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(26rem, 1.2fr);
  align-items: end;
  gap: clamp(1.25rem, 4vw, 3.25rem);
  width: min(100%, 920px);
  margin: 1.25rem auto 3.5rem;
  padding: 1rem 0;
}

.summary-intro .eyebrow { margin-bottom: .45rem; }

.study-summary h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
}

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

.summary-stats div {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  min-height: 76px;
  padding: .85rem 1rem;
  border: 1px solid rgba(182, 204, 236, .17);
  border-radius: 20px;
  background: rgba(8, 16, 29, .72);
}

.summary-stats dt { color: var(--blue); font-size: 1.65rem; font-weight: 900; }
.summary-stats dd { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.35; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .19em;
}

.eyebrow.blue { color: var(--blue); }

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

h2,
.subject-title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: .7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.button-primary { color: #07111d; background: var(--gold); }
.button-primary:hover, .button-primary:focus-visible { background: #ffd98c; }

.button-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(10, 18, 31, .72);
}

.button-secondary:hover, .button-secondary:focus-visible {
  border-color: var(--line-hover);
  background: rgba(18, 35, 57, .9);
}

.catalogue { margin-bottom: 4rem; scroll-margin-top: 1.25rem; }

.trainer-access-note {
  width: min(100%, 920px);
  margin: 0 auto 1rem;
  color: #ff6fb5;
  font-size: .93rem;
  font-weight: 700;
  line-height: 1.5;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(20rem, .6fr);
  align-items: end;
  gap: 3rem;
  margin-bottom: 1.75rem;
}

.section-heading h2,
.private-flow h2 {
  max-width: 16ch;
  margin-bottom: 0;
  font-size: clamp(2.25rem, 4.1vw, 4.4rem);
  line-height: 1;
}

.section-heading > p {
  max-width: 58ch;
  margin-bottom: .35rem;
  color: var(--muted);
}

.catalogue-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(8, 17, 31, .73);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .2);
}

.search-field {
  display: flex;
  flex: 1 1 24rem;
  align-items: center;
  gap: .7rem;
  min-width: 14rem;
  padding: 0 .7rem;
}

.search-field svg {
  width: 1.15rem;
  fill: none;
  stroke: var(--muted-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  padding: .65rem 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

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

.filters { display: flex; flex-wrap: wrap; gap: .45rem; }

.filter {
  padding: .56rem .78rem;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 800;
}

.filter span {
  display: inline-grid;
  min-width: 1.35rem;
  min-height: 1.35rem;
  margin-left: .22rem;
  place-items: center;
  border-radius: 999px;
  color: var(--muted-soft);
  background: rgba(255, 255, 255, .07);
  font-size: .68rem;
}

.filter:hover, .filter:focus-visible, .filter.is-active {
  color: var(--text);
  border-color: rgba(139, 208, 255, .28);
  background: rgba(139, 208, 255, .1);
}

.load-state,
.empty-state {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(182, 204, 236, .22);
  border-radius: var(--radius);
  background: rgba(8, 17, 31, .54);
}

.load-state[data-kind="error"] { color: #ffc0bc; }
.empty-state h3 { margin-bottom: .35rem; font: 700 1.7rem/1.15 Georgia, serif; }
.empty-state p:not(.eyebrow) { margin-bottom: 1.4rem; }

.subject-grid {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
  gap: 1rem;
}

.subject-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 27, 46, .9), rgba(7, 15, 28, .93));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .23);
}

.subject-cover {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 260px;
  padding: 1.35rem;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 10, 19, .24), rgba(4, 10, 19, .04)),
    url("./dmg-graph-theory-showcase.png") center / cover no-repeat;
}

.subject-cover::after {
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  content: "";
  background: linear-gradient(transparent, rgba(10, 19, 34, .99));
}

.subject-code,
.status-pill {
  position: relative;
  z-index: 1;
  padding: .44rem .65rem;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(4, 10, 19, .86);
  backdrop-filter: blur(8px);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.subject-code { color: var(--gold); }
.status-pill[data-status="in_progress"] { color: var(--green); }
.status-pill[data-status="completed"] { color: var(--blue); }
.status-pill[data-status="planned"] { color: var(--purple); }

.subject-body { padding: 0 1.35rem 1.35rem; }
.subject-body > header { margin-top: -2.75rem; position: relative; z-index: 2; }

.subject-title {
  max-width: 18ch;
  margin-bottom: .55rem;
  font-size: clamp(1.7rem, 2.5vw, 2.45rem);
  line-height: 1.02;
}

.subject-summary { min-height: 3.1em; margin-bottom: .9rem; color: var(--muted); }

.subject-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.25rem; }
.subject-meta span {
  padding: .36rem .58rem;
  border: 1px solid rgba(182, 204, 236, .14);
  border-radius: 999px;
  color: var(--muted-soft);
  background: rgba(255, 255, 255, .035);
  font-size: .72rem;
}

.trainer-area { margin-bottom: .8rem; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.subheading h4 { margin-bottom: .7rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.subheading span, .material-total { color: var(--muted-soft); font-size: .72rem; }

.trainer-list { display: grid; gap: .65rem; }

.trainer-card {
  display: grid;
  gap: .32rem;
  padding: 1rem;
  border: 1px solid rgba(139, 208, 255, .17);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(20, 39, 64, .86), rgba(12, 22, 38, .82));
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.trainer-card:hover,
.trainer-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-hover);
  outline: 0;
  background: linear-gradient(135deg, rgba(25, 50, 82, .96), rgba(14, 27, 47, .93));
}

.trainer-kicker { color: var(--gold); font-size: .63rem; font-weight: 900; letter-spacing: .13em; }
.trainer-title { font-size: 1.05rem; line-height: 1.25; }
.trainer-description { color: var(--muted); font-size: .82rem; }
.trainer-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; color: var(--blue); font-size: .72rem; font-weight: 800; }
.trainer-topics { overflow: hidden; color: var(--muted-soft); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.blank-trainers {
  margin: 0;
  padding: .9rem 1rem;
  color: var(--muted-soft);
  border: 1px dashed rgba(182, 204, 236, .16);
  border-radius: 18px;
  font-size: .8rem;
}

.materials-area { border-top: 1px solid rgba(182, 204, 236, .13); }
.materials-area summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem .2rem .2rem;
  cursor: pointer;
  list-style: none;
  font-size: .79rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.materials-area summary::-webkit-details-marker { display: none; }
.materials-area summary::before { content: "+"; color: var(--blue); font-size: 1.15rem; }
.materials-area[open] summary::before { content: "−"; }
.materials-area summary span:first-child { margin-right: auto; }

.material-list { display: grid; gap: .5rem; padding-top: .75rem; }

.material-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .72rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
}

.file-icon {
  display: grid;
  width: 2.35rem;
  height: 2.65rem;
  place-items: center;
  border: 1px solid rgba(242, 198, 113, .25);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(242, 198, 113, .06);
  font-size: .56rem;
  font-weight: 900;
}

.material-card > div { display: grid; min-width: 0; }
.material-title { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.material-note, .material-storage { color: var(--muted-soft); font-size: .67rem; }
.material-link { color: var(--blue); font-size: .72rem; font-weight: 800; }
.material-link:hover, .material-link:focus-visible { color: #c7eaff; }
.material-locked { color: var(--muted-soft); font-size: .68rem; }

.materials-cms-placeholder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.15rem;
  width: min(100%, 920px);
  margin: 0 auto 4rem;
  padding: 1.2rem 1.3rem;
  border: 1px dashed rgba(182, 204, 236, .24);
  border-radius: 22px;
  background: rgba(8, 17, 31, .44);
}

.cms-mark {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  place-items: center;
  color: var(--blue);
  border: 1px solid rgba(139, 208, 255, .22);
  border-radius: 16px;
  background: rgba(139, 208, 255, .07);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.materials-cms-placeholder .eyebrow { margin-bottom: .25rem; font-size: .68rem; }
.materials-cms-placeholder h2 { margin-bottom: .25rem; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.15; }
.materials-cms-placeholder p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .88rem; }
.cms-status { color: var(--muted-soft); font-size: .65rem; font-weight: 800; letter-spacing: .12em; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted-soft);
  border-top: 1px solid rgba(182, 204, 236, .11);
  font-size: .78rem;
}
footer p { margin: 0; }
footer a { color: var(--blue); font-weight: 700; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

@media (max-width: 1000px) {
  .section-heading { align-items: start; gap: 1.25rem; }
}

@media (max-width: 740px) {
  .site-header, main, footer { width: min(100% - 1.15rem, 1480px); }
  .site-header { min-height: 72px; }
  .header-links a:first-child { display: none; }
  .study-summary { grid-template-columns: 1fr; gap: 1rem; margin: .75rem auto 2.5rem; }
  .summary-stats { gap: .5rem; }
  .summary-stats div { min-height: 70px; padding: .75rem; }
  .summary-stats dt { font-size: 1.4rem; }
  .summary-stats dd { font-size: .74rem; }
  .section-heading { grid-template-columns: 1fr; }
  .section-heading > p { font-size: .9rem; }
  .catalogue-tools { align-items: stretch; flex-direction: column; border-radius: 22px; }
  .search-field { flex-basis: auto; min-width: 0; }
  .filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .15rem; }
  .filter { flex: 0 0 auto; }
  .subject-cover { min-height: 170px; }
  .subject-body { padding-inline: 1rem; }
  .material-card { grid-template-columns: auto minmax(0, 1fr); }
  .material-link, .material-locked { grid-column: 2; justify-self: start; }
  .materials-cms-placeholder { grid-template-columns: auto minmax(0, 1fr); padding: 1rem; }
  .cms-status { grid-column: 2; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 440px) {
  .summary-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
