/* Home page styles */

/* ============== HERO ============== */
.hero {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(56px, 8vw, 110px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 75% 0%, color-mix(in oklab, var(--sage) 28%, transparent) 0%, transparent 60%),
    radial-gradient(900px 500px at 10% 90%, color-mix(in oklab, var(--clay) 14%, transparent) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--cream-2); border: 1px solid var(--line-soft);
  margin-bottom: 24px;
}
.hero-copy .display { margin: 0 0 20px; }
.hero-copy .lede { max-width: 560px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-proof {
  display: flex; flex-direction: column; gap: 20px;
  padding-top: 28px; border-top: 1px solid var(--line-soft);
  max-width: 560px;
}
.proof-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 28px; }
.proof-stats > div { display: flex; flex-direction: column; gap: 2px; }
.proof-stats strong {
  font-family: var(--serif); font-size: 28px; font-weight: 500;
  line-height: 1; letter-spacing: -0.01em;
}
.proof-stats span { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.01em; }
.proof-press { display: flex; align-items: center; gap: 14px; }
.press-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.press-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.press-row i { color: var(--ink-3); font-style: normal; }

/* Map visual */
.hero-visual { position: relative; }
.map-frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px -40px rgba(44,42,38,0.25), 0 2px 0 rgba(44,42,38,0.03);
  overflow: hidden;
}
.map-tabs {
  display: flex; gap: 4px;
  padding: 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--cream);
  overflow-x: auto;
}
.map-tab {
  background: transparent; border: 1px solid transparent;
  padding: 7px 14px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.map-tab:hover { background: var(--cream-2); }
.map-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.map-canvas {
  position: relative; aspect-ratio: 4 / 3;
  background: #EFE9DB; overflow: hidden;
}
.map-tiles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* iOS Safari fix: even with `interactive: false`, the MapLibre canvas
     can swallow vertical swipes on some iPhones, freezing page scroll.
     Explicitly tell the browser that touches on the map are page-scroll
     gestures (pan-y) plus browser-level pinch-zoom — never map gestures.
     Pins are markers with their own element so their taps still fire. */
  touch-action: pan-y pinch-zoom;
}
.map-tiles .maplibregl-canvas { touch-action: pan-y pinch-zoom; }
/* MapLibre canvas outline would show a default blue focus ring on click
   when interactive:false — we still want no visible ring. */
.map-tiles .maplibregl-canvas:focus { outline: none; }
/* Compact bottom-right attribution: keep it readable but out of the way. */
.map-tiles .maplibregl-ctrl-bottom-right { z-index: 3; }
.map-tiles .maplibregl-ctrl-attrib {
  font-size: 10.5px; line-height: 1.2;
  background: color-mix(in oklab, #fff 88%, transparent);
  padding: 2px 6px; border-radius: 4px;
}

/* Photo pins are MapLibre Markers. MapLibre sets transform on the marker
   wrapper (.pin-wrap), so hover/active transforms live on the inner .pin
   to avoid stomping MapLibre's positioning. */
.pin-wrap { cursor: pointer; z-index: 10; }
.pin {
  display: block; position: relative;
  width: 54px; height: 54px;
  border-radius: 12px;
  background-size: cover; background-position: center;
  background-color: var(--cream-2);
  border: 2.5px solid #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  cursor: pointer; padding: 0;
  transition: transform .2s ease, box-shadow .2s, width .2s, height .2s, border-color .2s;
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -8px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 9px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}
.pin:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.24);
}
.pin.active {
  width: 64px; height: 64px;
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

/* Dense canvas — when a hub has many spots, slim the pins down so the
   map feels full without turning into a photo collage. */
.map-canvas.is-dense .pin { width: 40px; height: 40px; border-width: 2px; }
.map-canvas.is-dense .pin.active { width: 52px; height: 52px; }
.map-canvas.is-dense .pin::after {
  border-left-width: 5px; border-right-width: 5px; border-top-width: 7px;
  bottom: -6px;
}
.pin-gem {
  position: absolute; bottom: 4px; right: 4px;
  background: var(--gem); color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 9px; display: grid; place-items: center;
  font-weight: 700;
}

.spot-preview {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  max-width: 340px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  display: flex; gap: 12px; padding: 10px;
  z-index: 4;
  border: 1px solid var(--line-soft);
}
.spot-preview-img {
  width: 76px; height: 76px; border-radius: 10px;
  background-size: cover; background-position: center;
  background-color: var(--cream-3);
  flex-shrink: 0;
}
.spot-preview-body { flex: 1; min-width: 0; padding-top: 4px; }
.spot-preview-name {
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  letter-spacing: -0.005em; line-height: 1.15;
  color: var(--ink);
}
.spot-preview-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.spot-preview-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.spot-preview-tags span {
  font-size: 11px; background: var(--cream-2); padding: 3px 8px;
  border-radius: 999px; color: var(--ink-2);
}

.map-count {
  position: absolute; top: 16px; right: 16px;
  background: var(--ink); color: var(--cream);
  border-radius: 999px; padding: 7px 14px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500;
}
.map-count em { font-style: normal; font-weight: 600; }
.map-count .dot { background: var(--cream); }

.map-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-top: 1px solid var(--line-soft);
  background: var(--cream);
}
.map-foot-link {
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0; margin-left: 12px;
}
.map-foot-link:hover { color: var(--clay); }

