/* Golden Nevada 3D explorer. Tokens match the main site (src/styles/tokens.css). */
@font-face { font-family: 'Archivo Variable'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(fonts/archivo-latin.woff2) format('woff2-variations'); }
:root {
  --playa: #f3f4f0; --basalt: #171d1a; --basalt-2: #232b27; --sage: #5d6c62; --sage-light: #a9b3aa; --rule-dark: #36403a;
  --gold: #f2c230; --juniper: #24584b;
  --font: 'Archivo Variable', 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wide: 'wdth' 125; --narrow: 'wdth' 82; --r-1: 3px; --r-2: 6px; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pad: clamp(0.75rem, 0.4rem + 1.4vw, 1.25rem);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--basalt); color: var(--playa); overscroll-behavior: none; }
body { font-family: var(--font); font-size: 0.9375rem; line-height: 1.4; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
h1, h2, p, dl, dd, ul { margin: 0; } ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark { display: inline-block; width: 0.8em; height: 0.8em; background: var(--gold); flex: none; }
.apn, .num { font-variation-settings: var(--narrow); font-variant-numeric: tabular-nums lining-nums; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#view:active { cursor: grabbing; }

/* ---- loading ---- */
#loading, #veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--basalt); transition: opacity 0.7s var(--ease); }
#loading { background: radial-gradient(120% 80% at 50% 108%, #7a3d17 0%, #3a2418 30%, var(--basalt) 68%); }
#loading.out, #veil.out { opacity: 0; pointer-events: none; }
.loading-inner { width: min(26rem, 84vw); }
.loading-inner .mark { width: 1.6rem; height: 1.6rem; margin-bottom: 1.4rem; }
.loading-brand { color: var(--sage-light); font-weight: 600; }
#loading h1 { font-variation-settings: var(--wide); font-weight: 600; font-size: clamp(2.4rem, 1.4rem + 5vw, 4rem); line-height: 1; letter-spacing: -0.022em; margin: 0.15em 0 0.5em; }
.loading-sub { font-weight: 600; }
.loading-note { color: var(--sage-light); font-size: 0.8125rem; margin-top: 0.9rem; }
.bar { height: 2px; background: var(--rule-dark); margin-top: 0.7rem; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--playa); transform: scaleX(0); transform-origin: left; transition: transform 0.25s linear; }
#veil > div { width: min(18rem, 70vw); }
#veil p { font-variation-settings: var(--wide); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.015em; margin-top: 0.6rem; }

/* ---- top bar ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > *, .top > * { pointer-events: auto; }
.top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 0.75rem; padding: calc(var(--safe-t) + 0.6rem) calc(var(--safe-r) + var(--pad)) 1.6rem calc(var(--safe-l) + var(--pad)); pointer-events: none !important;
  background: linear-gradient(rgba(16, 20, 18, 0.62), rgba(16, 20, 18, 0)); }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; font-variation-settings: var(--wide); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45em; min-height: 2.5rem; padding: 0 0.85rem; border-radius: var(--r-1); background: rgba(23, 29, 26, 0.86); border: 1px solid var(--rule-dark); font-weight: 600; font-size: 0.875rem; }
.chip svg { width: 1.15rem; height: 1.15rem; }
.chip.icon { padding: 0; width: 2.5rem; justify-content: center; }
.chip:hover { border-color: var(--sage-light); }
#map-close { width: auto; padding: 0 0.85rem; white-space: nowrap; }

.compass { position: relative; flex: 1 1 auto; max-width: 30rem; height: 3.4rem; margin: 0 auto -0.9rem; align-self: flex-start; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); pointer-events: none !important; }
.compass-track { position: absolute; inset: 0; }
.compass-track span { position: absolute; top: 0; left: 50%; white-space: nowrap; font-size: 0.75rem; font-weight: 600; text-align: center; transform: translateX(-50%); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); will-change: transform; }
.compass-track span::after { content: ''; display: block; width: 1px; height: 0.45rem; margin: 0.15rem auto 0; background: currentColor; opacity: 0.8; }
.compass-track span.dir { font-variation-settings: var(--wide); font-size: 0.8125rem; }
.compass-track span.place { color: #d9dfd8; font-weight: 500; }
.compass-track span.place small { display: block; font-size: 0.6875rem; color: var(--sage-light); font-variation-settings: var(--narrow); line-height: 1; }
.compass-track span.place::after { display: none; }
.compass-needle { position: absolute; left: 50%; top: 2rem; width: 1px; height: 0.5rem; background: var(--playa); }
@media (max-width: 40rem) { .brand span:last-child { display: none; } .brand .mark { width: 1.25rem; height: 1.25rem; } .chip span { display: none; } .chip { padding: 0; width: 2.5rem; justify-content: center; } }

/* ---- mode switch ---- */
.modes, .seg { display: inline-flex; background: rgba(23, 29, 26, 0.86); border: 1px solid var(--rule-dark); border-radius: var(--r-1); padding: 2px; }
.modes button, .seg button { min-height: 2.25rem; padding: 0 0.8rem; border-radius: 2px; font-weight: 600; font-size: 0.875rem; color: var(--sage-light); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.modes button[aria-pressed='true'], .seg button[aria-pressed='true'] { background: var(--playa); color: var(--basalt); }
.modes { position: absolute; top: calc(var(--safe-t) + 3.7rem); left: calc(var(--safe-l) + var(--pad)); }

/* ---- quality menu ---- */
.menu { position: absolute; top: calc(var(--safe-t) + 3.5rem); right: calc(var(--safe-r) + var(--pad)); width: 15rem; background: var(--basalt); border: 1px solid var(--rule-dark); border-radius: var(--r-2); padding: 0.5rem; z-index: 5; }
.menu-title { font-weight: 600; padding: 0.35rem 0.5rem 0.5rem; }
.menu button { display: block; width: 100%; text-align: left; padding: 0.5rem; border-radius: var(--r-1); font-weight: 600; }
.menu button small { display: block; font-weight: 400; color: var(--sage-light); font-size: 0.78rem; }
.menu button[aria-pressed='true'] { background: var(--basalt-2); box-shadow: inset 2px 0 0 var(--playa); }
.menu-foot { padding: 0.5rem; color: var(--sage-light); font-size: 0.75rem; border-top: 1px solid var(--rule-dark); margin-top: 0.4rem; font-variant-numeric: tabular-nums; }

/* ---- labels in the scene ---- */
#labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none !important; }
.label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 0.4rem; padding: 0.22rem 0.5rem 0.22rem 0.4rem; background: rgba(23, 29, 26, 0.82); border-radius: var(--r-1); font-size: 0.78rem; font-weight: 600; white-space: nowrap; pointer-events: auto; cursor: pointer; will-change: transform, opacity; transition: opacity 0.25s; opacity: 0; pointer-events: none; }
.label small { font-weight: 500; color: var(--sage-light); font-variation-settings: var(--narrow); font-size: 0.75rem; }
.label.on { background: var(--playa); color: var(--basalt); } .label.on small { color: var(--sage); }
.label::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 0.9rem; background: rgba(243, 244, 240, 0.7); }

