/* PianoFarté, the wind forecast theme: a friendly weather report.
   Five inks: sky, white, green (the gas), amber, navy. Round corners, soft cards, no outlines. */
:root {
  --sky: #dcedfb;
  --sky-hi: #bfe0f8;
  --card: #ffffff;
  --navy: #0f3d6e;
  --ink: #17365a;
  --muted: #56738f;
  --green: #8fcb5a;
  --green-dk: #3f7a1c;
  --green-lt: #e4f4d6;
  --amber: #f0a830;
  --red: #d9482f;
  --line: rgba(15, 61, 110, .14);
  --head: "Fredoka", "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: clamp(10px, 3vw, 36px);
  --shadow: 0 2px 0 rgba(15, 61, 110, .08), 0 10px 26px rgba(15, 61, 110, .1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--sky); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: linear-gradient(var(--sky-hi), var(--sky) 420px) no-repeat, var(--sky); color: var(--ink);
  font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ── The fog bank, which parts, and the forecast card in front of it ── */
.curtain {
  position: fixed; top: 0; bottom: 0; width: 50vw; z-index: 20; background: #f3f9fe;
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
.curtain::after {                                   /* the edge of a cloud */
  content: ""; position: absolute; top: 0; bottom: 0; width: 72px;
  background: radial-gradient(circle at 50% 36px, #f3f9fe 35px, transparent 36px) 0 0 / 72px 72px repeat-y;
}
.curtain.l { left: 0; }
.curtain.l::after { right: -36px; }
.curtain.r { right: 0; }
.curtain.r::after { left: -36px; background-position: 0 36px; }
body.open .curtain.l { transform: translateX(-115%); }
body.open .curtain.r { transform: translateX(115%); }

.gate {
  position: fixed; inset: 0; z-index: 21; display: grid; place-items: center;
  padding: 30px 16px 20px; overflow-y: auto; text-align: center; transition: opacity .45s;
}
.gate[hidden] { display: none; }
body.open .gate { opacity: 0; pointer-events: none; }
.plaque {
  position: relative; width: min(500px, 100%); padding: 38px 30px 28px;
  background: var(--card); border-radius: 28px; box-shadow: var(--shadow), 0 30px 70px rgba(15, 61, 110, .16);
}
.eyebrow { font: 500 14px/1.2 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.plaque h1 { margin: 10px 0 6px; font: 600 clamp(46px, 12vw, 76px)/1 var(--head); color: var(--navy); letter-spacing: -.01em; }
.sub { margin-bottom: 26px; font-size: 19px; line-height: 1.35; color: var(--ink); text-wrap: balance; }
.sub::before, .tag::before {                        /* the wind icon of a weather report */
  content: ""; display: inline-block; width: 1.15em; height: 1.15em; margin-right: .35em; vertical-align: -.22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f3d6e' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M2 9h11a3 3 0 1 0-3-3M2 14h16a3 3 0 1 1-3 3M2 19h7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.go {
  padding: 15px 32px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 21px/1 var(--head); color: var(--navy); background: var(--green);
  box-shadow: 0 4px 0 var(--green-dk); transition: transform .08s, box-shadow .08s;
}
.go:hover { background: #9dd66a; }
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-dk); }
.go:disabled { opacity: .6; cursor: default; }
.fine { margin-top: 22px; font-size: 14px; line-height: 1.4; color: var(--muted); text-wrap: balance; }
.fine.err { font-weight: 700; color: var(--red); }

/* ── The theme control ── */
.themes {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 4px 4px 12px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 13px; color: var(--muted);
}
.themes span { margin-right: 4px; }
.themes button { padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer; background: none; font: 700 13px/1.2 var(--body); color: var(--ink); }
.themes button:hover { background: var(--sky); }
.themes button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.plaque .themes { margin-top: 20px; background: var(--sky); box-shadow: none; }
.plaque .themes button:hover { background: #fff; }
.plaque .themes button[aria-pressed="true"]:hover { background: var(--navy); }

/* ── "Funded by dumb.vc": the stamp of the investor, in its own ink ── */
.stamp {
  position: absolute; z-index: 3; display: block; white-space: nowrap; text-align: center; text-decoration: none;
  font: 400 26px/1 Impact, "Arial Black", sans-serif; letter-spacing: .03em; text-transform: uppercase;
  color: #ff5fa2; background: rgba(11, 11, 16, .86);
  border: 4px solid #ff5fa2; border-radius: 10px; padding: 9px 14px 10px;
  outline: 1.5px solid #ff5fa2; outline-offset: -8px;
  transform: rotate(-9deg); transition: transform .15s;
}
.stamp::before { content: "FUNDED BY"; display: block; margin: 0 -.4em 3px 0; font: 800 8px system-ui, sans-serif; letter-spacing: .4em; }
.stamp:hover { transform: rotate(-5deg) scale(1.05); }
.plaque .stamp { right: -16px; top: -28px; animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) .5s backwards; }
.stage .stamp { right: 18px; top: 18px; }
body.open .stage .stamp { animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) 1.15s backwards; }
@keyframes stamp { from { transform: rotate(-9deg) scale(2.6); opacity: 0; } }

/* ── Header ── */
.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px 16px; padding: 14px var(--side) 12px;
}
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.word { font: 600 clamp(28px, 3.4vw, 40px)/1 var(--head); color: var(--navy); }
.tag { font-size: 16px; color: var(--navy); }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 13px; color: var(--muted);
}
.pill b { font-weight: 700; color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #b9c9d8; transition: transform .08s; }
.pill.live .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-lt); }
.pill.blip .dot { transform: scale(1.7); }

