:root {
  --paper: #f3f0e7;
  --surface: #fffdf8;
  --ink: #171a20;
  --muted: #68716d;
  --line: rgb(23 26 32 / 14%);
  --purple: #8d5de0;
  --purple-dark: #5f339f;
  --purple-soft: #eee5ff;
  --green: #168d6c;
  --green-soft: #ddf2e9;
  --yellow: #f7c94b;
  --orange: #ef8c43;
  --shadow: 0 25px 72px rgb(38 42 38 / 13%);
  color-scheme: light;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 2%, rgb(22 141 108 / 14%), transparent 31rem),
    radial-gradient(circle at 95% 4%, rgb(141 93 224 / 22%), transparent 32rem),
    linear-gradient(135deg, #eff3ec 0%, var(--paper) 52%, #eee7db 100%);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

.page {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.eyebrow::before {
  width: 18px;
  height: 9px;
  border: solid var(--purple);
  border-width: 3px 0;
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

h1 {
  max-width: 880px;
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 800;
  line-height: 1.65;
}

.lead code {
  color: var(--purple-dark);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.button,
.support-chip,
.replay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.button,
.replay-button {
  border: 1px solid var(--line);
  background: white;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.button:hover,
.replay-button:hover {
  border-color: rgb(141 93 224 / 52%);
  transform: translateY(-1px);
}

.button:active,
.replay-button:active {
  transform: translateY(0);
}

.button--dark {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.button--dark:hover {
  border-color: var(--purple-dark);
  background: var(--purple-dark);
}

.support-chip {
  border: 1px solid rgb(22 141 108 / 25%);
  color: #0d5944;
  background: var(--green-soft);
}

.support-chip::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.support-chip.is-unsupported {
  border-color: rgb(239 140 67 / 30%);
  color: #844719;
  background: #ffecd9;
}

.support-chip.is-unsupported::before {
  background: var(--orange);
}

.workspace {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.control-panel,
.result-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgb(255 253 248 / 90%);
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.control-panel::-webkit-scrollbar {
  width: 8px;
}

.control-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgb(23 26 32 / 22%);
  background-clip: padding-box;
}

.panel-head,
.control-section {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div:first-child,
.preview-toolbar > div,
.code-head > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.panel-head p,
.preview-toolbar p,
.graph-head p,
.code-head p {
  color: var(--purple-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.panel-head h2,
.preview-toolbar h2,
.graph-head h2,
.code-head h2 {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.2;
}

.panel-head h2 {
  font-size: 18px;
  white-space: nowrap;
}

.section-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  color: white;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.section-number--purple {
  background: var(--purple);
}

.section-number--dark {
  background: var(--ink);
}

.mode-switch,
.preview-switch,
.code-switch {
  position: relative;
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eeede8;
}

.mode-switch button,
.preview-switch button,
.code-switch button {
  position: relative;
  z-index: 1;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.mode-switch button[aria-pressed="true"],
.preview-switch button[aria-pressed="true"],
.code-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 11px rgb(23 26 32 / 10%);
}

@supports (anchor-name: --selected-option) {
  .mode-switch::before,
  .preview-switch::before,
  .code-switch::before {
    position: absolute;
    z-index: 0;
    top: anchor(top);
    left: anchor(left);
    width: anchor-size(width);
    height: anchor-size(height);
    border-radius: 9px;
    background: white;
    box-shadow: 0 3px 11px rgb(23 26 32 / 10%);
    content: "";
    pointer-events: none;
    transition:
      top 260ms cubic-bezier(0.22, 1, 0.36, 1),
      left 260ms cubic-bezier(0.22, 1, 0.36, 1),
      width 260ms cubic-bezier(0.22, 1, 0.36, 1),
      height 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mode-switch button[aria-pressed="true"] {
    anchor-name: --mode-selected;
  }

  .mode-switch::before {
    position-anchor: --mode-selected;
  }

  .preview-switch button[aria-pressed="true"] {
    anchor-name: --preview-selected;
  }

  .preview-switch::before {
    position-anchor: --preview-selected;
  }

  .code-switch button[aria-pressed="true"] {
    anchor-name: --code-selected;
  }

  .code-switch::before {
    position-anchor: --code-selected;
    background: rgb(255 255 255 / 14%);
    box-shadow: none;
  }

  .mode-switch button[aria-pressed="true"],
  .preview-switch button[aria-pressed="true"],
  .code-switch button[aria-pressed="true"] {
    background: transparent;
    box-shadow: none;
  }
}

.control-section + .control-section,
.physics-summary {
  border-top: 1px solid var(--line);
}

.control-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.control-title > div > span {
  color: var(--purple-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.control-title h3 {
  margin-top: 3px;
  font-size: 16px;
}

.control-title > output {
  color: var(--purple-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.preset-grid button {
  display: grid;
  place-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 77px;
  padding: 9px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: white;
  font-size: 9px;
  font-weight: 900;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.preset-grid button:hover {
  border-color: rgb(141 93 224 / 50%);
  transform: translateY(-1px);
}

.preset-grid button[aria-pressed="true"] {
  border-color: var(--purple);
  color: var(--purple-dark);
  background: var(--purple-soft);
  box-shadow: inset 0 0 0 1px rgb(141 93 224 / 14%);
}

.preset-line {
  position: relative;
  display: block;
  width: 36px;
  height: 28px;
  overflow: hidden;
}

.preset-line::before {
  position: absolute;
  right: 1px;
  bottom: 4px;
  left: 1px;
  height: 2px;
  background: currentColor;
  content: "";
  transform-origin: left center;
}

.preset-line::after {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.preset-line--gentle::before {
  border-radius: 50%;
  transform: rotate(-28deg);
}

.preset-line--smooth::before {
  transform: rotate(-35deg);
}

.preset-line--snappy::before {
  bottom: 3px;
  height: 23px;
  clip-path: polygon(
    0 94%,
    7% 100%,
    48% 25%,
    56% 18%,
    100% 11%,
    100% 20%,
    59% 28%,
    12% 100%
  );
  background: currentColor;
  opacity: 1;
  transform: none;
}

.preset-line--snappy::after {
  top: 3px;
  right: 0;
  bottom: auto;
}

.preset-line--bouncy::before,
.preset-line--elastic::before {
  right: -4px;
  bottom: 11px;
  left: -4px;
  height: 12px;
  border: solid currentColor;
  border-width: 2px 0;
  border-radius: 50%;
  background: transparent;
  transform: rotate(-20deg);
}

.preset-line--elastic::before {
  height: 18px;
  transform: rotate(-14deg);
}

.range-field {
  display: grid;
  min-width: 0;
}

.range-field + .range-field {
  margin-top: 18px;
}

.range-field > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.range-field output {
  color: var(--purple-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

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

.range-scale {
  display: flex !important;
  justify-content: space-between;
  margin-top: 5px !important;
  margin-bottom: 0 !important;
  color: #8b918e !important;
  font-size: 9px !important;
  font-weight: 800;
}

.physics-grid {
  display: grid;
  gap: 16px;
}

.select-field,
.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.select-field {
  margin-top: 18px;
}

.select-field > span,
.switch-field > span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.select-field b,
.switch-field b {
  color: var(--ink);
  font-size: 11px;
}

.select-field small,
.switch-field small {
  line-height: 1.4;
}

.select-field select {
  min-width: 115px;
  height: 39px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 10px;
  font-weight: 900;
}

.preview-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.switch-field {
  margin-top: 15px;
  cursor: pointer;
}

.squash-field {
  padding: 11px 12px;
  border: 1px solid rgb(141 93 224 / 22%);
  border-radius: 12px;
  background: rgb(238 229 255 / 58%);
}

.squash-field b {
  color: var(--purple-dark);
}

.switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-field i {
  position: relative;
  flex: 0 0 auto;
  width: 43px;
  height: 25px;
  border-radius: 999px;
  background: #d5d6d1;
  transition: background-color 160ms ease;
}

.switch-field i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgb(23 26 32 / 20%);
  content: "";
  transition: transform 160ms ease;
}

.switch-field input:checked + i {
  background: var(--purple);
}

.switch-field input:checked + i::after {
  transform: translateX(18px);
}

.physics-summary {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  align-items: center;
  gap: 9px;
  padding: 15px 20px 18px;
  background: rgb(141 93 224 / 5%);
}

.physics-summary > span {
  writing-mode: vertical-rl;
  color: var(--purple-dark);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.physics-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.physics-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.physics-summary strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.result-panel {
  padding: 22px;
}

.preview-toolbar,
.graph-head,
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preview-toolbar {
  margin-bottom: 16px;
}

.replay-button {
  border-color: var(--purple);
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.replay-button span {
  margin-right: 7px;
  font-size: 18px;
  line-height: 1;
}

.motion-stage {
  display: grid;
  gap: 12px;
  min-height: 330px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background:
    radial-gradient(circle at 90% 12%, rgb(247 201 75 / 32%), transparent 180px),
    linear-gradient(rgb(23 26 32 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 26 32 / 5%) 1px, transparent 1px),
    #efede5;
  background-size: auto, 22px 22px, 22px 22px, auto;
  overflow: hidden;
}

.motion-lane {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgb(255 253 248 / 86%);
}

.motion-lane header {
  display: grid;
  gap: 4px;
}

.motion-lane header span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.motion-lane header strong {
  font-size: 15px;
}

.motion-lane--spring {
  border-color: rgb(141 93 224 / 36%);
  background: rgb(238 229 255 / 67%);
}

.motion-lane--spring header span,
.motion-lane--spring header strong {
  color: var(--purple-dark);
}

.motion-track {
  position: relative;
  min-width: 0;
  height: 98px;
  border: 1px solid rgb(23 26 32 / 9%);
  border-radius: 13px;
  background:
    linear-gradient(90deg, transparent 0 9%, rgb(23 26 32 / 10%) 9% calc(9% + 1px), transparent calc(9% + 1px) 91%, rgb(23 26 32 / 10%) 91% calc(91% + 1px), transparent calc(91% + 1px)),
    rgb(255 255 255 / 55%);
  overflow: hidden;
}

.motion-object {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 9%;
  display: grid;
  place-items: center;
  width: 72px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 6px 7px 0 rgb(23 26 32 / 12%);
  font-size: 9px;
  font-weight: 900;
  transform: translateY(-50%);
  will-change: transform, scale, opacity;
}

.motion-lane--spring .motion-object {
  color: white;
  background: var(--purple);
}

.motion-stage--scale .motion-track,
.motion-stage--panel .motion-track {
  display: grid;
  place-items: center;
}

.motion-stage--scale .motion-object {
  position: relative;
  top: auto;
  left: auto;
  width: 112px;
  height: 68px;
  border-radius: 17px;
  transform: none;
}

.motion-stage--panel .motion-object {
  position: relative;
  top: auto;
  left: auto;
  justify-items: start;
  width: 150px;
  height: 64px;
  padding: 13px;
  border-radius: 16px;
  transform: none;
}

.motion-stage--panel .motion-object::before,
.motion-stage--panel .motion-object::after {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  content: "";
}

.motion-stage--panel .motion-object::before {
  width: 70%;
}

.motion-stage--panel .motion-object::after {
  width: 44%;
  opacity: 0.5;
}

.motion-stage--panel .motion-object span {
  display: none;
}

.graph-section {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

.metric-list {
  display: flex;
  gap: 7px;
}

.metric-list > div {
  display: grid;
  gap: 2px;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 11px;
  background: #f1efe9;
}

.metric-list span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}

.metric-list strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.graph-wrap {
  position: relative;
  height: 260px;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f7f6f1;
  overflow: hidden;
}

#springGraph {
  display: block;
  width: 100%;
  height: 100%;
}

.graph-label {
  position: absolute;
  z-index: 1;
  color: rgb(23 26 32 / 46%);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.graph-label--target {
  top: 25%;
  right: 9px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgb(255 255 255 / 72%);
}

.graph-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 99px;
}

.legend-line--ease {
  background: #8b938f;
}

.legend-line--spring {
  background: var(--purple);
}

.code-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #101417;
  overflow: hidden;
}

.code-head {
  padding: 16px 17px;
  border-bottom: 1px solid rgb(255 255 255 / 11%);
}

.code-head p {
  color: #c3a7fa;
}

.code-head h2 {
  color: white;
}

.code-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.code-switch {
  border-color: rgb(255 255 255 / 10%);
  background: rgb(255 255 255 / 8%);
}

.code-switch button {
  color: rgb(255 255 255 / 58%);
}

.code-switch button[aria-pressed="true"] {
  color: white;
  background: rgb(255 255 255 / 14%);
  box-shadow: none;
}

.button--copy {
  border-color: var(--purple);
  color: white;
  background: var(--purple);
}

.button--copy:hover {
  color: white;
  background: #a477ef;
}

.code-panel pre {
  min-height: 185px;
  max-height: 330px;
  padding: 22px;
  color: #edf5f1;
  overflow: auto;
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.7;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 39px;
  padding: 10px 16px;
  border-top: 1px solid rgb(255 255 255 / 9%);
  color: rgb(255 255 255 / 48%);
  font-size: 9px;
  font-weight: 800;
}

.copy-status {
  color: #aee8d5;
}

.usage-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
  padding: 14px 16px;
  border: 1px solid rgb(141 93 224 / 23%);
  border-radius: 16px;
  color: #635a70;
  background: var(--purple-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.55;
}

.usage-note > strong {
  color: var(--purple-dark);
  font-size: 9px;
  letter-spacing: 0.11em;
}

.usage-note a {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(141 93 224 / 38%);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 370px minmax(0, 1fr);
  }

  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .motion-lane {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .page {
    width: min(760px, calc(100% - 32px));
    padding-top: 24px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
    grid-row: 2;
    max-height: none;
    overflow: visible;
  }

  .result-panel {
    grid-row: 1;
  }

  .preset-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 680px) {
  .page {
    width: min(100% - 22px, 600px);
    padding-top: 17px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero {
    gap: 18px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .support-chip {
    grid-column: 1 / -1;
  }

  .button {
    width: 100%;
  }

  .result-panel {
    grid-row: 2;
    padding: 13px;
    border-radius: 21px;
  }

  .control-panel {
    grid-row: 1;
  }

  .preview-toolbar,
  .graph-head,
  .code-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .replay-button {
    align-self: stretch;
  }

  .motion-stage {
    min-height: 390px;
    padding: 12px;
  }

  .motion-lane {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 9px;
    padding: 12px;
  }

  .motion-track {
    height: 100px;
  }

  .metric-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .metric-list > div {
    min-width: 0;
  }

  .graph-wrap {
    height: 220px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .physics-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .physics-summary > span {
    grid-column: 1 / -1;
    writing-mode: horizontal-tb;
  }

  .code-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .code-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .code-panel pre {
    min-height: 170px;
    padding: 17px;
  }

  .code-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .usage-note {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
