:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--sun-outside);
  color: var(--sun-inside);
  --sun-outside: #540b0e;
  --sun-inside: #fff3b0;
  --control-border: rgba(255, 243, 176, 0.58);
  --control-shadow: rgba(84, 11, 14, 0.28);
  --page-pad: clamp(4px, 1.4vmin, 10px);
  --canvas-width: calc(100vw - var(--page-pad) - var(--page-pad));
  --canvas-height: calc(100svh - var(--page-pad) - var(--page-pad));
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--sun-outside);
}

body {
  margin: 0;
  width: 100%;
  min-height: 100svh;
  background: var(--sun-outside);
  overflow: hidden;
}

.clock-shell {
  display: grid;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  padding: var(--page-pad);
}

.clock-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#clockCanvas {
  display: block;
  width: var(--canvas-width);
  height: var(--canvas-height);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
}

.clock-controls {
  position: fixed;
  top: clamp(10px, 1.8vw, 22px);
  right: clamp(10px, 1.8vw, 22px);
  z-index: 3;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.icon-button {
  width: clamp(34px, 4.2vmin, 42px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  color: var(--sun-inside);
  background: rgba(0, 0, 0, 0.16);
  box-shadow: 0 10px 24px var(--control-shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(0, 0, 0, 0.26);
  outline: 2px solid var(--sun-inside);
  outline-offset: 3px;
}

.palette-button {
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
}

.palette-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun-inside);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.palette-swatch:last-child {
  grid-column: 1 / -1;
  justify-self: center;
}

.info-control {
  position: relative;
}

.info-button {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.4vmin, 23px);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.info-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 12px 13px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  color: var(--sun-outside);
  background: var(--sun-inside);
  box-shadow: 0 16px 36px var(--control-shadow);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.35;
}

.info-panel a {
  color: var(--sun-outside);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.brand-credit {
  position: fixed;
  right: clamp(10px, 1.8vw, 22px);
  bottom: clamp(8px, 1.5vw, 18px);
  z-index: 2;
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
}

.brand-credit a,
.brand-credit span {
  color: var(--sun-inside);
}

.brand-credit a {
  text-decoration: none;
  text-shadow:
    0 1px 0 var(--sun-outside),
    1px 0 0 var(--sun-outside),
    0 -1px 0 var(--sun-outside),
    -1px 0 0 var(--sun-outside);
}

.brand-credit span {
  text-shadow:
    0 1px 0 var(--sun-outside),
    1px 0 0 var(--sun-outside),
    0 -1px 0 var(--sun-outside),
    -1px 0 0 var(--sun-outside);
}

.brand-credit a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@supports (height: 100dvh) {
  :root {
    --canvas-height: calc(100dvh - var(--page-pad) - var(--page-pad));
  }

  body,
  .clock-shell {
    min-height: 100dvh;
    height: 100dvh;
  }
}
