/* daybud.app: the app's B3 "Paper map" look. Fonts are served from this site, so visitors' browsers make no
   third-party requests. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/DMMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/DMMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #eef1eb;
  --panel: #ffffff;
  --land: #dde6d2;
  --ink: #1e2a23;
  --ink-soft: #46544b;
  --muted: #66756c;
  --faint: #8d9990;
  --line: rgba(30, 42, 35, 0.12);
  --accent: #d6461c;
  --on-accent: #eef1eb;
  --done: #2e8b57;
  --frame: #ffffff;
  --frame-ink: #2a2a26;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #121815;
    --panel: #1a221e;
    --land: #223029;
    --ink: #eaefe7;
    --ink-soft: #bcc6be;
    --muted: #8c9a90;
    --faint: #5e6a62;
    --line: rgba(234, 239, 231, 0.12);
    --accent: #ff6b3d;
    --on-accent: #121815;
    --done: #5cc48a;
    --frame: #eaefe7;
    --frame-ink: #2a2a26;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Archivo", "Arial Narrow", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 20px;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-block: 28px 64px; }
.narrow { max-width: 720px; }

.contours {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 88% 4%, transparent 0 15%, var(--line) 15.1% 15.3%, transparent 15.4% 24%,
      var(--line) 24.1% 24.3%, transparent 24.4% 33%, var(--line) 33.1% 33.3%, transparent 33.4%);
  opacity: 0.8;
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 16px; height: 16px; background: var(--accent); border-radius: 3px; transform: rotate(45deg); }
.brand-name {
  font-weight: 800; font-stretch: 68%; font-size: 26px; letter-spacing: 0.02em; text-transform: uppercase;
}
.top nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: "DM Mono", ui-monospace, monospace; font-size: 13px; }
.top nav a { color: var(--muted); text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; }
.top nav a:hover { color: var(--ink); }

.label {
  font-family: "Archivo", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.label.accent { color: var(--accent); }
.meta { font-family: "DM Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
h1, .display {
  font-weight: 800; font-stretch: 68%; line-height: 0.92; letter-spacing: 0.005em; text-transform: uppercase;
  margin: 6px 0 0; text-wrap: balance;
}
h1 { font-size: clamp(48px, 9vw, 96px); }
h2 { font-weight: 800; font-stretch: 75%; font-size: 30px; line-height: 1.05; margin: 0 0 10px; text-transform: uppercase; }
h3 { font-size: 19px; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 20px; line-height: 1.5; color: var(--ink-soft); max-width: 36em; margin-top: 18px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }

/* Home page */
.hero { padding-block: 64px 28px; }
.soon {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }
.feature .label { margin-bottom: 8px; }
.feature p { color: var(--ink-soft); margin: 0; font-size: 16px; }

