* { box-sizing: border-box; }

:root {
  color-scheme: light;
  font-family: "Avenir Next", "Century Gothic", "URW Gothic", Arial, sans-serif;
  --sun-yellow: #ffdf83;
  background: var(--sun-yellow);
  color: #173e42;
}

body { margin: 0; }

.teaser {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: clamp(24px, 5svh, 64px) 16px;
  background:
    radial-gradient(ellipse clamp(23rem, 64vw, 58rem) clamp(19rem, 55svh, 36rem) at 50% 45%,
      #fffdf5 20%, #fff5d9 49%, #fff0cc00 100%),
    radial-gradient(ellipse at 94% 100%, #f3ab9180, #f3ab9100 59%),
    linear-gradient(155deg, #ffe8a1, #ffdc79 72%, #ffd883);
}

.brand {
  width: clamp(218px, 25vw, 304px);
  aspect-ratio: 2.7;
  overflow: hidden;
  margin-bottom: clamp(20px, 3svh, 32px);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.vehicle {
  position: relative;
  width: min(100%, 690px, 124svh);
  aspect-ratio: 2.02;
  overflow: hidden;
}

.mustang {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 240ms ease-out;
}

.teaser:has(input[value="red"]:checked) .mustang-red,
.teaser:has(input[value="orange"]:checked) .mustang-orange,
.teaser:has(input[value="white"]:checked) .mustang-white,
.teaser:has(input[value="black"]:checked) .mustang-black {
  z-index: 1;
  opacity: 1;
}

.paints {
  display: flex;
  justify-content: center;
  gap: 5px;
  border: 0;
  margin: clamp(4px, 1.1svh, 10px) 0 0;
  padding: 0;
}

.swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
}

.swatch.red { --paint: #b82b36; }
.swatch.orange { --paint: #e47826; }
.swatch.white { --paint: #fff; }
.swatch.black { --paint: #232529; }

.swatch span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paint);
  box-shadow: inset 0 0 0 1px #1b262530;
  pointer-events: none;
}

.swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch input:checked + span { outline: 1px solid #173e42; outline-offset: 4px; }
.swatch input:focus-visible + span { outline: 2px solid #173e42; outline-offset: 5px; }

h1 {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  margin: clamp(18px, 3.5svh, 34px) 0 0;
  font-size: clamp(17px, 3.1vw, 31px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .20em;
  text-align: center;
  text-transform: uppercase;
}

h1::before,
h1::after {
  content: "";
  width: clamp(14px, 3.5vw, 42px);
  height: 1px;
  background: currentColor;
  opacity: .42;
}

@media (max-width: 767px), (max-width: 950px) and (pointer: coarse) {
  .teaser {
    /* Match the browser theme color wherever the page meets the toolbars. */
    background:
      radial-gradient(ellipse 117% 43% at 50% 50%,
        #fff7d9 22%, #ffedb0 57%, #ffdf8300 100%),
      var(--sun-yellow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mustang { transition: none; }
}
