/* Wayfare on the web: chart paper, ink, and the route's magenta, as in the app.
   The map beside the journal on a computer, above it on a phone. */
:root {
  --paper: #E8EDEA;
  --surface: #F4F7F5;
  --ink: #0D1B1E;
  --muted: #5A6B6E;
  --hairline: #C3CEC9;
  --route: #B4136B;
  --route-bright: #FF4FA3;
  --night: #0B1316;
  --night-surface: #152328;
  --on-night: #E6EDEA;
  --on-night-muted: #8CA0A3;
  --gutter: 32px;
  --rail: 34px;
  --type: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1316;
    --surface: #121E22;
    --ink: #E6EDEA;
    --muted: #8CA0A3;
    --hairline: #243338;
    --route: #FF4FA3;
    --night-surface: #17272C;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--type);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body.viewing { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--route); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }

/* Compressed at display sizes, like the place names printed on a chart. */
.display { font-weight: 800; font-stretch: 62%; letter-spacing: -0.005em; line-height: 0.98; }
.label { font-weight: 600; font-stretch: 86%; }

.icon { display: inline-flex; flex: none; }
.icon svg { height: 1em; width: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-mark svg { width: 1.375em; stroke-width: 4.5; }
.icon .dot { fill: currentColor; stroke: none; }
.icon-mark .ring { stroke-width: 3.2; }

/* The filled button, in the route's magenta, and its quiet twin. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px;
  border-radius: 18px; background: var(--route); color: var(--paper); text-decoration: none; white-space: nowrap;
  font-weight: 600; font-stretch: 86%; font-size: 15px;
}
.pill.big { height: 50px; padding: 0 26px; border-radius: 25px; font-size: 17px; box-shadow: 0 6px 16px -6px var(--route); }
.pill.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }

.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.wordmark .icon { color: var(--route); font-size: 20px; }
.wordmark .display { font-size: 24px; letter-spacing: 0.01em; }

/* --- The page ------------------------------------------------------------ */

.trip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 620px); min-height: 100vh; }
.map-pane { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--night); }
#map { width: 100%; height: 100%; }
.journal { min-width: 0; padding: 0 var(--gutter) 48px; }

.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  height: 64px; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

.map-button {
  position: absolute; z-index: 800; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff;
  background: rgba(11, 19, 22, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* --- The trip's name and figures ------------------------------------------- */

.title { padding: 28px 0 30px; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--route); font-size: 15px; margin-bottom: 10px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--route); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--route) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}
.title h1 { font-size: clamp(46px, 5.4vw, 72px); line-height: 0.92; }
.title h1 button { text-align: left; }
.byline { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 16px; }
.faces { display: inline-flex; }
.face {
  position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  background: var(--route); color: var(--paper); font-weight: 700; font-size: 13px; box-shadow: 0 0 0 2px var(--paper);
}
.face + .face { margin-left: -9px; background: var(--ink); }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.figures { display: flex; margin-top: 24px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.figure { flex: 1; padding: 14px 0 12px 16px; border-left: 1px solid var(--hairline); }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure b { display: block; font-size: 38px; }
.figure span { color: var(--muted); font-size: 14px; }

.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 12px; font-size: 15px; }
.counts { display: inline-flex; gap: 14px; color: var(--muted); margin-left: auto; }
.counts > span { display: inline-flex; align-items: center; gap: 5px; }
.latest {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; height: 38px; padding: 0 16px 0 12px;
  border-radius: 19px; font-size: 15px; color: var(--route); box-shadow: inset 0 0 0 1.5px var(--route);
}

/* --- The journal: the route down the page, from its dot to its ring ------- */

.route { list-style: none; margin: 0; padding: 0 0 0 var(--rail); }
.route > li { position: relative; }
/* The line, a piece per row: it starts at the first stop and ends at the last. */
.route > li::before {
  content: ""; position: absolute; left: calc(var(--rail) * -1 + 9px); width: 3px; top: 0; bottom: 0; background: var(--route);
}
.route > li:first-child::before { display: none; }
.stop:has(.node.first)::before { top: 30px; }
.stop:has(.node.last)::before { bottom: auto; height: 30px; }

.day { display: flex; align-items: baseline; gap: 8px; padding: 18px 0 10px; font-size: 15px; }
.route > .day:first-child { padding-top: 0; }
.day b { color: var(--route); }
.day span { color: var(--muted); }

.stop { padding-bottom: 16px; scroll-margin-top: 80px; }
.node {
  position: absolute; left: calc(var(--rail) * -1); top: 20px; width: 21px; height: 21px; display: grid; place-items: center;
}
.node::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--route);
  box-shadow: 0 0 0 3px var(--paper); transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.node.first::before { width: 15px; height: 15px; }
