:root {
  color-scheme: light;
  --sky: #79d8ff;
  --sky-deep: #45a9ee;
  --sun: #ffd63d;
  --sun-edge: #f49a20;
  --grass: #4ecb47;
  --grass-dark: #19883c;
  --leaf: #78f05c;
  --road: #6bc34f;
  --road-dark: #25733d;
  --cream: #fff3a8;
  --ink: #183b25;
  --shadow: #0d2719;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--sky);
}

body {
  min-width: 320px;
  font-family:
    "Courier New", Monaco, Consolas, "Liberation Mono", monospace;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.contact-block {
  position: fixed;
  top: clamp(12px, 2.6vw, 24px);
  left: clamp(12px, 3vw, 28px);
  z-index: 5;
  display: block;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  border: 3px solid #d8f9ff;
  border-radius: 0;
  background:
    linear-gradient(rgba(216, 249, 255, 0.22) 2px, transparent 2px),
    linear-gradient(90deg, rgba(216, 249, 255, 0.22) 2px, transparent 2px),
    #0b5d93;
  background-size: 12px 12px;
  box-shadow:
    4px 4px 0 #183b25,
    inset 0 0 0 3px rgba(255, 255, 255, 0.16);
  color: #fffdf1;
  font-size: clamp(0.68rem, 2.4vw, 0.86rem);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  text-shadow: 2px 2px 0 #183b25;
  white-space: nowrap;
  image-rendering: pixelated;
  animation: blueprintGlint 2.4s steps(2, end) infinite;
}

.contact-block::before,
.contact-block::after {
  position: absolute;
  display: block;
  width: 8px;
  height: 8px;
  border: 2px solid #fff3a8;
  content: "";
}

.contact-block::before {
  top: -5px;
  left: -5px;
  border-right: 0;
  border-bottom: 0;
}

.contact-block::after {
  right: -5px;
  bottom: -5px;
  border-top: 0;
  border-left: 0;
}

.contact-block:hover,
.contact-block:focus-visible {
  background-color: #1274ad;
  color: #fff3a8;
  outline: 0;
  transform: translateY(-2px);
}

.strava-button {
  position: fixed;
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 42px;
  padding: 0 12px;
  border: 4px solid #183b25;
  border-radius: 0;
  background: #fc4c02;
  box-shadow:
    4px 4px 0 #fff3a8,
    8px 8px 0 rgba(24, 59, 37, 0.24);
  color: #fffdf1;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  text-shadow: 2px 2px 0 #183b25;
  text-transform: uppercase;
  image-rendering: pixelated;
}

.strava-button::before {
  display: block;
  width: 0;
  height: 0;
  margin-right: 7px;
  border-right: 7px solid transparent;
  border-bottom: 14px solid #fffdf1;
  border-left: 7px solid transparent;
  content: "";
  filter: drop-shadow(2px 2px 0 #183b25);
}

.strava-button:hover,
.strava-button:focus-visible {
  background: #ff6a21;
  color: #fff3a8;
  outline: 0;
  transform: translateY(-2px);
}

.sound-toggle {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 46px;
  height: 42px;
  padding: 0;
  border: 4px solid #183b25;
  border-radius: 0;
  background: #fff3a8;
  box-shadow:
    4px 4px 0 #f49a20,
    8px 8px 0 rgba(24, 59, 37, 0.25);
  cursor: pointer;
  image-rendering: pixelated;
}

.bpm-label {
  position: absolute;
  right: -4px;
  bottom: calc(100% + 10px);
  min-width: 72px;
  padding: 4px 6px;
  border: 3px solid #183b25;
  background: #fff3a8;
  color: #183b25;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: none;
  box-shadow: 3px 3px 0 #f49a20;
  pointer-events: none;
}

.sound-toggle.is-playing .bpm-label {
  background: #b3f47a;
}

.speaker-icon,
.speaker-icon::before,
.speaker-icon::after {
  display: block;
  content: "";
}

.speaker-icon {
  position: relative;
  width: 20px;
  height: 18px;
  background:
    linear-gradient(90deg, #183b25 0 7px, transparent 7px),
    linear-gradient(135deg, transparent 0 39%, #183b25 40% 100%);
}

.speaker-icon::before,
.speaker-icon::after {
  position: absolute;
  top: 3px;
  right: -9px;
  width: 4px;
  height: 12px;
  background: #183b25;
}

.speaker-icon::before {
  transform: translateX(-1px);
}

.speaker-icon::after {
  right: -16px;
  height: 18px;
  top: 0;
}

.sound-toggle.is-playing {
  background: #b3f47a;
  animation: soundPulse 1.2s steps(2, end) infinite;
}

.sound-toggle.is-playing .speaker-icon::before,
.sound-toggle.is-playing .speaker-icon::after {
  background: #2b8f42;
}

.poster {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(18px, 4vw, 48px);
  padding-top: clamp(60px, 15vh, 150px);
  pointer-events: none;
}

h1 {
  max-width: min(94vw, 1180px);
  margin: 0;
  color: var(--cream);
  font-size: clamp(3.25rem, 12vw, 10.4rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 5px 0 #ffe066,
    0 10px 0 #f49a20,
    5px 0 0 #2b8f42,
    -5px 0 0 #2b8f42,
    5px 5px 0 #2b8f42,
    -5px 5px 0 #2b8f42,
    0 15px 0 var(--shadow),
    10px 20px 0 rgba(13, 39, 25, 0.28);
  animation: titleBob 2.8s steps(2, end) infinite;
}

@keyframes titleBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes soundPulse {
  50% {
    transform: translateY(-3px);
  }
}

@keyframes blueprintGlint {
  50% {
    box-shadow:
      4px 4px 0 #183b25,
      inset 0 0 0 3px rgba(255, 243, 168, 0.26);
  }
}

@media (max-width: 560px) {
  .contact-block {
    top: 10px;
    left: 10px;
    padding: 7px 8px;
    font-size: clamp(0.62rem, 3.3vw, 0.72rem);
  }

  .strava-button {
    left: 10px;
    bottom: 10px;
    min-width: 76px;
    height: 38px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .poster {
    padding-top: clamp(54px, 12vh, 92px);
  }

  h1 {
    font-size: clamp(3.4rem, 19vw, 6.2rem);
    text-shadow:
      0 4px 0 #ffe066,
      0 8px 0 #f49a20,
      4px 0 0 #2b8f42,
      -4px 0 0 #2b8f42,
      4px 4px 0 #2b8f42,
      -4px 4px 0 #2b8f42,
      0 12px 0 var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  h1 {
    animation-duration: 5.6s;
  }
}
