:root {
  color-scheme: light;
  --bg: #fbfcf7;
  --bg-top: #ffffff;
  --ink: #18241c;
  --muted: #566557;
  --line: #d9dfd3;
  --particle: #53745d;
  --particle-soft: #7f9785;
  --particle-bright: #2f6041;
  --control: rgba(255, 255, 255, 0.58);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfcf7;
  --bg-top: #ffffff;
  --ink: #18241c;
  --muted: #566557;
  --line: #d9dfd3;
  --particle: #53745d;
  --particle-soft: #7f9785;
  --particle-bright: #2f6041;
  --control: rgba(255, 255, 255, 0.58);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #080d0a;
    --bg-top: #101811;
    --ink: #f2f6ef;
    --muted: #b8c4b5;
    --line: #2f3932;
    --particle: #b7d3b5;
    --particle-soft: #78927d;
    --particle-bright: #d8f0d2;
    --control: rgba(255, 255, 255, 0.07);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080d0a;
  --bg-top: #101811;
  --ink: #f2f6ef;
  --muted: #b8c4b5;
  --line: #2f3932;
  --particle: #b7d3b5;
  --particle-soft: #78927d;
  --particle-bright: #d8f0d2;
  --control: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 44%);
}

.theme-toggle {
  appearance: none;
  position: fixed;
  top: 22px;
  right: 22px;
  padding: 6px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.theme-toggle:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.theme-icon {
  display: block;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1;
}

.breathing-screen {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  gap: 0;
  padding: 34px 18px 42px;
  text-align: center;
}

.eyebrow,
.phase,
.timer {
  margin: 0;
}

.eyebrow {
  align-self: start;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: lowercase;
}

.breath {
  align-self: center;
  display: grid;
  justify-items: center;
}

.breath-ring {
  width: min(520px, 78vw, 62svh);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

#particle-field {
  width: 100%;
  height: 100%;
  display: block;
}

.breath-status {
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.phase {
  min-width: 180px;
  font-size: 22px;
  line-height: 1.2;
}

.timer {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 520px) {
  .theme-toggle {
    top: 16px;
    right: 16px;
  }

  .breath-ring {
    width: min(390px, 90vw, 56svh);
  }

  .breathing-screen {
    padding-block: 28px 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #particle-field {
    opacity: 0.88;
  }
}
