:root {
  --bg: #121a1f;
  --surface: #1b252b;
  --border: #26323a;
  --text: #ecefee;
  --muted: #8fa0a6;
  --focus: #4f9c8c;
  --focus-dim: #2f5b52;
  --break: #c98a4b;
  --break-dim: #7a5330;
  --accent: var(--focus);
  --accent-dim: var(--focus-dim);
  --danger: #c96a5a;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

body.mode-break {
  --accent: var(--break);
  --accent-dim: var(--break-dim);
}

a {
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.wordmark {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

nav.top a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
}

nav.top a:hover {
  color: var(--text);
}

main {
  flex: 1;
}

footer.site {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer.site a {
  color: var(--muted);
  text-decoration: none;
}

footer.site a:hover {
  color: var(--text);
}

/* Timer */

.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 1rem;
}

.mode-label {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.digits {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.progress-track {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 2rem 0 2rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 1s linear, background 0.4s ease;
}

.controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c1214;
}

button.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

.length-adjust {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.length-adjust button {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 4px;
}

.sync-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  width: 100%;
}

.sync-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.sync-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.sync-status {
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.1em;
}

/* Static pages */

.prose h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
}

.prose p {
  color: var(--text);
  margin: 0 0 1.1rem;
  max-width: 34rem;
}

.prose a {
  color: var(--focus);
}

.not-found {
  text-align: center;
  padding-top: 3rem;
}

.not-found h1 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.not-found p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

@media (max-width: 420px) {
  .digits {
    font-size: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill {
    transition: none;
  }
}
