/* The climb demo: the app's climb screen inside the LP's .phone frame, and its controls.
   The screen is laid out at 390×845 and scaled to the frame's width by demo.js. */

.climb-demo {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: center;
}

.demo-phone { margin: 0; }

.demo-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 1561;
  overflow: hidden;
  border-radius: calc(44px - var(--bezel));
  background: #f3f8f7;
}

.d-app {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  padding: 0 20px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  color: #12302d;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.d-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 14px 0 34px;
  color: #000;
}

.d-clock { font-size: 17px; font-weight: 600; }
.d-island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; border-radius: 18px; background: #000; }
.d-status-icons { display: flex; align-items: center; gap: 6px; fill: #000; }

.d-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
  padding: 3px;
  border-radius: 26px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #5d6f6c;
}

.d-seg span { padding: 9px 0; border-radius: 24px; }
.d-seg .on { background: #26A69A; color: #fff; }

.d-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 12px;
  font-size: 18px;
  font-weight: 700;
}

.d-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-pct { font-weight: 600; color: #5f7f7a; }

.d-row { display: flex; gap: 12px; margin-bottom: 12px; }
.d-tile { flex: 1; min-width: 0; background: #fff; border-radius: 22px; padding: 14px 14px; }
.d-mint { background: #b8ece6; }
.d-lbl { font-size: 12px; color: #5f7f7a; }
.d-num { font-weight: 600; line-height: 1.1; white-space: nowrap; }
.d-big { height: 112px; padding: 16px 16px; }
.d-big .d-num { font-size: 46px; margin-top: 10px; }
.d-big.d-long .d-num { font-size: 38px; margin-top: 16px; }
.d-small { height: 86px; padding: 12px 10px 10px; }
.d-small .d-num { font-size: 22px; margin-top: 8px; }
.d-unit { font-size: 14px; font-weight: 600; margin-left: 4px; }
.d-sub { font-size: 11px; color: #5f7f7a; margin-top: 4px; }

.d-band { height: 4px; border-radius: 2px; background: #dfe6e5; overflow: hidden; margin: 2px 0 8px; }
.d-band-fill { height: 100%; background: #26A69A; transform-origin: 0 50%; transform: scaleX(0); }

.d-bars { display: block; width: 350px; height: 124px; }
.d-bar-labels { font-size: 11px; font-weight: 700; fill: #5d6f6c; text-anchor: middle; }

.d-map {
  position: relative;
  z-index: 0;
  isolation: isolate; /* Leaflet's panes stay under the buttons */
  height: 170px;
  margin-top: 12px;
  border-radius: 22px;
  overflow: hidden;
  background: #e4ece9;
}

.d-map .leaflet-control-attribution { font-size: 9px; }
.d-top { pointer-events: none; }
.d-flag {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #12302d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M4 14V2h1v.5c1.4-.8 2.8-.5 4.2 0 1.4.5 2.6.7 3.8-.1V8.5c-1.2.8-2.4.6-3.8.1-1.4-.5-2.8-.8-4.2 0V14z'/%3E%3C/svg%3E") center / 15px no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.d-top-label { display: block; text-align: center; font-size: 11px; font-weight: 700; color: #12302d; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

.d-buttons {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  top: 680px;
  display: flex;
  gap: 12px;
}

.d-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 60px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(16, 46, 44, 0.12);
  font-size: 20px;
  font-weight: 700;
  fill: #12302d;
}

.d-btn.dark { background: rgba(31, 66, 62, 0.92); color: #fff; fill: #fff; }

.d-tabs {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  top: 762px;
  display: flex;
  justify-content: space-around;
  padding: 5px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 16px rgba(16, 46, 44, 0.1);
}

.d-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 64px;
  padding: 6px 0;
  border-radius: 28px;
  font-size: 10px;
  font-weight: 600;
  fill: #1b1b1b;
}

.d-tab.on { background: #eceeee; }

/* controls */
.demo-side { display: grid; gap: 24px; align-content: start; }
.landing .demo-caption { font-size: 0.875rem; line-height: 1.25rem; color: var(--on-surface-muted); }
.demo-controls { display: grid; gap: 16px; justify-items: start; }

.demo-play {
  min-width: 128px;
  padding: 8px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5rem;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-play:hover { background: var(--primary-dim); }
.demo-play:active { transform: scale(0.98); }
.demo-play:focus-visible,
.demo-select select:focus-visible,
.demo-range input:focus-visible,
.demo-choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.demo-select { display: grid; gap: 4px; font-size: 0.875rem; color: var(--on-surface-muted); }
.demo-select select {
  font: inherit;
  font-size: 1rem;
  color: var(--on-surface);
  padding: 8px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  background: #fff;
}

.demo-range { display: grid; gap: 4px; width: 100%; max-width: 420px; }
.demo-range input { width: 100%; accent-color: var(--primary); }
.demo-where { font-size: 0.75rem; color: var(--on-surface-muted); font-variant-numeric: tabular-nums; }

.demo-choice { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.demo-choice legend { width: 100%; padding: 0; margin-bottom: 4px; font-size: 0.875rem; color: var(--on-surface-muted); }
.demo-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.demo-choice span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-container);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-choice span:hover { background: var(--surface-container-high); }
.demo-choice input:checked + span { background: var(--primary); color: #fff; }

p.demo-credit { margin-top: 8px; font-size: 0.75rem; line-height: 1rem; color: var(--on-surface-dim); }

/* on the LP: just the phone and a play button under it */
.climb-demo[data-mode="lp"] { grid-template-columns: 1fr; gap: 16px; justify-items: center; }
.climb-demo[data-mode="lp"] .demo-phone { width: 100%; max-width: 260px; }
.climb-demo[data-mode="lp"] .demo-side { justify-items: center; gap: 0; }
.climb-demo[data-mode="lp"] .demo-caption {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.climb-demo[data-mode="lp"] .demo-play { min-width: 0; padding: 4px 16px; font-size: 0.875rem; line-height: 1.25rem; background: var(--surface-container); color: var(--on-surface); }
.climb-demo[data-mode="lp"] .demo-play:hover { background: var(--surface-container-high); }

@media (max-width: 880px) {
  .climb-demo { grid-template-columns: 1fr; gap: 32px; }
  .climb-demo .demo-phone { width: 100%; max-width: 280px; margin: 0 auto; }
}
