.landing-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.landing-curtain {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 10;
  transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-page.is-exiting .landing-curtain {
  transform: translateY(-100%);
}

.landing-bg-icons {
  display: none;
}

/* --- Animated landing background: counties (green) + HUC8 (blue) ---
   Sized to sit between the two paragraphs of the choice screen. */
.landing-bg-svg {
  flex: 1 1 auto;
  height: 220px;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity 600ms ease-out;
}
.landing-bg-svg.is-visible { opacity: 1; }
.landing-bg-svg-root {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.bg-county-path {
  fill: none;                 /* outlines only */
  stroke: #B6D7A8;            /* light green */
  stroke-opacity: 0.55;
  stroke-width: 0.9;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.bg-huc8-path {
  fill: none;
  stroke: #7FAEFF;            /* light blue */
  stroke-opacity: 0.55;
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

@media (prefers-reduced-motion: reduce) {
  .bg-county-path,
  .bg-huc8-path { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
}

/* Scattered positions, each with a diagonal trajectory */
.landing-bg-icon:nth-child(1) {
  top: 8%;
  left: 5%;
  animation: landing-diag-1 25s ease-in-out infinite;
}
.landing-bg-icon:nth-child(2) {
  top: 15%;
  right: 8%;
  animation: landing-diag-2 28s ease-in-out infinite;
  animation-delay: -8s;
}
.landing-bg-icon:nth-child(3) {
  bottom: 12%;
  left: 12%;
  animation: landing-diag-3 22s ease-in-out infinite;
  animation-delay: -4s;
}
.landing-bg-icon:nth-child(4) {
  bottom: 10%;
  right: 10%;
  animation: landing-diag-4 30s ease-in-out infinite;
  animation-delay: -14s;
}

@keyframes landing-diag-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(15vw, 12vh); }
}
@keyframes landing-diag-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12vw, 15vh); }
}
@keyframes landing-diag-3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18vw, -10vh); }
}
@keyframes landing-diag-4 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-14vw, -13vh); }
}

.welcome-popup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
}

.welcome-content {
  text-align: left;
  max-width: 520px;
}

.headline-serif {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
}

.welcome-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #002FFF;
  margin-bottom: 1.5rem;
}

.welcome-animation {
  display: block;
  max-width: 320px;
  height: auto;
  margin-bottom: 1.5rem;
  background: transparent;
}

@media (max-width: 768px) {
  .welcome-animation {
    clip-path: inset(4px);
    -webkit-clip-path: inset(4px);
  }
}

.welcome-description,
.welcome-definition {
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 400;
  line-height: 1.6;
  color: #555;
  text-align: left;
}

.welcome-description {
  margin-bottom: 1.25rem;
}

.welcome-definition {
  margin-bottom: 2rem;
}

.welcome-definition strong {
  font-weight: 400;
}

.enter-viz-btn {
  display: inline-block;
  padding: 0.75rem 2.5rem;
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: #303030;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.enter-viz-btn:hover {
  background: #555;
}

/* ── Typing cursor ─────────────────────────────── */
.typing-cursor {
  display: inline;
  margin-left: 1px;
  font-weight: 300;
  animation: cursor-blink 0.7s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── "logs" span ───────────────────────────────── */
#title-logs {
  display: inline-block;
  vertical-align: baseline;
}

.logs-cursive {
  font-family: "Dancing Script", cursive;
  font-weight: 600;
  font-size: 1.08em;
}

.logs-handwriting {
  font-family: "Caveat", cursive;
  font-weight: 500;
  font-size: 1.1em;
}

/* ── Drop & rise keyframes ─────────────────────── */
@keyframes logs-drop-out {
  0%   { transform: translateY(0);    opacity: 1; filter: blur(0);    }
  100% { transform: translateY(22px); opacity: 0; filter: blur(4px);  }
}

@keyframes logs-rise-in {
  0%   { transform: translateY(-18px); opacity: 0; filter: blur(3px); }
  65%  { transform: translateY(5px);   opacity: 1; filter: blur(0);   }
  100% { transform: translateY(0);     opacity: 1; filter: blur(0);   }
}

/* ── Content visible immediately ───────────────── */

@keyframes content-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Choice screen (after Enter) ──────────── */
.choice-screen {
  display: none;
}

.choice-screen.visible {
  display: flex;
}

.welcome-popup.hidden {
  display: none;
}

.choice-content {
  text-align: left;
  max-width: 640px;
  position: relative;
  z-index: 1;
  animation: content-fade-in 0.6s ease forwards;
}

.choice-viz-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.choice-legend {
  flex: 0 0 auto;
  width: 150px;
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 11px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.legend-swatch {
  flex: 0 0 auto;
  width: 14px;
  height: 2px;
  margin-top: 0.5rem;
  border-radius: 1px;
}

.legend-swatch-counties { background: #B6D7A8; }
.legend-swatch-huc8 { background: #7FAEFF; }

.legend-text {
  display: flex;
  flex-direction: column;
}

.legend-label-counties { color: #6FA85A; font-weight: 500; }
.legend-label-huc8 { color: #4A7FD6; font-weight: 500; }

.legend-stat {
  color: #888;
  font-size: 10px;
  margin-top: 0.15rem;
}

.legend-refresh {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem 0.3rem 0.5rem;
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  color: #555;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
}

.legend-refresh:hover {
  border-color: #888;
  color: #1a1a1a;
}

.legend-refresh svg {
  transition: transform 0.4s ease;
}

.legend-refresh:hover svg,
.legend-refresh.is-loading svg {
  transform: rotate(360deg);
}

.legend-refresh.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.analogs-blue {
  color: #002FFF;
}

.choice-explanation {
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 400;
  line-height: 1.7;
  color: #1a1a1a;
  margin-bottom: 1.25rem;
}

.choice-buttons {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  justify-content: center;
}

.choice-btn {
  text-align: center;
  opacity: 1;
  transform: none;
}
