/* ===== Inner Atlas — immersive foundation ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #f2efe6;
  --ink-soft: rgba(242, 239, 230, 0.72);
  --ink-mute: rgba(242, 239, 230, 0.42);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --focus: rgba(220, 230, 210, 0.85);
  --font-display: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  --font-body: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fade: 1.1s;
  --space: clamp(1.4rem, 4.5vw, 3rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --touch-min: 2.75rem;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: #0c1210;
  line-height: 1.65;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  color-scheme: dark;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: #1a2420;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ===== Screens ===== */
#app {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--fade) var(--ease),
    visibility var(--fade) var(--ease);
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.screen[hidden] {
  display: flex;
}

/* ===== Living world layers ===== */
.world {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform: scale(1.02);
}

.world__base,
.world__veil,
.world__glow,
.world__particles,
.world__mist,
.world__dust,
.world__breath {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world__base {
  background-size: cover;
  background-position: center;
  transform-origin: center;
}

.world.is-alive .world__base {
  animation: world-breathe 22s var(--ease) infinite alternate;
}

.world--scene.is-alive .world__base {
  animation: world-arrive 36s var(--ease) forwards;
}

@keyframes world-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes world-arrive {
  from { transform: scale(1.08); filter: blur(14px); opacity: 0.7; }
  22% { filter: blur(0); opacity: 1; }
  to { transform: scale(1.16); filter: blur(0); opacity: 1; }
}

.world__veil {
  background:
    linear-gradient(180deg, rgba(8, 12, 14, 0.18) 0%, rgba(8, 12, 14, 0.55) 100%);
}

.world__glow {
  opacity: 0.55;
  mix-blend-mode: soft-light;
}

.world__dust {
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, 0.2), transparent);
  background-size: 100% 100%;
  animation: dust-drift 28s linear infinite;
  opacity: 0.45;
}

@keyframes dust-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-2%, -3%, 0); }
}

.world__breath {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
  animation: breath-pulse 7s var(--ease) infinite;
  opacity: 0;
}

.world__mist {
  opacity: 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(200, 210, 220, 0.08), transparent 40%),
    radial-gradient(ellipse at 70% 40%, rgba(180, 190, 200, 0.06), transparent 35%);
}

.world--scene.is-alive .world__mist {
  opacity: 1;
  animation: mist-drift 24s var(--ease) infinite alternate;
}

@keyframes mist-drift {
  from { transform: translateX(-3%) translateY(1%); }
  to { transform: translateX(4%) translateY(-2%); }
}

.world--scene.is-alive .world__breath {
  opacity: 1;
}

@keyframes breath-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.03); }
}

/* Atmosphere: threshold (start) */
.world[data-atmosphere="threshold"] .world__base {
  background:
    radial-gradient(ellipse at 35% 45%, rgba(70, 100, 95, 0.5), transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 55, 80, 0.45), transparent 45%),
    linear-gradient(160deg, #15201e 0%, #1c2830 48%, #12181c 100%);
}

.world[data-atmosphere="threshold"] .world__glow {
  background: radial-gradient(ellipse at 50% 40%, rgba(160, 190, 170, 0.25), transparent 55%);
  animation: glow-soft 12s var(--ease) infinite alternate;
}

@keyframes glow-soft {
  from { opacity: 0.35; }
  to { opacity: 0.7; }
}

/* Atmosphere: forest */
.world[data-atmosphere="forest"] .world__base {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(120, 150, 100, 0.35), transparent 40%),
    radial-gradient(ellipse at 70% 80%, rgba(20, 40, 30, 0.7), transparent 45%),
    linear-gradient(175deg, #2a3d30 0%, #1a2820 45%, #101814 100%);
}

.world[data-atmosphere="forest"] .world__glow {
  background:
    linear-gradient(115deg, transparent 30%, rgba(220, 230, 180, 0.12) 48%, transparent 62%),
    radial-gradient(ellipse at 40% 0%, rgba(200, 220, 160, 0.2), transparent 50%);
  animation: light-rays 18s var(--ease) infinite alternate;
}

