/* Hero — editorial copy left, one luminous country contour right. The only
   ambient movement is a signal travelling around that contour while the real
   area codes answer in sequence. */

.ln-hero {
  position: relative;
  /* Extra top room so the tall country map (Canada's arctic edge) clears the
     header — restores the breathing space the removed breadcrumb used to give. */
  padding: clamp(4.75rem, 8vw, 7.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

/* --- Load reveal (one-shot) ----------------------------------------------- */

.ln-hero__load-reveal {
  animation: ln-hero-load-reveal 900ms cubic-bezier(0.4, 2, 0.6, 1) both;
}

.ln-hero__visual.ln-hero__load-reveal {
  animation-delay: 120ms;
}

@keyframes ln-hero-load-reveal {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Grid ------------------------------------------------------------------ */

.ln-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: center;
}

/* --- Copy column ----------------------------------------------------------- */

.ln-hero__lede {
  max-width: 54ch;
  margin-bottom: 1.5rem;
}

.ln-hero__checklist {
  margin-bottom: 1.9rem;
  font-size: 1rem;
}

.ln-hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.ln-hero__ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.ln-hero__ghost-arrow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.ln-hero__ghost-arrow svg {
  width: 16px;
  height: 16px;
}

/* --- Map ------------------------------------------------------------------- */

.ln-hero__visual {
  position: relative;
  min-width: 0;
  width: min(116%, 700px);
  margin-left: -4%;
  isolation: isolate;
}

.ln-hero__visual::before {
  position: absolute;
  z-index: -1;
  inset: 4% 5% 26%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 107, 255, 0.075),
    rgba(111, 77, 255, 0.025) 42%,
    transparent 72%
  );
  filter: blur(28px);
  content: '';
  pointer-events: none;
}

.ln-map {
  position: relative;
  margin-bottom: clamp(0.75rem, 1.5vw, 1.2rem);
  --ln-trace-length: 2300;
}

.ln-map[data-map='canada'] {
  --ln-trace-length: 5200;
}

/* Only the page's own country renders — the attribute comes from the
   registry's LOCAL_COUNTRY template variable on <main>. */
[data-ln-country='usa'] .ln-map[data-map='canada'],
[data-ln-country='canada'] .ln-map[data-map='usa'] {
  display: none;
}

.ln-map__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* One clean violet contour. A second use of the same path carries the signal. */
.ln-map__land {
  fill: rgba(139, 107, 255, 0.012);
  stroke: url('#ln-map-stroke-usa');
  stroke-width: 1.45;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(139, 107, 255, 0.14));
  /* pathLength="1" (set in markup) normalizes every subpath so the draw is
     resolution-free. */
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: ln-map-draw 1400ms cubic-bezier(0.65, 0, 0.35, 1) both;
  animation-delay: 420ms;
}

[data-map='canada'] .ln-map__land {
  stroke: url('#ln-map-stroke-canada');
}

.ln-map__signal-outline {
  fill: none;
  stroke: #d7c7ff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 38 var(--ln-trace-length);
  stroke-dashoffset: var(--ln-trace-length);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgba(185, 140, 255, 0.38));
  animation: ln-outline-signal 7.2s 1.55s linear infinite;
}

