/* Hitch — base styles, fonts, animations, shared components.
   Design tokens + per-screen layout come from the design spec in design/README.md.
   One-off styles live inline in the screen templates (assets/app.js). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/BricolageGrotesque-var.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('fonts/HankenGrotesk-var.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #FAF5EA;
}
body {
  -webkit-font-smoothing: antialiased;
  font-family: 'Hanken Grotesk', sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  position: fixed;
  inset: 0;
}
input { -webkit-user-select: text; user-select: text; }
button { font-family: 'Hanken Grotesk', sans-serif; }

/* app shell: full viewport column, safe-area aware */
#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #FAF5EA;
  padding-top: env(safe-area-inset-top);
  max-width: 540px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

@keyframes hitchDash { to { stroke-dashoffset: -28; } }
@keyframes hitchPulse {
  0% { transform: translate(-50%,-50%) scale(.85); opacity: .5 }
  70% { transform: translate(-50%,-50%) scale(2.3); opacity: 0 }
  100% { transform: translate(-50%,-50%) scale(2.3); opacity: 0 }
}
@keyframes hitchUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
@keyframes hitchDrive { from { offset-distance: 0% } to { offset-distance: 100% } }

.hscreen { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.enter { animation: hitchUp .28s ease both; }
.hscroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { width: 0; height: 0; }

/* ── shared components ─────────────────────────────────────────── */

/* round header buttons (back / bell / share / message) */
.nav-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: #FFFDF8; border: 1px solid #ECE3D3;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; position: relative;
}

/* detail-screen header row */
.screen-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 10px;
}
.head-title { font: 700 16px 'Bricolage Grotesque'; color: #2A2017; }

.card { background: #FFFDF8; border: 1px solid #ECE3D3; border-radius: 16px; }

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Hanken Grotesk'; font-weight: 700; flex: none; position: relative;
}
.avatar .vbadge {
  position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px;
  border-radius: 50%; background: #3F8C5A; border: 2px solid #FFFDF8;
  display: flex; align-items: center; justify-content: center; font-size: 8px; color: #fff;
}

.btn-primary {
  width: 100%; border: none; background: #C75E33; color: #fff;
  font: 700 16px 'Hanken Grotesk'; padding: 16px; border-radius: 16px;
  box-shadow: 0 10px 22px -6px rgba(199,94,51,.5); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-outline {
  width: 100%; border: 1.5px solid #DED4C2; background: transparent; color: #2A2017;
  font: 700 16px 'Hanken Grotesk'; padding: 15px; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-green {
  width: 100%; border: none; background: #3F8C5A; color: #fff;
  font: 700 16px 'Hanken Grotesk'; padding: 16px; border-radius: 16px;
  box-shadow: 0 10px 22px -6px rgba(63,140,90,.45); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}

/* map mode segmented toggle */
.seg-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 30; display: flex;
  background: rgba(255,253,248,.92); border-radius: 12px; padding: 3px;
  box-shadow: 0 5px 14px -4px rgba(40,30,20,.35); border: 1px solid #EFE6D6;
}
.seg-btn {
  border: none; cursor: pointer; font: 600 11.5px 'Hanken Grotesk';
  padding: 6px 14px; border-radius: 9px; transition: all .2s; line-height: 1;
  background: transparent; color: #6B5E50;
}
.seg-btn.on-real { background: #C75E33; color: #fff; }
.seg-btn.on-trail { background: #3F8C5A; color: #fff; }

/* map layers crossfade */
.map-real, .map-trail { position: absolute; inset: 0; transition: opacity .5s ease; }

/* fixed-size map stage scaled to fit its container width (cover) */
.map-stage {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%); transform-origin: center;
}

/* tab bars */
.tabbar {
  flex: none; height: calc(64px + env(safe-area-inset-bottom));
  background: #FFFDF8; border-top: 1px solid #EFE7D7;
  display: flex; align-items: flex-start; justify-content: space-around;
  padding: 8px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 30;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; position: relative;
}
.tab span { font: 700 10px 'Hanken Grotesk'; }

/* toast */
.toast {
  position: absolute; left: 16px; right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: #2A2017; padding: 13px 16px; border-radius: 14px;
  box-shadow: 0 12px 28px -8px rgba(40,30,20,.5);
  animation: hitchUp .28s ease both;
}
.toast span { font: 600 13.5px 'Hanken Grotesk'; color: #fff; }

/* share sheet */
.scrim {
  position: absolute; inset: 0; z-index: 50; background: rgba(28,22,17,.45);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.sheet {
  background: #FAF5EA; border-top-left-radius: 24px; border-top-right-radius: 24px;
  padding: 18px 20px calc(26px + env(safe-area-inset-bottom));
  animation: hitchUp .28s ease both;
}
