/* ATLAS WORLD — premium immersive cartography */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --void: #060605;
  --parchment: #12100c;
  --forest: #1a2e1f;
  --gold: #c9a962;
  --gold-bright: #e0c882;
  --gold-dim: #7a6640;
  --ivory: #e8e4dc;
  --ivory-dim: rgba(232, 228, 220, 0.55);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: Inter, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-cine: cubic-bezier(0.16, 1, 0.3, 1);
  --map-w: 2400px;
  --map-h: 1600px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ivory-dim);
  font-family: var(--font-ui);
  font-weight: 300;
}

body.dossier-open { overflow: hidden; }

.atlas-world {
  position: fixed;
  inset: 0;
  background: var(--void);
}

.world-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  opacity: 0;
}

.world-viewport:active { cursor: grabbing; }

.world-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--map-w);
  height: var(--map-h);
  transform-origin: 0 0;
  will-change: transform;
}

.world-stage.is-focusing .hotspot:not(.is-active) {
  opacity: 0.45;
  filter: blur(0.5px);
  transition: opacity 0.6s var(--ease-cine), filter 0.6s;
}

.world-layer {
  position: absolute;
  inset: 0;
  width: var(--map-w);
  height: var(--map-h);
  pointer-events: none;
  will-change: transform;
}

.world-layer img,
.world-layer picture {
  width: 100%;
  height: 100%;
  display: block;
}

.world-layer--map {
  z-index: 1;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #12100e 0%, #060605 100%);
}

.world-layer--map img {
  width: var(--map-w);
  height: var(--map-h);
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.world-layer--haze { z-index: 2; }
.world-layer--light { z-index: 3; }
.world-layer--clouds { z-index: 4; opacity: 0.07; }
.world-layer--fog { z-index: 5; opacity: 0.06; }

.hotspots-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  width: var(--map-w);
  height: var(--map-h);
  pointer-events: none;
}

/* —— Atlas markers (hotspot polish) —— */
.hotspot,
.hotspot-anchor {
  --hs-w: 88px;
  --hs-h: 108px;
  --crest-w: 68px;
  --crest-h: 78px;
  --plate: 52px;
  position: absolute;
  transform: translate(-50%, -94%);
  width: var(--hs-w);
  height: var(--hs-h);
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: none;
}

.hotspot {
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  animation: hotspot-rise 0.9s var(--ease-cine) forwards;
  transition: transform 0.45s var(--ease-cine), filter 0.45s;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65));
}

.hotspot--tier-primary {
  --hs-w: 98px;
  --hs-h: 118px;
  --crest-w: 74px;
  --crest-h: 84px;
  --plate: 58px;
  z-index: 12;
}

.hotspot--tier-secondary {
  --hs-w: 88px;
  --hs-h: 108px;
  --crest-w: 66px;
  --crest-h: 76px;
  --plate: 50px;
  z-index: 8;
}

.hotspot--tier-tertiary {
  --hs-w: 74px;
  --hs-h: 92px;
  --crest-w: 56px;
  --crest-h: 64px;
  --plate: 42px;
  z-index: 4;
}

.hotspot--tier-tertiary.is-visible {
  opacity: 0.9;
}

.hotspot.is-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translate(-50%, -94%) scale(0.45);
}

.hotspot.is-visible { opacity: 1; }

.hotspot__halo {
  position: absolute;
  left: 50%;
  top: 42%;
  width: calc(var(--plate) + 28px);
  height: calc(var(--plate) + 28px);
  margin: calc((var(--plate) + 28px) / -2) 0 0 calc((var(--plate) + 28px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8, 10, 8, 0.55) 0%, rgba(8, 10, 8, 0.2) 45%, transparent 72%);
  box-shadow: 0 0 0 1px rgba(201, 169, 98, 0.08);
  pointer-events: none;
}

.hotspot__plate {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--plate);
  height: var(--plate);
  margin: calc(var(--plate) / -2) 0 0 calc(var(--plate) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(28, 26, 20, 0.92) 0%, rgba(10, 9, 7, 0.96) 72%);
  border: 1.5px solid rgba(201, 169, 98, 0.55);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(201, 169, 98, 0.12),
    inset 0 1px 0 rgba(255, 240, 200, 0.08);
  pointer-events: none;
}

.hotspot__aura {
  position: absolute;
  left: 50%;
  top: 42%;
  width: calc(var(--plate) + 8px);
  height: calc(var(--plate) + 8px);
  margin: calc((var(--plate) + 8px) / -2) 0 0 calc((var(--plate) + 8px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 169, 98, 0.18) 0%, transparent 68%);
  opacity: 0.35;
  transition: opacity 0.4s, transform 0.45s var(--ease-cine);
  pointer-events: none;
}

