/* NanoCast demo in the Udgam Labs brand (BRAND.md v3; founder, 3 Dec 2026: "match our design language, make it look
   beautiful"). Ink ground for the globe, paper panels, the sky family (NanoCast's family on the site) for every
   active state and the data, Newsreader 500 for names and numbers, Figtree for everything else, sentence case.
   Corners 12 (small parts), 28 (panels), pills for buttons and labels. No glows, no blur, no gradients except the
   colour keys of the maps. */

@font-face { font-family: "Figtree"; src: url("./fonts/figtree.woff") format("woff"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("./fonts/newsreader-500.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  --ink: #1C1B18;
  --ink-90: #34332F;
  --ink-surface: #26241F;
  --ink-border: #3F3C36;
  --graphite: #5E5C57;
  --muted: #8F8A7E;
  --ivory: #F3EFE6;
  --ivory-80: #C9C3B6;
  --paper: #FAF6EE;
  --white: #FFFFFF;
  --band: #F7F5F0;
  --s-deep: #345c9e;
  --s-base: #9db9e6;
  --s-tint: #dfe8f7;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Figtree", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(28, 27, 24, 0.18); border-radius: 999px; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#globe-container { position: fixed; inset: 0; cursor: grab; }
#globe-container:active { cursor: grabbing; }

.glass {
  background: var(--paper);
  border-radius: 28px;
}

select, button, input { font: inherit; color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--s-deep); outline-offset: 2px; }

/* Top bar: the name (standalone page only) and the run status, as quiet pills on the ink */
#topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.brand.glass { background: transparent; border-radius: 0; display: flex; align-items: baseline; gap: 12px; padding: 4px 6px; color: var(--ivory); }
.brand-dot { display: none; }
.brand h1 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -0.01em; }
.brand h1 span { font-family: var(--sans); font-size: 14px !important; color: var(--ivory-80) !important; font-weight: 400 !important; }
.brand .sub { font-size: 13px; color: var(--muted); }

.status-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--ink-surface);
  color: var(--ivory-80);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill strong { color: var(--ivory); font-weight: 600; }

/* Left panel: start, run, layer, colour key, display */
#left-panel {
  position: fixed;
  top: 68px;
  left: 16px;
  width: 280px;
  max-height: calc(100% - 152px);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 15;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--graphite);
  margin-bottom: 8px;
}

#scenario-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--white);
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231C1B18' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
#scenario-desc { font-size: 13px; line-height: 1.45; color: var(--graphite); margin-top: 8px; }

.primary-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  background: var(--s-deep);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.primary-btn:hover:not(:disabled) { opacity: 0.9; }
.primary-btn:disabled { opacity: 0.6; cursor: wait; }

.progress-wrap { margin-top: 10px; display: none; }
.progress-wrap.active { display: block; }
.progress-track { height: 6px; border-radius: 999px; background: var(--s-tint); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--s-deep); transition: width 0.06s linear; }
.progress-text { font-size: 12px; color: var(--graphite); margin-top: 6px; display: flex; justify-content: space-between; }

.layer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.layer-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  background: var(--ivory);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.12s ease;
}
.layer-btn:hover { background: var(--s-tint); }
.layer-btn.active { background: var(--s-base); font-weight: 600; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-90); padding: 3px 0; }
.toggle-row input { accent-color: var(--s-deep); width: 16px; height: 16px; cursor: pointer; }

.legend-bar { height: 10px; border-radius: 999px; }
.legend-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--graphite); margin-top: 6px; }

/* Right panel: your place, the time, every variable, the 10-day chart */
#pin-panel {
  position: fixed;
  top: 68px;
  right: 16px;
  width: 356px;
  max-height: calc(100% - 152px);
  overflow-y: auto;
  padding: 20px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-wrap { position: relative; }
.search-row { display: flex; gap: 6px; }
#city-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--white);
  border: none;
  font-size: 14px;
}
#city-input::placeholder { color: var(--muted); }
.go-btn {
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: var(--ivory);
  font-size: 14px;
  font-weight: 600;
}
.go-btn:hover { opacity: 0.9; }

.city-dropdown {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  z-index: 40;
  display: none;
  box-shadow: 0 8px 0 rgba(28, 27, 24, 0.06);
}
.city-dropdown.open { display: block; }
.city-opt { padding: 10px 14px; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.city-opt:hover { background: var(--s-tint); }
.city-opt .ctry { color: var(--graphite); font-size: 13px; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  background: var(--ivory);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-90);
  transition: background 0.12s ease;
}
.chip:hover { background: var(--s-tint); }
.chip.active { background: var(--s-base); color: var(--ink); font-weight: 600; }

.time-picker-wrap { background: var(--s-tint); border-radius: 20px; padding: 14px; }
.time-picker-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.mini-label { font-size: 13px; color: var(--graphite); font-weight: 500; }
.mini-lead { font-size: 13px; font-weight: 600; color: var(--s-deep); }
#forecast-datetime {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--white);
  border: none;
  font-size: 14px;
  color-scheme: light;
}
.time-picker-wrap .chip { background: var(--white); }
.time-picker-wrap .chip:hover { background: var(--paper); }
.time-picker-wrap .chip.active { background: var(--s-deep); color: var(--white); }