/* ── The sky: the weather map above the instrument ── */
.stage {
  position: relative; height: clamp(250px, 44vh, 520px); overflow: hidden;
  margin: 0 var(--side); border-radius: 28px 28px 0 0;
  background: linear-gradient(#a9d4f5, #e3f1fc 82%);
}
.stage::before {                                    /* the air goes green as the readout gets worse */
  content: ""; position: absolute; inset: 0; background: linear-gradient(#c3d86a, #e6efb4);
  opacity: 0; transition: opacity 1.6s;
}
.stage[data-air="1"]::before { opacity: .14; }
.stage[data-air="2"]::before { opacity: .34; }
.stage[data-air="3"]::before { opacity: .58; }
.stage[data-air="4"]::before { opacity: .85; }
#air { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.hud {
  position: absolute; left: 16px; top: 16px; z-index: 2; display: grid; gap: 1px; min-width: 150px; padding: 9px 14px 10px;
  background: rgba(255, 255, 255, .92); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 14px; line-height: 1.25; color: var(--muted);
}
.hud-h { font: 500 11px/1.3 var(--head); letter-spacing: .1em; text-transform: uppercase; }
.hud b { font: 600 18px/1.15 var(--head); color: var(--navy); }
#hudWind { color: var(--ink); font-variant-numeric: tabular-nums; }
#hudWind::first-letter { text-transform: uppercase; }

.warn {
  position: absolute; left: 16px; top: 104px; z-index: 2; display: none; padding: 6px 14px 6px 10px;
  border-radius: 999px; box-shadow: var(--shadow); background: var(--amber);
  font: 600 15px/1.2 var(--head); color: var(--navy);
}
.warn::before { content: "⚠"; margin-right: 6px; }
.stage[data-air="3"] .warn, .stage[data-air="4"] .warn { display: block; }
.stage[data-air="3"] .warn::after { content: "Yellow warning: strong wind"; }
.stage[data-air="4"] .warn { background: var(--red); color: #fff; }
.stage[data-air="4"] .warn::after { content: "Red warning: open every window"; }

.hint {
  position: absolute; left: 16px; right: 16px; top: 38%; text-align: center; pointer-events: none;
  font: 600 clamp(20px, 2.8vw, 32px)/1.2 var(--head); color: rgba(15, 61, 110, .78);
  transition: opacity .8s; text-wrap: balance;
}
.hint small { display: block; margin-top: 8px; font: 400 14px/1.35 var(--body); color: var(--muted); }
.hint.gone { opacity: 0; }

/* ── The instrument ── */
.piano { margin: 0 var(--side); background: var(--navy); border-radius: 0 0 28px 28px; box-shadow: var(--shadow); }
.fallboard { display: grid; place-items: center; height: 44px; border-bottom: 4px solid var(--amber); }
.maker { font: 500 15px/1 var(--head); letter-spacing: .26em; text-transform: uppercase; color: #fff; }
.keybed { padding: 0 clamp(8px, 2vw, 26px) 16px; }
.keys {
  position: relative; height: clamp(120px, 22vh, 190px);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.key { position: absolute; top: 0; cursor: pointer; }
.key.white {
  height: 100%; background: #fff; border: 1px solid #c3d5e6; border-top: 0; border-radius: 0 0 7px 7px;
  box-shadow: inset 0 -7px 0 #e3edf6;
}
.key.black { z-index: 2; height: 62%; background: var(--navy); border-radius: 0 0 5px 5px; box-shadow: inset 0 -5px 0 #2b5a8c; }
.key.white.on { background: var(--green); border-color: var(--green-dk); box-shadow: inset 0 -3px 0 var(--green-dk); }
.key.black.on { background: var(--green-dk); box-shadow: inset 0 -2px 0 #2c5a12; }
.lab { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; pointer-events: none; font-size: 11px; color: #8ea5ba; }
.lab.hot { font: 600 13px/1 var(--head); color: var(--navy); }
.key.black .lab { bottom: 8px; color: #9db9d6; }
.key.black .lab.hot { color: #fff; }

/* ── The controls: four cards ── */
.controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px;
  margin: 18px var(--side) 0;
}
.panel { padding: 18px 20px 22px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 0 0 14px; font: 600 21px/1.1 var(--head); color: var(--navy); }
.name { font: 700 15px/1.2 var(--body); color: var(--ink); }

.stops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; }
.stop { display: grid; justify-items: center; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; text-align: center; }
.knob {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%;
  background: var(--sky); font: 600 18px/1 var(--head); color: var(--navy);
  box-shadow: 0 4px 0 #b4d3ec; transition: transform .1s, box-shadow .1s, background .1s;
}
.stop:hover .knob { background: #cbe4f8; }
.stop[aria-pressed="true"] .knob { transform: translateY(3px); background: var(--green); box-shadow: 0 1px 0 var(--green-dk), 0 0 0 4px var(--green-lt); }
.nm { font: 700 14px/1.2 var(--body); color: var(--ink); }
.sb { font-size: 12px; line-height: 1.25; color: var(--muted); }

.slider, .field { display: grid; gap: 5px; margin-bottom: 15px; }
.slider:last-child, .field:last-child { margin-bottom: 0; }
.slider input { width: 100%; height: 22px; margin: 0; accent-color: var(--green-dk); cursor: pointer; }
.ends { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.2; color: var(--muted); }
.ends i { font-style: normal; }
select {
  width: 100%; padding: 9px 11px; border: 2px solid var(--sky); border-radius: 12px; background: #fff;
  font: 16px/1.2 var(--body);                       /* 16px or more, or iPhones zoom the page on focus */
}
.stepper { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; overflow: hidden; border: 2px solid var(--sky); border-radius: 12px; }
.stepper button { height: 38px; border: 0; background: var(--sky); cursor: pointer; font: 600 20px/1 var(--head); color: var(--navy); }
.stepper button:hover:not(:disabled) { background: #cbe4f8; }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper output { text-align: center; font-size: 15px; }

.tunes { display: grid; gap: 8px; margin-bottom: 10px; }
.btn {
  padding: 9px 13px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--sky); text-align: left; font: 700 15px/1.25 var(--body); color: var(--navy);
}
.btn:hover:not(:disabled) { background: #cbe4f8; }
.btn:disabled { opacity: .45; cursor: default; }
.btn small { display: block; margin-top: 1px; font: 400 13px/1.3 var(--body); color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.now { margin-top: 14px; min-height: 2.6em; font-size: 14px; line-height: 1.35; color: var(--muted); }
.now.live { font-weight: 700; color: var(--green-dk); }

body.drag::after {
  content: "Drop it. We'll forecast it."; position: fixed; inset: 12px; z-index: 30; display: grid; place-items: center; pointer-events: none;
  background: rgba(220, 237, 251, .93); border: 4px dashed var(--navy); border-radius: 28px;
  font: 600 clamp(26px, 5vw, 44px)/1.1 var(--head); color: var(--navy); text-align: center;
}

footer { padding: 26px 16px 34px; text-align: center; font-size: 14px; line-height: 1.4; color: var(--muted); }
footer p { margin-bottom: 5px; text-wrap: balance; }
footer a { color: var(--navy); font-weight: 700; }

@media (max-width: 560px) {
  .plaque { padding: 32px 20px 24px; }
  .stamp { font-size: 20px; padding: 7px 11px 8px; }
  .plaque .stamp { right: -6px; top: -24px; }
  .stage .stamp { right: 10px; top: 12px; }
  .hud { left: 10px; top: 10px; min-width: 0; padding: 7px 11px 8px; font-size: 13px; }
  .hud b { font-size: 15px; }
  .warn { left: 10px; top: 84px; font-size: 13px; }
  .hint { top: 44%; }
  .hint small { display: none; }
  .stage, .piano { border-radius: 20px 20px 0 0; }
  .piano { border-radius: 0 0 20px 20px; }
}
@media (pointer: coarse) {
  .slider input { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .curtain, .go, .knob, .hint, .stage::before { transition: none; }
  .stamp, .plaque .stamp, body.open .stage .stamp { animation: none; transition: none; }
}
