:root {
  font-family: "Times New Roman", Times, serif;
  color: #171714;
  background: #efeee8;
  font-size: calc(20px * var(--ui-scale));
  color-scheme: light;
  --ui-scale: 0.98;
  --page-background: #efeee8;
  --card-background: #e6e3da;
  --muted-color: #66645b;
  --footer-background: #d2cfc4;
  --divider-color: #aaa69b;
  --progress-color: #587c58;
  --answer-error-color: #a33c32;
  --footer-height: 72px;
  --date-spacing: calc(clamp(250px, 19vw, 340px) * var(--ui-scale));
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1100px;
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

a:focus-visible,
button:focus-visible,
.history-step:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

.container {
  width: calc(100% - 96px);
  max-width: calc(1760px * var(--ui-scale));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--page-background);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.cookie-notice {
  --cookie-notice-gap: clamp(16px, 2vw, 28px);
  position: fixed;
  left: var(--cookie-notice-gap);
  bottom: var(--cookie-notice-gap);
  z-index: 20;
  width: min(calc(620px * var(--ui-scale)), calc(100% - 2 * var(--cookie-notice-gap)));
  max-height: calc(100dvh - 2 * var(--cookie-notice-gap));
  overflow-y: auto;
  padding: calc(28px * var(--ui-scale));
  background: var(--card-background);
  transform: translateY(calc(100% + var(--cookie-notice-gap) + 2px));
  pointer-events: none;
  transition: transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cookie-notice.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-notice-title {
  margin: 0;
  font-size: calc(44px * var(--ui-scale));
  font-weight: 400;
  line-height: 1.12;
}

.cookie-notice-note {
  margin: 6px 0 14px;
  color: var(--muted-color);
  font-size: calc(26px * var(--ui-scale));
  font-style: italic;
  line-height: 1.2;
}

.cookie-notice-description {
  margin: 0;
  font-size: calc(30px * var(--ui-scale));
  line-height: 1.25;
}

.cookie-notice-link {
  font-weight: 700;
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: help;
}

.cookie-notice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 38px;
}

.cookie-notice-accept {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  font-size: calc(46px * var(--ui-scale));
  line-height: 1.1;
  cursor: pointer;
  transform-origin: right center;
  transition: transform 200ms ease;
}

.cookie-notice-accept .test-action-arrow {
  width: 0.62em;
  height: 1em;
}

.cookie-notice-accept:hover,
.cookie-notice-accept:focus-visible {
  transform: scale(1.12);
}

.site-header {
  position: fixed;
  top: 24px;
  left: 32px;
  z-index: 5;
}

.site-logo {
  display: block;
  width: calc(72px * var(--ui-scale));
  line-height: 0;
  transition: transform 180ms ease;
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-logo:hover {
  transform: scale(1.04);
}

.history-stage {
  padding-block: 104px 24px;
  background: var(--page-background);
}

.history-heading h1 {
  margin: 0;
  font-size: calc(clamp(36px, 2.6vw, 46px) * var(--ui-scale));
  font-weight: 400;
}

.history-body {
  display: grid;
  align-items: center;
  padding-block: 20px;
}

.history-stories,
.history-step-copy {
  min-width: 0;
}

.history-step {
  display: grid;
  grid-template-columns: minmax(300px, 28%) minmax(0, 1fr);
  align-items: center;
  column-gap: 64px;
}

.history-image {
  margin: 0;
  min-width: 0;
}

.history-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(clamp(240px, 39vh, 450px) * var(--ui-scale));
}

.history-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.65) contrast(0.97);
  mask-image: linear-gradient(#000 86%, transparent);
}

.history-art--painting {
  height: auto;
  aspect-ratio: 4 / 3;
}

.history-art--painting .history-photo {
  box-shadow: 0 20px 34px -28px rgb(40 34 24 / 45%);
}

.history-art--pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.history-art--pair .history-photo {
  height: 78%;
  object-position: 50% 25%;
}

.history-art--pair .history-photo:first-child {
  align-self: start;
  margin-top: 12px;
}

.history-art--pair .history-photo:last-child {
  align-self: end;
  margin-bottom: 12px;
}

.history-art--engraving .history-photo,
.history-art--laplace .history-photo {
  width: 92%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: grayscale(1) sepia(0.12) contrast(1.04);
  mask-image: radial-gradient(ellipse 78% 84% at 50% 44%, #000 62%, transparent 100%);
}

.history-art--book > .history-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 77%;
  height: 90%;
  object-position: 50% 20%;
}

