:root {
  color-scheme: light;
  --page-width: 1244px;
  --page-gutter: clamp(16px, 3vw, 38px);
  --header-height: 74px;
  --page: #f5f7fa;
  --surface: #fff;
  --surface-hover: #edf3fb;
  --ink: #172c48;
  --muted: #50647d;
  --border: #dce4ed;
  --blue: #1957a6;
  --blue-border: #8caad4;
  --hero-field: #e6edf3;
  --shadow: 0 8px 24px rgb(24 51 85 / 9%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  scroll-padding-top: calc(var(--header-height) + 18px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c1727;
  --surface: #14253a;
  --surface-hover: #1b3048;
  --ink: #e5effa;
  --muted: #b9c9db;
  --border: #344a60;
  --blue: #9bc5ff;
  --blue-border: #607eaa;
  --hero-field: #142a42;
  --shadow: 0 8px 24px rgb(0 0 0 / 24%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.page-width {
  width: min(var(--page-width), calc(100% - 2 * var(--page-gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: var(--page-gutter);
  z-index: 30;
  padding: 8px 14px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--blue);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
  text-decoration: none;
}

.brand img {
  flex: none;
  width: 43px;
  height: 43px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1.125rem, 2vw, 1.4375rem);
  font-weight: 720;
  letter-spacing: .015em;
}

.brand small {
  margin-top: 5px;
  color: var(--blue);
  font-size: .8125rem;
}

.course-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 20px;
  border-radius: 8px;
  background: var(--hero-field);
}

.hero-photo {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  display: block;
  width: 65%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
  mask-image: linear-gradient(to right, transparent, #000 30%);
}

[data-theme="dark"] .hero-photo {
  filter: brightness(.77);
}

.hero-inner {
  display: flex;
  align-items: center;
  min-height: clamp(310px, 29vw, 390px);
  padding: 34px clamp(22px, 3vw, 42px);
}

.hero-copy {
  width: 51%;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4.45vw, 3.75rem);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: .012em;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy h1 span + span {
  color: var(--blue);
}

.hero-copy p {
  max-width: 26em;
  margin: 15px 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.42vw, 1.125rem);
}

.course-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  line-height: 1.4;
}

.course-author img {
  flex: none;
  width: 56px;
  height: 56px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 24%;
}

.course-author strong,
.course-author span {
  display: block;
}

.course-author strong {
  font-size: 1.125rem;
}

.course-author span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .875rem;
}

.case-directory {
  padding-block: 8px 44px;
}

.case-group {
  padding-top: 24px;
}

.case-group + .case-group {
  margin-top: 33px;
  border-top: 1px solid var(--border);
}

.group-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.group-heading h2 {
  margin: 0;
  font-size: clamp(1.3125rem, 2.4vw, 1.6875rem);
  font-weight: 730;
  line-height: 1.45;
}

.group-heading span {
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.case-card:hover,
.case-card:focus-visible {
  border-color: var(--blue-border);
  box-shadow: var(--shadow);
}

.case-card:hover {
  transform: translateY(-2px);
}

.case-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-hover);
}

.card-copy {
  padding: 13px 15px 15px;
}

.card-copy h3 {
  margin: 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-weight: 710;
  line-height: 1.38;
}

.case-card:hover h3,
.case-card:focus-visible h3 {
  color: var(--blue);
}

.card-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.6;
}

@media (max-width: 1019px) {
  .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 66px;
  }

  .course-hero {
    display: flex;
    flex-direction: column-reverse;
    margin-top: 14px;
  }

  .hero-photo {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 2.25;
    object-position: center 57%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero-inner {
    min-height: 0;
    padding: 20px 18px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(1.5rem, 7.5vw, 2.75rem);
  }

  .hero-copy p {
    margin-top: 9px;
  }

  .course-author {
    margin-top: 15px;
  }

  .course-author img {
    width: 42px;
    height: 42px;
  }

  .case-directory {
    padding-block: 0 36px;
  }

  .case-group + .case-group {
    margin-top: 25px;
  }
}

@media (max-width: 520px) {
  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand small {
    font-size: .75rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  .case-card {
    transition: none;
  }

  .case-card:hover {
    transform: none;
  }
}
