:root {
  --ink: #102d38;
  --muted: #708086;
  --ice: #b9e7ec;
  --ice-strong: #5fc1cb;
  --paper: #f7f8f5;
  --line: #dce2df;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
b { font-weight: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 390px minmax(0, 1fr); overflow: hidden; }
.control-panel { z-index: 10; height: 100vh; background: rgba(249, 250, 247, .98); padding: 28px 32px 20px; display: flex; flex-direction: column; border-right: 1px solid rgba(16,45,56,.12); box-shadow: 12px 0 40px rgba(16,45,56,.08); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 37px; height: 37px; border: 1px solid var(--ink); border-radius: 50%; position: relative; display: grid; place-items: center; overflow: hidden; }
.brand-mark:before, .brand-mark:after, .brand-mark span { content: ""; position: absolute; width: 31px; height: 14px; border: 1.5px solid var(--ink); transform: rotate(-15deg); }
.brand-mark:before { top: 18px; left: -7px; }
.brand-mark:after { top: 11px; right: -10px; }
.brand-mark span { top: 23px; right: -1px; background: var(--ice); }
.brand p { margin: 0 0 2px; color: var(--muted); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; }
.brand h1 { margin: 0; text-transform: uppercase; font-size: 20px; line-height: 1; letter-spacing: -.04em; }
.brand h1 em { color: #69bcc5; font-style: normal; font-weight: 400; }
.intro { margin: 41px 0 28px; }
.eyebrow { color: #5eb2bb !important; font-weight: 700; font-size: 10px !important; letter-spacing: .2em; text-transform: uppercase; }
.intro h2 { margin: 10px 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 34px; font-weight: 400; letter-spacing: -.045em; line-height: .99; }
.intro > p:last-child { margin: 0; color: var(--muted); max-width: 294px; font-size: 12px; line-height: 1.55; }
.controls { border-top: 1px solid var(--line); padding-top: 20px; }
.control-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.control-heading > span { color: #75b8bd; font-size: 9px; font-weight: 700; }
.control-heading h3 { margin: 0; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.control-heading output { margin-left: auto; font-family: Georgia, serif; font-size: 22px; color: #4eaeba; }
.scenario-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: #fff; }
.scenario-tabs button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 10px 4px; cursor: pointer; font-size: 11px; transition: .2s ease; }
.scenario-tabs button:last-child { border-right: 0; }
.scenario-tabs button.active { background: var(--ink); color: white; }
.scenario-note { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.scenario-note span { width: 15px; height: 2px; background: var(--ice-strong); }
.year-heading { margin-top: 23px; margin-bottom: 7px; }
.slider-wrap input { width: 100%; height: 3px; margin: 10px 0 0; appearance: none; border-radius: 3px; background: linear-gradient(90deg, var(--ice-strong) var(--progress), #d8dedc var(--progress)); outline: none; }
.slider-wrap input::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border-radius: 50%; border: 3px solid white; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); cursor: ew-resize; }
.year-labels { display: flex; justify-content: space-between; margin-top: 8px; color: #9aa5a5; font-size: 8px; }
.play-button { margin-top: 11px; width: 100%; border: 1px solid var(--line); background: transparent; padding: 8px; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.play-button span { display: inline-block; margin-right: 8px; color: #52aeb8; font-size: 8px; }
.play-button.playing { background: #eef7f6; }
.layer-heading { margin-top: 20px; }
.base-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.base-switch button { border: 1px solid var(--line); background: #fff; padding: 5px 5px 8px; text-align: left; color: var(--muted); font-size: 9px; cursor: pointer; }
.base-switch button.active { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -2px var(--ice-strong); }
.base-switch button span { display: block; height: 35px; margin-bottom: 6px; background-size: cover; filter: saturate(.7); }
.topo-thumb { background-image: linear-gradient(25deg, #d3dfc9 25%, transparent 25%), linear-gradient(155deg, #eef1e8 35%, #c8dce0 36%, #c8dce0 42%, #e5ded0 43%); }
.ortho-thumb { background-image: linear-gradient(135deg, #455b43, #9c9c79 45%, #374d37 46%, #b4b9a0); }
.control-panel footer { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; gap: 10px; color: #929c9b; font-size: 8px; }
.control-panel footer p { margin: 0; }
.control-panel footer a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.map-panel, .map-frame { position: relative; min-width: 0; height: 100vh; }
.map-frame { overflow: hidden; cursor: grab; touch-action: none; background: #d9e0da; user-select: none; }
.map-frame:active { cursor: grabbing; }
.tile-layer { position: absolute; inset: 0; pointer-events: none; }
.tile-layer img { position: absolute; width: 256px; height: 256px; max-width: none; }
.base-tiles img { background: #dce2dd; }
.glacier-tiles { mix-blend-mode: multiply; transition: opacity .15s linear; }
.map-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(12,39,48,.08), transparent 22%, transparent 75%, rgba(12,39,48,.08)); }
.map-actions { position: absolute; top: 27px; right: 25px; display: grid; box-shadow: 0 6px 20px rgba(16,45,56,.16); }
.map-actions button { width: 38px; height: 38px; border: 0; border-bottom: 1px solid #e2e7e4; background: rgba(255,255,255,.94); font-size: 21px; cursor: pointer; }
.map-actions .home { border-bottom: 0; font-size: 17px; }
.map-caption { position: absolute; left: 27px; top: 27px; background: rgba(249,250,247,.92); backdrop-filter: blur(7px); display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; padding: 11px 15px; box-shadow: 0 7px 24px rgba(16,45,56,.11); }
.map-caption .live-dot { width: 6px; height: 6px; background: #58b7bf; border-radius: 50%; box-shadow: 0 0 0 4px rgba(88,183,191,.18); }
.map-caption strong { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.map-caption > span:last-child { grid-column: 2; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.legend { position: absolute; right: 25px; bottom: 38px; display: flex; align-items: center; gap: 8px; background: rgba(249,250,247,.9); padding: 9px 12px; color: var(--ink); font-size: 9px; }
.legend-swatch { width: 22px; height: 9px; background: linear-gradient(135deg, #d5f4f5, #64c7d0); border: 1px solid rgba(16,45,56,.25); }
.credits { position: absolute; left: 14px; bottom: 8px; padding: 3px 5px; background: rgba(255,255,255,.65); color: #304b53; font-size: 7px; }

@media (max-width: 820px) {
  .app-shell { display: block; overflow: visible; }
  .control-panel { width: 100%; height: auto; min-height: 0; padding: 22px; box-shadow: none; }
  .intro { margin: 28px 0 22px; }
  .intro h2 { font-size: 31px; }
  .control-panel footer { margin-top: 20px; }
  .map-panel, .map-frame { height: 62vh; min-height: 470px; }
  .map-caption { top: 16px; left: 16px; }
  .map-actions { top: 16px; right: 16px; }
}

@media (max-width: 420px) {
  .control-panel { padding: 18px; }
  .intro h2 { font-size: 28px; }
  .map-panel, .map-frame { min-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}
