:root {
  --accent-color: hsl(220, 100%, 50%);
  --background-color: rgb(254, 254, 254);
  --border-color: rgba(85, 78, 66, 0.25);
  --text-color: hsl(40, 5%, 15%);
  --text-color-subdued: rgb(135, 133, 128);
}

@media (color-gamut: p3) {
  @supports (color: color(display-p3 0 0 0 / 1)) {
    :root {
      --accent-color: color(display-p3 0.045 0.345 1);
    }
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-color: hsl(165, 65%, 40%);
    --background-color: hsl(40, 5%, 15%);
    --border-color: rgb(111, 110, 105);
    --text-color: hsl(0, 0%, 90%);
    --text-color-subdued: rgb(111, 110, 105);
  }

  @media (color-gamut: p3) {
    @supports (color: color(display-p3 0 0 0 / 1)) {
      :root {
        --accent-color: color(display-p3 0.1 0.8 0.6);
      }
    }
  }
}

.animation-controls {
  margin: 1rem 0;
  font-size: 0.875rem;
  font-family: ui-sans-serif;
}

.animation-controls label {
  display: block;
  margin-bottom: 0.5rem;
}

.animation-controls input {
  margin: 0 0.5rem;
  vertical-align: middle;
}

@keyframes letterOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: rotateX(60deg) translateY(-6px) scale(0.9);
    filter: blur(2px);
  }
}

@keyframes letterIn {
  0% {
    opacity: 0;
    transform: rotateX(-60deg) translateY(12px) scale(0.9);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

body {
  background: var(--background-color);
  color: var(--text-color);
  max-width: 48ch;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: "Georgia";
  transition: all 0.25s ease;
  transition-property: background-color, color;
}

body > header {
  font-family: ui-sans-serif;
  margin-top: 2rem;
}

section.header {
  margin-top: 5rem;
  margin-bottom: 4rem;
}

h1 {
  font-size: 1rem;
  text-wrap: balance;
  max-width: 22rem;
  font-weight: 400;
}

h1 span {
  text-wrap: nowrap;
  color: var(--accent-color);
  color: var(--accent-color);
}

h2 {
  color: var(--text-color-subdued);
  margin-top: 3rem;
  font-family: ui-sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

p {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.125rem;
}

article {
  margin-top: 5rem;
}

article header {
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

article header h1 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

article header time {
  font-family: ui-sans-serif, sans-serif;
  color: rgb(183, 181, 172);
}

article code {
  font-size: 0.875em;
}

footer {
  color: var(--text-color-subdued);
  margin: 2rem auto;
  font-size: 0.75rem;
}

.index ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

a {
  color: var(--accent-color);

  text-decoration-style: line;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-color);
  transition: text-decoration-color 0.2s ease-in-out;
}

a:hover {
  text-decoration-color: var(--accent-color);
}

.letter {
  display: inline-block;
  position: relative;
  will-change: transform, opacity, filter;
}

#hobby-1,
#hobby-2 {
  display: inline-block;
}

.hobby-wrapper {
  display: inline-block;
  position: relative;
  vertical-align: bottom;
}

.hobby-wrapper > span {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

/* Adjust button alignment */
button.shuffle {
  vertical-align: bottom;
  position: relative;
  margin-left: 4px;
}

.hobby-wrapper {
  cursor: default;
}