.hotspot__pedestal {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 36px;
  height: 10px;
  margin-left: -18px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.65) 0%, transparent 72%);
  border-radius: 50%;
  transition: transform 0.45s var(--ease-cine);
  pointer-events: none;
}

.hotspot__crest {
  position: relative;
  z-index: 3;
  width: var(--crest-w);
  height: var(--crest-h);
  display: block;
  margin: 0 auto;
  color: var(--gold);
  transition: color 0.4s, transform 0.45s var(--ease-cine), filter 0.4s;
}

.hotspot-anchor__gem {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dim));
  border: 1px solid rgba(255, 230, 180, 0.5);
  box-shadow: 0 0 12px rgba(201, 169, 98, 0.45);
  z-index: 4;
}

.hotspot__lockup {
  position: absolute;
  left: 50%;
  top: calc(42% + var(--plate) * 0.42);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px 8px;
  min-width: 88px;
  background: linear-gradient(180deg, rgba(12, 11, 8, 0.88) 0%, rgba(8, 7, 5, 0.78) 100%);
  border: 1px solid rgba(201, 169, 98, 0.28);
  border-radius: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.4s, transform 0.45s var(--ease-cine);
}

.hotspot--tier-primary .hotspot__lockup {
  min-width: 96px;
  border-color: rgba(201, 169, 98, 0.42);
}

.hotspot--tier-tertiary .hotspot__lockup {
  display: none;
}

.hotspot__lockup-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  line-height: 1.2;
  white-space: nowrap;
}

.hotspot--tier-primary .hotspot__lockup-title { font-size: 12px; }

.hotspot__lockup-sub {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(232, 228, 220, 0.55);
  white-space: nowrap;
}

.hotspot__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 6px);
  transform: translateX(-50%) translateY(8px);
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ivory);
  white-space: nowrap;
  background: rgba(10, 9, 7, 0.94);
  border: 1px solid rgba(201, 169, 98, 0.35);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease-cine), visibility 0.35s;
  pointer-events: none;
  z-index: 20;
}

.hotspot__ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--plate);
  height: var(--plate);
  margin: calc(var(--plate) / -2) 0 0 calc(var(--plate) / -2);
  border: 1px solid rgba(201, 169, 98, 0.35);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s, transform 0.45s var(--ease-cine);
  pointer-events: none;
}

.hotspot__ring--outer {
  width: calc(var(--plate) + 18px);
  height: calc(var(--plate) + 18px);
  margin: calc((var(--plate) + 18px) / -2) 0 0 calc((var(--plate) + 18px) / -2);
  border-style: dashed;
  border-color: rgba(201, 169, 98, 0.18);
}

.hotspot__pulse {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--plate);
  height: var(--plate);
  margin: calc(var(--plate) / -2) 0 0 calc(var(--plate) / -2);
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 98, 0.4);
  opacity: 0;
  pointer-events: none;
}

.hotspot--tier-primary .hotspot__pulse {
  animation: hotspot-pulse 3.2s var(--ease-cine) infinite;
}

.hotspot__wildlife {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 44px;
  height: 22px;
  margin-left: -22px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s, transform 0.45s var(--ease-cine);
  background: center / contain no-repeat;
  pointer-events: none;
}

.hotspot--stag_territory .hotspot__wildlife {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cpath d='M4 14 L12 6 L20 14 M28 6 L36 14' stroke='%23c9a962' stroke-width='1' fill='none' opacity='0.5'/%3E%3C/svg%3E");
}

.hotspot--boar_forest .hotspot__wildlife {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14'%3E%3Cellipse cx='20' cy='10' rx='12' ry='4' fill='%23c9a962' opacity='0.35'/%3E%3C/svg%3E");
}

.hotspot--duck_marsh .hotspot__wildlife {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M6 8 Q20 2 34 8' stroke='%23c9a962' fill='none' opacity='0.4'/%3E%3C/svg%3E");
}

.hotspot--pheasant_estate .hotspot__wildlife {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cpath d='M20 4 L22 10 L28 11 L23 14 L20 20 L17 14 L12 11 L18 10 Z' fill='%23c9a962' opacity='0.3'/%3E%3C/svg%3E");
}

.hotspot.is-hovered,
.hotspot.is-active {
  transform: translate(-50%, -98%) scale(1.08);
  z-index: 40;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 20px rgba(201, 169, 98, 0.18));
}

.hotspot--tier-primary.is-hovered,
.hotspot--tier-primary.is-active {
  transform: translate(-50%, -98%) scale(1.12);
}

.hotspot.is-hovered .hotspot__halo,
.hotspot.is-active .hotspot__halo {
  background: radial-gradient(circle, rgba(12, 14, 10, 0.7) 0%, rgba(201, 169, 98, 0.12) 50%, transparent 75%);
  box-shadow: 0 0 24px rgba(201, 169, 98, 0.15);
}