.world[data-atmosphere="forest"] .world__particles {
  background-image:
    radial-gradient(circle, rgba(190, 210, 160, 0.55) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(190, 210, 160, 0.35) 1px, transparent 1.5px);
  background-size: 120px 180px, 90px 140px;
  animation: leaves-fall 22s linear infinite;
  opacity: 0.55;
}

@keyframes light-rays {
  from { transform: translateX(-2%) rotate(-1deg); opacity: 0.4; }
  to { transform: translateX(3%) rotate(1deg); opacity: 0.75; }
}

@keyframes leaves-fall {
  from { background-position: 0 -20%, 40% -30%; }
  to { background-position: 10% 120%, 50% 130%; }
}

/* Atmosphere: ocean */
.world[data-atmosphere="ocean"] .world__base {
  background:
    radial-gradient(ellipse at 50% 70%, rgba(80, 140, 150, 0.4), transparent 50%),
    linear-gradient(180deg, #3a4a55 0%, #243840 40%, #152028 100%);
}

.world[data-atmosphere="ocean"] .world__glow {
  background: radial-gradient(ellipse at 50% 35%, rgba(200, 220, 230, 0.22), transparent 45%);
  animation: glow-soft 14s var(--ease) infinite alternate;
}

.world[data-atmosphere="ocean"] .world__particles {
  background:
    linear-gradient(180deg, transparent 52%, rgba(180, 210, 220, 0.1) 58%, transparent 64%),
    linear-gradient(180deg, transparent 66%, rgba(180, 210, 220, 0.07) 72%, transparent 78%),
    linear-gradient(180deg, transparent 80%, rgba(160, 190, 210, 0.05) 86%, transparent 92%);
  background-size: 100% 100%;
  animation: wave-drift 10s var(--ease) infinite alternate;
}

.world[data-atmosphere="ocean"] .world__mist {
  opacity: 0.55;
  background: radial-gradient(ellipse at 50% 20%, rgba(200, 220, 230, 0.15), transparent 50%);
}

@keyframes wave-drift {
  from { transform: translateY(0) scaleX(1); }
  to { transform: translateY(2%) scaleX(1.02); }
}

/* Atmosphere: fireplace */
.world[data-atmosphere="fireplace"] .world__base {
  background:
    radial-gradient(ellipse at 50% 75%, rgba(220, 120, 50, 0.35), transparent 40%),
    radial-gradient(ellipse at 50% 85%, rgba(180, 70, 30, 0.4), transparent 35%),
    linear-gradient(180deg, #2a221c 0%, #1c1612 50%, #120e0c 100%);
}

.world[data-atmosphere="fireplace"] .world__glow {
  background: radial-gradient(ellipse at 50% 80%, rgba(255, 160, 70, 0.35), transparent 45%);
  animation: fire-glow 3.5s var(--ease) infinite alternate;
}

.world[data-atmosphere="fireplace"] .world__particles {
  background-image:
    radial-gradient(circle, rgba(255, 200, 120, 0.7) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 160, 80, 0.45) 1px, transparent 1.5px);
  background-size: 80px 120px, 110px 160px;
  animation: ember-rise 9s linear infinite;
  opacity: 0.55;
}

@keyframes fire-glow {
  from { opacity: 0.4; transform: scale(1); }
  to { opacity: 0.85; transform: scale(1.04); }
}

@keyframes ember-rise {
  from { background-position: 20% 110%, 60% 120%; }
  to { background-position: 25% -10%, 55% -20%; }
}

/* Atmosphere: night */
.world[data-atmosphere="night"] .world__base {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(40, 60, 110, 0.45), transparent 50%),
    linear-gradient(180deg, #0e1420 0%, #121828 50%, #080c14 100%);
}

.world[data-atmosphere="night"] .world__glow {
  background:
    radial-gradient(1.5px 1.5px at 15% 20%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 35% 40%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 75% 35%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 90% 25%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 25% 55%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(ellipse at 50% 80%, rgba(60, 90, 140, 0.25), transparent 50%);
  animation: star-twinkle 8s var(--ease) infinite alternate;
}

@keyframes star-twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.95; }
}

