:root {
  color-scheme: light;
  --ink: #161719;
  --muted: #5d6472;
  --line: #d9dde5;
  --paper: #ffffff;
  --soft: #f4f6f8;
  --coal: #20252d;
  --red: #d4473d;
  --gold: #d99a2b;
  --teal: #16857d;
  --green: #4f8b3a;
  --shadow: 0 16px 42px rgba(28, 31, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(22, 23, 25, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: var(--red);
  font-weight: 800;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-nav a,
.nav-cta {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.top-nav a:hover,
.nav-cta:hover {
  background: var(--soft);
  color: var(--ink);
}

.nav-cta {
  color: white;
  background: var(--coal);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(36px, 6vw, 72px) clamp(18px, 4vw, 56px) 30px;
  background: #f8f3ec;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-kicker,
.category {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

h1 {
  margin: 0;
  font-size: 58px;
}

h2 {
  margin: 0 0 12px;
  font-size: 32px;
}

h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

p {
  margin: 0 0 16px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin-top: 18px;
  color: #383d47;
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.copy-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  color: white;
  background: var(--red);
}

.button.secondary {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.hero-media {
  overflow: hidden;
  border: 1px solid rgba(22, 23, 25, 0.12);
  border-radius: 8px;
  background: #111;
  box-shadow: var(--shadow);
}

.hero-media img,
.article-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.stats-grid,
.module-section,
.updates-section,
.content-section,
.play-section,
.listing-hero,
.legal-page,
.article-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 24px 0;
}

.stat-card {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  font-weight: 800;
}

.stat-card small {
  color: var(--muted);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 20px;
  align-items: end;
  margin: 34px 0 18px;
}

.section-heading p:last-child {
  color: var(--muted);
}

.update-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.update-card,
.module-card,
.code-card,
.steps article,
.related-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.update-card {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  padding: 18px;
}

.update-card p,
.module-card small,
.code-card small,
.related-card span {
  color: var(--muted);
}

.update-card div:last-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.update-card a:hover,
.text-link:hover,
.related-card:hover strong {
  color: var(--red);
}

.module-section,
.content-section,
.play-section {
  padding: 54px 0 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.module-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
}

.module-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.code-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.code-card {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-height: 188px;
  padding: 16px;
}

.code-card h3 {
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.copy-code {
  width: 100%;
  color: white;
  background: var(--coal);
}

.copy-code.is-copied {
  background: var(--teal);
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.steps article {
  min-height: 190px;
  padding: 18px;
}

.steps span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #f0d7cf;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: white;
}

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

th {
  background: var(--soft);
  font-size: 13px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

details p {
  padding: 0 18px 18px;
}

.sources ul,
.article-content ul {
  padding-left: 20px;
}

.play-section {
  margin-top: 56px;
  padding: 34px;
  border-radius: 8px;
  color: white;
  background: var(--coal);
}

.play-section p {
  color: #dce1e8;
}

.listing-hero {
  padding: 54px 0 24px;
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 28px;
  align-items: center;
  padding: 42px 0 30px;
}

.article-hero h1 {
  max-width: 820px;
  font-size: 48px;
}

.article-hero p:not(.breadcrumbs) {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.article-hero img {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding-bottom: 48px;
}

.toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.toc a {
  color: var(--muted);
  font-weight: 700;
}

.article-content {
  max-width: 860px;
}

.article-content h2 {
  margin-top: 34px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.legal-page {
  max-width: 840px;
  padding: 54px 0;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.5fr) minmax(160px, 0.5fr);
  gap: 28px;
  margin-top: 64px;
  padding: 36px clamp(18px, 4vw, 56px);
  color: #e9edf2;
  background: var(--coal);
}

.site-footer h2,
.site-footer h3 {
  margin-top: 0;
}

.site-footer p,
.site-footer a {
  color: #c8cfd9;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 14px;
}

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav-cta {
    display: none;
  }

  .hero,
  .article-hero,
  .article-layout,
  .section-heading {
    grid-template-columns: 1fr;
  }

  h1,
  .article-hero h1 {
    font-size: 42px;
  }

  .stats-grid,
  .update-grid,
  .module-grid,
  .code-grid,
  .code-grid.compact,
  .steps,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
  }

  .brand {
    min-width: 100%;
  }

  .top-nav {
    width: 100%;
  }

  .hero {
    padding-top: 30px;
  }

  h1,
  .article-hero h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 26px;
  }

  .stats-grid,
  .update-grid,
  .module-grid,
  .code-grid,
  .code-grid.compact,
  .steps,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
