
:root {
  --gold: #d1b47b;
  --text: #f1eadc;
  --muted: #c1b8a7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #0b0c10;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}



/* ===== MAP LAYOUT: KEEP MAP AND MARKERS ALIGNED ===== */

.atlas {
  --header-height: 112px;
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #0b0c10;
}


/* ========================================
   SHARED AUTHOR-PORTAL TITLE STYLE
   ======================================== */

.atlas-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  height: var(--header-height, 112px);
  box-sizing: border-box;
  padding: 16px 30px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;

  background: rgba(11, 12, 16, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.atlas-header > div {
  text-align: center;
}

.atlas-header .eyebrow {
  margin: 0 0 7px;
  color: #c9ad78;
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.atlas-header h1 {
  margin: 0;
  color: #f0eee8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.015em;
}

.back-link {
  justify-self: start;
  color: #c5c3bd;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #c9ad78;
}

.header-note {
  justify-self: end;
  max-width: 190px;
  margin: 0;
  color: #92939b;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: right;
}


/* ========================================
   SHARED AUTHOR-PORTAL ENDING / FOOTER
   ======================================== */

.atlas-footer {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  min-height: 42px;
  padding: 12px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  background: rgba(11, 12, 16, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  color: #777983;

  font-family: Arial, sans-serif;
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  line-height: 1.5;
  text-transform: uppercase;
}


/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 600px) {
  .atlas-header {
    padding: 12px 15px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 5px 12px;
  }

  .atlas-header > div {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .atlas-header .back-link {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.75rem;
  }

  .atlas-header .header-note {
    grid-column: 2;
    grid-row: 2;
    max-width: 145px;
    font-size: 0.68rem;
  }

  .atlas-footer {
    padding: 10px 14px;
    gap: 8px;
    font-size: 0.52rem;
    letter-spacing: 0.09em;
  }
}

@media (max-width: 360px) {
  .atlas-footer {
    font-size: 0.46rem;
    letter-spacing: 0.05em;
  }
}


/* The available map area is everything below the header */
.map-stage {
  position: absolute;
  inset: var(--header-height) 0 0;
  overflow: hidden;
  z-index: 0;
}

/* Keep the original 1400 × 900 map proportions */
.map-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, calc((100dvh - var(--header-height)) * 1.555556));
  height: min(100%, calc(100vw * 0.642857));
  transform: translate(-50%, -50%);
}

.world-map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}

.map-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Circular capital markers */
.nation-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  box-sizing: border-box;

  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;

  border: 2px solid var(--nation-color);
  border-radius: 50%;
  background: rgba(12, 14, 19, 0.8);
  box-shadow: 0 0 12px 3px var(--nation-glow);

  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

.nation-marker::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--nation-color);
}

.nation-marker:hover,
.nation-marker[aria-pressed="true"] {
  transform: translate(-50%, -50%) scale(1.3);
}

/* Subtle darkening over the map, without blocking clicks */
.map-shade {
  position: absolute;
  inset: var(--header-height) 0 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(7, 9, 14, 0.08);
}

/* ===== TRANSLUCENT NATION POP-UP ===== */

.nation-overlay {
  position: absolute;
  z-index: 10;

  left: 50%;
  top: 58%;
  width: min(360px, calc(100% - 32px));
  max-height: 55%;
  overflow-y: auto;
  box-sizing: border-box;

  padding: 25px;
  border: 1px solid color-mix(
    in srgb, var(--nation-color, #f0eee5) 55%, transparent
  );
  border-radius: 18px;

  background: color-mix(
    in srgb, var(--nation-color, #f0eee5) 13%, rgba(12, 14, 20, 0.91)
  );

  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.38),
    0 0 24px color-mix(
      in srgb, var(--nation-color, #f0eee5) 16%, transparent
    );

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -46%);
  transition: opacity 180ms ease, transform 180ms ease,
              visibility 180ms ease;
}

/* Visible only after a capital is selected */
.nation-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.nation-overlay .close-panel {
  color: var(--nation-color, #f0eee5);
}

.nation-overlay .ornament {
  background: var(--nation-color, #f0eee5);
  opacity: 0.65;
}

.nation-overlay .capital-name {
  color: var(--nation-color, #f0eee5);
}

.nation-overlay .explore-link {
  border-color: color-mix(
    in srgb, var(--nation-color, #f0eee5) 50%, transparent
  );
}

/* Footer stays at the bottom */
.atlas-footer {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Mobile */
@media (max-width: 600px) {
  .atlas {
    --header-height: 132px;
  }

  .nation-marker {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
  }

  .nation-overlay {
    top: 61%;
    padding: 20px;
  }
}