.world[data-atmosphere="night"] .world__particles {
  background: radial-gradient(ellipse at 80% 10%, rgba(200, 220, 255, 0.35), transparent 2%);
  animation: shooting-star 14s linear infinite;
  opacity: 0;
}

@keyframes shooting-star {
  0%, 85% { opacity: 0; transform: translate(0, 0); }
  87% { opacity: 0.8; }
  95% { opacity: 0; transform: translate(-40vw, 30vh); }
  100% { opacity: 0; }
}

/* Atmosphere: journey */
.world[data-atmosphere="journey"] .world__base {
  background:
    linear-gradient(180deg, #2a3038 0%, #1e242c 40%, #14181e 100%);
}

.world[data-atmosphere="journey"] .world__glow {
  background:
    linear-gradient(90deg, transparent 0%, rgba(180, 190, 200, 0.08) 40%, transparent 70%),
    radial-gradient(ellipse at 50% 40%, rgba(220, 200, 160, 0.12), transparent 50%);
  animation: cabin-sway 8s var(--ease) infinite alternate;
}

.world[data-atmosphere="journey"] .world__particles {
  background:
    linear-gradient(90deg, transparent 0%, rgba(140, 160, 140, 0.15) 20%, transparent 35%),
    linear-gradient(90deg, transparent 50%, rgba(100, 120, 140, 0.12) 70%, transparent 85%);
  animation: scenery-pass 18s linear infinite;
  opacity: 0.5;
}

@keyframes cabin-sway {
  from { transform: translateX(-1%); opacity: 0.45; }
  to { transform: translateX(1.5%); opacity: 0.7; }
}

@keyframes scenery-pass {
  from { transform: translateX(0); }
  to { transform: translateX(-12%); }
}

/* Atmosphere: rain */
.world[data-atmosphere="rain"] .world__base {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 110, 120, 0.35), transparent 45%),
    linear-gradient(180deg, #2a3238 0%, #1a2228 55%, #12161a 100%);
}

.world[data-atmosphere="rain"] .world__glow {
  background: linear-gradient(180deg, rgba(140, 160, 170, 0.12), transparent 40%);
  animation: glow-soft 11s var(--ease) infinite alternate;
}

.world[data-atmosphere="rain"] .world__particles {
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(200, 220, 230, 0.28) 100%),
    linear-gradient(180deg, transparent 0%, rgba(200, 220, 230, 0.16) 100%),
    linear-gradient(180deg, transparent 0%, rgba(180, 200, 210, 0.1) 100%);
  background-size: 2px 18px, 1px 28px, 1px 40px;
  background-repeat: repeat;
  animation: rain-fall 1.8s linear infinite;
  opacity: 0.4;
}

.world[data-atmosphere="rain"] .world__mist {
  opacity: 0.7;
  background:
    linear-gradient(180deg, rgba(120, 140, 150, 0.12), transparent 35%),
    radial-gradient(ellipse at 50% 80%, rgba(180, 190, 200, 0.1), transparent 45%);
}

@keyframes rain-fall {
  from { background-position: 0 -40px, 20px -60px; }
  to { background-position: 0 40px, 20px 40px; }
}

/* Atmosphere: map */
.world[data-atmosphere="map"] .world__base {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(40, 55, 60, 0.4), transparent 55%),
    linear-gradient(180deg, #10161a 0%, #0c1014 100%);
}

