/* ============ GLOBE VIEW ============ */
#globe-view {
  --mouse-x: 0;
  --mouse-y: 0;
  transition: transform 0.7s var(--ease-smooth), opacity 0.7s var(--ease-smooth);
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse 90% 85% at 50% 48%,
    #362820 0%, #2A1D15 40%, #1E1714 75%, #151010 100%
  );
}
#globe-view.shrink-away {
  transform: scale(0.12) translate(-20%, -20%);
  opacity: 0;
  pointer-events: none;
}
#globe-view.expand-back {
  transition: transform 0.6s var(--ease-smooth), opacity 0.5s var(--ease-smooth);
}

/* Leather/wood texture */
#globe-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(62, 43, 30, 0.03) 2px, rgba(62, 43, 30, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 100px, rgba(62, 43, 30, 0.02) 100px, rgba(62, 43, 30, 0.02) 200px);
  pointer-events: none;
}

.globe-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  animation: fadeDown 0.8s ease 0.2s both;
  text-shadow: 0 0 60px rgba(200, 146, 58, 0.12);
  position: relative;
  z-index: 2;
  translate: calc(var(--mouse-x) * 5px) calc(var(--mouse-y) * 3px);
  transition: translate 0.15s ease-out;
}
.globe-logo span {
  font-weight: 700;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--accent-amber-light);
  text-shadow: 0 0 40px rgba(200, 146, 58, 0.3);
}

.globe-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--accent-copper-rose);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
  animation: fadeDown 0.8s ease 0.4s both;
  position: relative;
  z-index: 2;
  translate: calc(var(--mouse-x) * 3px) calc(var(--mouse-y) * 2px);
  transition: translate 0.15s ease-out;
}

.globe-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-amber), transparent);
  margin-bottom: var(--space-5);
  animation: fadeIn 1s ease 0.5s both;
  position: relative;
  z-index: 2;
}

.globe-wrapper {
  position: relative;
  width: min(clamp(300px, 50vw, 520px), 50vh);
  height: min(clamp(300px, 50vw, 520px), 50vh);
  margin-bottom: var(--space-6);
  animation: fadeIn 1s ease 0.5s both;
}

.globe-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 140%; height: 140%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(180, 120, 50, 0.12) 0%,
    rgba(160, 100, 40, 0.07) 25%,
    rgba(140, 80, 30, 0.04) 45%,
    transparent 70%
  );
  pointer-events: none;
  animation: hazeBreath 5s ease-in-out infinite alternate;
}
@keyframes hazeBreath {
  from { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

#globe-canvas-container {
  width: 100%; height: 100%;
  cursor: grab;
  touch-action: none;
}
#globe-canvas-container:active { cursor: grabbing; }
#globe-canvas-container canvas { display: block; width: 100% !important; height: 100% !important; }

/* CSS Globe Fallback (mobile/no WebGL) */
.css-globe {
  width: 100%; height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(140, 95, 50, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(90, 60, 30, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 35% 35%, #6B4423 0%, #4A2E18 25%, #3D2B1E 45%, #2A1D15 65%, #1C1210 100%);
  background-size: 200% 100%, 100% 100%, 100% 100%;
  position: relative;
  box-shadow:
    inset -20px -20px 60px rgba(0,0,0,0.6),
    inset 10px 10px 30px rgba(140, 95, 50, 0.08),
    0 0 80px rgba(180, 120, 50, 0.12),
    0 0 160px rgba(180, 120, 50, 0.04);
  animation: cssGlobeRotate 30s linear infinite;
  overflow: hidden;
}
.css-globe::before {
  content: '';
  position: absolute;
  top: 8%; left: 12%;
  width: 35%; height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 220, 160, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.css-globe::after {
  content: '';
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 35%, rgba(180, 120, 50, 0.06) 55%, rgba(180, 120, 50, 0.1) 70%, transparent 85%);
  pointer-events: none;
  animation: cssGlobeHaze 4s ease-in-out infinite alternate;
}
@keyframes cssGlobeRotate {
  from { background-position: 0% 50%, 0% 0%, 0% 0%; }
  to { background-position: 100% 50%, 0% 0%, 0% 0%; }
}
@keyframes cssGlobeHaze {
  from { opacity: 0.6; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}
.css-globe-marker {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--accent-amber-light);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(218, 165, 78, 0.6), 0 0 4px rgba(218, 165, 78, 0.8);
  cursor: pointer;
  z-index: 1;
}
.css-globe-marker::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(218, 165, 78, 0.3);
  animation: cssMarkerPulse 2s ease-in-out infinite;
}
@keyframes cssMarkerPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.3; }
}
.css-globe-marker-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--accent-amber-light);
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0.7;
  pointer-events: none;
}

/* Tooltip */
#globe-tooltip {
  position: absolute;
  padding: var(--space-2) var(--space-4);
  background: rgba(28, 18, 16, 0.95);
  border: 1px solid rgba(200, 146, 58, 0.4);
  border-radius: 4px;
  color: var(--accent-amber-light);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
#globe-tooltip.visible { opacity: 1; }

.globe-tagline {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 300;
  font-style: italic;
  color: var(--surface-parchment);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-7);
  animation: fadeUp 0.8s ease 0.8s both;
  position: relative;
  z-index: 2;
}

.globe-cities {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  animation: fadeUp 0.8s ease 1s both;
  position: relative;
  z-index: 2;
}

.globe-city-link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent-amber-light);
  text-decoration: none;
  cursor: pointer;
  padding: var(--space-3) var(--space-6);
  border: 1px solid rgba(200,146,58,0.25);
  border-radius: 2px;
  transition: all var(--transition-base);
  letter-spacing: 0.06em;
  background: rgba(42, 29, 21, 0.5);
}
.globe-city-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-amber);
  background: rgba(200,146,58,0.12);
  box-shadow: 0 0 30px rgba(200,146,58,0.08), inset 0 0 30px rgba(200,146,58,0.04);
}
.globe-city-link .shop-count {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--accent-copper-rose);
  margin-left: var(--space-2);
  opacity: 0.7;
}

/* Loading */
.globe-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  z-index: 5;
  transition: opacity 0.6s ease;
}
.globe-loader.hidden { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 48px; height: 48px;
  border: 2px solid rgba(200,146,58,0.15);
  border-top-color: var(--accent-amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader-text {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--accent-copper-rose);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Golden ring bloom (moment of delight) */
@keyframes goldenRingBloom {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}
.golden-ring-bloom {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(218, 165, 78, 0.9);
  box-shadow: 0 0 20px rgba(218, 165, 78, 0.4), inset 0 0 8px rgba(218, 165, 78, 0.2);
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, -50%);
  animation: goldenRingBloom 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #globe-view { --mouse-x: 0 !important; --mouse-y: 0 !important; }
  .globe-logo, .globe-subtitle { translate: none !important; transition: none !important; }
  .globe-glow { animation: none; opacity: 0.85; }
  .css-globe, .css-globe::after, .css-globe-marker::after { animation: none; }
  .golden-ring-bloom { display: none; }
}

/* Responsive */
@media (max-width: 480px) {
  .globe-cities { gap: var(--space-3); }
  .globe-city-link { font-size: var(--text-xs); padding: var(--space-2) var(--space-4); }
  .globe-subtitle { font-size: var(--text-xs); letter-spacing: 0.25em; }
}
