/* Smidge web timer. Plain paper and dark ink, so the disc is the only loud thing on screen
   (the same rule as the app's Palette.swift). */
:root {
  --paper: #f9f8f5;
  --face: #ffffff;
  --well: #ece9e6;
  --rule: #dbd9d4;
  --ink: #1b1d21;
  --muted: #66686d;
  --tomato: #de3d30;
  --on-tomato: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111214;
    --face: #202124;
    --well: #2b2d30;
    --rule: #404245;
    --ink: #f2f1ed;
    --muted: #a3a5a8;
  }
}

:root[data-theme="dark"] {
  --paper: #111214;
  --face: #202124;
  --well: #2b2d30;
  --rule: #404245;
  --ink: #f2f1ed;
  --muted: #a3a5a8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; }

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.75rem;
  padding: 0.9rem 1rem 1.1rem;
  background: var(--paper);
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.plain { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.plain a { text-decoration: none; }
.top .by { color: var(--muted); font-size: 0.85rem; text-decoration: none; }

.dial-wrap {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  min-height: 0;
}

#disc {
  width: min(78vw, 54svh);
  height: min(78vw, 54svh);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 50%;
}
#disc:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
body.running #disc { cursor: default; }

.face { fill: var(--face); stroke: var(--rule); stroke-width: 1.2; }
.tick { stroke: var(--muted); stroke-width: 0.7; stroke-linecap: round; opacity: 0.7; }
.tick.major { stroke: var(--ink); stroke-width: 1.4; opacity: 1; }
.num { fill: var(--ink); font-size: 8.8px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.wedge { fill: var(--tomato); }
.knob { fill: var(--ink); }
.handle { fill: var(--face); stroke: var(--tomato); stroke-width: 2.4; }

#digits {
  margin: 0;
  font-size: clamp(2rem, 6.5svh, 4.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
body.done #digits { color: var(--tomato); }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; width: 100%; }

button, select {
  font: inherit;
  color: var(--ink);
  background: var(--well);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  min-height: 44px;
  cursor: pointer;
}
button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button:focus-visible, select:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#start { background: var(--tomato); color: var(--on-tomato); font-weight: 700; min-width: 7.5rem; }
body.running .presets { visibility: hidden; }

.stage:fullscreen .top, .stage:fullscreen .presets { display: none; }
.stage:fullscreen #disc { width: min(88vw, 76svh); height: min(88vw, 76svh); }

.about {
  max-width: 36rem;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
  border-top: 1px solid var(--rule);
}
.about h1 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 1rem; }
.about h2 { font-size: 1.2rem; margin: 2.2rem 0 0.5rem; }
.about p, .about li { color: var(--ink); }
.about .muted { color: var(--muted); font-size: 0.92rem; }
.about ul { padding-left: 1.2rem; }
.about nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.95rem; }
kbd {
  font: 600 0.85em ui-monospace, Menlo, monospace;
  background: var(--well);
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
}

@media (max-width: 520px) {
  #disc { width: 86vw; height: 86vw; }
  button, select { padding: 0.45rem 0.8rem; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
