:root {
  --ink: #f7f4ea;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #7eb6d9;
  color: var(--ink);
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
}

#meadow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.zen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

.zen-quote {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  max-width: min(38rem, 92vw);
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 0;
  background: none;
  color: inherit;
  text-align: center;
}

.zen-quote:focus {
  outline: none;
}

.zen-quote:focus-visible {
  outline: 2px solid rgba(255, 236, 170, 0.85);
  outline-offset: 8px;
  border-radius: 0.4rem;
}

#quote-text {
  display: block;
  font-size: clamp(1.35rem, 4.4vw, 2.35rem);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-wrap: balance;
  color: #fffdf6;
  -webkit-text-stroke: 0.85px rgba(18, 12, 8, 0.72);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 10px rgba(18, 12, 8, 0.5))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.82))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.38));
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
}

#quote-text.is-fading {
  opacity: 0;
}

.zen-volume {
  position: fixed;
  z-index: 2;
  left: 0.85rem;
  bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff8dc;
  filter:
    drop-shadow(0 1px 1px #000)
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.zen-sound,
.zen-full {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
}

.zen-sound svg,
.zen-full svg {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zen-sound .icon-speaker {
  fill: currentColor;
  stroke: none;
}

.zen-sound .icon-waves {
  display: none;
}

.zen-sound .icon-mute {
  display: block;
}

.zen-sound.is-on .icon-waves {
  display: block;
}

.zen-sound.is-on .icon-mute {
  display: none;
}

.zen-sound:focus,
.zen-full:focus,
.zen-volume-label input:focus {
  outline: none;
}

.zen-sound:focus-visible,
.zen-full:focus-visible,
.zen-volume-label input:focus-visible {
  outline: 2px solid rgba(255, 236, 170, 0.85);
  outline-offset: 3px;
}

.zen-full .icon-exit {
  display: none;
}

.zen-full.is-on .icon-enter {
  display: none;
}

.zen-full.is-on .icon-exit {
  display: block;
}

.zen-volume:not(.is-on) .zen-sound {
  animation: sound-hint 2.8s ease-in-out infinite;
}

.zen-volume-label {
  display: flex;
  align-items: center;
  margin: 0;
}

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

.zen-volume-label input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 7.6rem;
  height: 1.35rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.zen-volume-label input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.38);
}

.zen-volume-label input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff8dc;
  box-shadow: 0 0 0 2px rgba(18, 12, 8, 0.55);
}

.zen-volume-label input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.38);
}

.zen-volume-label input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff8dc;
  box-shadow: 0 0 0 2px rgba(18, 12, 8, 0.55);
}

@keyframes sound-hint {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #quote-text {
    transition: none;
  }

  .zen-volume:not(.is-on) .zen-sound {
    animation: none;
  }
}