.history-document {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  width: 48%;
  height: auto;
  padding: 5px;
  background: var(--page-background);
  box-shadow: 0 12px 26px -12px rgb(40 34 24 / 38%);
}

.history-art--trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.history-art--trio .history-photo {
  height: 68%;
  object-position: 50% 12%;
  filter: grayscale(1) sepia(0.12);
  mix-blend-mode: multiply;
}

.history-art--trio .history-photo:first-child {
  align-self: start;
  margin-top: 20px;
}

.history-art--trio .history-photo:last-child {
  align-self: end;
  margin-bottom: 20px;
}

.history-art--data {
  height: auto;
}

.history-art--data .history-photo {
  height: auto;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: saturate(0.45);
  mask-image: none;
}

.history-caption {
  margin-top: 12px;
  color: var(--muted-color);
  font-size: calc(clamp(16px, 1.05vw, 19px) * var(--ui-scale));
  line-height: 1.3;
}

.history-step + .history-step {
  margin-top: 48px;
}

.history-period {
  margin: 0 0 14px;
  color: var(--muted-color);
  font-size: calc(clamp(20px, 1.4vw, 24px) * var(--ui-scale));
  line-height: 1.25;
}

.history-step h2 {
  max-width: 26ch;
  margin: 0 0 22px;
  font-size: calc(clamp(30px, 2.3vw, 38px) * var(--ui-scale));
  font-weight: 400;
  line-height: 1.15;
}

.history-step-copy > p:last-child {
  max-width: 60ch;
  margin: 0;
  font-size: calc(clamp(22px, 1.8vw, 30px) * var(--ui-scale));
  line-height: 1.45;
}

.timeline {
  display: none;
  position: relative;
  height: 116px;
  --timeline-axis: 108px;
  --timeline-offset: 0px;
}

.timeline::before {
  position: absolute;
  z-index: 2;
  top: var(--timeline-axis);
  right: 0;
  left: 0;
  height: 1px;
  background: #77776d;
  content: "";
}

.timeline::after {
  position: absolute;
  z-index: 2;
  top: calc(var(--timeline-axis) - 5px);
  right: 1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #77776d;
  border-right: 1px solid #77776d;
  transform: rotate(45deg);
  content: "";
  pointer-events: none;
}

.timeline-viewport {
  position: relative;
  z-index: 3;
  height: var(--timeline-axis);
  margin-right: 28px;
  overflow: clip;
  mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

.timeline-dates {
  position: relative;
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-dates,
.timeline-ticks {
  transform: translateX(var(--timeline-offset));
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.timeline-ruler {
  position: absolute;
  z-index: 1;
  top: calc(var(--timeline-axis) - 32px);
  right: 28px;
  left: 0;
  height: 32px;
  overflow: clip;
  clip-path: polygon(0 0, 100% 0, calc(100% - 80px) 100%, 80px 100%);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  pointer-events: none;
  transform: scaleY(-1);
}

.timeline-ticks {
  display: block;
  width: 100%;
  height: 32px;
  overflow: visible;
}

.timeline-tick {
  stroke: #b3b2a8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.timeline-tick.is-medium {
  stroke: #929287;
}

.timeline-tick.is-major {
  stroke: #66665e;
  transform-origin: 0 0;
  transition: transform 180ms ease;
}

.timeline-tick.is-active {
  stroke: #171714;
  stroke-width: 2;
  transform: scaleY(1.55);
}

.timeline-dates > li {
  flex: 0 0 var(--date-spacing);
  width: var(--date-spacing);
}

.timeline-date {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: var(--timeline-axis);
  border: 0;
  padding: 8px 12px 42px;
  color: var(--muted-color);
  background: transparent;
  font-size: calc(clamp(24px, 1.65vw, 30px) * var(--ui-scale));
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
}

.timeline-date[aria-selected="true"] {
  color: #171714;
  font-size: calc(clamp(27px, 1.65vw, 32px) * var(--ui-scale));
  font-weight: 700;
}

.timeline-date:focus-visible {
  outline-offset: -6px;
}

.history-hint {
  display: none;
  margin: 6px 0 0;
  color: rgb(23 23 20 / 62%);
  font-size: calc(clamp(16px, 1.05vw, 20px) * var(--ui-scale));
  font-style: italic;
  line-height: 1.25;
  text-align: right;
}

.history-footer {
  padding-top: 12px;
  text-align: center;
}

.skip-history {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: calc(clamp(24px, 1.7vw, 30px) * var(--ui-scale));
  text-decoration: none;
  transform-origin: center;
  transition: transform 200ms ease;
}

.skip-arrow {
  display: block;
  width: 2.6em;
  height: auto;
}

.skip-history:hover,
.skip-history:focus-visible {
  transform: scale(1.12);
}

.js .history-stage {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 720px;
}

.js .history-body {
  flex: 1;
  min-height: 0;
}

.js .history-step + .history-step {
  margin-top: 0;
}

.js .history-hint,
.js .timeline {
  display: block;
}

.js .history-step:not([hidden]) .history-step-copy {
  animation: history-appear 240ms ease-out;
}

.section-zone {
  position: relative;
}

.section-zone::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(100% - 136px);
  max-width: calc(1680px * var(--ui-scale));
  height: 1px;
  background: var(--divider-color);
  transform: translateX(-50%);
  content: "";
  pointer-events: none;
}

.topics {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding-block: 112px 64px;
}

.topics h2 {
  margin: 0 0 38px;
  font-size: calc(clamp(36px, 2.6vw, 46px) * var(--ui-scale));
  font-weight: 400;
}

.topic-carousel {
  margin-inline: auto;
}

.topic-card {
  display: flex;
  flex-direction: column;
  min-height: calc(560px * var(--ui-scale));
  padding: 36px 44px 28px;
  background: var(--card-background);
}

.topic-card + .topic-card {
  margin-top: 24px;
}

.topic-card h3 {
  max-width: 38ch;
  margin: 0 0 22px;
  font-size: calc(clamp(30px, 2.3vw, 38px) * var(--ui-scale));
  font-weight: 400;
  line-height: 1.2;
}

.topic-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 3.2vw, 60px);
}

