/* Daichi — trail passport.
   Palette sampled from the Daichi tags and tickets: moss green and bone cream.
   Clay appears only where something is being recorded or destroyed. */

@font-face {
  font-family: 'Dela Gothic One';
  src: url('/fonts/dela/dela-gothic-one-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/fonts/hanken/hanken-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/fonts/dmmono/dm-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
/* Metric-matched fallbacks so text does not jump when the web fonts arrive. */
@font-face {
  font-family: 'Dela Fallback';
  src: local('Arial Black'), local('Arial Bold'), local('Arial');
  size-adjust: 118%;
  ascent-override: 88%;
  descent-override: 24%;
}
@font-face {
  font-family: 'Hanken Fallback';
  src: local('Arial');
  size-adjust: 98%;
}

:root {
  --moss: #43563a; /* primary: tickets, buttons, brand */
  --pine: #26331f; /* text and deep surfaces */
  --ink: #1b2416; /* strongest text */
  --bone: #ebe4d1; /* tag cream: cards, text on moss */
  --paper: #f5f0e3; /* page */
  --lichen: #8c9a72; /* decoration, stitching, chart fills */
  --muted: #56624b; /* secondary text on paper */
  --clay: #a34a2f; /* recording, destructive */
  --line: rgb(38 51 31 / 0.16);
  --stitch-on-moss: rgb(235 228 209 / 0.55);
  --stitch-on-bone: rgb(67 86 58 / 0.5);

  --font-display: 'Dela Gothic One', 'Dela Fallback', 'Arial Black', sans-serif;
  --font-body: 'Hanken Grotesk', 'Hanken Fallback', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --fs-hero: clamp(2.6rem, 15.5vw, 7.5rem); /* "BEYOND." is 5.6em wide in Dela */
  --fs-h1: clamp(1.9rem, 5.2vw, 3.1rem);
  --fs-h2: clamp(1.35rem, 3.2vw, 1.9rem);
  --fs-h3: 1.0625rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.72rem;

  --radius: 16px;
  --radius-s: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --tabbar: 68px;
  --topbar: 62px;
  --chrome-top: calc(var(--topbar) + env(safe-area-inset-top));
  --shadow: 0 1px 0 rgb(38 51 31 / 0.08), 0 10px 24px -14px rgb(38 51 31 / 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--pine);
  font: 400 var(--fs-body) / 1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
p,
dl,
dd,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-moss :focus-visible,
.on-moss:focus-visible {
  outline-color: var(--bone);
}
/* <main> takes focus on navigation for screen readers; it needs no ring. */
main[tabindex='-1']:focus,
main[tabindex='-1']:focus-visible {
  outline: none;
}
[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 2000;
  background: var(--ink);
  color: var(--bone);
  padding: 10px 14px;
  border-radius: 8px;
}
.skip:focus {
  top: 12px;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Type ------------------------------------------------------------------ */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.h1 {
  font-size: var(--fs-h1);
}
.h2 {
  font-size: var(--fs-h2);
  line-height: 1.05;
}
.h3 {
  font: 650 var(--fs-h3) / 1.3 var(--font-body);
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: var(--fs-small);
}
.prose {
  max-width: 62ch;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Brand ------------------------------------------------------------------ */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 400 1.25rem/1 var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}
.wordmark svg {
  width: 30px;
  height: 30px;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1.5px solid var(--moss);
  border-radius: 12px;
  background: var(--moss);
  color: var(--bone);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:hover {
  background: var(--pine);
  border-color: var(--pine);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn--ghost {
  background: transparent;
  color: var(--pine);
  border-color: var(--stitch-on-bone);
}
.btn--ghost:hover {
  background: rgb(67 86 58 / 0.1);
  border-color: var(--moss);
}
.btn--bone {
  background: var(--bone);
  color: var(--pine);
  border-color: var(--bone);
}
.btn--bone:hover {
  background: #fff8e6;
  border-color: #fff8e6;
}
.btn--outline-bone {
  background: transparent;
  color: var(--bone);
  border-color: var(--stitch-on-moss);
}
.btn--outline-bone:hover {
  background: rgb(235 228 209 / 0.12);
  border-color: var(--bone);
}
.btn--danger {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff6ea;
}
.btn--danger:hover {
  background: #873a23;
  border-color: #873a23;
}
.btn--small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: var(--fs-small);
  border-radius: 10px;
}
.btn--block {
  width: 100%;
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--moss);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Forms ------------------------------------------------------------------ */

.field {
  display: grid;
  gap: 6px;
  align-content: start;
  margin-bottom: 16px;
}
.field > label,
.field > .label {
  font-weight: 650;
  font-size: var(--fs-small);
}
.field .hint {
  font-size: var(--fs-small);
  color: var(--muted);
}
.input,
.field input:not([type='checkbox'], [type='radio'], [type='range'], [type='file']),
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background: #fffdf6;
  border: 1.5px solid rgb(38 51 31 / 0.32);
  border-radius: var(--radius-s);
}
.field textarea {
  min-height: 120px;
  resize: vertical;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--moss);
}
.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--clay);
}
.on-moss .field .hint,
.on-moss .muted {
  color: inherit;
  opacity: 0.86;
}
.on-moss .linkish {
  color: var(--bone);
}
.on-moss .form-error {
  background: #f6dcd2;
}
.grid-2 {
  display: grid;
  gap: 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.form-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 4px solid var(--clay);
  background: rgb(163 74 47 / 0.1);
  border-radius: 6px;
  color: #6f2c18;
  font-weight: 600;
}
.switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
}
.switch input {
  appearance: none;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: rgb(38 51 31 / 0.25);
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fffdf6;
  transition: transform 0.15s ease;
}
.switch input:checked {
  background: var(--moss);
}
.switch input:checked::after {
  transform: translateX(18px);
}
.on-moss .switch input {
  background: rgb(235 228 209 / 0.3);
  box-shadow: inset 0 0 0 1.5px var(--stitch-on-moss);
}
.on-moss .switch input:checked {
  background: var(--bone);
}
.on-moss .switch input:checked::after {
  background: var(--moss);
}
.switch strong {
  display: block;
  font-weight: 650;
}