.pin-results { display: flex; flex-direction: column; gap: 12px; }
.pin-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pin-header > div:first-child { min-width: 0; flex: 1; }
.pin-coords { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-sub { font-size: 12.5px; line-height: 1.35; color: var(--graphite); margin-top: 4px; min-height: 2.7em; font-variant-numeric: tabular-nums; }
.cond-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--s-tint);
  color: var(--s-deep);
  white-space: nowrap;
}

.pin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-box {
  background: var(--white);
  border-radius: 16px;
  padding: 10px 11px;
  transition: background 0.12s ease;
  cursor: pointer;
  min-height: 78px;
  min-width: 0;
}
.stat-box:hover { background: var(--s-tint); }
.stat-box.active { background: var(--s-base); }
.stat-box .k { font-size: 12px; color: var(--graphite); font-weight: 500; }
.stat-box.active .k { color: var(--ink-90); }
.stat-box .v { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.15; margin-top: 4px; color: var(--s-deep); white-space: nowrap; overflow: hidden; text-overflow: clip; font-variant-numeric: tabular-nums; }
.stat-box.active .v { color: var(--ink); }
.stat-box .v-sub { font-size: 11.5px; color: var(--graphite); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-box.active .v-sub { color: var(--ink-90); }

.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 2px; margin-bottom: 6px; }
#chart-title.section-label { margin: 0; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.chart-meta { font-size: 12px; color: var(--graphite); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rollout-cta { font-size: 13px; color: var(--ink-90); background: var(--s-tint); border-radius: 16px; padding: 10px 12px; text-align: center; }

#meteogram-svg { width: 100%; height: 118px; display: block; cursor: crosshair; background: var(--white); border-radius: 16px; }

.daily-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 6px; }
.day-card { background: var(--white); border-radius: 12px; padding: 7px 4px; text-align: center; cursor: pointer; transition: background 0.12s ease; }
.day-card:hover { background: var(--s-tint); }
.day-card.active { background: var(--s-base); }
.day-card.pending { opacity: 0.55; cursor: default; }
.day-card .d-lbl { font-size: 11.5px; color: var(--graphite); font-weight: 500; }
.day-card .d-hi { font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.day-card .d-lo { font-size: 12px; color: var(--graphite); }
.day-card .d-rn { font-size: 11px; color: var(--s-deep); margin-top: 1px; font-weight: 600; }

/* Bottom: the 10-day timeline, a paper pill */
#timeline-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  padding: 10px 22px 10px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 15;
  border-radius: 999px;
}
.play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--ivory);
  font-size: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.play-btn:hover { opacity: 0.9; }
.time-readout { width: 200px; flex-shrink: 0; }
.time-readout .lead { font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-readout .utc { font-size: 12px; color: var(--graphite); margin-top: 2px; }
#step-slider { flex: 1; accent-color: var(--s-deep); cursor: pointer; height: 20px; }
.hint { font-size: 12.5px; color: var(--graphite); white-space: nowrap; }

@media (max-width: 1100px) {
  #left-panel { width: 248px; padding: 16px; }
  #pin-panel { width: 320px; padding: 16px; }
  .hint { display: none; }
}

/* udgamlabs.com hero mode (?mode=hero): only the globe; the page draws its own controls. */
html.hero-mode body { background: transparent; }
html.hero-mode #topbar, html.hero-mode #left-panel, html.hero-mode #pin-panel, html.hero-mode #timeline-bar { display: none !important; }

/* udgamlabs.com page (?mode=embed): the whole app inside the page's first screen; the page carries the title. */
html.embed-mode .brand { display: none; }
html.embed-mode #topbar { justify-content: flex-end; }
html.embed-mode #quick-cities { max-height: 72px; overflow-y: auto; }

/* Phones and narrow frames (founder, 5 Dec 2026: on the phone the panels covered the map): nothing sits on the globe.
   The page scrolls instead: the globe in its own block, then the timeline, your place, and the start, layers and key.
   Inside udgamlabs.com the frame grows to this full height (app.js tells the page), so there is no scroll inside it. */
@media (max-width: 760px) {
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; }
  body { display: flex; flex-direction: column; gap: 8px; padding: 0 0 8px; }
  #topbar { display: none; }
  .glass { border-radius: 20px; }
  #globe-container { position: relative; inset: auto; order: 1; width: 100%; height: min(112vw, 460px); flex: none; touch-action: none; }
  #left-panel, #pin-panel, #timeline-bar { position: static; width: auto; max-height: none; overflow: visible; margin: 0 8px; }
  #timeline-bar { order: 2; padding: 6px 14px 6px 6px; gap: 10px; }
  #pin-panel { order: 3; padding: 14px; }
  #left-panel { order: 4; padding: 14px; gap: 14px; }
  #scenario-desc, #progress-wrap:not(.active) { display: none; }
  .layer-grid { grid-template-columns: repeat(3, 1fr); }
  .layer-btn { padding: 7px 9px; font-size: 12.5px; }
  html.embed-mode #quick-cities { max-height: none; overflow: visible; }
  .play-btn { width: 36px; height: 36px; }
  .time-readout { width: 132px; }
  .time-readout .lead { font-size: 16px; }
  .time-readout .utc { display: none; }
}

/* People who ask their device for less motion: no fades on the tiles (app.js also skips the autoplay). */
@media (prefers-reduced-motion: reduce) {
  .stat-box, .day-card { transition: none; }
}