.topic-copy,
.topic-formulas {
  min-width: 0;
}

.topic-questions {
  margin: 0;
  padding-left: 24px;
  font-size: calc(clamp(24px, 1.8vw, 30px) * var(--ui-scale));
  line-height: 1.4;
}

.topic-questions li + li {
  margin-top: 5px;
}

.topic-summary {
  max-width: 68ch;
  margin: 22px 0;
  color: var(--muted-color);
  font-size: calc(clamp(22px, 1.55vw, 26px) * var(--ui-scale));
  line-height: 1.45;
}

.topic-formulas h4 {
  margin: 0 0 16px;
  color: var(--muted-color);
  font-size: calc(clamp(20px, 1.45vw, 24px) * var(--ui-scale));
  font-style: italic;
  font-weight: 400;
}

.formula-list {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.formula-list math {
  margin: 0;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: calc(clamp(22px, 1.65vw, 28px) * var(--ui-scale));
  text-align: left;
}

.formula-note {
  margin: 18px 0 22px;
  color: var(--muted-color);
  font-size: calc(clamp(17px, 1.15vw, 20px) * var(--ui-scale));
  font-style: italic;
  line-height: 1.35;
}

.formula-laws {
  gap: 12px;
}

.formula-law {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: 5px 14px;
}

.formula-name {
  flex: 0 0 128px;
  color: var(--muted-color);
  font-size: calc(clamp(17px, 1.15vw, 20px) * var(--ui-scale));
  font-style: italic;
}

.topic-link {
  align-self: flex-end;
  margin-top: auto;
  font-size: calc(clamp(25px, 1.7vw, 30px) * var(--ui-scale));
  text-decoration: underline;
  transform-origin: right center;
  transition: transform 200ms ease;
}

.topic-link:hover,
.topic-link:focus-visible {
  transform: scale(1.12);
}

.topic-number {
  margin-right: 0.2em;
}

.carousel-arrow,
.carousel-dots {
  display: none;
}

.is-ready .carousel-layout {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  column-gap: 20px;
}

.is-ready .topic-slides {
  overflow: clip;
}

.is-ready .topic-track {
  display: flex;
  align-items: stretch;
  transform: translateX(calc(var(--slide-index, 1) * -100%));
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.is-ready .topic-track.is-positioning {
  transition: none;
}

.is-ready .topic-card,
.is-ready .lesson-card {
  flex: 0 0 100%;
  min-width: 0;
}

.is-ready .topic-card + .topic-card {
  margin-top: 0;
}

.is-ready .carousel-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  border: 0;
  padding: 12px;
  background: transparent;
  cursor: pointer;
}

.carousel-arrow svg {
  flex-shrink: 0;
  transition: transform 180ms ease;
}

.carousel-previous svg {
  rotate: 180deg;
}

.carousel-arrow:hover svg {
  transform: scale(1.15);
}

.is-ready .carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.carousel-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  border: 0;
  padding: 8px;
  background: transparent;
  cursor: pointer;
}

