/* Timer: Zone 2 nach DESIGN.md. Token-Set lauer.io, Schrift Inter lokal.
   Bewegung nur über transform und opacity, der Kuchen wird per JavaScript
   als Pfad nachgezeichnet, nicht per CSS animiert. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/inter-800.woff2") format("woff2"); }

:root {
  --ink: #102c3f;
  --text: #243b4a;
  --muted: #627b8d;
  --blue-900: #003d66;
  --blue-800: #004b76;
  --blue-700: #005f96;
  --blue-100: #eaf7ff;
  --blue-050: #f4fbff;
  --orange: #f6a23a;
  --line: #c9ddeb;
  --line-soft: #e2edf5;
  --surface: #ffffff;
  --surface-muted: #f3f5f7;
  --focus: var(--orange);
  --radius-button: 4px;
  --dur-press: 100ms;
  --dur-state: 150ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--surface);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Die H1 verlangt die Seitenprüfung, sichtbar soll sie nicht sein. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.timer {
  flex: 1 0 auto;
  width: min(28rem, 100% - 2rem);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Zifferblatt */

.timer__dial {
  width: min(100%, 24rem);
}

.timer__dial svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 61, 102, 0.08));
}

.dial__face {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 2;
}

.dial__tick {
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.dial__tick--major {
  stroke: var(--ink);
  stroke-width: 3;
}

.dial__number {
  fill: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-anchor: middle;
}

.dial__pie {
  fill: var(--blue-800);
}

.dial__hub {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 2;
}

.dial__dot {
  fill: var(--ink);
}

/* Restzeit, nur mit gesetzter Checkbox sichtbar */

.timer__readout {
  margin: 0;
  color: var(--ink);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.timer__readout[hidden] {
  display: none;
}

/* Bedienelemente */

.timer__presets,
.timer__steuerung {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.timer__presets .btn {
  flex: 1 1 0;
  min-width: 3rem;
  padding-inline: 0.25rem;
}

.timer__steuerung .btn {
  flex: 1 1 0;
}

.timer__eingabe {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
}

.timer__eingabe input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 3rem;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.timer__eingabe input::-webkit-outer-spin-button,
.timer__eingabe input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer__eingabe input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.timer__eingabe input:focus-visible {
  border-color: var(--blue-700);
}

.timer__eingabe .btn {
  flex: 0 0 auto;
  min-width: 6.5rem;
}

.btn {
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid var(--blue-700);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--blue-800);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color var(--dur-state) var(--ease-out), transform var(--dur-press) ease-out;
}

.btn:hover {
  background: var(--blue-050);
}

.btn:active {
  transform: scale(0.98);
}

.btn[aria-pressed="true"],
.btn--primary {
  background: var(--blue-800);
  border-color: var(--blue-800);
  color: #fff;
}

.btn[aria-pressed="true"]:hover,
.btn--primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn:disabled:hover {
  background: var(--surface);
}

.timer__option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.timer__option input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--blue-800);
  cursor: pointer;
}

/* Unter 26rem passen die sieben Vorgaben nicht mehr in eine Reihe:
   vier und drei, beide Reihen zentriert. */
@media (max-width: 26rem) {
  .timer__presets .btn {
    flex: 0 0 calc(25% - 0.375rem);
  }
}

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

@media (prefers-reduced-transparency: reduce) {
  .timer__dial svg {
    filter: none;
  }
}

@media (prefers-contrast: more) {
  .btn,
  .timer__eingabe input {
    border-width: 2px;
  }

  .dial__face {
    stroke: var(--ink);
  }

  .dial__tick {
    stroke: var(--ink);
  }
}