.map-caption {
  text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-3);
}
.map-caption a { color: var(--ink); font-weight: 500; }

/* Map loading state — subtle shimmer while spots are fetched */
.map-canvas.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklab, #fff 35%, transparent) 50%,
    transparent 100%
  );
  animation: map-shimmer 1.6s ease-in-out infinite;
  pointer-events: none; z-index: 2;
}
@keyframes map-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Mosaic variant — same dataset as the map, grid layout.
   Hidden by default; activated when #hero-visual has data-visual="mosaic". */
.hero-mosaic { display: none; }
[data-visual="mosaic"] .map-frame,
[data-visual="mosaic"] .map-caption { display: none; }
[data-visual="mosaic"] .hero-mosaic {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 120px;
  gap: 10px; border-radius: var(--radius-lg); overflow: hidden;
  max-height: 640px; overflow-y: auto;
}
.hm-tile {
  background-size: cover; background-position: center;
  border-radius: 8px; background-color: var(--cream-3);
}
/* Repeating 6-cell rhythm — every 6th tile spans 2 rows at positions 1
   and 4, keeping a long list visually varied instead of a flat grid. */
.hm-tile:nth-child(6n+1),
.hm-tile:nth-child(6n+4) { grid-row: span 2; }

@media (max-width: 980px) {
  /* minmax(0, 1fr) instead of 1fr so the column can't auto-grow to a
     child's min-content — same bug pattern that was widening
     .proof-stats past the viewport. */
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { min-width: 0; }
  .hero-visual { order: 2; min-width: 0; }
  .proof-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 540px) {
  /* iPhone SE / narrow phones: 44px min for .display pushed "Google Maps"
     flush to the viewport edge; 32px floor keeps the serif drama without
     overflow. Stat rows stack instead of two-column. */
  .hero-copy .display { font-size: clamp(32px, 8.5vw, 44px); }
  .hero-copy .lede { font-size: 16px; }
  .proof-stats { grid-template-columns: 1fr; gap: 18px; }
}

/* ============== STORY ============== */
.story { background: var(--cream-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.story-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: clamp(36px, 5vw, 64px);
}
.story-step {
  display: grid;
  grid-template-columns: 80px 1fr 260px;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
}
.story-step:nth-child(even) { direction: rtl; }
.story-step:nth-child(even) > * { direction: ltr; }
.story-step:nth-child(even) .step-num { text-align: right; }

.step-num {
  font-family: var(--serif); font-size: 56px; font-weight: 400;
  line-height: 1; color: var(--ink); letter-spacing: -0.02em;
  /* Was opacity 0.35 — failed WCAG AA 3:1 for large text. Bumping to
     0.55 keeps the decorative-numeral feel while passing contrast. */
  opacity: 0.55;
}
.step-body h3 { margin: 0 0 8px; }
.step-body p { color: var(--ink-2); max-width: 520px; margin: 0; text-wrap: pretty; }
.step-visual { display: flex; justify-content: center; }

.phone {
  width: 100%; max-width: 260px;
  aspect-ratio: 9 / 19;
  border-radius: 36px;
  padding: 8px;
  background: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(44,42,38,0.4), 0 2px 0 rgba(44,42,38,0.06);
  overflow: hidden;
}
.phone img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  border-radius: 28px;
  background: var(--cream);
}
.phone-sm { max-width: 220px; }
.phone-lg { max-width: 320px; }

.story-outcome {
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(32px, 5vw, 56px);
  background: var(--ink); color: var(--cream);
  border-radius: var(--radius-lg);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.story-outcome h3 { margin: 0 0 12px; color: var(--cream); }
.story-outcome .lede { color: color-mix(in oklab, var(--cream) 80%, transparent); margin: 0; }
.outcome-stat {
  border-left: 1px solid color-mix(in oklab, var(--cream) 22%, transparent);
  padding-left: clamp(20px, 3vw, 32px);
}
.outcome-stat-n {
  display: block; font-family: var(--serif); font-size: clamp(56px, 8vw, 96px);
  line-height: 1; letter-spacing: -0.03em; margin-bottom: 10px;
}
.outcome-stat-l {
  display: block; font-size: 14px; color: color-mix(in oklab, var(--cream) 68%, transparent);
  max-width: 280px; line-height: 1.5;
}

@media (max-width: 780px) {
  .story-step { grid-template-columns: 1fr; }
  .story-step:nth-child(even) { direction: ltr; }
  .step-num { font-size: 40px; opacity: 0.3; }
  .story-outcome { grid-template-columns: 1fr; }
  .outcome-stat { border-left: 0; padding-left: 0; border-top: 1px solid color-mix(in oklab, var(--cream) 18%, transparent); padding-top: 24px; }
}

/* ============== BENTO FEATURES ============== */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(260px, auto);
  gap: 16px;
}
.bento-tile {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
}
.bento-tile .eyebrow { margin-bottom: 2px; }
.bento-tile h3 { margin: 0; }
.bento-tile p { color: var(--ink-2); margin: 0; font-size: 15.5px; }
.tile-copy { max-width: 420px; }
.tile-visual { margin-top: auto; display: flex; justify-content: center; }