.carousel-dot::after {
  width: 7px;
  height: 7px;
  border: 1px solid #77776d;
  border-radius: 50%;
  content: "";
  transition: transform 180ms ease, background-color 180ms ease;
}

.carousel-dot[aria-current="true"]::after {
  border-color: #171714;
  background: #171714;
  transform: scale(1.25);
}

.carousel-dot:hover::after {
  transform: scale(1.25);
}

.topics-next {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-right: 76px;
}

.section-next {
  font-size: calc(clamp(20px, 1.3vw, 24px) * var(--ui-scale));
  font-style: italic;
  white-space: nowrap;
}

.final-test {
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--footer-height));
  padding-block: 72px 80px;
}

.final-test-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 42%);
  align-items: start;
  gap: clamp(60px, 6vw, 112px);
  max-width: 1520px;
}

.final-test-copy h2 {
  margin: 0 0 26px;
  font-size: calc(clamp(32px, 2.15vw, 40px) * var(--ui-scale));
  line-height: 1.2;
}

.final-test-description {
  max-width: 44ch;
  min-height: calc(5.2em + 4px);
  font-size: calc(clamp(24px, 1.55vw, 28px) * var(--ui-scale));
  font-style: italic;
  line-height: 1.3;
}

.final-test-description p {
  margin: 0;
}

.final-test-description p + p {
  margin-top: 4px;
}

.test-progress {
  margin-top: clamp(42px, 5vw, 78px);
}

.test-progress h3 {
  margin: 0 0 24px;
  font-size: calc(clamp(30px, 2.4vw, 42px) * var(--ui-scale));
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
}

.test-progress-list {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.test-progress-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 34px;
  font-size: calc(28px * var(--ui-scale));
  line-height: 1;
  text-decoration: none;
}

.test-progress-circle {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transition: background-color 180ms ease, transform 180ms ease;
}

.test-progress-final {
  margin-left: 5px;
}

.test-progress-final .test-progress-circle {
  width: 64px;
  height: 64px;
}

