/* Palette variants share structure; accepted A's downstream content is preserved. */
body[data-theme] {
  --ink: #19323a;
  --muted: #5b7279;
  --accent: #087f83;
  --secondary: #c33c33;
  --green: var(--accent);
  --mint: #eff9f8;
  --border: #d9e8e8;
  --cta: var(--accent);
}
body[data-theme="scarlet"] {
  --accent: #bb352f;
  --secondary: #087f83;
  --mint: #fcf3f0;
  --border: #ebddda;
  --cta: #bb352f;
}
body[data-theme="duet"] {
  --cta: #bb352f;
}
body[data-theme] .button.primary {
  background: var(--cta);
  border-color: var(--cta);
}
body[data-theme] :focus-visible {
  outline-color: var(--accent);
}
.mosaic-hero {
  display: grid;
  grid-template-columns: 1fr 1.16fr;
  gap: 64px;
  align-items: center;
  padding: 42px 0 66px;
}
.mosaic-hero h1 {
  font-size: clamp(38px, 4vw, 62px);
  line-height: 1.12;
  letter-spacing: -2.4px;
}
.offer {
  min-width: 0;
}
.mosaic-hero .lead {
  font-size: 20px;
  line-height: 1.5;
  margin-top: 22px;
}
.hero-counts {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin: 26px 0 22px;
  font-size: 17px;
  color: var(--ink);
}
.hero-counts strong {
  font-size: 24px;
  color: var(--accent);
  font-weight: 650;
}
.mosaic-hero .actions {
  margin-top: 0;
  gap: 12px;
  flex-wrap: wrap;
}
.mosaic-hero .micro {
  margin-top: 12px;
}
.motion-stage {
  background: var(--mint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 16px;
  min-width: 0;
}
.motion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.motion-toggle {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  min-height: 40px;
}
.formula {
  font:
    32px Georgia,
    serif;
  margin: 20px 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.formula span {
  white-space: nowrap;
  color: var(--ink);
}
.formula em {
  color: var(--secondary);
  font-style: normal;
}
.motion-stage .function-graph {
  max-height: 320px;
}
.formula output {
  font:
    17px Onest,
    sans-serif;
  min-width: 75px;
}
.function-graph {
  width: 100%;
  display: block;
  overflow: hidden;
}
.graph-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.graph-axis {
  stroke: var(--ink);
  stroke-width: 1.4;
  fill: none;
}
.graph-labels {
  fill: var(--muted);
  font:
    14px Onest,
    sans-serif;
}
.graph-curve {
  stroke: var(--accent);
  stroke-width: 3.4;
  fill: none;
}
.graph-guide {
  stroke: var(--secondary);
  stroke-width: 1.1;
  stroke-dasharray: 5 6;
  fill: none;
}
.graph-vertex {
  fill: var(--secondary);
}
.motion-code {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 16px 4px 0;
}
.motion-code pre {
  font:
    14px/1.7 ui-monospace,
    monospace;
  color: var(--ink);
  margin: 0;
}
.motion-code pre span,
.motion-code b {
  color: var(--accent);
}
.motion-code p {
  font-size: 13px;
  line-height: 1.5;
}
.demo-note {
  font-size: 11px;
  margin-top: 12px;
  text-align: center;
}
.subject-section {
  padding: 30px 0 80px;
}
.subject-section h2 {
  font-size: 44px;
}
.subject-section .lead {
  margin: 16px 0 44px;
}
.subject-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.subject-example {
  padding: 30px 32px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.subject-example:not(:nth-child(3n)) {
  border-right: 1px solid var(--border);
}
.subject-top {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 76px;
}
.subject-symbol {
  color: var(--accent);
  font-size: 48px;
  font-weight: 450;
  line-height: 1;
  min-width: 62px;
}
.subject-top h3 {
  font-size: 23px;
  line-height: 1.2;
  max-width: 240px;
}
.subject-symbol svg {
  display: block;
  width: 64px;
  height: 64px;
}
.subject-visual {
  height: 138px;
  margin: 20px 0 14px;
  display: flex;
  align-items: center;
  color: var(--accent);
}
.subject-visual svg {
  width: 200px;
  height: 130px;
}
.subject-visual svg text {
  font:
    20px Onest,
    sans-serif;
  stroke: none;
  fill: var(--ink);
}
.fill-accent {
  fill: var(--accent);
  stroke: var(--accent);
}
.fill-secondary {
  fill: var(--secondary);
  stroke: var(--secondary);
}
.muted-line {
  stroke: var(--border);
}
.secondary-line {
  stroke: var(--secondary);
}
.subject-example p {
  font-size: 16px;
  min-height: 50px;
  max-width: 270px;
}
.subject-open {
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 17px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.mini-code {
  padding: 16px 18px;
  background: var(--mint);
  border-radius: 8px;
  font:
    15px/1.65 ui-monospace,
    monospace;
  margin: 0;
  color: var(--ink);
}
.mini-code span {
  color: var(--accent);
}
.word-preview {
  font-size: 18px;
  line-height: 1.8;
  width: 210px;
}
.word-preview small {
  display: block;
  color: var(--muted);
  font-size: 15px;
}
.word-preview span {
  display: flex;
  justify-content: space-between;
}
.word-preview b {
  color: var(--secondary);
}
.sequence-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  color: var(--accent);
  flex-wrap: wrap;
}
.sequence-preview span {
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 50%;
  font-size: 20px;
}
.sequence-preview i {
  font-style: normal;
  font-size: 16px;
}
.gallery-note {
  margin-top: 24px;
  max-width: 850px;
}
.art-section {
  padding: 24px 0 74px;
}
.art-section h2 {
  margin-bottom: 38px;
}
.art-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.art-gallery figure {
  margin: 0;
  min-width: 0;
}
.art-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 3px;
}
.art-gallery figcaption {
  margin-top: 14px;
  font-size: 20px;
  color: var(--ink);
}
.subject-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: 90dvh;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  color: var(--ink);
  font: inherit;
}
.subject-dialog::backdrop {
  background: #19323a80;
}
.dialog-head {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.dialog-close {
  font-size: 30px;
  background: none;
  border: 0;
  min-width: 44px;
  min-height: 44px;
  line-height: 1;
}
.sample-body {
  padding: 24px;
}
.sample-body > h3 {
  margin-bottom: 20px;
}
.sample-body .lesson {
  padding: 0;
  border: 0;
}
.sample-body > svg:not(.function-graph) {
  display: block;
  width: 180px;
  margin: 20px auto;
  height: 140px;
  color: var(--accent);
}
.sample-range {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 16px;
  margin: 20px 0;
}
.sample-range input {
  accent-color: var(--accent);
  flex: 1;
  min-width: 100px;
  min-height: 44px;
}
.sample-range output {
  min-width: 28px;
}
.mean-model {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  padding: 30px;
  background: var(--mint);
  border-radius: 8px;
}
.example-course {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--border);
}
.example-course .micro {
  margin-top: 10px;
}
.gate-inputs {
  display: flex;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.gate-inputs input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  vertical-align: middle;
}
.gate-lamp {
  font-size: 70px;
  text-align: center;
  color: var(--border);
}
.gate-lamp.on {
  color: var(--secondary);
}
@media (max-width: 1100px) {
  .mosaic-hero {
    gap: 30px;
  }
  .mosaic-hero h1 {
    font-size: 46px;
  }
  .hero-counts {
    gap: 14px;
    font-size: 14px;
  }
  .hero-counts strong {
    font-size: 22px;
  }
  .subject-example {
    padding: 24px 20px;
  }
  .subject-symbol {
    font-size: 40px;
    min-width: 45px;
  }
  .subject-top {
    gap: 12px;
  }
  .subject-top h3 {
    font-size: 20px;
  }
  .motion-code {
    flex-wrap: wrap;
  }
}
@media (max-width: 800px) {
  .mosaic-hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
    gap: 32px;
  }
  .mosaic-hero h1 {
    font-size: 46px;
    max-width: 620px;
  }
  .motion-stage {
    max-width: 650px;
  }
  .subject-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .subject-example:not(:nth-child(3n)) {
    border-right: 0;
  }
  .subject-example:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
  .art-gallery {
    gap: 12px;
  }
  .art-gallery figcaption {
    font-size: 17px;
  }
  .subject-section h2 {
    font-size: 36px;
  }
}
@media (max-width: 540px) {
  .mosaic-hero h1 {
    font-size: clamp(28px, 9.4vw, 37px);
    letter-spacing: -1.5px;
  }
  .mosaic-hero .lead {
    font-size: 18px;
  }
  .hero-counts {
    gap: 14px 20px;
    font-size: 14px;
  }
  .hero-counts strong {
    font-size: 21px;
  }
  .mosaic-hero .actions .button {
    padding: 12px 16px;
  }
  .motion-stage {
    padding: 14px 12px;
  }
  .motion-heading {
    font-size: 11px;
  }
  .motion-toggle {
    padding: 6px 10px;
    font-size: 12px;
  }
  .formula {
    font-size: 25px;
    flex-wrap: wrap;
  }
  .formula output {
    font-size: 15px;
  }
  .motion-code {
    gap: 10px;
  }
  .motion-code p {
    font-size: 12px;
  }
  .subject-section {
    padding-bottom: 52px;
  }
  .subject-section h2,
  .art-section h2 {
    font-size: 32px;
    letter-spacing: -1px;
  }
  .subject-section .lead {
    font-size: 18px;
    margin-bottom: 30px;
  }
  .subject-gallery {
    grid-template-columns: 1fr;
  }
  .subject-example {
    padding: 24px 0;
  }
  .subject-example:nth-child(odd) {
    border-right: 0;
  }
  .subject-top {
    min-height: 62px;
  }
  .subject-top h3 {
    font-size: 25px;
    max-width: 280px;
  }
  .subject-symbol {
    min-width: 66px;
    font-size: 49px;
  }
  .subject-visual {
    margin: 10px 0;
    height: 130px;
  }
  .subject-example p {
    min-height: 0;
    max-width: none;
  }
  .art-gallery {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .art-gallery figcaption {
    font-size: 20px;
  }
  .subject-dialog {
    width: calc(100% - 20px);
  }
  .sample-body {
    padding: 20px 16px;
  }
  .dialog-head {
    padding: 12px 16px;
  }
  .example-course {
    padding: 20px 16px;
  }
}
