@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400&display=swap');

:root {
  --canvas: #f5f1ec;
  --surface: #ffffff;
  --surface-storm: #d3cec6;
  --ink: #111111;
  --muted: #626260;
  --subtle: #9c9fa5;
  --hairline: #d3cec6;
  --orange: #ff5600;
}

* { box-sizing: border-box; }

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

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Instrument Sans", sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}

button, a {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}

.sky {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(17,17,17,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.027) 1px, transparent 1px),
    var(--canvas);
  background-size: 64px 64px;
}

.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}

.masthead, .footer {
  position: absolute;
  z-index: 8;
  left: clamp(24px, 4vw, 64px);
  right: clamp(24px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.masthead { top: 28px; }

.wordmark {
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.55px;
  text-decoration: none;
}

.period { color: var(--orange); }
.weather-note, .footer, .intro p { color: var(--muted); }
.weather-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

.intro {
  position: absolute;
  z-index: 4;
  top: 20%;
  left: clamp(24px, 8vw, 128px);
  pointer-events: none;
}

.intro h1 {
  margin: 0;
  font-size: clamp(52px, 7.5vw, 112px);
  font-weight: 500;
  line-height: .91;
  letter-spacing: clamp(-5px, -.055em, -2.2px);
}

.intro p { margin: 24px 0 0 5px; font-size: 14px; }

.cloud-field { position: absolute; inset: 0; z-index: 5; }
.cloud {
  --cloud-width: 220px;
  position: absolute;
  width: var(--cloud-width);
  height: 160px;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform: scale(var(--scale));
  transform-origin: center;
  animation: drift var(--duration) ease-in-out var(--delay) infinite alternate;
  touch-action: none;
}

.cloud:active, .cloud.is-raining { cursor: grabbing; animation-play-state: paused; }
.cloud:focus-visible .cloud-shape { outline: 2px solid var(--orange); outline-offset: 7px; }
.cloud--one { top: 15%; left: 62%; --travel: 15vw; }
.cloud--two { top: 49%; left: 12%; --travel: 20vw; }
.cloud--three { top: 56%; left: 67%; --travel: -18vw; }
.cloud--four { top: 32%; left: 42%; --travel: 12vw; }

.cloud-shape {
  position: absolute;
  left: 10px;
  top: 24px;
  width: 200px;
  height: 102px;
  filter: drop-shadow(0 1px 0 var(--hairline));
  transition: filter .35s ease, transform .25s ease;
}

.cloud:hover .cloud-shape { transform: translateY(-3px); }
.cloud.is-raining .cloud-shape {
  transform: translateY(0);
  filter: drop-shadow(0 1px 0 #aaa49b) brightness(.91);
}

.puff, .cloud-base { position: absolute; display: block; background: var(--surface); }
.puff { border-radius: 50%; }
.puff--left { width: 78px; height: 74px; left: 12px; top: 30px; }
.puff--middle { width: 104px; height: 102px; left: 52px; top: 0; }
.puff--right { width: 72px; height: 68px; right: 5px; top: 36px; }
.cloud-base { width: 172px; height: 55px; left: 14px; top: 49px; border-radius: 0 0 34px 34px; }

.rain { position: absolute; top: 120px; left: 35px; width: 150px; height: 125px; pointer-events: none; opacity: 0; }
.raindrop {
  position: absolute;
  top: 0;
  width: 1px;
  height: var(--length);
  background: var(--ink);
  opacity: var(--opacity);
  animation: fall var(--speed) linear var(--drop-delay) infinite;
}
.cloud.is-raining .rain { opacity: 1; }

.lightning {
  position: absolute;
  z-index: -1;
  top: 112px;
  left: 92px;
  width: 35px;
  height: 72px;
  opacity: 0;
  background: var(--orange);
  clip-path: polygon(58% 0, 12% 52%, 48% 52%, 28% 100%, 88% 39%, 54% 39%);
  filter: drop-shadow(0 0 8px rgba(255,86,0,.45));
}
.cloud.is-lightning .lightning { animation: bolt .42s steps(1) both; }

.flash {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  background: rgba(255,255,255,.7);
}
.flash.is-active { animation: sky-flash .4s steps(1) both; }

.footer { bottom: 27px; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .02em; }
.footer p { margin: 0; }
.coordinates { color: var(--subtle); }

@keyframes drift {
  from { transform: translateX(calc(var(--travel) * -.5)) translateY(-5px) scale(var(--scale)); }
  to { transform: translateX(calc(var(--travel) * .5)) translateY(5px) scale(var(--scale)); }
}
@keyframes fall {
  0% { transform: translateY(-8px); opacity: 0; }
  18% { opacity: var(--opacity); }
  100% { transform: translateY(118px); opacity: 0; }
}
@keyframes bolt { 0%, 24%, 48% { opacity: 1; } 12%, 36%, 100% { opacity: 0; } }
@keyframes sky-flash { 0%, 22% { opacity: .34; } 10%, 35%, 100% { opacity: 0; } }

@media (max-width: 700px) {
  .sky { background-size: 40px 40px; }
  .weather-note { display: none; }
  .intro { top: 17%; }
  .intro p { margin-top: 18px; }
  .cloud--one { top: 30%; left: 58%; }
  .cloud--two { top: 52%; left: -6%; }
  .cloud--three { top: 66%; left: 45%; }
  .cloud--four { top: 42%; left: 31%; }
  .footer > p:first-child { display: none; }
  .footer { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  .raindrop { animation-duration: 1.4s; }
}