.test-progress-step[aria-current="step"] .test-progress-circle::after {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.test-progress-final[aria-current="step"] .test-progress-circle::after {
  width: 21px;
  height: 21px;
}

.test-progress-step.is-completed .test-progress-circle {
  background: var(--progress-color);
}

.test-progress-step:hover .test-progress-circle {
  transform: scale(1.08);
}

.test-progress-tooltip {
  position: absolute;
  z-index: 25;
  bottom: calc(100% + 14px);
  left: 50%;
  width: max-content;
  max-width: 290px;
  padding: 12px 16px;
  border: 1px solid var(--divider-color);
  background: var(--page-background);
  font-size: 18px;
  line-height: 1.35;
  text-align: left;
  white-space: pre-line;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 160ms ease;
}

.test-progress-step.is-completed:hover .test-progress-tooltip,
.test-progress-step.is-completed:focus-visible .test-progress-tooltip {
  visibility: visible;
  opacity: 1;
}

.test-progress-list > li:first-child .test-progress-tooltip {
  left: 0;
  transform: none;
}

.test-progress-list > li:last-child .test-progress-tooltip {
  right: 0;
  left: auto;
  transform: none;
}

.test-progress-total {
  margin: 22px 0 0;
  color: var(--muted-color);
  font-size: calc(21px * var(--ui-scale));
  font-style: italic;
  line-height: 1.3;
}

.is-file-preview .cookie-notice {
  display: none !important;
}

.local-preview-help {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  left: 24px;
  padding: 16px 24px;
  border: 1px solid var(--divider-color);
  background: var(--page-background);
  font-size: 21px;
  line-height: 1.35;
}

.local-preview-help p {
  margin: 0 0 8px;
}

.test-start {
  --paper-width: calc(clamp(300px, 22vw, 400px) * var(--ui-scale));
  position: relative;
  justify-self: center;
  width: var(--paper-width);
  height: calc(var(--paper-width) * 626 / 494 + 16px);
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: default;
}

.test-paper {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  aspect-ratio: 494 / 626;
  isolation: isolate;
  transform-origin: 50% 58%;
  transition: transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.test-paper::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("assets/notebook-paper.jpg") center / cover;
  transform: scaleX(-1);
  content: "";
}

.paper-copy {
  display: block;
  padding: 54px 26px;
  font-size: calc(clamp(24px, 1.6vw, 29px) * var(--ui-scale));
  font-style: italic;
  line-height: 1.2;
}

.paper-title {
  display: block;
  min-height: 3.6em;
  margin-bottom: 34px;
  text-align: center;
}

.paper-student {
  display: block;
  line-height: 1.7;
  white-space: nowrap;
}

.test-pencil {
  position: absolute;
  top: 20px;
  right: -30px;
  display: block;
  width: calc(var(--paper-width) * 0.98 * 100 / 1822);
  height: calc(var(--paper-width) * 0.98);
  overflow: hidden;
  transform-origin: 50% 56%;
  transition: transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.test-action {
  position: absolute;
  bottom: 18%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  transform: translateX(-50%);
  transition: transform 200ms ease;
}

.test-action-label {
  display: block;
  padding: 8px 4px;
  font-size: calc(clamp(27px, 1.75vw, 32px) * var(--ui-scale));
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.test-action-arrow {
  flex-shrink: 0;
}

.test-action-arrow-right {
  rotate: 180deg;
}

.test-start:hover .test-paper,
.test-start:focus-visible .test-paper {
  transform: translate(-8px, -3px) rotate(-10deg);
}

.test-start:hover .test-pencil,
.test-start:focus-visible .test-pencil {
  transform: translate(-4px, -8px) rotate(-24deg);
}

.test-start:hover .test-action,
.test-start:focus-visible .test-action {
  transform: translateX(-50%) scale(1.12);
}

.test-start:focus-visible {
  outline: none;
}

.test-start:focus-visible .test-action-label {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.test-start[data-quiz-start] {
  cursor: pointer;
}

body.quiz-is-open {
  overflow: hidden;
}

.quiz-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 8px 24px 20px;
  overflow: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

.quiz-dialog[open] {
  display: grid;
  place-items: center;
}

.quiz-dialog::backdrop {
  background: rgb(239 238 232 / 58%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.quiz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.quiz-surface {
  position: relative;
  --quiz-paper-width: max(320px, min(calc(680px * var(--ui-scale)), calc((100dvh - 164px) * 494 / 626), calc(100vw - 64px)));
  width: min(calc(var(--quiz-paper-width) + 210px), calc(100vw - 48px));
  margin-inline: auto;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 2px;
}

.quiz-timer-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.quiz-timer-label {
  color: var(--muted-color);
  font-size: calc(22px * var(--ui-scale));
  font-style: italic;
}

.quiz-timer {
  font-size: calc(30px * var(--ui-scale));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.quiz-close-wrap {
  position: relative;
  z-index: 2;
}

.quiz-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 200ms ease;
}

.quiz-close:hover,
.quiz-close:focus-visible {
  transform: scale(1.12);
}

.quiz-close-warning {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 64px));
  padding: 12px 16px;
  border: 1px solid var(--divider-color);
  background: var(--page-background);
  font-size: 18px;
  line-height: 1.3;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.quiz-close-wrap:hover .quiz-close-warning,
.quiz-close-wrap:focus-within .quiz-close-warning {
  visibility: visible;
  opacity: 1;
}

.quiz-window {
  width: calc(var(--quiz-paper-width) + 20px);
  margin-inline: auto;
  padding: 10px;
  overflow: hidden;
}

.quiz-track {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.quiz-sheet {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  padding-top: 4%;
  aspect-ratio: 494 / 626;
  container-type: inline-size;
  background: url("assets/notebook-paper.jpg") top left / 100% 100%;
}

.quiz-sheet-title {
  margin: 0;
  padding-inline: 3%;
  font-size: clamp(29px, 8cqi, 54px);
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
}

.quiz-sheet-body {
  padding: 6.5% 6% 5% 17%;
}

.quiz-question-number {
  margin: 0 0 9cqi;
  font-size: clamp(24px, 5.6cqi, 38px);
  font-style: italic;
  line-height: 1.2;
}

.quiz-question {
  margin: 0;
  font-size: clamp(18px, 4.3cqi, 29px);
  line-height: 1.25;
}

.quiz-answer-form {
  margin-top: 5.5cqi;
}

.quiz-answer-note {
  margin: 14px 0 0;
  color: var(--muted-color);
  font-size: clamp(14px, 2.8cqi, 18px);
  font-style: italic;
  line-height: 1.3;
}

.quiz-answer-note + .quiz-answer-form {
  margin-top: 18px;
}

.quiz-answer-caption {
  margin: 0 0 12px;
  font-size: clamp(23px, 5cqi, 32px);
  font-style: italic;
}

.quiz-answer-form-multiple .quiz-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}

.quiz-answer-form-multiple .quiz-answer-label {
  font-size: clamp(18px, 4.2cqi, 28px);
}

.quiz-answer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.quiz-answer-label {
  font-size: clamp(24px, 5.4cqi, 36px);
  font-style: italic;
  line-height: 1.2;
}

.quiz-answer-input {
  width: clamp(100px, 25cqi, 170px);
  min-width: 0;
  height: 1.8em;
  padding: 5px 10px;
  border: 1px solid var(--muted-color);
  border-radius: 0;
  background: var(--page-background);
  color: inherit;
  font: inherit;
  font-size: clamp(20px, 4.4cqi, 30px);
  text-align: center;
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.quiz-answer-input::placeholder {
  color: var(--muted-color);
  font-size: 0.72em;
  font-style: italic;
}

.quiz-answer-input:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

.quiz-answer-input[aria-invalid="true"] {
  border: 2px solid var(--answer-error-color);
  background: #f5e9e2;
  outline-color: var(--answer-error-color);
}

.quiz-answer-error {
  min-height: 1.3em;
  margin: 9px 0 0;
  color: var(--answer-error-color);
  font-size: clamp(15px, 2.8cqi, 18px);
  line-height: 1.3;
  text-align: right;
}

.quiz-hint-book {
  position: absolute;
  z-index: 2;
  bottom: 76px;
  left: calc(50% + var(--quiz-paper-width) / 2 + 24px);
  width: clamp(96px, 10vw, 134px);
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-style: italic;
  line-height: 1.3;
  cursor: pointer;
  transform-origin: center bottom;
  transition: transform 200ms ease;
}

.quiz-hint-book img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 7px 6px rgb(45 32 15 / 20%));
}

.quiz-hint-book:hover,
.quiz-hint-book:focus-visible {
  transform: translateY(-5px) rotate(-3deg) scale(1.06);
}

.quiz-hint-panel {
  position: fixed;
  z-index: 5;
  bottom: 100px;
  left: 50%;
  width: min(1000px, calc(100vw - 56px), calc((100dvh - 180px) * 986 / 528));
  transform: translateX(-50%);
  transform-origin: center bottom;
}

.quiz-hint-panel > img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 18px rgb(36 26 12 / 20%));
}

.quiz-book-close {
  position: absolute;
  top: -43px;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 200ms ease;
}

.quiz-book-close:hover,
.quiz-book-close:focus-visible {
  transform: scale(1.12);
}

.quiz-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 48px;
  margin-top: 2px;
}

.quiz-progress {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: clamp(11px, 1.3vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiz-progress-step {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.quiz-progress-step[aria-current="step"] .quiz-progress-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.quiz-progress-step.is-correct {
  background: var(--progress-color);
}

.quiz-next {
  display: grid;
  grid-column: 3;
  place-items: center;
  justify-self: start;
  min-width: 52px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: left center;
  transition: transform 200ms ease;
}

.quiz-next:hover,
.quiz-next:focus-visible {
  transform: scale(1.12);
}

.quiz-next:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.quiz-next-text {
  font-size: calc(clamp(22px, 1.8vw, 29px) * var(--ui-scale));
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 6px;
  white-space: nowrap;
}

.quiz-result {
  padding-top: 17%;
}

.quiz-result-title {
  margin: 0 0 24px;
  font-size: clamp(28px, 6cqi, 40px);
  font-style: italic;
  line-height: 1.2;
}

.quiz-result-time-label,
.quiz-result-total,
.quiz-result-storage {
  margin: 0 0 20px;
  font-size: clamp(20px, 4cqi, 27px);
  line-height: 1.3;
}

.quiz-result-time-label {
  margin-bottom: 8px;
  font-style: italic;
}

.quiz-result-time {
  margin: 0 0 30px;
  font-size: clamp(42px, 10cqi, 68px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.quiz-result-total {
  font-size: clamp(17px, 3.5cqi, 23px);
}

.quiz-result-storage {
  color: var(--muted-color);
  font-style: italic;
}

.site-footer {
  min-height: var(--footer-height);
  padding-block: 12px;
  background: var(--footer-background);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(var(--footer-height) - 24px);
}

.footer-slot {
  min-width: 0;
}

.footer-slot + .footer-slot {
  border-left: 1px solid var(--divider-color);
}

.section-container {
  width: calc(100% - 200px);
  max-width: calc(1440px * var(--ui-scale));
  margin-inline: auto;
}

.section-page-main {
  padding-top: 144px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: calc(clamp(30px, 2.5vw, 40px) * var(--ui-scale));
  line-height: 1;
  white-space: nowrap;
}

.section-number {
  font-size: 1.65em;
}

.section-page-title {
  max-width: 35ch;
  margin: 30px 0 42px;
  font-size: calc(clamp(34px, 2.8vw, 46px) * var(--ui-scale));
  font-weight: 400;
  line-height: 1.2;
}

.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.chapter-nav-edge {
  gap: 18px;
  min-width: 106px;
  font-size: calc(19px * var(--ui-scale));
  font-style: italic;
}

.chapter-nav-arrow {
  width: 2.4em;
}

.chapter-nav-previous .chapter-nav-arrow {
  rotate: 90deg;
}

.chapter-nav-next .chapter-nav-arrow {
  rotate: -90deg;
}

.chapter-nav-numbers {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.chapter-nav-number {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 30px;
  min-height: 52px;
  font-size: calc(27px * var(--ui-scale));
  text-decoration: none;
  transition: transform 200ms ease;
}

.chapter-nav-number[aria-current="page"] {
  font-size: calc(43px * var(--ui-scale));
}

.chapter-nav-number:hover,
.chapter-nav-number:focus-visible {
  transform: scale(1.12);
}

.section-overview {
  min-height: 300px;
  padding: 38px 44px;
  background: var(--card-background);
}

.section-overview h2,
.lesson-card h3 {
  margin: 0;
  font-size: calc(clamp(27px, 2vw, 34px) * var(--ui-scale));
  font-weight: 400;
  line-height: 1.2;
}

.section-question-list {
  margin: 22px 0 0;
  padding-left: 24px;
  font-size: calc(26px * var(--ui-scale));
  line-height: 1.4;
}

.section-summary {
  margin: 24px 0 0;
  color: var(--muted-color);
  font-size: calc(24px * var(--ui-scale));
  line-height: 1.45;
}

.section-lessons {
  margin-block: 60px 64px;
}

.lesson-card {
  min-height: 560px;
  padding: 34px 44px 40px;
  background: var(--card-background);
}

.lesson-card + .lesson-card {
  margin-top: 24px;
}

.is-ready .lesson-card + .lesson-card {
  margin-top: 0;
}

.lesson-carousel.is-ready .carousel-layout {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 12px;
  margin-inline: -52px;
}

.lesson-carousel.is-ready .carousel-arrow {
  width: 40px;
  padding-inline: 6px;
}

.lesson-question {
  margin: 0 0 44px;
  color: var(--muted-color);
  font-size: calc(27px * var(--ui-scale));
  font-style: italic;
  font-weight: 400;
}

.lesson-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
}

.lesson-theory-slot {
  min-height: 170px;
}

.lesson-card .lesson-examples-title {
  font-size: calc(26px * var(--ui-scale));
}

.lesson-examples-slot {
  min-height: 100px;
}

.lesson-formulas-slot {
  min-height: 270px;
}

.section-question-list li + li {
  margin-top: 8px;
}

.section-question-list a {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--divider-color);
  transition: text-decoration-color 180ms ease;
}

.section-question-list a:hover,
.section-question-list a[aria-current="true"] {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

.lesson-carousel[data-auto-height] {
  scroll-margin-top: 32px;
}

.lesson-carousel[data-auto-height].is-ready .topic-track {
  align-items: flex-start;
}

.lesson-carousel[data-auto-height].is-ready .carousel-layout {
  align-items: start;
}

.lesson-carousel[data-auto-height].is-ready .carousel-arrow {
  position: sticky;
  top: 104px;
  margin-top: 80px;
}

.section-page--lecture .lesson-question {
  margin-bottom: 32px;
  line-height: 1.35;
}

.section-page--lecture .lesson-body {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 3vw, 56px);
}

.section-page--lecture .lesson-copy,
.section-page--lecture .lesson-formulas {
  min-width: 0;
  font-size: calc(23px * var(--ui-scale));
  line-height: 1.48;
}

.section-page--lecture .lesson-theory-slot,
.section-page--lecture .lesson-examples-slot,
.section-page--lecture .lesson-formulas-slot {
  min-height: 0;
  margin-top: 22px;
}

.section-page--lecture .lesson-copy p {
  margin: 0 0 18px;
}

.section-page--lecture .lesson-copy p:last-child {
  margin-bottom: 0;
}

.section-page--lecture .lesson-card h4 {
  margin: 28px 0 12px;
  font-size: calc(24px * var(--ui-scale));
  font-weight: 400;
  line-height: 1.3;
}

.section-page--lecture .lesson-copy strong {
  font-weight: 600;
}

.section-page--lecture .lesson-examples-title {
  margin-top: 40px;
}

.section-page--lecture .lesson-formulas {
  border-left: 1px solid var(--divider-color);
  padding-left: 28px;
}

.lesson-example + .lesson-example,
.lesson-formula-group + .lesson-formula-group {
  margin-top: 24px;
  border-top: 1px solid #c9c5ba;
  padding-top: 24px;
}

.section-page--lecture .lesson-example h4 {
  margin-top: 0;
  color: var(--muted-color);
  font-size: calc(22px * var(--ui-scale));
  font-style: italic;
}

.lesson-calculation {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 8px;
}

.lesson-calculation math {
  margin: 0;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: calc(25px * var(--ui-scale));
  text-align: left;
}

.section-page--lecture .lesson-formula-group h4 {
  margin: 0 0 16px;
  font-size: calc(22px * var(--ui-scale));
}

.lesson-formula-group p:not(.formula-note) {
  margin: 16px 0 0;
  font-size: calc(20px * var(--ui-scale));
  line-height: 1.45;
}

.lesson-formula-group .formula-note {
  margin: 14px 0 10px;
}

.lesson-formula-group .formula-list {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 6px;
}

.lesson-comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(18px * var(--ui-scale));
  line-height: 1.4;
  text-align: left;
}

.lesson-comparison th,
.lesson-comparison td {
  padding: 9px 0;
  vertical-align: top;
  font-weight: 400;
}

.lesson-comparison th:first-child {
  padding-right: 14px;
}

.lesson-comparison thead {
  color: var(--muted-color);
}

.lesson-comparison tr {
  border-bottom: 1px solid #c9c5ba;
}

.lesson-properties {
  margin: 0;
  padding-left: 26px;
}

.lesson-properties li + li {
  margin-top: 10px;
}

.lesson-region-diagram {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin-top: 20px;
  font: italic 25px "Times New Roman", serif;
}

.lesson-carousel .topics-next {
  padding-right: 0;
}

.section-navigation-bottom {
  position: relative;
}

.section-navigation-bottom .chapter-nav {
  position: absolute;
  right: 0;
  bottom: 36px;
  left: 0;
}

@keyframes history-appear {
  from {
    transform: translateY(5px);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-height: 800px) {
  .history-stage {
    padding-top: 88px;
  }

  .history-body {
    padding-block: 4px;
  }

  .history-art {
    height: calc(250px * var(--ui-scale));
  }

  .history-art--painting,
  .history-art--data {
    height: auto;
  }
}

@media (max-height: 840px) {
  .section-navigation-bottom {
    padding-block: 24px 36px;
  }

  .section-navigation-bottom .chapter-nav {
    position: static;
  }
}

@media (max-width: 950px) {
  .quiz-hint-book {
    position: fixed;
    right: 18px;
    bottom: 80px;
    left: auto;
    width: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-hint-book,
  .quiz-book-close,
  .test-progress-tooltip,
  .quiz-close,
  .quiz-close-warning,
  .quiz-answer-input,
  .quiz-next,
  .cookie-notice,
  .cookie-notice-accept,
  .site-logo,
  .timeline-dates,
  .timeline-ticks,
  .timeline-tick.is-major,
  .skip-history,
  .is-ready .topic-track,
  .carousel-arrow svg,
  .carousel-dot::after,
  .topic-link,
  .test-progress-circle,
  .chapter-nav-number,
  .test-paper,
  .test-pencil,
  .test-action {
    transition: none;
  }

  .js .history-step:not([hidden]) .history-step-copy {
    animation: none;
  }
}