/* ===== Content layout ===== */
.screen-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(var(--space) + var(--safe-top)) var(--space) calc(var(--space) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

.screen-content--center {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.screen-content--home {
  justify-content: flex-end;
  padding-bottom: clamp(1.5rem, 5vh, 3rem);
  gap: 1.5rem;
}

.screen-content--scene {
  justify-content: flex-end;
  align-items: stretch;
  max-width: 48rem;
}

.screen-content--map {
  max-width: 42rem;
}

.home-hero {
  margin-top: auto;
  margin-bottom: 0.5rem;
}

.screen-header {
  margin-top: clamp(1.5rem, 6vh, 3.5rem);
  margin-bottom: 1.5rem;
}

.brand-mark {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 1.25rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 5rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.tagline {
  font-weight: 200;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  color: var(--ink-soft);
  margin: 0.5rem 0 2rem;
  letter-spacing: 0.08em;
}

.eyebrow {
  font-weight: 200;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.85rem;
}

.screen-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 2.85rem);
  line-height: 1.15;
  color: var(--ink);
}

.place-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.place-name--scene {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
}

.place-line {
  color: var(--ink-soft);
  font-weight: 200;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  max-width: 24rem;
  line-height: 1.75;
  margin-top: 0.5rem;
}

.map-hint {
  margin-top: 0.65rem;
  color: var(--ink-mute);
  font-weight: 200;
  font-size: 0.9rem;
}

/* ===== Glass UI ===== */
.glass-panel {
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 1.4rem;
  padding: 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.invite-card {
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: clamp(1.75rem, 5vw, 2.75rem);
  max-width: 26rem;
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease);
}

.invite-card.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.scene-hud {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28));
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem 1.25rem;
  align-self: flex-start;
  max-width: 28rem;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 1.4s var(--ease),
    transform 1.4s var(--ease);
}

.scene-hud.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#screen-scene.is-arriving .scene-hud {
  opacity: 0;
}