.tile-spots { grid-column: span 3; grid-row: span 2; background: #fff; }
.tile-ai    { grid-column: span 3; grid-row: span 2; background: var(--ink); color: var(--cream); }
.tile-ai p { color: color-mix(in oklab, var(--cream) 78%, transparent); }
.tile-ai h3 { color: var(--cream); }
.tile-ai .eyebrow { color: color-mix(in oklab, var(--cream) 60%, transparent); }

.tile-map { grid-column: span 3; grid-row: span 2; background: #EFE9DB; }
.tile-plan { grid-column: span 3; grid-row: span 2; }
.tile-book { grid-column: span 4; grid-row: span 1; background: #F1EDE4; }
/* Deeper clay (clay * 75% + black 25%) so white body/eyebrow text hits
   WCAG AA Normal (4.5:1). Plain --clay gives only 3.4:1 against white. */
.tile-upload { grid-column: span 2; grid-row: span 1; background: color-mix(in oklab, var(--clay) 75%, black); color: #fff; }
.tile-upload h3 { color: #fff; }
.tile-upload p { color: #fff; }
.tile-upload .eyebrow { color: #fff; }

.tile-spots .phone, .tile-map .phone { max-width: 200px; }
.tile-ai .phone, .tile-plan .phone { max-width: 200px; }

.partner-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 4px;
}

@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-spots, .tile-ai, .tile-map, .tile-plan, .tile-book, .tile-upload { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .tile-spots, .tile-ai, .tile-map, .tile-plan, .tile-book, .tile-upload { grid-column: span 1; }
}

/* ============== CITIES ============== */
.cities { background: var(--cream-2); }
.city-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.city-card {
  padding: 26px;
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  position: relative; overflow: hidden;
  transition: transform .2s ease, border-color .2s;
  border-top: 3px solid var(--accent, var(--ink));
}
.city-card:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.city-count {
  font-family: var(--serif); font-size: 36px; font-weight: 400;
  line-height: 1; letter-spacing: -0.02em; margin-bottom: 18px;
  /* Accent colors (set per-card via inline --accent) are used for the
     top border only — some accents (sd gold, la blue) don't meet WCAG
     AA Large on white for the count text. Use --ink for the numeral. */
  color: var(--ink);
}
.city-name { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.15; }
.city-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.cities-note { text-align: center; margin-top: 32px; color: var(--ink-2); font-size: 15px; }
.cities-note a { color: var(--ink); font-weight: 500; }

@media (max-width: 900px) { .city-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .city-grid { grid-template-columns: 1fr; } }

/* ============== FAQ ============== */
.faq-wrap { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 0;
}
.faq-item summary {
  list-style: none; cursor: pointer;
  font-family: var(--serif); font-size: 20px; font-weight: 500;
  letter-spacing: -0.005em; line-height: 1.3;
  padding: 18px 40px 18px 0; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%); font-size: 22px; color: var(--ink-3);
  font-family: var(--sans); font-weight: 300;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "–"; }
.faq-body { padding: 0 0 18px; }
.faq-body p { color: var(--ink-2); margin: 0; max-width: 640px; }
.faq-body a { color: var(--ink); font-weight: 500; }

@media (max-width: 780px) { .faq-wrap { grid-template-columns: 1fr; } }

/* ============== DOWNLOAD ============== */
.download { background: var(--ink); color: var(--cream); position: relative; overflow: hidden; }
.download::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 400px at 80% 30%, color-mix(in oklab, var(--clay) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.download-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
.download h2 { margin: 0 0 16px; color: var(--cream); }
.download .lede { color: color-mix(in oklab, var(--cream) 78%, transparent); max-width: 560px; margin: 0 0 28px; }
.download .stores { margin-bottom: 16px; }
.download-note { color: color-mix(in oklab, var(--cream) 55%, transparent); }
.download-visual { display: flex; justify-content: center; }

@media (max-width: 780px) { .download-inner { grid-template-columns: 1fr; } .download-visual { order: 2; } }

/* ============== FOOTNOTES ============== */
.footnotes { padding: 32px 0 48px; }
.footnotes .small { color: var(--ink-3); }
