/* "Walk This Site" 3D feature chrome — the idle establishing shot's overlay
   controls, and the full-viewport first-person takeover (HUD/splash/exit).
   Visually a dark teal-black + monospace + index-contour-orange system,
   deliberately distinct from the light, per-brand marketing theme — see
   apps/web/components/walk/splash.tsx's original header comment. Ported
   1:1 from the Tailwind utility strings in walk/*.tsx. */

.walk-idle {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}
.walk-idle canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.walk-fallback {
  display: flex;
  aspect-ratio: 16 / 9;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-align: center;
  padding: 1rem;
}

.walk-compass {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(217, 127, 31, 0.6);
  background: rgba(11, 16, 15, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.walk-enter-cta-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  pointer-events: none;
}
.walk-enter-cta {
  pointer-events: auto;
  animation: pulse 2s ease-in-out infinite;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(217, 127, 31, 0.7);
  background: rgba(11, 16, 15, 0.85);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #f2b077;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.walk-enter-cta:hover {
  background: #0b100f;
  color: #f7c896;
}

.walk-pegman {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.walk-pegman__button {
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(217, 127, 31, 0.7);
  background: rgba(11, 16, 15, 0.85);
  color: #f2b077;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: background 0.15s ease, transform 0.15s ease;
}
.walk-pegman__button:hover {
  background: #0b100f;
}
.walk-pegman__button--dragging {
  cursor: grabbing;
  transform: scale(1.1);
  opacity: 0.6;
}
.walk-pegman__label {
  user-select: none;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(217, 127, 31, 0.4);
  background: rgba(11, 16, 15, 0.8);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-data);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f2b077;
  backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------- takeover */
.walk-takeover {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  /* Fallback sky behind the WebGL canvas. The scene now renders its own
     sky dome (js/walk/sky.js) over an opaque clear color, so this gradient
     only shows for the instant before the first frame
     showing through). */
  background: linear-gradient(to bottom, #5b9bd8 0%, #a9cfe6 55%, #dde8ec 100%);
}
.walk-takeover--active {
  z-index: 50;
  opacity: 1;
  pointer-events: auto;
  /* Fade in on entry only — the base class carries no transition, so
     exiting snaps back to the page instantly. */
  transition: opacity 0.6s ease;
}
.walk-takeover canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.walk-exit-btn {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 50;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(11, 16, 15, 0.8);
  padding: 0.4rem 0.75rem;
  font-family: var(--font-data);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #e7f2ec;
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: none;
}
.walk-takeover--active .walk-exit-btn {
  display: block;
}

/* ---------------------------------------------------------------- HUD */
.walk-hud__panel {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 15, 0.75);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-data, monospace);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  display: none;
}
.walk-takeover--active .walk-hud__panel {
  display: block;
}
.walk-hud__panel--position {
  left: 1rem;
  top: 1rem;
}
.walk-hud__panel--orientation {
  right: 1rem;
  top: 1rem;
}
.walk-hud__panel--legend {
  bottom: 1rem;
  left: 1rem;
}
.walk-hud__panel--status {
  bottom: 1rem;
  right: 1rem;
  text-align: right;
}
.walk-hud__panel--controls {
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(60vw, 640px);
}
.walk-hud__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #7f9a90;
  margin: 0;
}
.walk-hud__value {
  font-size: 0.75rem;
  color: #e7f2ec;
  margin: 0.15rem 0 0;
}
.walk-hud__minimap-box {
  position: relative;
  margin-top: 0.25rem;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.walk-hud__minimap-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.walk-hud__north-label {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: #e7f2ec;
}
.walk-hud__player {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.walk-hud__heading-row {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.walk-hud__needle {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  color: #d97f1f;
  will-change: transform;
}
.walk-hud__legend-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.walk-hud__legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}
.walk-hud__swatch {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 1px;
  flex-shrink: 0;
}
.walk-hud__legend-label {
  color: #e7f2ec;
}
.walk-hud__legend-label--off {
  color: #5c6b66;
}
.walk-hud__legend-state {
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 10px;
  color: #7f9a90;
}
.walk-hud__status-mode {
  font-size: 0.75rem;
  color: #e7f2ec;
  margin: 0;
}
.walk-hud__status-fps {
  margin: 0.1rem 0 0;
  font-size: 10px;
  color: #7f9a90;
}
.walk-hud__controls-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.75rem;
}
.walk-hud__controls-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 11px;
}
.walk-hud__key {
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.35rem;
  font-size: 10px;
  font-weight: 600;
  color: #e7f2ec;
}
.walk-hud__action {
  color: #8ea89d;
}

/* --------------------------------------------------------- touch UI */
/* Dual virtual joysticks + RUN toggle (touch-controls.js), mounted only
   on touch/coarse-pointer devices. Gated under .walk-takeover--active
   exactly like .walk-hud__panel above, so it's never visible during the
   idle establishing shot or before Enter is pressed. Sits above the HUD
   (z-index 40) so its own chrome never renders under a HUD panel, but
   below the exit button and splash overlay (z-index 50) so those always
   stay reachable/on top. */