/* ---- touch stick, dash, hint ---- */
.stick { position: absolute; width: 7rem; height: 7rem; margin: -3.5rem 0 0 -3.5rem; border-radius: 50%; border: 1px solid rgba(243, 244, 240, 0.4); background: rgba(23, 29, 26, 0.25); pointer-events: none !important; }
.stick i { position: absolute; left: 50%; top: 50%; width: 2.8rem; height: 2.8rem; margin: -1.4rem; border-radius: 50%; background: rgba(243, 244, 240, 0.85); }
.dash { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(4.5rem, 15vh, 9rem); pointer-events: none !important; }
.dash svg { width: 100%; height: 100%; display: block; stroke: none; }
.gauges { position: absolute; left: 50%; bottom: calc(var(--panel-h, 0px) + var(--safe-b) + 0.6rem); transform: translateX(-50%); display: flex; gap: 1.4rem; text-align: center; line-height: 1; pointer-events: none !important; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.gauges b { display: block; font-variation-settings: var(--narrow); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauges span { font-size: 0.7rem; color: #d9dfd8; }
.lift { position: absolute; right: calc(var(--safe-r) + var(--pad)); bottom: calc(var(--panel-h, 0px) + var(--safe-b) + 1rem); display: none; flex-direction: column; gap: 0.5rem; }
@media (pointer: coarse) { .lift { display: flex; } }
.lift button { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: rgba(23, 29, 26, 0.7); border: 1px solid rgba(243, 244, 240, 0.4); display: grid; place-items: center; touch-action: none; }
.lift button:active { background: var(--playa); color: var(--basalt); } .lift svg { width: 1.5rem; height: 1.5rem; }
#veil small { display: block; color: var(--sage-light); margin-top: 0.25rem; }
.hint { position: absolute; left: 50%; top: calc(var(--safe-t) + 7rem); transform: translateX(-50%); max-width: min(30rem, 88vw); padding: 0.55rem 0.85rem; background: rgba(23, 29, 26, 0.9); border-radius: var(--r-1); text-align: center; font-size: 0.875rem; pointer-events: none !important; animation: hint 0.4s var(--ease); }
@keyframes hint { from { opacity: 0; transform: translate(-50%, -0.4rem); } }

/* ---- parcel panel ---- */
.panel { position: absolute; background: var(--basalt); border: 1px solid var(--rule-dark); display: flex; flex-direction: column; }
.grab { display: none; }
.panel-head { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem 1rem 0; }
.panel-title { flex: 1; min-width: 0; }
.panel h2 { font-variation-settings: var(--wide); font-weight: 600; font-size: 1.375rem; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.panel-title .apn { color: var(--sage-light); margin-top: 0.25rem; font-size: 0.875rem; }
.pager { display: flex; gap: 0.25rem; }
.pager button { width: 2.25rem; height: 2.25rem; border: 1px solid var(--rule-dark); border-radius: var(--r-1); display: grid; place-items: center; }
.pager button:hover { border-color: var(--sage-light); } .pager svg { width: 1.1rem; height: 1.1rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0.8rem 1rem 0; border-top: 1px solid var(--rule-dark); border-bottom: 1px solid var(--rule-dark); }
.facts > div { padding: 0.55rem 0; } .facts > div + div { padding-left: 0.9rem; border-left: 1px solid var(--rule-dark); }
.facts dt, .rows dt, .concept-label { font-size: 0.78rem; color: var(--sage-light); }
.facts dd { font-variation-settings: var(--narrow); font-variant-numeric: tabular-nums; font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.concept { padding: 0.75rem 1rem 0.9rem; }
.concept .seg { display: flex; margin-top: 0.3rem; background: none; }
.concept .seg button { flex: 1; padding: 0 0.3rem; }
.concept-out { margin-top: 0.7rem; font-size: 0.875rem; }
.concept-out .figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.concept-out .figures b { display: block; font-variation-settings: var(--narrow); font-variant-numeric: tabular-nums; font-size: 1.2rem; line-height: 1.1; }
.concept-out .figures span { font-size: 0.75rem; color: var(--sage-light); line-height: 1.2; display: block; margin-top: 0.15rem; }
.concept-out p { color: var(--sage-light); font-size: 0.78rem; margin-top: 0.6rem; line-height: 1.35; }
.concept-out p.plain { color: var(--playa); font-size: 0.875rem; margin-top: 0; }
.panel-more { padding: 0.9rem 1rem 1rem; border-top: 1px solid var(--rule-dark); overflow-y: auto; overscroll-behavior: contain; }
.desc { font-size: 0.875rem; color: #d9dfd8; }
.rows { margin-top: 0.7rem; }
.rows > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid var(--rule-dark); font-size: 0.875rem; }
.rows dd { text-align: right; font-variation-settings: var(--narrow); font-variant-numeric: tabular-nums; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1rem; border-radius: var(--r-1); border: 1.5px solid rgba(243, 244, 240, 0.55); font-weight: 600; font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--basalt); } .btn.gold:hover { background: #ffd95a; border-color: #ffd95a; }
.btn.ghost:hover { background: var(--playa); color: var(--basalt); border-color: var(--playa); }

@media (min-width: 56rem) {
  .gauges { bottom: 1.2rem; }
  .panel { top: calc(var(--safe-t) + 6.8rem); right: calc(var(--safe-r) + var(--pad)); width: 22.5rem; max-height: calc(100% - 8rem - var(--safe-t)); border-radius: var(--r-2); }
  .menu { z-index: 20; }
}
@media (max-width: 55.99rem) {
  .panel { left: 0; right: 0; bottom: 0; border-width: 1px 0 0; border-radius: var(--r-2) var(--r-2) 0 0; padding-bottom: var(--safe-b); max-height: 82%; transition: transform 0.32s var(--ease); }
  .grab { display: block; width: 100%; height: 1.4rem; flex: none; } .grab i { display: block; width: 2.4rem; height: 3px; border-radius: 2px; background: var(--sage); margin: 0.45rem auto 0; }
  .panel-head { padding-top: 0.1rem; }
  .panel h2 { font-size: 1.2rem; }
  .facts { margin-top: 0.6rem; } .facts > div { padding: 0.4rem 0; } .facts dd { font-size: 1.15rem; }
  .concept { padding: 0.55rem 1rem 0.75rem; } .concept-label { display: none; } .concept .seg { margin-top: 0; }
  .panel:not(.open) .panel-more { display: none; }
  .panel.mini .facts, .panel.mini .concept { display: none; } .panel.mini .panel-head { padding-bottom: 0.7rem; }
  .dash { bottom: var(--panel-h, 0px); }
  @media (orientation: landscape) and (max-height: 30rem) {
    .panel { left: auto; width: min(21rem, 46vw); top: calc(var(--safe-t) + 3.4rem); bottom: 0; max-height: none; border-width: 1px 0 0 1px; border-radius: var(--r-2) 0 0 0; overflow-y: auto; }
    .grab { display: none; } .panel:not(.open) .panel-more { display: block; } .panel-head { padding-top: 0.8rem; } .dash { bottom: 0; }
    .panel.mini { top: auto; } .panel.mini .panel-more { display: none !important; }
  }
}

/* ---- map ---- */
#map { position: fixed; inset: 0; z-index: 30; background: var(--basalt); display: flex; flex-direction: column; padding: calc(var(--safe-t) + 0.6rem) calc(var(--safe-r) + var(--pad)) calc(var(--safe-b) + 0.6rem) calc(var(--safe-l) + var(--pad)); user-select: none; }
.map-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 0.6rem; }
.map-top h2 { font-variation-settings: var(--wide); font-weight: 600; font-size: 1.375rem; letter-spacing: -0.015em; }
.map-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.areas { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; flex: none; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.areas::-webkit-scrollbar { display: none; }
.areas button { flex: none; text-align: left; padding: 0.45rem 0.7rem; border: 1px solid var(--rule-dark); border-radius: var(--r-1); font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.areas button small { display: block; font-weight: 400; color: var(--sage-light); font-size: 0.75rem; font-variation-settings: var(--narrow); }
.areas button[aria-pressed='true'] { background: var(--playa); color: var(--basalt); border-color: var(--playa); } .areas button[aria-pressed='true'] small { color: var(--sage); }
.map-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.map-canvas-wrap { position: relative; flex: 1 1 60%; min-height: 0; background: #e9e6dc; border-radius: var(--r-1); overflow: hidden; }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.map-legend { position: absolute; left: 0.5rem; bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; padding: 0.35rem 0.55rem; background: rgba(243, 244, 240, 0.92); color: var(--basalt); border-radius: var(--r-1); font-size: 0.72rem; font-weight: 500; max-width: calc(100% - 7.5rem); }
.map-legend span { display: inline-flex; align-items: center; gap: 0.35rem; } .map-legend i { display: inline-block; width: 1.1rem; height: 0; border-top: 2px solid; }
.map-list { flex: 0 1 34%; min-height: 5rem; overflow-y: auto; border-top: 1px solid var(--rule-dark); }
.map-list button { display: flex; width: 100%; align-items: baseline; gap: 0.6rem; padding: 0.6rem 0.25rem; border-bottom: 1px solid var(--rule-dark); text-align: left; font-size: 0.9rem; }
.map-list button:hover, .map-list button.on { background: var(--basalt-2); }
.map-list b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .map-list b .mark { margin-right: 0.5rem; width: 0.6em; height: 0.6em; }
.map-list span { color: var(--sage-light); font-variation-settings: var(--narrow); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 56rem) {
  .map-body { flex-direction: row; gap: 1rem; }
  .areas { flex-direction: column; overflow: auto; width: 14rem; margin: 0; padding: 0; } .areas button { white-space: normal; }
  .map-main { flex-direction: row; gap: 1rem; } .map-canvas-wrap { flex: 1; } .map-list { flex: none; width: 19rem; border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