/* App shell -------------------------------------------------------------- */

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--chrome-top);
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: rgb(245 240 227 / 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar nav {
  display: none;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff6ea;
  text-decoration: none;
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px var(--gutter) calc(var(--tabbar) + 40px + env(safe-area-inset-bottom));
}
.page.page--wide {
  max-width: none;
  padding: 0 0 calc(var(--tabbar) + env(safe-area-inset-bottom));
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head .mono {
  color: var(--muted);
  margin-bottom: 8px;
}

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 950;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pine);
  color: var(--bone);
}
.tabbar a {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  text-decoration: none;
  opacity: 0.72;
}
.tabbar a[aria-current='page'] {
  opacity: 1;
}
.tabbar a[aria-current='page'] svg {
  color: #fff8e6;
}
.tabbar svg {
  width: 22px;
  height: 22px;
}
.tabbar .tab-rec {
  opacity: 1;
}
.tabbar .tab-rec .tab-rec__dot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -18px;
  border-radius: 50%;
  background: var(--bone);
  color: var(--pine);
  box-shadow: 0 0 0 5px var(--pine);
}
.tabbar .tab-rec.is-live .tab-rec__dot {
  background: var(--clay);
  color: #fff6ea;
}

@media (min-width: 860px) {
  .tabbar {
    display: none;
  }
  .topbar nav {
    display: flex;
    gap: 6px;
  }
  .topbar nav a {
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
  }
  .topbar nav a:hover {
    background: rgb(67 86 58 / 0.1);
  }
  .topbar nav a[aria-current='page'] {
    background: var(--moss);
    color: var(--bone);
  }
  .page {
    padding-bottom: 64px;
  }
  .page.page--wide {
    padding-bottom: 0;
  }
  body > #toasts {
    bottom: 24px;
  }
}

/* Stamp (avatar) --------------------------------------------------------- */

.stamp {
  --size: 44px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--moss);
  color: var(--bone);
  font: 400 calc(var(--size) * 0.36) / 1 var(--font-display);
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
}
.stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stamp-ring {
  display: inline-grid;
  padding: calc(var(--size, 44px) * 0.07);
  border-radius: 50%;
  border: 2px dashed var(--stitch-on-bone);
}
.on-moss .stamp-ring {
  border-color: var(--stitch-on-moss);
}