@keyframes ln-outline-signal {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ln-map-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Area-code beacons ignite in sequence, then breathe at a very low amplitude. */
.ln-map__pin {
  animation: ln-pin-ignite 600ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(800ms + var(--pin-d) * 110ms);
}

@keyframes ln-pin-ignite {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ln-map__halo {
  fill: rgba(139, 107, 255, 0.14);
  transform-box: fill-box;
  transform-origin: center;
  animation: ln-beacon-breathe 3.6s calc(1.6s + var(--pin-d) * 180ms) ease-out infinite;
}

@keyframes ln-beacon-breathe {
  0%,
  62%,
  100% {
    opacity: 0.28;
    transform: scale(0.72);
  }
  78% {
    opacity: 0.45;
    transform: scale(1.24);
  }
}

.ln-map__dot {
  fill: #b79cff;
  stroke: #f4f1ff;
  stroke-width: 1.25;
  filter: drop-shadow(0 0 2px rgba(139, 107, 255, 0.4));
}

.ln-map__tag rect {
  fill: rgba(13, 18, 39, 0.94);
  stroke: rgba(181, 157, 255, 0.55);
  stroke-width: 0.9;
  filter: drop-shadow(0 6px 12px rgba(2, 6, 23, 0.52));
}

.ln-map__tag text {
  fill: #f5f2ff;
  font-family: var(--ln-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-anchor: middle;
}

.ln-map__tag {
  opacity: 0.68;
  animation: ln-code-focus 7.2s calc(1.7s + var(--pin-d) * 0.58s) ease-in-out infinite;
}

@keyframes ln-code-focus {
  0%,
  18%,
  100% {
    opacity: 0.68;
    filter: none;
  }
  7% {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(185, 140, 255, 0.28));
  }
}

/* --- Stats rail ------------------------------------------------------------ */

.ln-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.4rem;
  margin: 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--ln-rule);
  list-style: none;
}

.ln-hero__stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.ln-hero__stat .ln-icon {
  width: 34px;
  height: 34px;
  color: var(--ln-geo);
}

.ln-hero__stat:nth-child(2) .ln-icon {
  color: var(--ln-accent);
}
.ln-hero__stat:nth-child(3) .ln-icon {
  color: var(--ln-live);
}
.ln-hero__stat:nth-child(4) .ln-icon {
  color: var(--ln-rot-2);
}

.ln-hero__stat-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.ln-hero__stat-value {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--ln-ink);
  line-height: 1.15;
}

.ln-hero__stat-label {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ln-text-muted);
}

/* --- Search ---------------------------------------------------------------- */

.ln-hero__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 720px;
  margin: clamp(2.2rem, 4vw, 3.2rem) auto 0;
  padding: 0.5rem 0.5rem 0.5rem 1.1rem;
  border-radius: var(--ln-radius-pill);
  background: rgba(19, 25, 47, 0.72);
  box-shadow:
    inset 0 0 0 1px var(--ln-border-strong),
    0 12px 34px rgba(2, 6, 23, 0.35);
  transition: box-shadow 0.3s ease;
}

.ln-hero__search:focus-within {
  box-shadow:
    inset 0 0 0 1.5px var(--ln-primary-ring),
    0 12px 34px rgba(2, 6, 23, 0.4),
    0 0 0 4px rgba(139, 107, 255, 0.12);
}

.ln-hero__search-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--ln-text-muted);
}

.ln-hero__search-icon svg {
  width: 18px;
  height: 18px;
}

.ln-hero__search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--ln-ink-soft);
  font-size: 1rem;
  outline: none;
}

.ln-hero__search-input::placeholder {
  color: var(--ln-text-muted);
}

.ln-hero__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.ln-hero__search-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.62rem 1.35rem;
  border: 0;
  border-radius: var(--ln-radius-pill);
  background: var(--ln-primary-gradient);
  color: var(--ln-ink);
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    filter 0.25s ease,
    box-shadow 0.25s ease;
}

.ln-hero__search-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 8px 22px var(--ln-primary-shadow);
}

.ln-hero__search-btn:focus-visible {
  outline: 2px solid var(--ln-accent);
  outline-offset: 2px;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 980px) {
  .ln-hero__grid {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }

  .ln-hero__visual {
    max-width: 650px;
    margin-inline: auto;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .ln-hero__search {
    padding-left: 0.9rem;
  }

  .ln-hero__search-btn {
    padding-inline: 1rem;
  }

  .ln-hero__stats {
    gap: 0.8rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ln-hero__load-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .ln-map__pin {
    animation: none;
    opacity: 1;
  }

  /* Drop the border draw — the base rule already holds the final,
     fully-visible state. */
  .ln-map__land {
    animation: none;
  }

  .ln-map__halo,
  .ln-map__tag,
  .ln-map__signal-outline {
    animation: none;
  }

  .ln-map__signal-outline {
    stroke-dasharray: none;
    opacity: 0.28;
  }
}
