:root {
  color-scheme: light dark;
  --paper: #efeee8;
  --ink: #252923;
  --muted: #696c62;
  --rule: #cecec3;
  --grid: #dcdcd1;
  --accent: #d34b2a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171918;
    --ink: #e5e7dd;
    --muted: #a4a89d;
    --rule: #3d423d;
    --grid: #292e29;
    --accent: #f07b57;
  }
  .light-label { display: none; }
  .dark-label { display: inline !important; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--paper); background: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.page {
  min-height: 100svh;
  max-width: 1920px;
  margin-inline: auto;
  padding-inline: clamp(22px, 4.1vw, 80px);
  display: flex;
  flex-direction: column;
}

.masthead {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: inherit;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.3px;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark-dot { color: var(--accent); }
.wordmark-suffix { font-weight: 400; }
.edition, .artwork-note, .footer {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.1px;
}
.edition { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.edition-line { width: 24px; height: 1px; background: var(--accent); }

main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.artwork {
  position: relative;
  width: min(100%, 960px);
  height: clamp(285px, 47svh, 540px);
  min-height: 285px;
  margin: 28px auto 0;
  background-image: radial-gradient(var(--grid) .7px, transparent .7px);
  background-size: 20px 20px;
  background-position: center;
}
.artwork-note { position: absolute; top: 8px; left: 18px; color: var(--muted); font-size: 9px; }
.sculpture { display: block; width: 100%; height: 100%; overflow: visible; }
.axis-lines { stroke: var(--rule); stroke-width: 1; }
.axis-dotted { stroke-dasharray: 2 7; }
#variable-form path { vector-effect: non-scaling-stroke; }
#variable-form .accent-contour { stroke: var(--accent); stroke-width: 1.6; }
.crosshair { position: absolute; width: 11px; height: 11px; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--muted); }
.crosshair::before { width: 11px; height: 1px; top: 5px; }
.crosshair::after { width: 1px; height: 11px; left: 5px; }
.crosshair-tl { top: 0; left: 0; }
.crosshair-tr { top: 0; right: 0; }
.crosshair-bl { bottom: 0; left: 0; }
.crosshair-br { bottom: 0; right: 0; }
.motion-button {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 13px;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
}
.motion-button:hover { color: var(--accent); border-color: var(--accent); }
.motion-button svg { width: 16px; height: 16px; }
.play-icon { display: none; }
.motion-button[aria-pressed="true"] .play-icon { display: block; }
.motion-button[aria-pressed="true"] .pause-icon { display: none; }

.message { position: relative; text-align: center; padding: 26px 0 42px; }
.status-marker { display: flex; justify-content: center; gap: 3px; margin-bottom: 15px; }
.status-marker span { width: 4px; height: 10px; background: var(--accent); }
.status-marker span:nth-child(2) { opacity: .65; }
.status-marker span:nth-child(3) { opacity: .3; }
h1 {
  margin: 0;
  font-size: clamp(48px, 6.2vw, 90px);
  line-height: .94;
  font-weight: 500;
  letter-spacing: -.065em;
}
.period { color: var(--accent); }
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 80px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
.width-control { display: flex; align-items: center; gap: 16px; }
.width-control label { cursor: pointer; }
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: clamp(64px, 10vw, 144px);
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: ew-resize;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--muted); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--muted); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 9px;
  height: 15px;
  margin-top: -7px;
  border: 2px solid var(--paper);
  border-radius: 0;
  background: var(--accent);
}
input[type="range"]::-moz-range-thumb { width: 5px; height: 11px; border: 2px solid var(--paper); border-radius: 0; background: var(--accent); }
output { min-width: 4ch; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.footer-mark { color: var(--accent); font-size: 16px; letter-spacing: -1px; grid-column: 2; }
.theme-status { display: flex; align-items: center; justify-content: flex-end; gap: 6px; grid-column: 3; white-space: nowrap; }
.theme-icon { width: 11px; height: 11px; border: 1px solid var(--muted); border-radius: 50%; background: linear-gradient(90deg, var(--muted) 50%, transparent 50%); margin-right: 4px; }
.dark-label { display: none; }
.auto-label { opacity: .7; }

@media (min-width: 1600px) and (min-height: 1000px) {
  .artwork { height: 52svh; max-height: 650px; width: min(100%, 1100px); }
  .message { padding-bottom: 60px; }
}

@media (max-width: 600px) {
  .masthead { min-height: 82px; }
  .wordmark { font-size: 24px; }
  .edition { font-size: 8px; letter-spacing: .5px; gap: 8px; }
  .edition-line { width: 12px; }
  .artwork { margin-top: 24px; height: clamp(280px, 43svh, 400px); }
  .artwork-note { font-size: 8px; left: 16px; }
  .sculpture { width: calc(100% + 24px); max-width: none; margin-left: -12px; }
  .message { padding: 32px 0 46px; }
  h1 { font-size: clamp(44px, 10.2vw, 62px); }
  .status-marker { margin-bottom: 20px; }
  .footer { min-height: 84px; gap: 16px; grid-template-columns: 1fr auto; font-size: 9px; letter-spacing: .6px; }
  .width-control { gap: 10px; }
  .footer-mark { display: none; }
  .theme-status { grid-column: 2; gap: 4px; }
  .theme-icon { margin-right: 2px; }
  .auto-label { display: none; }
}

@media (max-width: 359px) {
  .edition { display: none; }
  .width-control { gap: 8px; }
  .theme-icon { display: none; }
}

@media (max-height: 650px) and (min-width: 700px) {
  .masthead { min-height: 72px; }
  main { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
  .artwork { height: 360px; margin: 20px 0; }
  h1 { font-size: clamp(42px, 5vw, 72px); }
  .message { padding: 0; }
  .footer { min-height: 64px; }
}