/* Tickets: the signature ------------------------------------------------- */

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 120px;
  border-radius: var(--radius);
  background: var(--moss);
  color: var(--bone);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease;
}
/* stitched inner border, as on the fabric tags */
.ticket::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px dashed var(--stitch-on-moss);
  border-radius: 11px;
  pointer-events: none;
}
a.ticket:hover {
  transform: translateY(-2px) rotate(-0.25deg);
}
.ticket--bone {
  background: var(--bone);
  color: var(--pine);
}
.ticket--bone::before {
  border-color: var(--stitch-on-bone);
}
.ticket__stub {
  position: relative;
  display: grid;
  place-items: center;
  padding: 16px 8px 16px 16px;
  border-right: 1.5px dashed var(--stitch-on-moss);
}
.ticket--bone .ticket__stub {
  border-right-color: var(--stitch-on-bone);
}
/* perforation notches where the stub tears off */
.ticket__stub::before,
.ticket__stub::after {
  content: '';
  position: absolute;
  right: -8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--page-bg, var(--paper));
}
.ticket__stub::before {
  top: -8px;
}
.ticket__stub::after {
  bottom: -8px;
}
.ticket__stub svg {
  width: 56px;
  height: 56px;
}
.ticket__stub img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}
.ticket__body {
  min-width: 0;
  padding: 18px 20px 16px 18px;
  display: grid;
  gap: 6px;
  align-content: center;
}
.ticket__eyebrow {
  opacity: 0.85;
}
.ticket__title {
  font: 400 1.18rem/1.12 var(--font-display);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.ticket__coords {
  opacity: 0.8;
}
.ticket__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 4px;
}
.ticket__stats div {
  display: grid;
}
.ticket__stats dt {
  font: 400 0.64rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}
.ticket__stats dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ticket__lock {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 16px;
  height: 16px;
  opacity: 0.8;
}
.ticket-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

/* Cards and panels ------------------------------------------------------- */

.card {
  background: #fbf7ea;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
}
.card + .card {
  margin-top: 18px;
}
.card > .h2 {
  margin-bottom: 6px;
}
.card > .h2 + p {
  margin-bottom: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats div {
  background: #fbf7ea;
  padding: 16px 18px;
}
.stats dt {
  color: var(--muted);
}
.stats dd {
  margin-top: 4px;
  font: 400 clamp(1.25rem, 3.4vw, 1.75rem) / 1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.stats dd small {
  font: 600 0.8rem var(--font-body);
  margin-left: 3px;
}
.empty {
  padding: 40px 24px;
  border: 2px dashed var(--stitch-on-bone);
  border-radius: var(--radius);
  text-align: center;
}
.empty .display {
  font-size: var(--fs-h2);
  margin-bottom: 8px;
}
.empty p {
  max-width: 44ch;
  margin: 0 auto 18px;
  color: var(--muted);
}
.empty .btn-row {
  justify-content: center;
}
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bone);
  border: 1px solid var(--stitch-on-bone);
  font-size: var(--fs-small);
}
.notice svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}
.notice--clay {
  background: rgb(163 74 47 / 0.1);
  border-color: rgb(163 74 47 / 0.45);
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 7px 14px;
  min-height: 36px;
  border-radius: 999px;
  border: 1.5px solid var(--stitch-on-bone);
  background: transparent;
  font-weight: 600;
  font-size: var(--fs-small);
  cursor: pointer;
}
.chip[aria-pressed='true'] {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--bone);
}

/* Maps ------------------------------------------------------------------- */

.map {
  width: 100%;
  height: clamp(280px, 52vh, 520px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bone);
  border: 1px solid var(--line);
  z-index: 0;
}
.map--full {
  height: calc(100dvh - var(--chrome-top) - var(--tabbar) - env(safe-area-inset-bottom));
  border-radius: 0;
  border: 0;
}
.map--picker {
  height: 280px;
}
@media (min-width: 860px) {
  .map--full {
    height: calc(100dvh - var(--chrome-top));
  }
}
.leaflet-container {
  font-family: var(--font-body);
  background: var(--bone);
}
.leaflet-control-attribution {
  font-size: 10px;
}
.leaflet-bar a,
.leaflet-control-layers {
  color: var(--pine);
}
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  background: var(--paper);
  color: var(--pine);
}
.leaflet-popup-tip {
  background: var(--paper);
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-size: var(--fs-small);
}
.leaflet-popup-content strong {
  display: block;
  font: 400 0.95rem/1.15 var(--font-display);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--moss);
  border: 3px solid #fffdf6;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.45);
}
.pin--trip {
  background: var(--bone);
  border-color: var(--moss);
}
.pin--end {
  background: var(--pine);
  border-radius: 4px;
}
.pin--me {
  background: var(--clay);
  box-shadow: 0 0 0 6px rgb(163 74 47 / 0.25), 0 1px 4px rgb(0 0 0 / 0.45);
}
.pin--probe {
  width: 14px;
  height: 14px;
  background: #fffdf6;
  border-color: var(--clay);
}

/* Recorder --------------------------------------------------------------- */

