@font-face {
  font-family: DM Sans;
  src: url(/static/fonts/dm-sans.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url(/static/fonts/fraunces.woff2) format("woff2");
  font-weight: 400 650;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url(/static/fonts/fraunces-italic.woff2) format("woff2");
  font-weight: 400 650;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --panel: #fdfaf3;
  --ink: #292520;
  --quiet: #6d6257;
  --line: #ded5c7;
  --accent: #aa3d2c;
  --accent-hover: #8d3022;
  --display: Fraunces, Georgia, serif;
  --sans: DM Sans, system-ui, sans-serif;
  --mono: "Courier New", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 20rem; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.symbol-library, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-width { width: min(100% - 6rem, 76rem); margin-inline: auto; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  height: 4.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font: 625 2rem/.8 var(--display);
  letter-spacing: -.075em;
  text-decoration: none;
}

.brand > svg { width: 2rem; height: 2rem; color: var(--accent); }
.brand span span { color: var(--accent); }
.masthead nav a {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 650;
}

.masthead nav a:hover { color: var(--accent); }
.masthead .editor-link { display: none; }
.masthead nav svg, .primary svg, .zone svg, .theme-label svg, .event-date svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.workspace { padding-block: 2.6rem 3.2rem; }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(22rem, 32%, 25.5rem);
  column-gap: clamp(2rem, 4vw, 3.6rem);
  grid-template-areas:
    "intro editor"
    "preview editor"
    "themes editor";
}

.intro { grid-area: intro; min-width: 0; }
.intro h1 {
  font: 480 clamp(3.9rem, 6.4vw, 6.1rem)/.93 var(--display);
  letter-spacing: -.067em;
}

.intro em { font-weight: inherit; color: var(--accent); }
.intro p {
  margin-top: 1.15rem;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  color: var(--quiet);
  line-height: 1.45;
}

.preview { grid-area: preview; min-width: 0; margin-top: 1.75rem; }
.stage, .mini, .display-page {
  --scene-ink: #523a2c;
  --scene-edge: #d3b998;
  --scene-top: #e8ceb1;
  --scene-light: #f5dec0;
  --scene-bottom: #d9b795;
  --mount-width: 77%;
  --clock-ratio: 2.78;
  background-color: var(--scene-top);
  background-image:
    url(/static/grain.png),
    radial-gradient(ellipse at 48% 26%, var(--scene-light), transparent 68%),
    linear-gradient(173deg, transparent 39%, var(--scene-bottom) 100%);
}

.scene-digital {
  --scene-ink: #354037;
  --scene-edge: #adb7a2;
  --scene-top: #bac6b1;
  --scene-light: #e1e9d8;
  --scene-bottom: #a4af9c;
  --mount-width: 72%;
  --clock-ratio: 2.74;
}

.scene-binary {
  --scene-ink: #f4dfc6;
  --scene-edge: #5b4861;
  --scene-top: #524257;
  --scene-light: #6f5a74;
  --scene-bottom: #382f3e;
  --mount-width: 72%;
  --clock-ratio: 2.62;
}

.scene-flap {
  --scene-ink: #633b31;
  --scene-edge: #dbb2a1;
  --scene-top: #e4beae;
  --scene-light: #f5dacb;
  --scene-bottom: #cd9889;
  --mount-width: 75%;
  --clock-ratio: 2.68;
}

.stage {
  width: 100%;
  min-height: 22.25rem;
  aspect-ratio: 2.18;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--scene-edge);
  border-radius: .65rem;
  color: var(--scene-ink);
  padding: 1.1rem 1.25rem 1rem;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  border-radius: .45rem;
  opacity: .14;
  pointer-events: none;
  z-index: -1;
}

.stage-top, .stage-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
}

