@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f0e8;
  --bg-accent: #f0dfc7;
  --ink: #1d1c1a;
  --muted: #5c554c;
  --accent: #0f6b6f;
  --accent-2: #cc5b2d;
  --card: #fffaf3;
  --shadow: rgba(29, 28, 26, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top, #fff6e6 0%, #f4e4cf 35%, #f0dcc2 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  padding: 48px clamp(20px, 4vw, 64px) 64px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.controls-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  margin: 0 0 16px;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  margin: 0 0 8px;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

select {
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--card);
  font-size: 1rem;
  font-weight: 600;
}

.settings {
  position: relative;
  min-width: 160px;
}

.settings-toggle {
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.settings-panel {
  position: absolute;
  right: 0;
  top: 44px;
  background: #fff;
  border-radius: 16px;
  border: 2px solid var(--ink);
  padding: 12px;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 12px 25px var(--shadow);
  display: none;
  z-index: 10;
}

.settings-panel.open {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.settings-row label {
  font-size: 0.7rem;
}

.settings-row select {
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.status {
  color: #fff;
  padding: 28px 32px;
  border-radius: 20px;
  box-shadow: 0 18px 40px var(--shadow);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.status.go {
  background: linear-gradient(135deg, #0f6b6f 0%, #1e8a76 60%, #4a9c69 100%);
}

.status.no-go {
  background: linear-gradient(135deg, #8f3a2b 0%, #c24c2a 60%, #d4682d 100%);
}

.status.marginal {
  background: linear-gradient(135deg, #9a6a1d 0%, #bf7a22 60%, #d18a26 100%);
}

.status::after {
  content: "";
  position: absolute;
  inset: -50% -20% auto auto;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.status h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.status p {
  margin: 0;
  opacity: 0.85;
}

.status.compact {
  padding: 18px 22px;
  margin-top: 16px;
  margin-bottom: 32px;
}

.status.compact h2 {
  font-size: 1.2rem;
}

.thresholds {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 8px;
}

.status-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  background: #fff;
  color: #0f6b6f;
  font-weight: 700;
}

.status-pill.no-go {
  background: #ffe9df;
  color: #cc5b2d;
}

.status-pill.marginal {
  background: #fff2cf;
  color: #8d5d1a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 12px 25px var(--shadow);
  min-height: 150px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.card-body p {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  color: var(--muted);
}

.card-body span {
  font-weight: 600;
  color: var(--ink);
}

.hourly {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 25px var(--shadow);
}

.hourly + .hourly {
  margin-top: 20px;
}

.hourly + .grid {
  margin-top: 24px;
}

.hourly h3 {
  margin: 0 0 16px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}

.map-section {
  margin-bottom: 32px;
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 25px var(--shadow);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

#map {
  width: 100%;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--ink);
}

.flow-canvas {
  mix-blend-mode: multiply;
}

.wind-icon {
  background: transparent;
  border: none;
}

.wind-marker {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 10px 20px var(--shadow);
}

.wind-marker.wind-uncertain {
  border-style: dashed;
}

.wind-arrow {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 16px;
  height: 14px;
  transform-origin: 50% 90%;
}

.wind-arrow .arrow-shaft {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 2px;
  height: 8px;
  background: var(--accent);
  transform: translateX(-50%);
  border-radius: 999px;
}

.wind-arrow .arrow-head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--accent);
  transform: translateX(-50%);
}

.wind-speed {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  margin-top: 12px;
}

.sources {
  margin-top: 32px;
  padding-top: 16px;
}

.sources h3 {
  margin: 0 0 12px;
}

#sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dedication {
  margin-top: 28px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted);
  text-align: center;
}

.source-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px var(--shadow);
  font-size: 0.9rem;
}

.source-pill span {
  font-weight: 600;
}

.source-pill.ok {
  border-left: 6px solid #1f8d68;
}

.source-pill.offline {
  border-left: 6px solid #cc5b2d;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-row {
    width: 100%;
    justify-content: space-between;
  }

  .controls {
    flex: 1;
  }

  .settings {
    min-width: auto;
  }

  .status {
    padding: 24px;
  }

  .settings {
    align-self: flex-end;
  }

  .settings-panel {
    right: 0;
    left: auto;
    width: min(90vw, 260px);
  }
}