.rec {
  display: grid;
  min-height: calc(100dvh - var(--chrome-top) - var(--tabbar) - env(safe-area-inset-bottom));
  grid-template-rows: minmax(220px, 1fr) auto;
}
.rec .map {
  height: 100%;
  min-height: 220px;
  border-radius: 0;
  border: 0;
}
.rec__panel {
  position: relative;
  z-index: 2;
  margin-top: -18px;
  padding: 22px var(--gutter) 24px;
  border-radius: 22px 22px 0 0;
  background: var(--moss);
  color: var(--bone);
}
.rec__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.rec__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rec__state .rec-dot {
  color: #ffb49c;
}
.rec__state.is-idle .rec-dot,
.rec__state.is-paused .rec-dot {
  animation: none;
  color: var(--lichen);
}
.rec__big {
  font: 400 clamp(3rem, 15vw, 5.4rem) / 0.95 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.rec__big small {
  font: 600 1rem var(--font-body);
  margin-left: 6px;
  opacity: 0.85;
}
.rec__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 18px;
}
.rec__grid div {
  padding-top: 10px;
  border-top: 1.5px dashed var(--stitch-on-moss);
}
.rec__grid dt {
  opacity: 0.8;
}
.rec__grid dd {
  font: 700 1.3rem/1.2 var(--font-body);
  font-variant-numeric: tabular-nums;
}
.rec__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rec__controls .btn {
  min-height: 56px;
  font-size: 1.05rem;
}
.rec__controls .btn--wide {
  grid-column: 1 / -1;
}
.rec__hint {
  margin-top: 14px;
  font-size: var(--fs-small);
  opacity: 0.88;
}
.rec__hint button {
  color: var(--bone);
}
@media (min-width: 860px) {
  .rec {
    min-height: calc(100dvh - var(--chrome-top));
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 400px;
  }
  .rec__panel {
    margin: 0;
    border-radius: 0;
    padding: 32px;
    align-content: start;
  }
}

/* Detail pages ----------------------------------------------------------- */

.hero-ticket {
  position: relative;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--radius);
  background: var(--moss);
  color: var(--bone);
  margin-bottom: 18px;
}
.hero-ticket::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--stitch-on-moss);
  border-radius: 10px;
  pointer-events: none;
}
.hero-ticket--bone {
  background: var(--bone);
  color: var(--pine);
}
.hero-ticket--bone::before {
  border-color: var(--stitch-on-bone);
}
.hero-ticket .display {
  font-size: var(--fs-h1);
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.hero-ticket__by {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  text-decoration: none;
  font-weight: 600;
  position: relative;
}
.hero-ticket .stats {
  margin-top: 20px;
  background: var(--stitch-on-moss);
  border-color: var(--stitch-on-moss);
  position: relative;
}
.hero-ticket .stats div {
  background: var(--moss);
}
.hero-ticket .stats dt {
  color: inherit;
  opacity: 0.8;
}
.two-col {
  display: grid;
  gap: 18px;
}
@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}
.profile {
  position: relative;
  touch-action: pan-y;
}
.profile svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.profile__scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  padding: 2px 0;
}
.profile__readout {
  min-height: 1.4em;
  margin-top: 8px;
  color: var(--muted);
}
.photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.photo-grid figure {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bone);
}
.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-grid button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(27 36 22 / 0.78);
  color: var(--bone);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.photo-grid button svg {
  width: 16px;
  height: 16px;
}

/* Avatar studio ---------------------------------------------------------- */

.studio {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 700px) {
  .studio {
    grid-template-columns: 260px 1fr;
  }
}
.studio__preview {
  display: grid;
  justify-items: center;
  gap: 12px;
}
.studio__canvas {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--moss);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--bone);
  font: 400 4rem/1 var(--font-display);
}
.studio__canvas canvas {
  width: 100%;
  height: 100%;
}
.studio__ring {
  padding: 12px;
  border-radius: 50%;
  border: 2.5px dashed var(--stitch-on-bone);
}
input[type='range'] {
  width: 100%;
  accent-color: var(--moss);
  min-height: 32px;
}

/* Dialog + toasts -------------------------------------------------------- */

dialog {
  width: min(92vw, 440px);
  padding: 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--pine);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6);
}
dialog::backdrop {
  background: rgb(27 36 22 / 0.6);
}
dialog .display {
  font-size: 1.35rem;
  margin-bottom: 10px;
}
dialog .btn-row {
  margin-top: 20px;
  justify-content: flex-end;
}
#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3000;
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bone);
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}
.toast--bad {
  background: #6f2c18;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Auth ------------------------------------------------------------------- */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--moss);
  color: var(--bone);
  --page-bg: var(--moss);
}
.auth__top {
  padding: 18px var(--gutter);
}
.auth__wrap {
  display: grid;
  place-items: start center;
  padding: 12px var(--gutter) 60px;
}
.auth__card {
  width: min(100%, 440px);
  padding: clamp(22px, 5vw, 34px);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--pine);
  position: relative;
}
.auth__card::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--stitch-on-bone);
  border-radius: 10px;
  pointer-events: none;
}
.auth__card > * {
  position: relative;
}
.auth__card .display {
  font-size: var(--fs-h2);
  margin-bottom: 6px;
}
.auth__card > p {
  margin-bottom: 20px;
}
.auth__alt {
  margin-top: 18px;
  text-align: center;
}

