:root {
  color-scheme: light;
  --ink: #0b2554;
  --sun: #ffd51f;
  --sky: #1aa8ff;
  --paper: #fffdf7;
  --cold-sky: #c3d9e8;
  --rain: #3f709b;
  --control-bg: rgb(255 253 247 / 92%);
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 20rem;
  background: var(--paper);
  overflow: hidden;
}

button,
select {
  font: inherit;
}

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  transition: background-color 300ms ease;
}

.page[data-verdict='no'] {
  background: #eef5f8;
}

.topbar {
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2rem;
  padding: clamp(1.4rem, 3.5vw, 3.25rem);
}

.question {
  max-width: 25rem;
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 2.1rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.province-control {
  display: grid;
  grid-template-columns: auto minmax(10rem, 15rem);
  align-items: center;
  gap: 0.75rem;
}

.province-control label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 0.16rem solid currentColor;
  border-bottom: 0.16rem solid currentColor;
  content: '';
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select {
  width: 100%;
  min-height: 3rem;
  appearance: none;
  padding: 0.6rem 2.8rem 0.6rem 1rem;
  color: var(--ink);
  background: var(--control-bg);
  border: 0.14rem solid var(--ink);
  border-radius: 999px;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
  cursor: pointer;
  font-weight: 800;
}

select:focus-visible {
  outline: 0.22rem solid var(--sky);
  outline-offset: 0.2rem;
}

select:disabled {
  cursor: wait;
  opacity: 0.72;
}

.answer-wrap {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
}

.weather-shape,
.garment {
  position: absolute;
  pointer-events: none;
}

.weather-shape {
  width: min(68vw, 76vh);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  transform: translateY(-2%);
  transition:
    width 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-radius 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 300ms ease;
  animation: arrive 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rain {
  position: absolute;
  bottom: -12%;
  display: none;
  width: clamp(0.45rem, 0.8vw, 0.85rem);
  height: 22%;
  background: var(--rain);
  border-radius: 999px;
  transform: rotate(18deg);
}

.rain-one {
  left: 25%;
}

.rain-two {
  bottom: -20%;
  left: 49%;
}

.rain-three {
  right: 23%;
}

.garment {
  top: 50%;
  right: clamp(2rem, 7vw, 8rem);
  height: auto;
  color: var(--sky);
  opacity: 0;
  transform: translateY(-35%);
  transition: opacity 180ms ease;
}

.shorts {
  width: min(24vw, 22rem);
}

.trousers {
  width: min(18vw, 16rem);
  color: #3f78a8;
  transform: translateY(-43%) rotate(3deg);
}

.garment-detail {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.26;
  stroke-width: 9;
  vector-effect: non-scaling-stroke;
}

.answer-copy {
  z-index: 2;
  display: grid;
  justify-items: center;
  min-width: 0;
  transform: translateX(calc(-0.035em - 8vw));
}

.answer {
  margin: 0;
  font-family: 'Arial Black', Arial, Helvetica, sans-serif;
  font-size: clamp(9rem, 35vw, 36rem);
  font-weight: 950;
  line-height: 0.72;
  letter-spacing: -0.105em;
  text-transform: uppercase;
  white-space: nowrap;
}

.temperature {
  margin: clamp(1rem, 2.4vh, 1.75rem) 0 0;
  padding: 0.48rem 0.9rem 0.42rem;
  background: rgb(255 253 247 / 88%);
  border: 0.12rem solid currentColor;
  border-radius: 999px;
  box-shadow: 0.16rem 0.16rem 0 currentColor;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.temperature:empty {
  display: none;
}

.note {
  min-height: 1.2em;
  margin: 0.85rem 0 0;
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.note:empty {
  display: none;
}

.answer-wrap[data-verdict='yes'] .shorts,
.answer-wrap[data-verdict='no'] .trousers {
  opacity: 1;
  animation: rise 850ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.answer-wrap[data-verdict='no'] .weather-shape {
  width: min(63vw, 70vh);
  background: var(--cold-sky);
  border-radius: 48% 52% 44% 56% / 58% 48% 52% 42%;
}

.answer-wrap[data-verdict='no'] .rain {
  display: block;
}

.answer-wrap[data-verdict='no'] .answer {
  font-size: clamp(8rem, 29vw, 30rem);
  letter-spacing: -0.09em;
}

.answer-wrap[data-state='loading'] .weather-shape,
.answer-wrap[data-state='unavailable'] .weather-shape,
.answer-wrap[data-state='invalid'] .weather-shape {
  width: min(38vw, 24rem);
  background: #e3e8e6;
}

.answer-wrap[data-state='loading'] .answer-copy,
.answer-wrap[data-state='unavailable'] .answer-copy,
.answer-wrap[data-state='invalid'] .answer-copy {
  max-width: 26rem;
  padding: 2rem;
  text-align: center;
  transform: none;
}

.answer-wrap[data-state='loading'] .note,
.answer-wrap[data-state='unavailable'] .note,
.answer-wrap[data-state='invalid'] .note {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

footer {
  position: absolute;
  z-index: 6;
  bottom: clamp(1.25rem, 3vw, 2.5rem);
  left: clamp(1.4rem, 3.5vw, 3.25rem);
}

footer a {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration-thickness: 0.12rem;
  text-transform: uppercase;
  text-underline-offset: 0.22rem;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(4%) scale(0.88);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(5%);
  }
}

@keyframes rise-mobile {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(40%);
  }
}

@media (max-width: 42rem) {
  body {
    overflow: auto;
  }

  .page {
    min-height: 40rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 1.5rem;
  }

  .question {
    max-width: 17rem;
    line-height: 1.05;
  }

  .province-control {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    width: min(100%, 18rem);
  }

  .weather-shape {
    width: min(105vw, 66vh);
    transform: translateY(-4%);
  }

  .answer-wrap[data-verdict='no'] .weather-shape {
    width: min(95vw, 62vh);
  }

  .answer-copy {
    transform: translateY(-7vh) translateX(-0.035em);
  }

  .answer {
    font-size: clamp(9.5rem, 49vw, 16rem);
  }

  .answer-wrap[data-verdict='no'] .answer {
    font-size: clamp(8.2rem, 43vw, 14rem);
  }

  .garment {
    top: auto;
    bottom: -1vh;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .shorts {
    width: 62vw;
  }

  .trousers {
    bottom: -6vh;
    width: 40vw;
  }

  .answer-wrap[data-verdict='yes'] .shorts,
  .answer-wrap[data-verdict='no'] .trousers {
    animation-name: rise-mobile;
  }

  .temperature {
    margin-top: 1.25rem;
  }

  footer {
    bottom: 1rem;
  }
}

@media (max-height: 43rem) and (min-width: 42.01rem) {
  .topbar {
    padding-top: 1.25rem;
    padding-bottom: 0.75rem;
  }

  .answer {
    font-size: min(31vw, 15rem);
  }

  .temperature {
    margin-top: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
