:root {
  /* Light page, like the Cookbo and Audio Bubble sites. */
  --bg: #f4f3f1;
  --fg: #16171b;
  --muted: #77787e;
  --pill: #34353b;
  --blue: #0066cc;
  /* The map card stays dark, like the app, with its own tokens. */
  --map-bg: #16181e;
  --map-fg: #f3f3f5;
  --map-muted: #8b8e99;
  --card: rgb(30 31 37 / 0.82);
  --sign-red: #d0202e;   /* the app icon's sign */
  --mon: #3d85f5;
  --tue: #f5802e;
  --wed: #33c780;
  --thu: #ad52eb;
  --fri: #f04352;
  --sat: #f0bd1f;
  --sun: #4dc2e6;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); color: var(--fg); }

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.45;
}

a { color: inherit; }

/* Home */

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  text-align: center;
}

.app-icon {
  display: block;
  width: clamp(40px, 8vw, 56px);
  height: auto;
  border-radius: 22.5%;
  margin: 0 auto 12px;
  box-shadow: 0 4px 14px rgb(22 23 27 / 0.16);
}

h1 {
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.tagline {
  margin-top: 10px;
  font-size: clamp(17px, 2.6vw, 21px);
  color: var(--muted);
  text-wrap: balance;
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  min-height: 420px;
  margin-top: 24px;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: var(--map-bg);
  color: var(--map-fg);
  box-shadow: 0 1px 2px rgb(22 23 27 / 0.08), 0 18px 44px rgb(22 23 27 / 0.18);
}

#map {
  position: absolute;
  inset: 0;
}

/* Day pills: the legend and the readout's rule rows */

.d {
  display: inline-block;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: 0.02em;
}
.d.mon { background: var(--mon); }
.d.tue { background: var(--tue); }
.d.wed { background: var(--wed); }
.d.thu { background: var(--thu); }
.d.fri { background: var(--fri); }
.d.sat { background: var(--sat); }
.d.sun { background: var(--sun); }

.legend {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.4);
  pointer-events: none;
}

.legend.countdown,
.legend.dayparking {
  align-items: center;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px 5px 5px 12px;
  gap: 0;
}
.legend.countdown .label,
.legend.dayparking .label {
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--map-muted);
}
.legend[hidden] { display: none; }

.u {
  display: inline-block;
  min-width: 22px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #fff;
}
.legend .u:nth-of-type(2) { border-radius: 999px 0 0 999px; }
.legend .u:last-child { border-radius: 0 999px 999px 0; }

/* View toggle */