/* Landing ---------------------------------------------------------------- */

.land-hero {
  position: relative;
  overflow: hidden;
  background: var(--moss);
  color: var(--bone);
  --page-bg: var(--moss);
}
.land-hero__topo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--bone);
  opacity: 0.13;
  pointer-events: none;
}
.land-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px var(--gutter);
  max-width: 1240px;
  margin: 0 auto;
}
.land-hero__inner {
  position: relative;
  display: grid;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) var(--gutter) clamp(56px, 9vw, 120px);
}
.land-hero__inner > * {
  min-width: 0;
}
.land-hero h1 {
  font-size: var(--fs-hero);
  line-height: 0.86;
}
.land-hero__lede {
  max-width: 44ch;
  margin: 22px 0 28px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}
.land-hero__coords {
  margin-top: 26px;
  opacity: 0.85;
}
.land-stack {
  display: grid;
  gap: 14px;
  align-content: center;
  width: 100%;
  max-width: 440px;
}
.land-stack .ticket:nth-child(1) {
  transform: rotate(-2.2deg);
}
.land-stack .ticket:nth-child(2) {
  transform: rotate(1.2deg);
}
.land-stack .ticket:nth-child(3) {
  transform: rotate(-0.8deg);
}
.land-stack .ticket--moss-deep {
  background: var(--pine);
}
@media (min-width: 940px) {
  .land-hero__inner {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
  .land-hero h1 {
    font-size: clamp(4.6rem, 8.4vw, 6.9rem);
  }
  .land-stack {
    justify-self: end;
  }
  .land-stack .ticket:nth-child(2) {
    transform: rotate(1.4deg) translateX(14px);
  }
}
.land-section {
  padding: clamp(56px, 9vw, 110px) var(--gutter);
}
.land-section > div {
  max-width: 1160px;
  margin: 0 auto;
}
.land-section--bone {
  background: var(--bone);
  --page-bg: var(--bone);
}
.land-section .display.h1 {
  max-width: 16ch;
  margin-bottom: clamp(28px, 5vw, 52px);
}
.land-three {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.land-three article {
  padding-top: 18px;
  border-top: 2px dashed var(--stitch-on-bone);
}
.land-three svg {
  width: 34px;
  height: 34px;
  color: var(--moss);
  margin-bottom: 14px;
}
.land-three h3 {
  font: 400 1.3rem/1.1 var(--font-display);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.land-steps {
  display: grid;
  gap: 14px;
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.land-steps li {
  counter-increment: step;
  position: relative;
  padding: 22px 20px 22px;
  border-radius: var(--radius);
  background: var(--paper);
}
.land-steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 26px;
  font: 400 var(--fs-label) / 1 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--muted);
}
.land-steps h3 {
  font: 400 1.1rem/1.15 var(--font-display);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.land-cta {
  background: var(--pine);
  color: var(--bone);
  text-align: center;
}
.land-cta .display {
  font-size: clamp(2.4rem, 9vw, 6rem);
  margin: 0 auto 24px;
}
.land-cta p {
  margin: 0 auto 28px;
  max-width: 46ch;
}
.land-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px var(--gutter);
  background: var(--pine);
  color: var(--bone);
  border-top: 1.5px dashed var(--stitch-on-moss);
}
.rise {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 26px;
  }
}

/* Public page ------------------------------------------------------------ */

.pub-head {
  display: grid;
  gap: 20px;
  justify-items: start;
  padding: clamp(24px, 5vw, 44px);
  border-radius: var(--radius);
  background: var(--moss);
  color: var(--bone);
  position: relative;
  margin-bottom: 18px;
}
.pub-head::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--stitch-on-moss);
  border-radius: 10px;
  pointer-events: none;
}
.pub-head > * {
  position: relative;
}
.pub-head .display {
  font-size: var(--fs-h1);
}
.pub-head .stamp {
  --size: 104px;
  background: var(--pine);
}
@media (min-width: 640px) {
  .pub-head {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}
.loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
