:root {
  --bg: #080808;
  --text: #e8e8e4;
  --muted: #8d8d86;
  --faint: #5e5e58;
  --line: #2a2a28;
  --dot: #3f3f3a;
  --accent: #e8e8e4;
  --accent-2: #9a9a94;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f1ed;
  --text: #1c1c1a;
  --muted: #6a6a64;
  --faint: #8a8a84;
  --line: #ddd9d2;
  --dot: #c8c4bc;
  --accent: #1c1c1a;
  --accent-2: #6a6a64;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100dvh;
  background-color: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background-color: transparent;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

.skip {
  position: absolute;
  left: 16px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 3;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.theme {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.theme-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: inset -4px -1px 0 0 var(--bg);
}

html[data-theme="light"] .theme {
  background: #fff;
  border-color: #d9d4cc;
}

html[data-theme="light"] .theme-orb {
  background: var(--text);
  box-shadow:
    0 0 0 2px #fff,
    0 -7px 0 -4px var(--text),
    0 7px 0 -4px var(--text),
    -7px 0 0 -4px var(--text),
    7px 0 0 -4px var(--text);
}

.frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  padding:
    calc(28px + env(safe-area-inset-top))
    calc(28px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(32px + env(safe-area-inset-left));
}

.hello {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.name {
  width: fit-content;
  margin: 10px 0 0;
  font-size: clamp(2.7rem, 6vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.02;
  transform-origin: 0% 70%;
}

.name.pulse {
  animation: name-pulse 0.48s ease;
}

.role {
  margin: 10px 0 0;
  color: var(--muted);
}

.block {
  margin-top: 22px;
}

.block h2,
.foot-label,
.played-label {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.line,
.things,
.links,
.foot p {
  margin: 0;
}

.line + .line {
  margin-top: 2px;
}

.muted,
.thing-note,
.arrow,
.played-label {
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.links a,
.links button {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.links a:hover,
.links a:focus-visible,
.links button:hover,
.links button:focus-visible,
.played-link:hover,
.played-link:focus-visible {
  color: var(--text);
}

.arrow {
  font-size: 0.85em;
}

.things {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.things li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.thing-name {
  color: var(--text);
  text-decoration: none;
}

a.thing-name {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

a.thing-name:hover,
a.thing-name:focus-visible {
  color: var(--text);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
}

.foot-side {
  min-width: 0;
}

.foot-end {
  text-align: right;
}

.foot-label {
  margin-bottom: 4px;
}

.count {
  color: var(--text);
}

.played {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.played[hidden] {
  display: none;
}

.played-link,
.played-body {
  min-width: 0;
  text-decoration: none;
}

.played-label,
.played-title {
  display: block;
}

.played-title {
  color: var(--text);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.bars i {
  display: block;
  width: 2px;
  height: 12px;
  background: var(--muted);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.bars i:nth-child(2) {
  animation-delay: 0.16s;
}

.bars i:nth-child(3) {
  animation-delay: 0.32s;
}

.bars.is-still i {
  animation: none;
}

.bars.is-still i:nth-child(1) {
  height: 5px;
}

.bars.is-still i:nth-child(2) {
  height: 10px;
}

.bars.is-still i:nth-child(3) {
  height: 7px;
}

.toast {
  color: var(--muted);
}

.toast[hidden] {
  display: none;
}

.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

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

html.theme-ready,
html.theme-ready body,
html.theme-ready .theme,
html.theme-ready .hello,
html.theme-ready .role,
html.theme-ready .line,
html.theme-ready .thing-note,
html.theme-ready .foot,
html.theme-ready .played-title {
  transition:
    background-color 0.45s ease,
    color 0.45s ease,
    border-color 0.45s ease;
}

@keyframes name-pulse {
  0% {
    transform: none;
    color: var(--text);
  }
  40% {
    transform: scale(1.03) rotate(-1deg);
    color: var(--flash, var(--accent-2));
  }
  100% {
    transform: none;
    color: var(--text);
  }
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

@media (max-width: 760px) {
  .frame {
    padding-right: calc(18px + env(safe-area-inset-right));
    padding-left: calc(18px + env(safe-area-inset-left));
  }

  .block {
    margin-top: 22px;
  }

  .foot {
    flex-direction: column;
    gap: 16px;
  }

  .foot-end {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .bars i:nth-child(1) {
    height: 5px;
  }

  .bars i:nth-child(2) {
    height: 10px;
  }

  .bars i:nth-child(3) {
    height: 7px;
  }
}
