/* ============================================================
   Hub — "the pamphlet"
   Browsable on a bench with no camera involved.
   ============================================================ */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding-left: max(var(--gutter), var(--safe-left));
  padding-right: max(var(--gutter), var(--safe-right));
  /* Clear the fixed scan dock so the last card is never trapped under it. */
  padding-bottom: calc(124px + var(--safe-bottom));
}

/* ---------- Masthead ---------- */

.masthead {
  padding: calc(28px + var(--safe-top)) 0 20px;
  text-align: center;
}

.masthead-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  color: var(--brass);
}
.masthead-mark svg { width: 100%; height: 100%; }

.masthead h1 {
  font-size: clamp(27px, 7.5vw, 36px);
  margin-bottom: 6px;
}

.masthead-sub {
  font-size: 14px;
  color: var(--ink-3);
}

.visit-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.visit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.visit-pill.is-open  { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal-deep); }
.visit-pill.is-closed { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- Section headers ---------- */

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 21px;
}

.section-note {
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Missions ---------- */

.mission-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Bleed to the screen edge so cards look like they continue off-screen. */
  margin-inline: calc(-1 * max(var(--gutter), var(--safe-left)));
  padding-inline: max(var(--gutter), var(--safe-left));
  padding-bottom: 4px;
  scrollbar-width: none;
}
.mission-rail::-webkit-scrollbar { display: none; }

/* Mission cards are a fixed dark surface in both themes — they're the
   one "poster" element on the page. Deliberately not themed, so these
   are literals rather than tokens that flip. */
.mission-card {
  flex: 0 0 auto;
  width: min(78%, 300px);
  scroll-snap-align: start;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #241d16, #3d3024);
  color: #f7f2e8;
  border: 1px solid rgba(212, 171, 106, .22);
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.mission-card:active { transform: scale(.98); }

.mission-card .eyebrow { color: #d4ab6a; }

.mission-card h3 {
  font-size: 20px;
  margin: 8px 0 6px;
  color: #f7f2e8;
}

.mission-blurb {
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(247, 242, 232, .74);
}

.mission-stops {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #d4ab6a;
}

.mission-track {
  display: flex;
  gap: 4px;
}
.mission-track i {
  width: 16px; height: 3px;
  border-radius: 2px;
  background: #d4ab6a;
  opacity: .55;
}

/* ---------- Filters ---------- */

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-inline: calc(-1 * max(var(--gutter), var(--safe-left)));
  padding: 2px max(var(--gutter), var(--safe-left));
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

/* ---------- Building list ---------- */

.chip-mission {
  background: var(--brass-deep);
  border-color: var(--brass-deep);
  color: #fff;
}
.chip-mission[aria-pressed="true"] {
  background: var(--brass-deep);
  border-color: var(--brass-deep);
  color: #fff;
}

.building-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.building-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.building-card:active {
  transform: scale(.985);
  box-shadow: var(--shadow);
}

.building-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-3);
  display: grid;
  place-items: center;
  color: var(--brass-deep);
}
/* The icon is a fallback sitting underneath; the photo must cover it
   rather than stack below it in the grid flow. */
.building-thumb img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.building-thumb svg { width: 30px; height: 30px; opacity: .55; }

.building-body { min-width: 0; }

.building-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.building-name {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-display);
}

.building-era {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brass-deep);
}

.building-teaser {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.building-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.building-cat {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.empty-note {
  padding: 28px 8px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ---------- Footer ---------- */

.hub-footer {
  margin-top: 40px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.hub-footer a { color: var(--brass-deep); font-weight: 600; }

/* ---------- Scan CTA (fixed) ---------- */

.scan-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + var(--safe-bottom));
  z-index: 40;
  width: min(100% - 32px, 420px);
  display: flex;
  justify-content: center;
}

.scan-dock .btn {
  width: 100%;
  box-shadow: var(--shadow-lg);
}

/* ---------- Foldable / wide ---------- */

@media (min-width: 700px) {
  .building-list {
    grid-template-columns: 1fr 1fr;
  }
  .masthead { padding-top: calc(40px + var(--safe-top)); }
}