.modes {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.4);
  white-space: nowrap;
}
.modes button {
  border: 0;
  background: none;
  color: var(--map-muted);
  font: 700 13px/1 var(--font);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modes button[aria-pressed="true"] {
  background: var(--map-fg);
  color: var(--map-bg);
}

.readout {
  margin-top: 16px;
  min-height: 3.2em;
  max-width: 44ch;
  font-size: 17px;
  font-weight: 600;
  text-wrap: balance;
}
.readout .where { color: var(--muted); font-weight: 500; }
.readout .rules {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.readout .rule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.readout .pills { display: inline-flex; border-radius: 999px; overflow: hidden; }
.readout .move {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
}
.readout .move .u { border-radius: 999px; padding: 4px 9px; }

/* What's new: a parking sign on a perforated post, planted in the map's
   corner. It rotates in about a pivot far below the map, so one small turn
   sweeps it in from out of sight on the left along a gentle arc, settling
   upright on a damped spring. Closing it turns it back out. */
/* Sized in em off one base size, so it scales up whole on wider screens */
.new-sign {
  position: absolute;
  left: 28px;
  bottom: 0;
  font-size: 10px;
  width: 16.2em;
  padding-bottom: 7.6em;   /* how much post shows below the sign */
  transform: rotate(-18deg);
  transform-origin: 3em calc(100% + 100em);   /* far below the post */
  filter: drop-shadow(0 0.5em 1em rgb(0 0 0 / 0.5));
}
.new-sign.in {
  animation: sign-in 0.75s ease-out both;
  /* A damped spring: one small overshoot, then settles */
  animation-timing-function: linear(0, 0.054, 0.187, 0.359, 0.541, 0.712, 0.857, 0.97, 1.05, 1.099, 1.122, 1.126, 1.115, 1.097, 1.074, 1.051, 1.031, 1.013, 1, 0.992, 0.986, 0.984, 0.984, 0.986, 0.989, 0.992, 0.994, 0.997, 0.999, 1, 1);
}
.new-sign.out { animation: sign-out 0.35s cubic-bezier(0.5, 0, 0.75, 0) both; }
@keyframes sign-in {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(0); }
}
@keyframes sign-out {
  from { transform: rotate(0); }
  to   { transform: rotate(-18deg); }
}
/* Like the app icon's sign: white, rounded, with a thin red stroke just
   inside the edge */
.sign {
  position: relative;
  z-index: 1;
  padding: 1.6em 1.6em 1.8em;
  border-radius: 1.4em;
  background: #fbfaf6;
  /* The ring, then a shadow of its own that falls on the post too */
  box-shadow: inset 0 0 0 0.35em #fbfaf6, inset 0 0 0 0.6em var(--sign-red), 0 0.5em 1em rgb(0 0 0 / 0.4);
  color: var(--sign-red);
  /* Narrow like street-sign lettering: Apple's condensed Helvetica, else Arial Narrow */
  font-family: "HelveticaNeue-CondensedBold", "Helvetica Neue Condensed Bold", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  font-stretch: condensed;
  line-height: 1.1;
  text-align: left;
  text-transform: uppercase;
}
/* Two rivets where it's fixed to the post, each touching the red stroke and
   through one of the post's holes (main.js spaces the holes to fit) */
.sign::before, .sign::after {
  content: "";
  position: absolute;
  left: 3em;
  width: 0.7em;
  height: 0.7em;
  margin-left: -0.35em;
  border-radius: 50%;
  background: #cfd2d6;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.35);
}
.sign::before { top: 0.6em; z-index: 1; }   /* through the badge */
.sign::after { bottom: 0.6em; }
/* A red square in the top-left corner, merging with the stroke like the
   icon's, with an App Store mark; the version sits beside it on two lines */
.sign-badge {
  position: absolute;
  top: 0.35em;
  left: 0.35em;
  width: 4.4em;
  height: 4.4em;
  display: grid;
  place-items: center;
  border-radius: 1.05em 0 1em 0;
  background: var(--sign-red);
  color: #fff;
}
.sign-badge svg { width: 3.25em; height: 3.25em; }
.sign-head { min-height: 3em; padding-left: 3.6em; }
.sign-new { font-size: 1.1em; font-weight: 700; letter-spacing: 0.04em; line-height: 1.15; }
.sign-new .version { font-size: 1.45em; letter-spacing: 0; }
.sign-title { margin-top: 0.25em; font-size: 1.6em; font-weight: 800; white-space: nowrap; }
.sign-body { margin-top: 0.35em; font-size: 1.2em; font-weight: 700; letter-spacing: 0.02em; }
.sign-close {
  position: absolute;
  /* Its own font size is 1.8× the sign's, so these ems are of that */
  top: 0.5em;
  right: 0.5em;
  width: 1.1em;
  height: 1.1em;
  border: 0;
  background: none;
  color: #9a9ca2;
  font: 1.8em/1 system-ui, sans-serif;
  cursor: pointer;
}
.sign-close:hover { color: #16171b; }
/* Square steel post under the sign's left side, light and flat with an
   outline, its holes punched right through (a mask), so the map shows in them */
.post {
  position: absolute;
  top: 0.95em;   /* level with the top rivet's center, where a hole falls */
  bottom: 0;
  left: 3em;
  width: 2.2em;
  margin-left: -1.1em;
  border: 1px solid rgb(0 0 0 / 0.35);
  border-bottom: 0;
  background: #d9dce0;
  --holes: radial-gradient(circle, transparent 0.25em, #000 0.31em) center calc(var(--hole-gap, 1.5em) / -2) / 2.2em var(--hole-gap, 1.5em) repeat-y;
  -webkit-mask: var(--holes);
  mask: var(--holes);
}
@media (min-width: 768px) {
  .new-sign { left: 40px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .new-sign.in { animation: none; transform: none; }
  .new-sign.out { animation: none; }
}

.download {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--pill);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.download svg { flex: none; margin-top: -2px; }   /* optical centering: the logo's leaf sits high */
.download:hover { transform: scale(1.04); }
.download:active { transform: scale(0.97); }

.footer-links {
  margin-top: 26px;
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
}
.footer-links a, .made-by a { text-decoration: none; }
.footer-links a:hover, .made-by a:hover { color: var(--fg); }

.made-by {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* "App by Jon Bobrow", the same signature as in the app */
.by-jon { display: inline-block; margin-top: 14px; color: var(--muted); transition: color 0.15s; }
.by-jon:hover { color: var(--fg); }
.by-jon svg { display: block; width: 150px; height: auto; }

/* Map controls, restyled for the dark card */

.maplibregl-ctrl-group {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px !important;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.4) !important;
}
.maplibregl-ctrl-group button + button { border-top-color: rgb(255 255 255 / 0.08); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib {
  background: rgb(18 19 24 / 0.7) !important;
  color: var(--map-muted);
  font-family: var(--font);
}
.maplibregl-ctrl-attrib a, .maplibregl-ctrl-attrib-inner { color: var(--map-muted); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* Privacy and Support */

.doc {
  max-width: 640px;
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 16px 56px;
}
.doc .back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.doc .back img { width: 26px; height: 26px; border-radius: 22.5%; }
.doc h1 { margin-top: 36px; font-size: clamp(32px, 6vw, 44px); }
.doc .updated { margin-top: 6px; color: var(--muted); font-size: 15px; }
.doc h2 { margin-top: 32px; font-size: 21px; }
.doc p, .doc li { margin-top: 10px; font-size: 17px; text-wrap: pretty; }
.doc ul { padding-left: 1.2em; }
.doc a:not(.back) { color: var(--blue); }

/* The printable dash note on Support: the PDF's page folded in half, its top
   half standing up, leaning back a little, and its bottom half lying flat on
   the dash in front, with a number written in. Real 3D, seen from above. */
/* The note and its download button side by side, stacked on phones */
.dash-note-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  margin-top: 8px;
}
.dash-note {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 0.98;
  perspective: 1400px;
  perspective-origin: 50% 0;
}
.note {
  position: absolute;
  left: 14%;   /* the turn brings its left side nearer, so it sits right of center */
  right: 8%;
  top: 54%;   /* the fold */
  transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(-14deg);
}
.note-half {
  position: absolute;
  left: 0;
  width: 100%;
  aspect-ratio: 612 / 396;
  background: url(dash-note.jpg) 0 0 / 100% 200% no-repeat;
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.12);
}
.note-top {
  bottom: 0;
  transform-origin: 50% 100%;
  transform: rotateX(14deg);
  /* Turned a little from the light, so a touch darker than the flat half */
  background-image: linear-gradient(rgb(0 0 0 / 0.025), rgb(0 0 0 / 0.07)), url(dash-note.jpg);
  background-size: 100% 100%, 100% 200%;
}
.note-bottom {
  top: 0;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
  background-position: 0 100%;
  /* Lies in the dash's plane, so its shadow does too */
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.12), 0.6em 1.2em 2em rgb(22 23 27 / 0.18);
}
/* On the line: 12–88% across, 84.5% down the half */
.note-number {
  position: absolute;
  left: 16%;
  bottom: 16.5%;
  width: 38%;
  color: #1f3c8f;   /* ballpoint blue */
}
.doc a.download { margin-top: 0; color: #fff; font-size: 16px; padding: 12px 22px; }

/* Three views fit the toggle on a phone */
@media (max-width: 420px) {
  .modes button { padding: 9px 11px; font-size: 12px; }
}