.stage-top {
  font-family: var(--mono);
  font-size: .77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.preview-label { display: inline-flex; gap: .55rem; align-items: center; }
.preview-label > span, .shared-state > span {
  width: .43rem;
  height: .43rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.preview-label > span { color: #983831; box-shadow: 0 0 0 2px #98383120; }
.scene-binary .preview-label > span { color: #ffd383; box-shadow: 0 0 0 2px #ffd38324; }
.stage-bottom {
  padding-top: .8rem;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: .875rem;
}

.stage-bottom > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-bottom > span:first-child { font-weight: 700; }
.stage-bottom > span:last-child { flex-shrink: 0; }
.clock-mount {
  display: block;
  width: var(--mount-width);
  max-width: 34rem;
  margin: auto;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
}

.instrument {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: auto;
  isolation: isolate;
  font-family: var(--mono);
}

.instrument::before {
  content: "";
  position: absolute;
  inset: 83% -5% -11% -3%;
  z-index: -2;
  transform: skewX(-17deg);
  border-radius: 48%;
  background: #26160eb5;
  filter: blur(2.6cqw);
}

.instrument::after {
  content: "";
  position: absolute;
  inset: 97% 5% -3% 6%;
  z-index: -1;
  border-radius: 30%;
  background: #261a17;
  filter: blur(.65cqw);
  opacity: .62;
}

.clock-face, .readout, .unit, .digits { min-width: 0; }
.clock-face {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.readout {
  display: grid;
  grid-template-columns: minmax(0, var(--days-width, 1fr)) repeat(3, minmax(0, 1fr));
  gap: 1.25cqw;
}

.readout.expanded { --days-width: 1.6fr; }
.readout.three-digit { --days-width: 1.25fr; }
.readout.wide { --days-width: 2.1fr; }
.unit { text-align: center; }
.digits {
  display: flex;
  justify-content: center;
  gap: .45cqw;
  align-items: stretch;
}

.unit-name {
  display: block;
  margin-top: 1cqw;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 1.65cqw;
  font-weight: bold;
  letter-spacing: .1em;
}

.instrument-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.65cqw;
  line-height: 1;
  white-space: nowrap;
  font-weight: bold;
  letter-spacing: .13em;
}

/* Walnut cabinet, woven speaker cloth, and an enamel display bezel. */
.clock-radio {
  aspect-ratio: var(--clock-ratio);
  padding: 2.1cqw;
  gap: 1.55cqw;
  border-radius: 4.5cqw;
  background:
    url(/static/grain.png),
    repeating-linear-gradient(2deg, #28130d44 0 .11cqw, #8b5a3714 .2cqw .67cqw, #daa77626 .72cqw .79cqw),
    repeating-linear-gradient(178deg, transparent 0 .93cqw, #2b150c49 1.32cqw, transparent 1.65cqw 2.15cqw),
    linear-gradient(180deg, #a2724d 0%, #633e29 9%, #825133 14%, #4f2c1e 63%, #633922 89%, #3c231a 99%);
  box-shadow: inset 0 .3cqw .3cqw #f2c792b5, inset .4cqw 0 .55cqw #6e402b,
              inset -.5cqw -.55cqw 1cqw #2b160f, 0 .85cqw .75cqw #3b251f60;
}

.speaker {
  position: relative;
  display: block;
  flex: 0 0 26%;
  border-radius: 2.45cqw 1.05cqw 1.05cqw 2.45cqw;
  background:
    radial-gradient(circle, #23170d 18%, #46301d 30%, transparent 42%) 0 0 / 1cqw 1cqw,
    repeating-linear-gradient(0deg, #eac28a38 0 .08cqw, transparent .12cqw .35cqw),
    repeating-linear-gradient(90deg, #5b3b1fa1 0 .08cqw, transparent .13cqw .33cqw),
    radial-gradient(ellipse at 39% 20%, #c39b60, #a27843 55%, #78512e);
  border: .22cqw solid #2e1b12;
  box-shadow: inset 0 0 1.4cqw #3b251fb0, 0 .15cqw .2cqw #ca9b737a;
}

.speaker::before {
  content: "";
  position: absolute;
  inset: 6% 8% 25%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #3e271121 50%, #f9cc8220 66%, transparent 74%);
}

.radio-knob {
  position: absolute;
  width: 6.1cqw;
  height: 6.1cqw;
  left: 50%;
  bottom: 1.7cqw;
  transform: translateX(-50%);
  border: .28cqw solid #302016;
  border-radius: 50%;
  background:
    radial-gradient(circle, #74401a 0 .13cqw, transparent .27cqw),
    repeating-conic-gradient(#4c2b1410 0deg 5deg, #ffe2a34a 6deg 9deg, #4c2b1422 10deg 13deg),
    radial-gradient(circle, #895024, #e5bf7d 42%, #694524 61%, #e8c78a 69%, #623d1f 75%);
  box-shadow: .2cqw .35cqw .65cqw #26170ad1;
}

.clock-radio .clock-face {
  border-radius: 1.05cqw 2.5cqw 2.5cqw 1.05cqw;
  padding: 1.55cqw 2.6cqw 1.35cqw;
  gap: 1.65cqw;
  background: url(/static/grain.png), linear-gradient(163deg, #ede1ba, #e4d1a6 52%, #bda575);
  color: #523925;
  border: .2cqw solid #392317;
  box-shadow: inset 0 .4cqw .5cqw #fff0c8b3, inset 0 -.22cqw .55cqw #6a492e80;
}

.clock-radio .instrument-brand > span:first-child {
  font: italic 620 3.5cqw/.75 var(--display);
  letter-spacing: -.055em;
}

.clock-radio .instrument-brand > span:last-child { font-size: 1.4cqw; }
.clock-radio .readout { gap: .8cqw; }
.clock-radio .unit {
  padding: .65cqw .48cqw .75cqw;
  border-radius: .65cqw;
  background: linear-gradient(163deg, #382a25, #241d1c);
  color: #e0cba0;
  box-shadow: inset 0 .3cqw .45cqw #170f0e, 0 .2cqw .18cqw #fff2c4ac;
}

.clock-radio .digits { height: 13cqw; }
.clock-radio .unit-name { font-size: 1.5cqw; }
.number-tile {
  --fold-time: 145ms;
  --drop-time: 240ms;
  --tile-radius: .37cqw;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  perspective: 32cqw;
  border-radius: var(--tile-radius);
  font: 700 10.1cqw/.9 var(--mono);
  letter-spacing: -.08em;
}

.clock-radio .number-tile {
  --upper-surface: linear-gradient(#302825, #2c2522);
  --lower-surface: linear-gradient(#39312b, #25201d);
  --tile-edge: #94806e48;
  background: #2c2522;
  color: #f2dfb6;
  text-shadow: 0 .22cqw .18cqw #130f0a;
}

.flip-half {
  position: absolute;
  inset-inline: 0;
  height: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 .11cqw var(--tile-edge);
  backface-visibility: hidden;
}

.flip-upper {
  top: 0;
  transform-origin: center bottom;
  border-radius: var(--tile-radius) var(--tile-radius) 0 0;
  background: var(--upper-surface);
}

.flip-lower {
  bottom: 0;
  transform-origin: center top;
  border-radius: 0 0 var(--tile-radius) var(--tile-radius);
  background: var(--lower-surface);
}

.flip-glyph {
  position: absolute;
  inset-inline: 0;
  display: grid;
  place-items: center;
  height: 200%;
  padding-right: .26cqw;
}

.flip-upper .flip-glyph { top: 0; }
.flip-lower .flip-glyph { bottom: 0; }

.number-tile::after {
  content: "";
  position: absolute;
  inset: calc(50% - .125cqw) 0 auto;
  height: .25cqw;
  z-index: 3;
  background: #110c0a99;
  box-shadow: 0 .1cqw #e2c89b2a;
}

.flip-hold, .flip-fold, .flip-drop {
  visibility: hidden;
  pointer-events: none;
}

.flip-hold {
  z-index: 1;
  animation: hold-lower calc(var(--fold-time) + var(--drop-time)) linear;
}

.flip-fold {
  z-index: 2;
  animation: fold-upper var(--fold-time) cubic-bezier(.42, .05, .86, .65);
}

.flip-drop {
  z-index: 2;
  animation: drop-lower var(--drop-time) cubic-bezier(.2, .6, .35, 1) var(--fold-time);
}

@keyframes hold-lower {
  from, to { visibility: visible; }
}

@keyframes fold-upper {
  from { visibility: visible; transform: rotateX(0deg); filter: brightness(1); }
  to { visibility: visible; transform: rotateX(-90deg); filter: brightness(.56); }
}

@keyframes drop-lower {
  0% { visibility: visible; transform: rotateX(90deg); filter: brightness(.63); }
  76% { visibility: visible; transform: rotateX(-7deg); filter: brightness(1.06); }
  100% { visibility: visible; transform: rotateX(0deg); filter: brightness(1); }
}

.expanded .unit:first-child .number-tile { font-size: 7.4cqw; }
.wide .unit:first-child .number-tile { font-size: 5.7cqw; }

/* Seven-segment quartz display in a textured molded shell. */
.clock-digital {
  aspect-ratio: var(--clock-ratio);
  padding: 2.15cqw 2.7cqw 2.4cqw;
  border: .38cqw solid #242927;
  border-radius: 4.65cqw;
  background: url(/static/grain.png), linear-gradient(168deg, #454b47, #2a302d 53%, #444b45 95%);
  box-shadow: inset 0 .35cqw .35cqw #a5ada695, inset 0 -.4cqw .48cqw #111713,
              0 .65cqw .3cqw #222924a8, 0 1.2cqw .7cqw #28312a64;
}

.clock-digital .clock-face {
  padding: 1.3cqw 3cqw 1.05cqw;
  gap: 1.45cqw;
  border: .4cqw solid #262f2b;
  border-radius: 2.7cqw;
  background: url(/static/grain.png), linear-gradient(149deg, #222b29 58%, #2c3430 61%, #181d1b);
  color: #e2e8de;
  box-shadow: inset 0 0 0 .24cqw #b9c9b2, inset 0 0 0 .72cqw #52645c, 0 .2cqw .45cqw #121813;
}

.clock-digital .instrument-brand > span:first-child { font-size: 2.2cqw; }
.clock-digital .instrument-brand > span:last-child { color: #c3d6c6; }
.clock-digital .readout {
  gap: 2cqw;
  padding: 2cqw 1.9cqw 1.2cqw;
  color: #283827;
  background: url(/static/grain.png), linear-gradient(169deg, #acbf9a, #c0cb9e 49%, #a1ae81);
  border-radius: .55cqw;
  box-shadow: inset .25cqw .45cqw .7cqw #435037b0, 0 .18cqw .2cqw #8c9c8185;
}

.clock-digital .digits { height: 13cqw; gap: .65cqw; }
.clock-digital .unit-name { margin-top: .8cqw; font-size: 1.5cqw; }
.segment-digit {
  position: relative;
  display: block;
  flex: 0 1 6.4cqw;
  min-width: 0;
  height: 100%;
  transform: skewX(-7deg);
}

.segment {
  position: absolute;
  background: currentColor;
  opacity: .10;
}

.segment.on { opacity: 1; }
.segment:nth-child(1), .segment:nth-child(4), .segment:nth-child(7) {
  left: 12%;
  width: 76%;
  height: 12%;
  clip-path: polygon(13% 0, 87% 0, 100% 50%, 87% 100%, 13% 100%, 0 50%);
}

.segment:nth-child(1) { top: 0; }
.segment:nth-child(4) { bottom: 0; }
.segment:nth-child(7) { top: 44%; }
.segment:nth-child(2), .segment:nth-child(3), .segment:nth-child(5), .segment:nth-child(6) {
  width: 18%;
  height: 43%;
  clip-path: polygon(50% 0, 100% 13%, 100% 87%, 50% 100%, 0 87%, 0 13%);
}

.segment:nth-child(2), .segment:nth-child(6) { top: 4%; }
.segment:nth-child(3), .segment:nth-child(5) { bottom: 4%; }
.segment:nth-child(2), .segment:nth-child(3) { right: 0; }
.segment:nth-child(5), .segment:nth-child(6) { left: 0; }

/* Amber indicators on a smoked-glass panel. */
.clock-binary {
  aspect-ratio: var(--clock-ratio);
  padding: 2.45cqw 2.8cqw;
  border: .28cqw solid #211920;
  border-radius: 2.25cqw;
  background: url(/static/grain.png), linear-gradient(158deg, #51444f, #302832 33%, #28232e 92%, #60525c);
  box-shadow: inset 0 .38cqw .3cqw #a4929da0, inset 0 -.36cqw .58cqw #141118, 0 .63cqw .5cqw #1d171d99;
}

.clock-binary .clock-face {
  gap: 1.5cqw;
  padding: 1.55cqw 3cqw 1.35cqw;
  background: linear-gradient(166deg, #332730, #241c26 66%);
  border: .2cqw solid #1e151e;
  border-radius: 1cqw;
  color: #efc197;
  box-shadow: inset 0 .22cqw .4cqw #b3787050, 0 .2cqw .3cqw #6e5e6c77;
}

.clock-binary .instrument-brand {
  color: #dec3af;
  padding-bottom: 1cqw;
  border-bottom: .15cqw solid #b884745a;
}

.clock-binary .instrument-brand > span:first-child { font-size: 2.1cqw; }
.binary-display { position: relative; padding-left: 4cqw; }
.bit-key {
  position: absolute;
  left: .3cqw;
  top: 0;
  height: 17cqw;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  place-items: center;
  font-size: 1.95cqw;
  color: #b9988f;
}

.clock-binary .digits { height: 17cqw; gap: 2cqw; }
.bit-column {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  place-items: center;
  flex: 0 1 3.6cqw;
}

.bit {
  display: block;
  width: 2.7cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 20%, #775548, #493339 50%, #3e2d36);
  box-shadow: inset 0 .16cqw .32cqw #211721, 0 .12cqw .18cqw #95685c66;
}

.bit.on {
  background: radial-gradient(circle at 43% 35%, #fff1bd 3%, #ffd783 56%, #f39048 100%);
  box-shadow: 0 0 1.5cqw #ef9e4ec9, 0 0 .45cqw #ffb040, inset 0 .14cqw .2cqw #fff4bb;
}

.clock-binary .expanded .unit:first-child .digits, .clock-binary .wide .unit:first-child .digits { gap: .45cqw; }
.clock-binary .wide .unit:first-child .bit { width: 2.1cqw; }

/* Powder-coated station board with mechanical flap seams. */
.clock-flap {
  aspect-ratio: var(--clock-ratio);
  padding: 2.2cqw;
  border-radius: 2.3cqw;
  background: url(/static/grain.png), linear-gradient(174deg, #be5843, #ab3c2a 76%, #803325);
  border: .19cqw solid #713e2e;
  box-shadow: inset 0 .42cqw .4cqw #ffa485af, inset 0 -.48cqw .5cqw #6f2c21, 0 .8cqw .55cqw #73362780;
}

.clock-flap .clock-face {
  padding: 1.6cqw 2.4cqw 1.15cqw;
  gap: 1.65cqw;
  color: #f4d0b1;
  border: .24cqw solid #652d25;
  border-radius: 1.35cqw;
  background: url(/static/grain.png), linear-gradient(#772e27, #921f1a);
  box-shadow: inset 0 .3cqw .65cqw #421915a1, 0 .23cqw .3cqw #f0987280;
}

.clock-flap .instrument-brand > span:first-child { font-size: 2.2cqw; }
.clock-flap .readout { gap: 1.5cqw; }
.clock-flap .digits { height: 15.1cqw; }
.clock-flap .number-tile {
  --fold-time: 165ms;
  --drop-time: 280ms;
  --upper-surface: linear-gradient(#efddc4, #e7d0b4);
  --lower-surface: linear-gradient(#ddba98, #edcfac);
  --tile-edge: #f6dfc9c4;
  font-size: 11.6cqw;
  background: #e9d4b8;
  color: #56281f;
  box-shadow: 0 .31cqw .26cqw #34130fc2;
}

.clock-flap .three-digit .unit:first-child .number-tile { font-size: 9.5cqw; }
.clock-flap .number-tile::after { height: .32cqw; background: #69382d99; }

.themes { grid-area: themes; margin-top: 1.55rem; scroll-margin-top: 1rem; }
.themes h2, .editor h2 {
  font: 560 1.55rem/1.1 var(--display);
  letter-spacing: -.045em;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .8rem;
}

.theme-button {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .3rem;
  border-radius: .55rem;
  min-width: 0;
  text-align: left;
  color: var(--ink);
  transition: background-color .15s, border-color .15s;
}

.theme-button:hover { border-color: #9c8070; }
.theme-button[aria-pressed="true"] { border-color: var(--accent); background: #fbefe4; }
.mini {
  display: grid;
  place-items: center;
  aspect-ratio: 2.18;
  border-radius: .3rem;
  overflow: hidden;
}

.mini .clock-mount { width: calc(var(--mount-width) + 2%); }
.theme-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .15rem;
  padding: .35rem .2rem .2rem;
  font-size: .875rem;
  font-weight: 650;
}

.theme-label svg { width: 1rem; height: 1rem; visibility: hidden; color: var(--accent); }
.theme-button[aria-pressed="true"] .theme-label svg { visibility: visible; }

.editor {
  grid-area: editor;
  align-self: start;
  min-width: 0;
  scroll-margin-top: 1rem;
  padding: clamp(1.2rem, 2.2vw, 1.85rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .65rem;
  box-shadow: 0 2px 3px #4c301411, 0 12px 30px -23px #4c301444;
}

.editor h2 { font-size: 2.05rem; }
.editor form { display: grid; gap: 1.02rem; margin-top: 1.4rem; }
.field { min-width: 0; }
.field > label, .precision legend {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding: 0;
  font-size: .91rem;
  font-weight: 700;
  margin-bottom: .39rem;
}

.field > label span, .hint {
  color: var(--quiet);
  font-size: .805rem;
  font-weight: 400;
}

.field > label span { margin-left: auto; }
.editor input:not([type="radio"]), .link-field {
  width: 100%;
  height: 2.8rem;
  border-radius: .35rem;
  border: 1px solid #d9cebe;
  background: #fffcf6;
  color: var(--ink);
  padding: 0 .65rem;
  font-size: .94rem;
}

.editor input::placeholder { color: #81726a; opacity: 1; }
.editor input[aria-invalid="true"], .link-field:has(input[aria-invalid="true"]) { border-color: var(--accent); }
.precision { margin: 0; padding: 0; border: 0; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: .19rem;
  background: #eee8dc;
  border: 1px solid #e6dece;
  border-radius: .4rem;
  gap: .2rem;
}

.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.segmented span {
  display: block;
  text-align: center;
  padding: .43rem .15rem;
  border: 1px solid transparent;
  border-radius: .29rem;
  color: #64584f;
  font-size: .875rem;
  font-weight: 600;
}

.segmented input:checked + span {
  border-color: #ddd2c2;
  background: #fffaf1;
  color: var(--ink);
  box-shadow: 0 1px 2px #2b1d1521;
}

.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.date-fields { display: grid; gap: .65rem; grid-template-columns: 1fr 1fr; }
.date-fields.date-only { grid-template-columns: 1fr; }
.editor input[type="date"], .editor input[type="time"] { min-width: 0; font-variant-numeric: tabular-nums; }
.zone {
  display: flex;
  align-items: center;
  gap: .36rem;
  margin-top: -.5rem;
  min-height: 1.15rem;
  color: var(--quiet);
  font-size: .81rem;
  line-height: 1.4;
}

.zone svg { width: 1rem; height: 1rem; }
.slug-field { border-top: 1px solid #e6ddd0; padding-top: .95rem; }
.link-field {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.link-field > span { color: var(--accent); font: 700 1rem var(--mono); }
.editor .link-field input {
  padding: 0;
  height: calc(100% - 2px);
  border: 0;
  background: transparent;
  outline: 0;
}

.link-field:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.hint { line-height: 1.4; margin-top: .36rem; }
.form-error { color: var(--accent); font-size: .875rem; line-height: 1.4; }
.primary {
  min-height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  padding: .55rem 1rem;
  border: 1px solid #983625;
  border-radius: .35rem;
  color: #fffbf3;
  background: var(--accent);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: inset 0 1px #ffffff22, 0 1px 2px #4e241b2a;
  transition: background-color .15s;
}

.primary:hover { background: var(--accent-hover); }
.primary:disabled { opacity: .7; cursor: wait; }

.display-page {
  --display-gutter: clamp(1rem, 3.5vw, 3.75rem);
  --display-accent: #983831;
  --display-rule: color-mix(in srgb, currentColor 24%, transparent);
  --display-surface: color-mix(in srgb, var(--scene-top) 48%, var(--scene-light));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--scene-ink);
}

.display-page.scene-binary { --display-accent: #ffd383; }
.display-page :focus-visible { outline-color: var(--display-accent); }
.display-page .masthead { border-color: var(--display-rule); }
.display-page .masthead-inner {
  width: auto;
  height: auto;
  min-height: 3.75rem;
  margin-inline: var(--display-gutter);
}

.display-page .brand > svg, .display-page .brand span span { color: var(--display-accent); }
.display-page .masthead nav { display: flex; align-items: center; gap: .45rem; }
.display-control, .display-page .masthead nav .display-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .35rem .65rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: .4rem;
  border: 1px solid var(--display-rule);
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-size: .865rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.display-control:hover, .display-page .masthead nav .display-control:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
}

.countdown-display {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(8rem, 1fr) auto;
  padding: clamp(1.35rem, 4vh, 3rem) var(--display-gutter) 1.05rem;
  overflow-x: clip;
}

.display-heading { min-width: 0; text-align: center; }
.display-heading h1 {
  max-width: 24ch;
  margin-inline: auto;
  font: 480 clamp(2.4rem, 6.25vw, 6.3rem)/.97 var(--display);
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.shared-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin-bottom: .85rem;
  color: var(--display-accent);
  font: 700 .83rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.display-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  container-type: size;
}

.display-frame .clock-mount {
  width: min(94cqw, calc(86cqh * var(--clock-ratio)));
  max-width: none;
}

.display-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  border-top: 1px solid var(--display-rule);
  padding-top: .8rem;
}

.event-date {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
  line-height: 1.45;
}

.event-date > div { display: flex; flex-wrap: wrap; gap: .1rem .75rem; }
.event-date svg { color: var(--display-accent); }
.event-date time { font-weight: 700; }
.display-theme {
  font: 700 .77rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.share-feedback {
  position: absolute;
  z-index: 4;
  inset: .5rem var(--display-gutter) auto auto;
  max-width: calc(100% - var(--display-gutter) * 2);
  display: grid;
  gap: .3rem;
  justify-items: end;
}

.share-feedback > p:not(:empty), .share-feedback > input {
  padding: .55rem .7rem;
  border: 1px solid var(--display-rule);
  border-radius: .4rem;
  background: var(--display-surface);
  color: inherit;
  font-size: .875rem;
  box-shadow: 0 .25rem .65rem #23130d26;
}

.share-feedback input { width: min(21rem, 100%); }

.missing .primary { margin-top: 1.5rem; }

@media (max-width: 65rem) {
  .page-width { width: calc(100% - 4rem); }
  .workspace-grid { column-gap: 1.7rem; }
  .stage { min-height: 18.75rem; }
}

@media (max-width: 54rem) {
  .page-width { width: min(100% - 3rem, 42rem); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace-grid { grid-template-areas: "intro" "preview" "themes" "editor"; }
  .workspace-grid .editor { margin-top: 1.55rem; }
  .masthead .browse-link { display: none; }
  .masthead .editor-link { display: flex; }
  .workspace { padding-top: 2rem; }
  .intro h1 { font-size: clamp(3.35rem, 10.5vw, 5.6rem); }
}

@media (max-width: 30rem) {
  .page-width { width: calc(100% - 2rem); }
  .masthead-inner { height: 3.85rem; }
  .intro p { margin-top: .8rem; }
  .preview { margin-top: 1.2rem; }
  .stage { min-height: 14.5rem; padding: .75rem .75rem .7rem; }
  .stage-top { font-size: .69rem; letter-spacing: .065em; }
  .stage-bottom { gap: .35rem .6rem; padding-top: .5rem; font-size: .8rem; }
  .stage .clock-mount { width: min(94%, calc(var(--mount-width) + 12%)); }
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .editor input:not([type="radio"]) { font-size: 1rem; }
}

@media (max-width: 40rem) {
  .display-page .display-new span { display: none; }
  .display-page .brand { font-size: 1.7rem; }
  .display-page .brand > svg { width: 1.65rem; height: 1.65rem; }
  .display-control, .display-page .masthead nav .display-control {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  .display-frame .clock-mount { width: min(100cqw, calc(86cqh * var(--clock-ratio))); }
}

@media (max-width: 40rem) and (orientation: portrait) {
  .countdown-display { grid-template-rows: 1fr auto 1fr; }
  .display-heading {
    align-self: end;
    padding-bottom: clamp(1.15rem, 3.2vh, 1.8rem);
  }
  .display-frame { container-type: inline-size; }
  .display-frame .clock-mount { width: 100%; }
  .display-details { align-self: end; }
}

@media (max-height: 34rem) and (orientation: landscape) {
  .display-page .masthead-inner { min-height: 3rem; }
  .countdown-display { padding-block: .7rem .65rem; }
  .display-heading h1 { font-size: clamp(1.85rem, 6.8vh, 3.4rem); }
  .shared-state { margin-bottom: .3rem; }
  .display-details { padding-top: .45rem; }
}

@media (max-width: 23rem) {
  .date-fields { grid-template-columns: 1fr; }
  .display-page #copy-link span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .flip-hold, .flip-fold, .flip-drop { animation: none; }
}
