#design-system.design-system {
  --ds-max: 1180px;
  --ds-pad: clamp(20px, 4vw, 32px);

  --ds-h1: clamp(34px, 4.5vw, 52px);
  --ds-h2: clamp(22px, 3vw, 32px);
  --ds-h3: clamp(18px, 2vw, 22px);
  --ds-body: clamp(15px, 1.4vw, 17px);

  --ds-ink: #0f172a;
  --ds-muted: #5f6b7a;
  --ds-body-ink: #334155;
  --ds-line: #e7ebf3;
  --ds-line-strong: #d9e2f5;
  --ds-card: rgba(255, 255, 255, 0.88);
  --ds-card-solid: #ffffff;
  --ds-accent: #4067D9;
  --ds-accent-2: #6f8cff;
  --ds-accent-soft: #eef2ff;

  --ds-radius-lg: 24px;
  --ds-radius-md: 18px;
  --ds-radius-sm: 14px;

  --ds-shadow-sm: 0 10px 24px rgba(17, 24, 39, 0.06);
  --ds-shadow-md: 0 18px 40px rgba(17, 24, 39, 0.08);
  --ds-shadow-lg: 0 30px 72px rgba(17, 24, 39, 0.12);

  color: var(--ds-ink);
  position: relative;
  overflow: clip;
  background:
    radial-gradient(circle at 10% 10%, rgba(64, 103, 217, 0.04), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(64, 103, 217, 0.05), transparent 22%);
}

/* generic section */
#design-system .ds-section {
  max-width: var(--ds-max);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 46px) var(--ds-pad);
}

/* intro + section framing */
#design-system .ds-intro,
#design-system .ds-colors {
  animation: dsIntroUp 0.72s cubic-bezier(.2,.7,.2,1) both;
}

#design-system .ds-kicker {
  margin: 0 0 10px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(64, 103, 217, 0.12);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-accent);
  font-weight: 800;
}

#design-system .ds-heading {
  margin: 0 0 14px;
  font-size: var(--ds-h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ds-ink);
  text-wrap: balance;
}

#design-system .ds-lede {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

#design-system .ds-subhead {
  margin: 0;
  font-size: var(--ds-h2);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ds-ink);
}

#design-system .ds-body {
  margin: 0;
  font-size: var(--ds-body);
  line-height: 1.8;
  color: var(--ds-body-ink);
  max-width: 68ch;
}

#design-system .ds-title-font {
  font-family: "Marope", serif;
  font-weight: 700;
  color: var(--ds-ink);
}

#design-system .ds-body-font {
  font-family: "Fira Sans", sans-serif;
  font-weight: 700;
  color: var(--ds-ink);
}

/* font row */
#design-system .ds-font-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 4px;
}

/* font cards */
#design-system .ds-font-card {
  position: relative;
  isolation: isolate;
  background: var(--ds-card);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
  box-shadow: var(--ds-shadow-sm);
  transition:
    transform 0.28s cubic-bezier(.2,.7,.2,1),
    box-shadow 0.28s cubic-bezier(.2,.7,.2,1),
    border-color 0.28s ease,
    background 0.28s ease;
}

#design-system .ds-font-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(64, 103, 217, 0.10), transparent 34%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

#design-system .ds-font-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ds-accent) 0%, var(--ds-accent-2) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 2;
}

#design-system .ds-font-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ds-shadow-lg);
  border-color: var(--ds-line-strong);
  background: var(--ds-card-solid);
}

#design-system .ds-font-card:hover::before {
  opacity: 1;
}

#design-system .ds-font-card:hover::after {
  transform: scaleX(1);
}

#design-system .ds-font-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.32s cubic-bezier(.2,.7,.2,1), filter 0.28s ease;
}

#design-system .ds-font-card:hover img {
  transform: scale(1.025);
  filter: saturate(1.02);
}

#design-system .ds-font-card figcaption {
  position: relative;
  z-index: 3;
  padding: 18px;
}

#design-system .ds-font-name {
  margin: 0 0 4px;
  font-size: var(--ds-h3);
  line-height: 1.2;
  font-weight: 800;
  color: var(--ds-ink);
  transition: color 0.28s ease, transform 0.28s ease;
}

#design-system .ds-font-card:hover .ds-font-name {
  color: var(--ds-accent);
  transform: translateY(-1px);
}

#design-system .ds-font-name--title {
  font-family: "Marope", serif;
}