.walk-touch {
  position: fixed;
  inset: 0;
  z-index: 41;
  pointer-events: none;
  display: none;
}
.walk-takeover--active .walk-touch {
  display: block;
}

.walk-touch__move-zone {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 140px;
  border-radius: 999px;
  border: 1px solid rgba(217, 127, 31, 0.5);
  background: rgba(11, 16, 15, 0.75);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  touch-action: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.walk-touch__move-zone--active {
  border-color: rgba(217, 127, 31, 0.8);
  background: rgba(11, 16, 15, 0.85);
}
.walk-touch__move-nub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(217, 127, 31, 0.8);
  background: rgba(217, 127, 31, 0.35);
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out;
  pointer-events: none;
}
.walk-touch__move-zone--active .walk-touch__move-nub {
  transition: none;
  background: rgba(217, 127, 31, 0.55);
}

.walk-touch__look-zone {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  pointer-events: auto;
  touch-action: none;
}
.walk-touch__look-hint {
  position: absolute;
  top: 6.5rem;
  right: 1.25rem;
  pointer-events: none;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 15, 0.6);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-data, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #8ea89d;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}
.walk-touch__look-zone--active .walk-touch__look-hint {
  opacity: 0.35;
}

.walk-touch__run-btn {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  /* Stacked above .walk-touch__look-zone, which shares this corner of
     the screen — DOM order (appended after the look zone) already
     paints it on top; this is belt-and-suspenders so a touch on the
     button's own box always hits the button, never the zone under it. */
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(217, 127, 31, 0.6);
  background: rgba(11, 16, 15, 0.8);
  font-family: var(--font-data, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f2b077;
  pointer-events: auto;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.walk-touch__run-btn--active {
  border-color: rgba(217, 127, 31, 0.9);
  background: rgba(217, 127, 31, 0.25);
  color: #f7c896;
  box-shadow: 0 0 0 3px rgba(217, 127, 31, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ------------------------------------------------------------- splash */
.walk-splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: #0b100f;
  padding: 2.5rem 1.5rem;
  font-family: var(--font-data, monospace);
  color: #e7f2ec;
}
.walk-splash__inner {
  width: 100%;
  max-width: 36rem;
}
.walk-splash__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: #7f9a90;
  margin: 0;
}
.walk-splash__heading {
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.walk-splash__body {
  margin: 1rem 0 0;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #a9c2b8;
}
.walk-splash__stats {
  margin: 1.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 1px solid #2a3a35;
  padding-left: 1rem;
  font-size: 0.9rem;
}
.walk-splash__stats dd {
  margin: 0;
  color: #d7e8e0;
}
.walk-splash__cta {
  animation: pulse 2s ease-in-out infinite;
  margin-top: 2rem;
  width: 100%;
  border-radius: 2px;
  border: 1px solid rgba(217, 127, 31, 0.7);
  background: rgba(217, 127, 31, 0.1);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #f2b077;
  cursor: pointer;
}
.walk-splash__cta:hover {
  background: rgba(217, 127, 31, 0.2);
  color: #f7c896;
}
.walk-splash__keybinds {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem 2rem;
  font-size: 0.75rem;
  color: #8ea89d;
}
@media (min-width: 640px) {
  .walk-splash__keybinds {
    grid-template-columns: 1fr 1fr;
  }
}
.walk-splash__keybinds > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.walk-splash__key {
  min-width: 7.5em;
  flex-shrink: 0;
  color: #e7f2ec;
}

/* Idle-diorama layer chips: quick toggles for the 3D model view so a
   land developer can strip structures/towers and study bare terrain.
   Same visual family as .walk-enter-cta, minus the pulse. */
.walk-idle-layers {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.4rem;
  pointer-events: auto;
  z-index: 3;
}
.walk-idle-layers button {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(217, 127, 31, 0.55);
  background: rgba(11, 16, 15, 0.82);
  padding: 0.3rem 0.7rem;
  font-family: var(--font-data);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #f2b077;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.walk-idle-layers button[aria-pressed="false"] {
  border-color: rgba(140, 140, 130, 0.4);
  color: rgba(200, 200, 190, 0.55);
}

/* Relief-exaggeration slider inside the idle chip bar. */
.walk-idle-relief {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(217, 127, 31, 0.55);
  background: rgba(11, 16, 15, 0.82);
  padding: 0.3rem 0.7rem;
  font-family: var(--font-data);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #f2b077;
  backdrop-filter: blur(4px);
}
.walk-idle-relief span {
  min-width: 5.2em;
}
.walk-idle-relief input[type="range"] {
  width: 6.5rem;
  accent-color: #d97f1f;
  cursor: pointer;
}