.node.last::before { width: 17px; height: 17px; background: var(--paper); box-shadow: inset 0 0 0 3.5px var(--route), 0 0 0 3px var(--paper); }
.stop.current .node::before { transform: scale(1.35); }
.node.live::before { animation: ring 1.8s ease-in-out infinite; }
@keyframes ring {
  0% { box-shadow: inset 0 0 0 3.5px var(--route), 0 0 0 0 color-mix(in srgb, var(--route) 55%, transparent); }
  70%, 100% { box-shadow: inset 0 0 0 3.5px var(--route), 0 0 0 10px transparent; }
}

.card { background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: 0 10px 24px -18px rgba(13, 27, 30, 0.5); }
.shot { position: relative; aspect-ratio: 4 / 3; background: var(--hairline); }
.shot .open { position: absolute; inset: 0; width: 100%; height: 100%; cursor: zoom-in; }
.shot .open:focus-visible { outline-offset: -4px; border-radius: 22px; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shade {
  position: absolute; inset: auto 0 0; height: 58%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(4, 10, 12, 0.3) 45%, rgba(4, 10, 12, 0.78));
}
.caption { position: absolute; left: 18px; right: 84px; bottom: 15px; color: #fff; pointer-events: none; }
.caption h2 { font-size: 32px; margin-top: 3px; text-wrap: balance; }
.caption .time { font-size: 14px; opacity: 0.85; }
.caption .place { font-size: 15px; margin-top: 3px; opacity: 0.9; }
.count, .heart {
  position: absolute; right: 12px; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  border-radius: 17px; color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(11, 19, 22, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.count { top: 12px; height: 28px; font-size: 13px; pointer-events: none; }
.heart { bottom: 12px; }
.heart .icon { font-size: 18px; }
.heart.liked svg { fill: var(--route-bright); stroke: var(--route-bright); }
.heart.bounce .icon { animation: bounce 0.35s ease-out; }
@keyframes bounce { 40% { transform: scale(1.4); } }
.heart[disabled] { cursor: default; }

.strip { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip:last-child { padding-bottom: 12px; }
.thumb { flex: none; width: 54px; height: 54px; border-radius: 11px; overflow: hidden; opacity: 0.6; transition: opacity 0.15s; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 0.85; }
.thumb.current { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--route); }
.words { padding: 12px 18px 15px; }
.note { font-size: 16px; white-space: pre-wrap; max-width: 60ch; }
.note + .note { margin-top: 6px; }
.song { margin-top: 6px; font-size: 14px; color: var(--muted); }
.note + .song { margin-top: 8px; }
.words > .song:first-child { margin-top: 0; }

/* A waypoint with no photo: a paper card, as in the app. */
.card.bare { padding: 16px 18px 17px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
.card.bare > .icon { font-size: 26px; color: var(--route); margin-top: 2px; }
.card.bare .caption { position: static; color: var(--ink); }
.card.bare .caption h2 { font-size: 28px; }
.card.bare .caption .time, .card.bare .caption .place { color: var(--muted); opacity: 1; }
.card.bare .note, .card.bare .song { grid-column: 2; margin-top: 8px; }

.more, .empty { color: var(--muted); font-size: 14px; padding-left: var(--rail); margin-top: 2px; }
.empty { padding: 24px 0; }

/* --- What Wayfare is ---------------------------------------------------------- */

.pitch {
  margin-top: 44px; padding: 30px 28px 28px; border-radius: 28px; background: var(--night-surface); color: var(--on-night);
  scroll-margin: 90px;
}
.pitch-mark { color: var(--route-bright); font-size: 30px; line-height: 0; }
.pitch h2 { font-size: clamp(34px, 3.4vw, 44px); margin-top: 16px; text-wrap: balance; }
.pitch-lead { margin-top: 12px; color: var(--on-night-muted); max-width: 46ch; }
.points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 16px; }
.points li { display: flex; gap: 13px; }
.points .icon { font-size: 22px; color: var(--route-bright); margin-top: 1px; }
.points b { display: block; font-size: 17px; }
.points p { color: var(--on-night-muted); font-size: 15px; margin-top: 2px; max-width: 44ch; }
.pitch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 26px; }
.quiet-link { color: var(--on-night-muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.pitch.nudged .badge { animation: nudge 0.9s ease-out; }
@keyframes nudge {
  0% { box-shadow: 0 0 0 0 rgba(255, 79, 163, 0.8); }
  100% { box-shadow: 0 0 0 16px rgba(255, 79, 163, 0); }
}

/* The App Store button. Swap for Apple's own badge art once the app is listed. */
.badge {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 15px; border-radius: 14px;
  background: #fff; color: #0B1316; text-decoration: none; font-weight: 600; font-size: 20px; line-height: 1.05;
}
.badge .icon { font-size: 24px; }
.badge small { display: block; font-size: 11px; font-weight: 500; }
.badge.soon { cursor: default; }

.foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 30px; color: var(--muted); font-size: 13px; }
.foot .icon { color: var(--route); font-size: 13px; }

/* --- Map marks ------------------------------------------------------------- */

.mark {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; overflow: hidden;
  background: var(--route-bright) center / cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease-out;
}
.mark.bare { width: 16px; height: 16px; margin: 12px; }
.mark.current { border-color: var(--route-bright); border-width: 3px; transform: scale(1.35); }
.leaflet-container { background: var(--night); font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-bar { border: 0 !important; border-radius: 14px; overflow: hidden; box-shadow: none; }
.leaflet-bar a, .leaflet-bar a:hover {
  background: rgba(11, 19, 22, 0.55); color: #fff; border: 0; width: 42px; height: 40px; line-height: 40px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.leaflet-bottom.leaflet-right .leaflet-bar { margin: 0 16px 26px 0; }

/* --- Along the foot of a phone: the app ------------------------------------- */

.dock { display: none; }

/* --- Loading, a link that no longer works, an invitation -------------------- */

.state {
  min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: 0 28px 12vh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; color: var(--muted);
}
p.state { align-items: center; }
.state .wordmark { margin-bottom: 26px; }
.state h1 { color: var(--ink); font-size: 46px; text-wrap: balance; }
.state-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.state .badge { background: var(--ink); color: var(--paper); }
.state .quiet { font-size: 14px; }

/* --- Photo viewer ---------------------------------------------------------- */

.viewer { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; display: flex; flex-direction: column; }
.viewer > img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-bar { display: flex; align-items: flex-end; gap: 12px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
.viewer-bar .where { flex: 1; min-width: 0; }
.viewer-bar h3 { font-size: 26px; }
.viewer-bar p { margin-top: 3px; font-size: 14px; opacity: 0.8; }
.viewer-bar .viewer-note { opacity: 1; font-size: 15px; margin-top: 6px; max-width: 70ch; }
.viewer-bar .heart { position: static; background: rgba(255, 255, 255, 0.14); }
.viewer-close, .viewer-step {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.viewer-close { top: calc(12px + env(safe-area-inset-top)); left: 14px; }
.viewer-count { position: absolute; top: calc(24px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: 14px; opacity: 0.8; pointer-events: none; }
.viewer-step { top: 50%; transform: translateY(-50%); }
.viewer-step.prev { left: 14px; }
.viewer-step.next { right: 14px; }
@media (hover: none) { .viewer-step { display: none; } }

/* --- A phone, or a narrow window: the map above the journal ---------------- */

@media (max-width: 860px) {
  :root { --gutter: 16px; --rail: 28px; }
  .trip { display: block; }
  /* The journal is the page: the map heads it and scrolls away with it. */
  .map-pane { position: relative; height: 40vh; height: 40svh; min-height: 230px; }
  .journal { padding-bottom: 40px; }
  body.has-dock .journal { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }

  /* The name over the map, as the app's wordmark sits over its globe. */
  .bar {
    position: absolute; left: 0; right: 0; margin: 0; z-index: 3; height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(11, 19, 22, 0.7), transparent);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .bar .wordmark { pointer-events: auto; color: #fff; }
  .bar .wordmark .icon { color: var(--route-bright); }
  .bar .pill { display: none; }
  .map-button { top: auto; right: auto; left: 12px; bottom: 12px; width: 38px; height: 38px; font-size: 18px; }
  .leaflet-control-zoom { display: none; }

  .title { padding: 22px 0 24px; }
  .title h1 { font-size: clamp(44px, 13vw, 60px); }
  .figure b { font-size: 32px; }
  .stop { padding-bottom: 14px; scroll-margin-top: 16px; }
  .caption h2 { font-size: 28px; }
  .pitch { padding: 26px 22px 24px; margin-left: -4px; margin-right: -4px; }

  .dock {
    position: fixed; z-index: 900; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; border-radius: 22px;
    background: rgba(11, 19, 22, 0.86); color: var(--on-night);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6);
  }
  .dock-icon { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
  .dock-words { flex: 1; min-width: 0; line-height: 1.2; }
  .dock-words b { display: block; font-size: 16px; }
  .dock-words span { display: block; font-size: 13px; color: var(--on-night-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock .pill { background: var(--route-bright); color: var(--night); height: 34px; padding: 0 14px; font-size: 14px; }
  .dock .pill.ghost { background: transparent; color: var(--on-night); }
  .dock-close { position: absolute; top: -9px; right: -5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--night-surface); color: var(--on-night-muted); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
}
@media (max-width: 380px) {
  .dock-words span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .node.live::before, .heart.bounce .icon, .pitch.nudged .badge { animation: none; }
  .node::before, .mark, .thumb { transition: none; }
}