.hotspot.is-hovered .hotspot__plate,
.hotspot.is-active .hotspot__plate {
  border-color: rgba(224, 200, 130, 0.75);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(201, 169, 98, 0.22),
    inset 0 1px 0 rgba(255, 240, 200, 0.12);
}

.hotspot.is-hovered .hotspot__aura,
.hotspot.is-active .hotspot__aura {
  opacity: 1;
  transform: scale(1.12);
}

.hotspot.is-hovered .hotspot__crest,
.hotspot.is-active .hotspot__crest {
  color: var(--gold-bright);
  transform: translateY(-6px) scale(1.06);
  filter: drop-shadow(0 0 14px rgba(201, 169, 98, 0.5));
}

.hotspot.is-hovered .hotspot__ring,
.hotspot.is-active .hotspot__ring { opacity: 1; }

.hotspot.is-hovered .hotspot__ring--outer {
  transform: scale(1.15);
  opacity: 0.85;
  animation: ring-breathe 2s ease-in-out infinite;
}

.hotspot.is-hovered .hotspot__pulse,
.hotspot.is-active .hotspot__pulse { opacity: 0.7; }

.hotspot.is-hovered .hotspot__wildlife {
  opacity: 1;
  transform: translateY(0);
}

.hotspot.is-hovered .hotspot__pedestal,
.hotspot.is-active .hotspot__pedestal { transform: scaleX(1.35); }

.hotspot.is-hovered .hotspot__lockup,
.hotspot.is-active .hotspot__lockup {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
  border-color: rgba(201, 169, 98, 0.5);
}

.hotspot.is-hovered .hotspot__tooltip,
.hotspot.is-active .hotspot__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hotspot.is-active .hotspot__crest {
  animation: crest-shimmer 2.5s ease-in-out infinite;
}

@keyframes crest-shimmer {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(201, 169, 98, 0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(224, 200, 130, 0.6)); }
}

@keyframes hotspot-rise {
  from { opacity: 0; transform: translate(-50%, -72%) scale(0.55); }
  to { opacity: 1; transform: translate(-50%, -94%) scale(1); }
}

@keyframes hotspot-pulse {
  0% { transform: scale(0.95); opacity: 0.35; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes ring-breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* HUD */
.hud {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-cine) 0.5s;
}

.atlas-world.is-ready .hud { opacity: 1; }

.hud > * { pointer-events: auto; }

.hud-brand {
  top: 28px;
  left: 32px;
}

.hud-brand__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ivory);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hud-brand__sub {
  font-size: 0.5625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-top: 6px;
}

.hud-layers {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 188px;
  padding: 18px 16px;
  background: rgba(8, 7, 6, 0.78);
  border: 1px solid rgba(201, 169, 98, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.hud-layers__group { margin-bottom: 16px; }
.hud-layers__group:last-child { margin-bottom: 0; }

.hud-layers__title {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 8px;
}

.hud-layers__chips { display: flex; flex-wrap: wrap; gap: 5px; }

.hud-chip {
  padding: 5px 9px;
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
  background: transparent;
  border: 1px solid rgba(201, 169, 98, 0.1);
  cursor: pointer;
  transition: all 0.35s var(--ease-cine);
}

.hud-chip:hover {
  border-color: rgba(201, 169, 98, 0.35);
  color: var(--ivory);
}

.hud-chip.is-on {
  color: var(--ivory);
  background: rgba(26, 46, 31, 0.7);
  border-color: rgba(201, 169, 98, 0.45);
  box-shadow: 0 0 16px rgba(201, 169, 98, 0.08);
}

.hud-zoom {
  right: 28px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-zoom__btn {
  width: 44px;
  height: 44px;
  font-size: 1.125rem;
  color: var(--gold);
  background: rgba(8, 7, 6, 0.8);
  border: 1px solid rgba(201, 169, 98, 0.18);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.35s var(--ease-cine);
}

.hud-zoom__btn:hover {
  border-color: var(--gold);
  color: var(--ivory);
  box-shadow: 0 0 20px rgba(201, 169, 98, 0.12);
}

@media (max-width: 768px) {
  .hud-layers {
    left: auto;
    right: 14px;
    top: auto;
    bottom: 110px;
    transform: none;
    max-width: 150px;
  }
  .hud-brand { left: 16px; top: 16px; }
  .hotspot--tier-primary { --hs-w: 82px; --hs-h: 100px; --crest-w: 62px; --crest-h: 72px; --plate: 46px; }
  .hotspot--tier-secondary { --hs-w: 74px; --hs-h: 92px; }
  .hotspot--tier-tertiary { --hs-w: 64px; --hs-h: 80px; }
}