/* Legal pages */
.doc h2 { margin-top: 38px; font-size: 26px; }
.doc ul { padding-left: 1.2em; margin: 0 0 14px; }
.doc li + li { margin-top: 6px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0 18px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.foot {
  margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap;
  gap: 8px 22px; font-family: "DM Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted);
}
.foot a { color: var(--muted); }

/* Shared trip */
.trip-head { padding-block: 28px 8px; }
.map { position: relative; margin-top: 18px; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.map canvas { display: block; width: 100%; height: 340px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; margin-top: 18px; }
.stat b { display: block; font-weight: 800; font-stretch: 68%; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-family: "DM Mono", monospace; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.stops { list-style: none; margin: 18px 0 0; padding: 0; }
.stops li { display: grid; grid-template-columns: 76px 16px minmax(0, 1fr); gap: 0 12px; align-items: start; padding: 8px 0; }
.stops .when { font-family: "DM Mono", monospace; font-size: 13px; color: var(--muted); padding-top: 3px; }
.stops .pin { width: 12px; height: 12px; border: 2px solid var(--done); border-radius: 50%; margin-top: 6px; }
.stops .name { font-weight: 700; font-size: 18px; }
.stops .place { font-family: "DM Mono", monospace; font-size: 13px; color: var(--muted); }
.stops .leg { grid-column: 3; font-family: "DM Mono", monospace; font-size: 12px; color: var(--muted); padding: 2px 0; }
.section { margin-top: 36px; }
.trips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.trip-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.trip-chip b { font-weight: 700; }
.trip-chip small { font-family: "DM Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.trip-chip:hover { border-color: var(--muted); }
.trip-chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 26px 22px; margin-top: 18px; }
.polaroid { cursor: pointer; transition: transform 0.15s ease; }
.polaroid:hover { transform: scale(1.02); }
.polaroid .face { background: var(--frame); padding: 8px 8px 0; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3); position: relative; }
/* A photo with a story has a small folded corner, as a hint there's more on the back. */
.polaroid.has-story .face::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--frame) 50%, rgba(42, 42, 38, 0.18) 50%);
}
/* Tall photos are framed from their upper part, where faces usually are. */
.polaroid img, .polaroid .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 28%; background: #cfd6ca; }
.polaroid .cap {
  font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; color: var(--frame-ink); padding: 9px 2px 11px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

/* The gallery: one photo at a time over the page, big and uncropped, turning over for its story. */
.gallery {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: #0b0f0d; color: #eaefe7;
}
.gallery[hidden], .gallery [hidden] { display: none; }
.gallery .g-stage { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; height: 100%; justify-content: center; }
.gallery .g-card {
  width: min(100%, 560px); height: min(calc(100vh - 150px), 780px); height: min(calc(100dvh - 150px), 780px);
  perspective: 1600px; cursor: pointer; flex: none;
}
.gallery .g-inner { position: relative; width: 100%; height: 100%; transition: transform 0.5s ease; transform-style: preserve-3d; }
.gallery .g-card.flipped .g-inner { transform: rotateY(180deg); }
.gallery .g-face, .gallery .g-back {
  position: absolute; inset: 0; background: var(--frame); color: var(--frame-ink); border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.gallery .g-face { display: flex; flex-direction: column; padding: 14px 14px 0; }
.gallery .g-photo { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.gallery .g-photo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.gallery .g-cap {
  font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; padding: 14px 4px 18px;
}
.gallery .g-back {
  transform: rotateY(180deg); padding: 28px 26px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
}
.gallery .g-when { font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.gallery .g-story { font-style: italic; font-size: 20px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.gallery .g-story.empty { opacity: 0.5; }
.gallery .g-bar { width: min(100%, 560px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gallery .g-count { font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.06em; opacity: 0.8; }
.gallery .g-turn {
  font: 600 14px "Archivo", system-ui, sans-serif; letter-spacing: 0.02em; color: #eaefe7; cursor: pointer;
  background: rgba(234, 239, 231, 0.14); border: 1px solid rgba(234, 239, 231, 0.35); border-radius: 999px; padding: 10px 18px;
}
.gallery .g-turn:hover { background: rgba(234, 239, 231, 0.24); }
.gallery .g-close, .gallery .g-prev, .gallery .g-next {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; font: 400 28px/1 system-ui, sans-serif;
  color: #eaefe7; background: rgba(234, 239, 231, 0.14);
}
.gallery .g-close:hover, .gallery .g-prev:hover, .gallery .g-next:hover { background: rgba(234, 239, 231, 0.24); }
.gallery .g-prev { grid-column: 1; }
.gallery .g-next { grid-column: 3; }
.gallery .g-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 1; }
.message { padding: 70px 0; text-align: center; color: var(--ink-soft); }
.made { margin-top: 42px; display: flex; align-items: center; gap: 10px; font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.12em; color: var(--muted); }
/* The map zooms: a finger scrolls the page until the map is zoomed in, then it moves the map. */
.map canvas { touch-action: pan-y; }
.map.zoomed canvas { touch-action: none; cursor: grab; }
.map.zoomed canvas:active { cursor: grabbing; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.map-btn {
  font: 600 14px "Archivo", system-ui, sans-serif; color: var(--ink); cursor: pointer; min-height: 40px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.map-btn:hover:not(:disabled) { border-color: var(--muted); }
.map-btn:disabled { opacity: 0.45; cursor: default; }
.map-hint { font-family: "DM Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.02em; color: var(--muted); }

/* Likes: a small count on the polaroid, and the buttons under the big photo. */
.polaroid .likes {
  position: absolute; top: 14px; right: 14px; padding: 2px 8px; border-radius: 999px;
  font: 500 11px "DM Mono", ui-monospace, monospace; color: #fff; background: rgba(18, 24, 21, 0.72);
}
.polaroid .likes[hidden] { display: none; }
.gallery .g-actions { width: min(100%, 560px); display: flex; justify-content: center; gap: 10px; }
.gallery .g-like, .gallery .g-note {
  font: 600 14px "Archivo", system-ui, sans-serif; color: #eaefe7; cursor: pointer; min-height: 40px;
  background: rgba(234, 239, 231, 0.14); border: 1px solid rgba(234, 239, 231, 0.35); border-radius: 999px; padding: 9px 18px;
}
.gallery .g-like[aria-pressed="true"] { color: #fff; background: rgba(255, 107, 61, 0.28); border-color: #ff6b3d; }
.gallery .g-like:hover, .gallery .g-note:hover { background: rgba(234, 239, 231, 0.24); }
.gallery .g-like:disabled { opacity: 0.7; cursor: default; }

/* A private note, over the page or the gallery. */
.note-box {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(11, 15, 13, 0.72);
}
.note-box[hidden], .note-box [hidden] { display: none; }
.note-card {
  width: min(100%, 480px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--panel); color: var(--ink); border-radius: 14px; padding: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.note-card h2 { margin: 0; font: 800 26px/1.1 "Archivo", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.01em; }
.note-lead { margin: 8px 0 0; color: var(--ink-soft); }
.note-form label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.note-left { font-weight: 400; color: var(--muted); }
.note-form input, .note-form textarea {
  width: 100%; font: 400 16px/1.4 "Archivo", system-ui, sans-serif; color: var(--ink);
  background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.note-form textarea { resize: vertical; min-height: 110px; }
.note-status { min-height: 1.3em; margin: 10px 0 0; color: var(--accent); font-size: 14px; }
.note-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.note-send, .note-cancel {
  font: 600 15px "Archivo", system-ui, sans-serif; cursor: pointer; min-height: 44px; border-radius: 999px; padding: 10px 20px;
}
.note-send { color: var(--on-accent); background: var(--accent); border: 0; }
.note-send:disabled { opacity: 0.6; cursor: default; }
.note-cancel { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.note-privacy { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.note-sent p { margin: 14px 0; font-size: 17px; }
.note-intro { margin: 6px 0 12px; color: var(--ink-soft); }
.page-note { border-color: var(--accent); }

/* Phones: two polaroids to a row, so the wall still reads as a wall. */
@media (max-width: 520px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .polaroid .face { padding: 6px 6px 0; }
  .polaroid .cap { font-size: 10px; letter-spacing: 0.05em; padding: 7px 2px 9px; }
  .gallery { gap: 2px; padding-inline: 4px; }
  .gallery .g-prev, .gallery .g-next { width: 32px; height: 32px; font-size: 22px; }
  .gallery .g-face { padding: 10px 10px 0; }
  .gallery .g-back { padding: 22px 20px; }
  .gallery .g-story { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .gallery .g-inner, .polaroid { transition: none; } }
