/* ============================================================================
   Gyde Web Beta — "Atlas" design tokens + shell/map styling.
   Ported verbatim from the design handoff (colors_and_type.css + index.html).
   The beta is LOCKED to the light paper theme regardless of OS dark mode, so
   the dark-mode block is intentionally omitted and re-asserted on .gyde-app.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* Metric fix: Google's Instrument Serif collapses wrapped multi-line headings
   in Chrome without explicit ascent/descent overrides. Keep this. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/instrumentserif/v5/jizBRFtNs2ka5fXjeivQ4LroWlx-2zI.ttf) format("truetype");
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  --bg: #EAEBE5;
  --surface: #F4F4EE;
  --surface-alt: #FFFFFF;
  --ink: #101814;
  --ink-soft: #2A332D;
  --muted: #6E776F;
  --hairline: rgba(16, 24, 20, 0.10);
  --hairline-strong: rgba(16, 24, 20, 0.22);

  --primary: #1F5F55;
  --primary-ink: #FFFFFF;
  --primary-soft: #D6E5DF;
  --primary-dark: #163F39;
  --primary-light: #6FB8AA;

  --accent: #C57B3C;
  --accent-soft: #F1E2CC;
  --accent-dark: #9E5E26;

  --success: #2E8A5C;
  --warning: #B7791F;
  --error: #B65A35;

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 20, 0.06);
  --shadow-md: 0 12px 28px -16px rgba(16, 24, 20, 0.18);
  --shadow-lg: 0 20px 40px -28px rgba(16, 24, 20, 0.30);
  --shadow-xl: 0 40px 80px -28px rgba(16, 24, 20, 0.30),
               0 12px 28px -10px rgba(16, 24, 20, 0.18);
  --shadow-primary: 0 8px 20px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(55% 45% at 28% 18%, color-mix(in srgb, #1F5F55 9%, transparent), transparent 70%),
    radial-gradient(48% 42% at 86% 12%, color-mix(in srgb, #C57B3C 8%, transparent), transparent 70%),
    #E4E5DE;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The beta always renders on the light paper system — re-assert tokens on the
   frame so an OS dark theme can't bleed in. */
.gyde-app {
  --bg: #EAEBE5; --surface: #F4F4EE; --surface-alt: #FFFFFF;
  --ink: #101814; --ink-soft: #2A332D; --muted: #6E776F;
  --hairline: rgba(16, 24, 20, 0.10); --hairline-strong: rgba(16, 24, 20, 0.22);
  --primary: #1F5F55; --primary-ink: #FFFFFF; --primary-soft: #D6E5DF;
  --primary-dark: #163F39; --primary-light: #6FB8AA;
  --accent: #C57B3C; --accent-soft: #F1E2CC; --accent-dark: #9E5E26;
  position: relative;
  overflow: hidden;
  width: min(440px, 100vw);
  height: min(900px, 100dvh);
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(16, 24, 20, 0.35);
}
@media (max-width: 460px) { .gyde-app { box-shadow: none; } }

#map { position: absolute; inset: 0; z-index: 1; background: #E7E8E0; }

/* Tint the base map toward the Gyde sage/teal palette. */
.leaflet-tile { filter: sepia(0.22) saturate(0.85) hue-rotate(62deg) brightness(1.01) contrast(0.98); }
.leaflet-tile, .leaflet-tile-loaded { opacity: 1 !important; }
.leaflet-container { background: #E7E8E0; font-family: var(--font-body); }
.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow-md); margin: 0 12px 96px 0 !important; }
.leaflet-control-zoom a { background: var(--surface-alt) !important; color: var(--ink) !important; border-color: var(--hairline) !important; }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.7) !important; font-size: 9px !important; }

/* POI pins */
.leaflet-div-icon { background: transparent; border: none; }
.gyde-pin {
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid var(--pc);
  display: grid; place-items: center; box-shadow: 0 4px 10px -3px rgba(16, 24, 20, 0.35); transition: all .15s ease;
}
.gyde-pin.is-active { box-shadow: 0 12px 24px -6px color-mix(in srgb, var(--pc) 55%, transparent); }
.gyde-pin-glyph { transform: rotate(45deg); display: grid; place-items: center; }

/* Route numbered stop dots */
.gyde-stop {
  width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #1F5F55;
  color: #163F39; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(16, 24, 20, 0.25);
}
.gyde-stop.is-active { background: #1F5F55; color: #fff; transform: scale(1.12); box-shadow: 0 8px 18px -6px rgba(31, 95, 85, 0.8); }
.gyde-stop.is-done { background: #E0E8E4; color: #1F5F55; opacity: 0.72; }
.gyde-stop.is-listening.is-active { background: #C57B3C; border-color: #C57B3C; box-shadow: 0 8px 18px -6px rgba(197, 123, 60, 0.85); }

/* Group member avatars on the map */
.gyde-member {
  width: 100%; height: 100%; border-radius: 50%; background: var(--mc); color: #fff; border: 2px solid #fff;
  display: grid; place-items: center; box-shadow: 0 3px 8px -1px rgba(16, 24, 20, 0.4);
}
.gyde-member-face { font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.gyde-member.is-you { background: var(--mc); }
.gyde-member-pulse {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: color-mix(in srgb, #1F5F55 22%, transparent); animation: gpulse 2.4s ease-out infinite;
}
@keyframes gpulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
.no-scrollbar { scrollbar-width: none; }

/* ---- Reusable type / control primitives (used by macros + JS templates) --- */
.gyde-app h2, .gyde-app h3 { margin: 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary);
}
.serif-h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1;
  letter-spacing: -0.01em; color: var(--ink);
}
.serif-h2 em, .serif-em { font-style: italic; font-family: var(--font-display); color: var(--primary); }
.btn-primary {
  width: 100%; height: 50px; border-radius: 999px; border: none; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-primary);
}
.btn-secondary {
  width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--primary); background: var(--surface-alt);
  color: var(--primary-dark); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer;
}
button { font-family: inherit; }
.gyde-icon { display: block; }

@media (prefers-reduced-motion: reduce) {
  .gyde-member-pulse { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