/* ===== Search ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.need-search {
  margin-bottom: 0.9rem;
}

.need-input {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.need-input::placeholder {
  color: var(--ink-mute);
}

.need-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

/* ===== Moods ===== */
.mood-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.mood-btn {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  min-height: var(--touch-min);
  padding: 1.05rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.5s var(--ease),
    border-color 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.mood-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.mood-btn:active {
  transform: scale(0.98);
}

.need-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.need-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.need-chip:hover {
  color: var(--ink-soft);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

/* ===== Buttons ===== */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  min-height: var(--touch-min);
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
}

.btn--glass {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn--ghost {
  color: var(--ink-soft);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.btn--ghost:hover {
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.btn-row--scene {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1rem 1.5rem;
  margin-top: 1.1rem;
}

.screen-nav {
  padding-top: 0.5rem;
}

.screen-nav--row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.screen-content--profile {
  max-width: 40rem;
}

/* ===== Fog-of-war map ===== */
.atlas-map {
  --fog-strength: 1;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  max-height: min(54vh, 28rem);
  margin: 0 auto;
  border-radius: 42% 48% 45% 50% / 48% 42% 52% 45%;
  background:
    radial-gradient(ellipse at 45% 40%, rgba(35, 50, 48, 0.5), transparent 50%),
    radial-gradient(ellipse at 60% 65%, rgba(30, 40, 55, 0.4), transparent 45%),
    linear-gradient(150deg, #141c1a 0%, #0e1418 55%, #121816 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

.atlas-map::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(8, 10, 12, 0.88), transparent 42%),
    radial-gradient(ellipse at 70% 60%, rgba(6, 8, 10, 0.85), transparent 38%),
    radial-gradient(ellipse at 50% 80%, rgba(10, 12, 14, 0.7), transparent 40%);
  opacity: var(--fog-strength);
  animation: fog-shift 20s var(--ease) infinite alternate;
  pointer-events: none;
  z-index: 0;
  transition: opacity 1.4s var(--ease);
}

.atlas-fog {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 0, 0, 0.55), transparent 35%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 0, 0, 0.5), transparent 30%);
  opacity: calc(var(--fog-strength) * 0.85);
  animation: fog-shift 26s var(--ease) infinite alternate-reverse;
  transition: opacity 1.4s var(--ease);
}

@keyframes fog-shift {
  from { transform: translate(-2%, 1%); }
  to { transform: translate(3%, -2%); }
}

.map-spot {
  position: absolute;
  z-index: 1;
  width: 0.55rem;
  height: 0.55rem;
  margin: -0.275rem 0 0 -0.275rem;
  border: none;
  border-radius: 50%;
  background: rgba(35, 42, 40, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  cursor: default;
  padding: 0;
  transition:
    background 1.2s var(--ease),
    box-shadow 1.2s var(--ease),
    width 0.8s var(--ease),
    height 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.map-spot.is-visited {
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  background: rgba(210, 225, 190, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 28px rgba(170, 200, 150, 0.5),
    0 0 70px rgba(140, 170, 130, 0.3);
  cursor: pointer;
}

.map-spot.is-visited:hover {
  transform: scale(1.12);
}

.map-spot__label {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.55rem);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: transparent;
  pointer-events: none;
  transition: color 1s var(--ease);
}

.map-spot.is-visited .map-spot__label {
  color: var(--ink-soft);
}

.map-spot__count {
  position: absolute;
  left: 50%;
  top: calc(100% + 1.45rem);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 200;
  letter-spacing: 0.06em;
  color: transparent;
  pointer-events: none;
  transition: color 1s var(--ease);
}

.map-spot.is-visited .map-spot__count {
  color: var(--ink-mute);
}

/* ===== Memory pins (profile) ===== */
.memory-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  margin-bottom: 1rem;
  max-height: min(48vh, 22rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.memory-empty {
  color: var(--ink-mute);
  font-weight: 200;
  font-size: 0.95rem;
  padding: 1rem 0;
}

.memory-pin {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  border-radius: 1.1rem;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.memory-pin:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.memory-pin__mood {
  font-size: 0.7rem;
  font-weight: 200;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.memory-pin__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.35rem;
}

.memory-pin__count {
  font-size: 0.82rem;
  font-weight: 200;
  color: var(--ink-soft);
}

/* ===== Focus ===== */
.btn:focus-visible,
.mood-btn:focus-visible,
.need-chip:focus-visible,
.need-input:focus-visible,
.map-spot:focus-visible,
.memory-pin:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .glass-panel {
    padding: 1.4rem;
  }

  .mood-btn {
    padding: 1.2rem 1rem;
  }

  .btn-row {
    flex-direction: row;
    justify-content: center;
  }

  .screen-content--home {
    justify-content: center;
    padding-top: max(12vh, calc(var(--safe-top) + 4rem));
  }

  .screen-content--map,
  .screen-content--profile {
    max-width: 44rem;
  }

  .screen-title {
    font-size: clamp(2.1rem, 4vw, 3rem);
  }
}

@media (min-width: 960px) {
  .screen-content {
    max-width: 42rem;
  }

  .brand {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
  }

  .atlas-map {
    max-height: min(58vh, 32rem);
  }
}

@media (max-width: 380px) {
  .mood-list {
    grid-template-columns: 1fr;
  }

  .map-spot__count {
    display: none;
  }

  .screen-title {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  .place-name {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .screen-content--home {
    justify-content: flex-start;
    padding-top: 1rem;
    overflow-y: auto;
  }

  .home-hero {
    margin-top: 0.5rem;
  }

  .atlas-map {
    max-height: 42vh;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --fade: 0.01ms;
  }

  .screen,
  .mood-btn,
  .need-chip,
  .btn,
  .map-spot,
  .memory-pin,
  .invite-card,
  .scene-hud,
  .atlas-map,
  .atlas-fog,
  .skip-link {
    transition: none !important;
  }

  .world.is-alive .world__base,
  .world--scene.is-alive .world__base,
  .world__dust,
  .world__glow,
  .world__particles,
  .world__mist,
  .world__breath,
  .atlas-map::before,
  .atlas-fog {
    animation: none !important;
  }

  .map-spot.is-visited:hover {
    transform: none;
  }

  .invite-card,
  .scene-hud {
    opacity: 1;
    transform: none;
  }

  .invite-card.is-shown,
  .scene-hud.is-visible {
    opacity: 1;
  }
}
