:root {
  --ink: #0B1220; --ink-2: #111C2B; --land: #111A29; --line: #2F3A4D;
  --gold: #E8A33D; --paper: #F2EFE9; --slate: #8B94A3;
  --ember: #E8782D; --lived: #F2EFE9; --want: #7FA3CC;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --pad: 20px;
}
* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* The stage: the map fills the view, the type floats on it */
.app { height: 100vh; height: 100svh; min-height: 560px; display: flex; flex-direction: column; }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--ink); }
.head { flex: none; padding: calc(18px + env(safe-area-inset-top)) var(--pad) 14px; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--ink); outline: none; }
.leaflet-container { background: var(--ink); font-family: var(--sans); }
.leaflet-overlay-pane svg { overflow: visible; }
.leaflet-overlay-pane path { transition: fill-opacity .18s, stroke-opacity .18s; outline: none; }
.leaflet-overlay-pane path[data-m="0"].leaflet-interactive:hover { fill: #1C2A40; }
.lbl-wrap { pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; font: 400 11px/1 var(--sans); letter-spacing: .02em; color: #A6B0C0; pointer-events: none; }
.lbl.m1, .lbl.m2 { color: #0B1220; font-weight: 500; }
.lbl.m3 { color: #A9C3E0; }
.lbl[data-out="1"] { color: #C9D1DD; font-weight: 400; }
.lbl[hidden], .ld[hidden] { display: none; }
.ld { position: absolute; left: 0; top: 0; height: 1px; transform-origin: 0 50%; background: #AEB7C6; opacity: .8; pointer-events: none; }
.tip { background: #111C2B; border: 1px solid rgba(139,148,163,.35); color: var(--paper); font: 400 13px var(--sans); border-radius: 8px; padding: 4px 9px; }
.tip::before { display: none; }
.leaflet-control-zoom { border: 0 !important; margin: 0 !important; }
.leaflet-control-zoom a { background: rgba(11,18,32,.85) !important; color: var(--slate) !important; border: 1px solid rgba(139,148,163,.3) !important; width: 40px !important; height: 40px !important; line-height: 38px !important; font-size: 20px !important; }
.leaflet-control-zoom a:first-child { border-radius: 12px 12px 0 0 !important; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 12px 12px !important; border-top: 0 !important; }
.leaflet-top.leaflet-right { top: 24px; right: 24px; }
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } }

.ui { position: absolute; inset: 0; pointer-events: none; z-index: 500; }
.rail { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--pad) calc(38px + env(safe-area-inset-bottom)); }
.rail > * { pointer-events: auto; }

.head h1 { margin: 0; font: 400 22px/1.15 var(--serif); color: var(--gold); letter-spacing: .005em; }
.intro { margin: 8px 0 0; max-width: 62ch; font-size: 13px; line-height: 1.5; color: var(--slate); }

.count { display: inline-flex; align-items: flex-end; gap: 16px; margin-bottom: 10px; padding: 16px 20px 14px; border-radius: 20px; background: #0B1220; border: 1px solid rgba(139,148,163,.22); align-self: flex-start; }
.num { font: 400 clamp(76px, 22vw, 108px)/.8 var(--serif); font-variant-numeric: lining-nums tabular-nums; font-variation-settings: 'opsz' 72; color: var(--paper); letter-spacing: -.01em; }
.sub { display: flex; flex-direction: column; padding-bottom: 2px; font-size: 14px; color: var(--slate); line-height: 1.3; }
.pct { font: 400 22px/1.2 var(--serif); color: var(--ember); font-variant-numeric: lining-nums; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modes button { position: relative; min-height: 52px; padding: 8px 6px; border-radius: 14px; border: 1px solid rgba(139,148,163,.28); background: #0B1220; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; color: var(--slate); transition: border-color .15s, background .15s, color .15s; }
.modes b { font: 400 20px/1 var(--serif); color: var(--paper); font-variant-numeric: lining-nums tabular-nums; }
.modes i { position: absolute; top: 9px; left: 10px; width: 8px; height: 8px; border-radius: 50%; }
.modes [data-mode="visited"] i { background: var(--ember); }
.modes [data-mode="lived"] i { background: var(--lived); }
.modes [data-mode="want"] i { border: 1.5px dashed var(--want); }
.modes button[aria-pressed="true"] { color: var(--paper); background: #111C2B; }
.modes [data-mode="visited"][aria-pressed="true"] { border-color: var(--ember); }
.modes [data-mode="lived"][aria-pressed="true"] { border-color: var(--lived); }
.modes [data-mode="want"][aria-pressed="true"] { border-color: var(--want); }

.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.get { display: flex; margin-top: 8px; align-items: center; justify-content: center; min-height: 50px; border-radius: 999px; background: var(--ember); color: #0B1220; font: 500 16px/1 var(--sans); text-decoration: none; transition: background .15s; }
.getbox { display: flex; flex-direction: column; margin-top: 14px; }
.getbox .get { margin-top: 0; }
.bridge { margin: 0 0 4px; padding: 0 4px; font: 400 13px/1.3 var(--sans); color: #C9D1DD; white-space: nowrap; }
.get:hover { background: #F08A40; }
.acts button { flex: 1 1 auto; padding: 0 10px; white-space: nowrap; min-height: 44px; font-size: 13px; color: var(--slate); transition: color .15s; border-radius: 999px; background: #0B1220; border: 1px solid rgba(139,148,163,.22); }
.acts button:hover { color: var(--paper); }
#save { color: var(--gold); }

.info { position: absolute; right: var(--pad); bottom: calc(5px + env(safe-area-inset-bottom)); z-index: 600; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: #0B1220; border: 1px solid rgba(139,148,163,.4); color: var(--slate); font: italic 400 15px/1 var(--serif); cursor: pointer; }
.info::after { content: ""; position: absolute; inset: -5px; }
.info:hover, .info[aria-expanded="true"] { color: var(--paper); border-color: rgba(139,148,163,.8); }
.credit { position: absolute; right: calc(var(--pad) + 34px); bottom: calc(5px + env(safe-area-inset-bottom)); z-index: 600; max-width: calc(100% - 64px); padding: 6px 12px; border-radius: 13px; background: #0B1220; border: 1px solid rgba(139,148,163,.4); font-size: 12px; line-height: 14px; color: var(--paper); }
.credit[hidden] { display: none; }
.toast { position: absolute; left: 50%; top: 40%; transform: translate(-50%, 8px); z-index: 900; padding: 10px 18px; border-radius: 999px; background: rgba(17,28,43,.96); border: 1px solid rgba(232,163,61,.5); color: var(--gold); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* The list sheet sits above the dock on phones, and on the right on wide screens */
.sheet { position: absolute; z-index: 700; left: 0; right: 0; top: 0; bottom: 0; background: rgba(11,18,32,.97); overflow-y: auto; padding: calc(20px + env(safe-area-inset-top)) var(--pad) 40px; -webkit-overflow-scrolling: touch; }
.sheet[hidden] { display: none; }
.sheet .x { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; margin: -8px -10px 0 0; font-size: 28px; color: var(--slate); background: rgba(11,18,32,.97); border-radius: 50%; }
.sheet h2 { margin: 22px 0 6px; font: 400 14px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.sheet h2:first-child { margin-top: 6px; }
.place { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; padding: 0 2px; border-bottom: 1px solid rgba(47,58,77,.7); text-align: left; font: 400 17px var(--serif); color: var(--paper); }
.place s { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(139,148,163,.4); text-decoration: none; }
.place[data-m="1"] s { background: var(--ember); border-color: var(--ember); }
.place[data-m="2"] s { background: var(--lived); border-color: var(--lived); }
.place[data-m="3"] s { border: 1.5px dashed var(--want); }

/* Below the map */
.notes, .article { max-width: 640px; margin: 0 auto; padding: 72px var(--pad) calc(56px + env(safe-area-inset-bottom)); }
.denom { margin: 0 0 40px; font: 400 18px/1.5 var(--serif); color: var(--paper); }
.fact { margin: 40px 0 0; font: 400 18px/1.5 var(--serif); color: var(--paper); }
.rows { display: grid; gap: 22px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: baseline; font-size: 14px; color: var(--slate); }
.row b { font: 400 22px/1 var(--serif); color: var(--paper); font-variant-numeric: lining-nums tabular-nums; }
.row .bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(47,58,77,.7); overflow: hidden; }
.row .bar span { display: block; height: 100%; background: var(--ember); transition: width .25s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(139,148,163,.3); font: 400 16px var(--serif); color: var(--paper); }
.chips button[data-m="1"] { border-color: var(--ember); }
.chips button[data-m="2"] { border-color: var(--lived); }
.chips button[data-m="3"] { border: 1px dashed var(--want); }
.cta { display: inline-block; margin: 56px 0 0; font: 400 clamp(24px, 6vw, 32px)/1.25 var(--serif); color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(232,163,61,.45); padding-bottom: 4px; }
.cta:hover { border-bottom-color: var(--gold); }
.foot { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 72px; font-size: 14px; }
.foot a { display: inline-block; padding: 10px 0; color: var(--slate); text-decoration: none; }
.foot a:hover, .foot a[aria-current] { color: var(--paper); }

.article h2 { margin: 40px 0 14px; font: 400 14px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.article h1 { margin: 0 0 40px; font: 400 clamp(34px, 8vw, 48px)/1.1 var(--serif); color: var(--gold); }
.article p { margin: 0 0 22px; font: 400 19px/1.6 var(--serif); color: var(--paper); }
.plain .article { padding-top: 96px; }

#print-img { display: none; }
@media print {
  body > *:not(#print-img) { display: none !important; }
  html, body { background: #fff !important; }
  #print-img { display: block; width: 100%; max-height: 100vh; object-fit: contain; }
}

/* Wide screens: the count and controls sit in a left column over the map */
@media (min-width: 900px) {
  :root { --pad: 56px; }
  .rail { width: 476px; }
  .head { padding-top: 24px; padding-bottom: 18px; }
  .head h1 { font-size: 28px; }
  .intro { font-size: 14px; }
  .num { font-size: 132px; }
  .pct { font-size: 28px; }
  .count { margin-bottom: 20px; }
  .info { right: 24px; }
  .credit { right: 58px; }
  .sheet { left: auto; width: 380px; }
  .toast { top: auto; bottom: 90px; left: calc(50% + 220px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Alaska and Hawaii sit in small insets of their own, clear of the count and the controls */
#insets { position: absolute; z-index: 5; display: flex; align-items: flex-end; gap: 22px; left: 16px; bottom: 70px; }
.inset-wrap { position: relative; }
.inset-wrap b { position: absolute; left: 50%; transform: translateX(-50%); bottom: -17px; font: 400 11px/1 var(--sans); letter-spacing: .02em; color: #A6B0C0; pointer-events: none; }
.inset { width: 130px; height: 86px; background: transparent; }
.inset.leaflet-container { background: transparent; }
#inset-15 { width: 96px; height: 62px; }
@media (min-width: 900px) { .inset { width: 220px; height: 146px; } #inset-15 { width: 150px; height: 96px; } }

/* Phones: the count and the Get Toka button share a row, so the map keeps more of the screen */
@media (max-width: 899px) {
  .dock { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "bridge bridge" "count get" "modes modes" "acts acts"; column-gap: 8px; }
  .count { grid-area: count; margin: 0; padding: 10px 14px 8px; gap: 10px; }
  .num { font-size: clamp(54px, 15vw, 68px); }
  .pct { font-size: 18px; }
  .sub { font-size: 12px; }
  .getbox { display: contents; }
  .getbox .get { grid-area: get; margin: 0; min-height: 0; font-size: 18px; }
  .bridge { grid-area: bridge; margin: 0 -6px 6px; padding: 0 4px; font-size: min(12px, calc((100vw - 28px) / 27)); }
  .modes { grid-area: modes; margin-top: 8px; }
  .modes button { min-height: 46px; }
  .acts { grid-area: acts; }
}