#design-system .ds-font-name--body {
  font-family: "Fira Sans", sans-serif;
}

#design-system .ds-weights {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-muted);
  transition: color 0.28s ease;
}

#design-system .ds-font-card:hover .ds-weights {
  color: #475569;
}

/* colors */
#design-system .ds-colors {
  padding-top: 18px;
}

#design-system .ds-colors .ds-heading {
  margin-top: 0;
}

#design-system .ds-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 18px;
}

#design-system .ds-swatch {
  position: relative;
  overflow: hidden;
  background: var(--ds-card);
  border: 1px solid var(--ds-line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  transition:
    transform 0.26s cubic-bezier(.2,.7,.2,1),
    box-shadow 0.26s ease,
    border-color 0.26s ease,
    background 0.26s ease;
}

#design-system .ds-swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(64, 103, 217, 0.08), transparent 36%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

#design-system .ds-swatch::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ds-accent) 0%, var(--ds-accent-2) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

#design-system .ds-swatch:hover {
  transform: translateY(-4px);
  box-shadow: var(--ds-shadow-sm);
  border-color: var(--ds-line-strong);
  background: #fff;
}

#design-system .ds-swatch:hover::before {
  opacity: 1;
}

#design-system .ds-swatch:hover::after {
  transform: scaleX(1);
}

#design-system .ds-chip {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: var(--chip, #ddd);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.26s cubic-bezier(.2,.7,.2,1),
    box-shadow 0.26s ease;
}

#design-system .ds-swatch:hover .ds-chip {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.04),
    0 10px 18px rgba(64, 103, 217, 0.08);
}

#design-system .ds-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#design-system .ds-name {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ds-ink);
  transition: color 0.26s ease;
}

#design-system .ds-swatch:hover .ds-name {
  color: var(--ds-accent);
}

#design-system .ds-hex {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.26s ease;
}

#design-system .ds-swatch:hover .ds-hex {
  color: #475569;
}

/* motion */
@media (prefers-reduced-motion: no-preference) {
  #design-system .ds-font-card,
  #design-system .ds-swatch {
    animation: dsFade 0.45s ease both;
  }

  #design-system .ds-font-card:nth-child(1) { animation-delay: 0.04s; }
  #design-system .ds-font-card:nth-child(2) { animation-delay: 0.1s; }

  #design-system .ds-swatch:nth-child(1) { animation-delay: 0.02s; }
  #design-system .ds-swatch:nth-child(2) { animation-delay: 0.05s; }
  #design-system .ds-swatch:nth-child(3) { animation-delay: 0.08s; }
  #design-system .ds-swatch:nth-child(4) { animation-delay: 0.11s; }
  #design-system .ds-swatch:nth-child(5) { animation-delay: 0.14s; }
  #design-system .ds-swatch:nth-child(6) { animation-delay: 0.17s; }
  #design-system .ds-swatch:nth-child(7) { animation-delay: 0.20s; }
  #design-system .ds-swatch:nth-child(8) { animation-delay: 0.23s; }
  #design-system .ds-swatch:nth-child(9) { animation-delay: 0.26s; }
}

@keyframes dsIntroUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dsFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* tablet */
@media (max-width: 980px) {
  #design-system .ds-swatches {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* mobile */
@media (max-width: 640px) {
  #design-system .ds-heading {
    font-size: 36px;
    line-height: 1.08;
  }

  #design-system .ds-subhead {
    font-size: 24px;
  }

  #design-system .ds-body {
    font-size: 15px;
    line-height: 1.75;
  }

  #design-system .ds-font-row,
  #design-system .ds-swatches {
    grid-template-columns: 1fr;
  }

  #design-system .ds-font-card figcaption,
  #design-system .ds-swatch {
    padding: 14px;
  }

  #design-system .ds-name,
  #design-system .ds-hex,
  #design-system .ds-weights {
    font-size: 13px;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  #design-system .ds-intro,
  #design-system .ds-colors,
  #design-system .ds-font-card,
  #design-system .ds-font-card::before,
  #design-system .ds-font-card::after,
  #design-system .ds-font-card img,
  #design-system .ds-font-name,
  #design-system .ds-weights,
  #design-system .ds-swatch,
  #design-system .ds-swatch::before,
  #design-system .ds-swatch::after,
  #design-system .ds-chip,
  #design-system .ds-name,
  #design-system .ds-hex {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}