:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --paper-strong: #fffdf8;
  --ink: #1f2528;
  --muted: #64706f;
  --line: #d7d0c4;
  --accent: #b43a2e;
  --accent-2: #c79a20;
  --blue: #2f6f91;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}

code {
  padding: 0.12rem 0.34rem;
  border: 1px solid #ded6c9;
  border-radius: 5px;
  background: #fffaf0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

math.formula {
  margin: 0 0.12em;
  font-family: "STIX Two Math", "Cambria Math", "Times New Roman", serif;
  font-size: 1.05em;
  vertical-align: -0.2em;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 5vw, 74px);
  border-bottom: 1px solid var(--line);
  background: #efe9de;
}

.hero__text {
  max-width: 700px;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.13;
  letter-spacing: 0;
}

h1 {
  max-width: 10em;
  font-size: clamp(2.5rem, 7vw, 6.4rem);
}

h2 {
  font-size: clamp(1.58rem, 3vw, 2.75rem);
}

.hero p:not(.eyebrow),
.section__copy p {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.28vw, 1.12rem);
}

.hero__viewer {
  min-height: 62vh;
  border: 1px solid rgba(31, 37, 40, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f5ed;
}

.section {
  display: grid;
  grid-template-columns: minmax(300px, 0.84fr) minmax(420px, 1.16fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(42px, 7vw, 96px) clamp(22px, 5vw, 74px);
  border-bottom: 1px solid var(--line);
}

.section--alt {
  background: var(--paper-strong);
}

.section--focus {
  align-items: stretch;
}

.section__copy {
  align-self: center;
}

.figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f9f6ef;
}

.figures-stack {
  display: grid;
  gap: 1rem;
}

.figures-stack .viewer {
  height: min(42vh, 430px);
  min-height: 320px;
}

.viewer {
  position: relative;
  width: 100%;
  height: min(58vh, 620px);
  min-height: 360px;
}

.viewer--large {
  min-height: 620px;
}

.figure--large {
  min-height: 100%;
}

.figure canvas,
.hero__viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

figcaption {
  min-height: 3.5rem;
  padding: 0.78rem 1rem 0.95rem;
  border-top: 1px solid var(--line);
  color: #6d746f;
  font-size: 0.92rem;
  line-height: 1.55;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) 4.2rem;
  gap: 0.75rem;
  align-items: center;
  max-width: 38rem;
  margin: 1.5rem 0 0.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid #d8cfc1;
  border-radius: 8px;
  background: #fffaf0;
}

.controls label {
  font-weight: 750;
  white-space: nowrap;
}

.controls output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

@media (max-width: 980px) {
  .hero,
  .section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero__viewer,
  .viewer,
  .viewer--large {
    min-height: 420px;
    height: 54vh;
  }
}

@media (max-width: 620px) {
  .hero,
  .section {
    padding: 28px 16px 42px;
  }

  .controls {
    grid-template-columns: 1fr 3.8rem;
  }

  .controls label {
    grid-column: 1 / -1;
  }
}
