/*
  Scroll connector — dashed line that draws itself between landing sections.
  Driven by scroll_connector_controller.js, which sets `--p` (0 → 1) and
  toggles `.is-lit` once the line reaches its node.

  Accent comes from `--connector-rgb` (a Catppuccin channel triplet such as
  var(--ctp-mauve-rgb)), so it follows Latte/Mocha automatically.
*/
.section-connector {
  --p: 1;
  --connector-rgb: var(--ctp-sky-rgb);
  --dash: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-connector__track {
  position: relative;
  width: 2px;
  height: clamp(7rem, 16vw, 12rem);
  /* Faint dashed rail showing where the line will go */
  background-image: linear-gradient(to bottom, rgb(var(--mocha-surface1-rgb)) 0 60%, transparent 60% 100%);
  background-size: 2px var(--dash);
}

.section-connector__fill {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to bottom, rgb(var(--connector-rgb)) 0 60%, transparent 60% 100%);
  background-size: 2px var(--dash);
  clip-path: inset(0 0 calc((1 - var(--p)) * 100%) 0);
}

/* Glowing head that rides the tip of the line */
.section-connector__head {
  position: absolute;
  left: 50%;
  top: calc(var(--p) * 100%);
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgb(var(--connector-rgb));
  box-shadow: 0 0 0 4px rgb(var(--connector-rgb) / 0.18), 0 0 16px 2px rgb(var(--connector-rgb) / 0.55);
  transform: translate(-50%, -50%);
  opacity: calc(var(--p) * 4);
  transition: opacity 200ms ease;
}

.section-connector.is-lit .section-connector__head {
  opacity: 0;
}

.section-connector__node {
  margin-top: 0.75rem;
  transform: scale(0.85);
  filter: grayscale(1);
  opacity: 0.55;
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease, opacity 300ms ease, box-shadow 450ms ease;
  border-radius: 1rem;
}

.section-connector.is-lit .section-connector__node {
  transform: scale(1);
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 6px rgb(var(--connector-rgb) / 0.08), 0 10px 30px -8px rgb(var(--connector-rgb) / 0.55);
}

.section-connector__eyebrow {
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(var(--mocha-subtext0-rgb));
  transition: color 300ms ease;
}

.section-connector.is-lit .section-connector__eyebrow {
  color: rgb(var(--connector-rgb));
}

@media (prefers-reduced-motion: reduce) {
  .section-connector__node,
  .section-connector__head,
  .section-connector__eyebrow {
    transition: none;
  }
}

/* Subtle dot grid behind the hero — texture without a gradient wash */
.hero-grid {
  background-image: radial-gradient(rgb(var(--mocha-text-rgb) / 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

/* Same dot texture as .hero-grid, without the fade, for full panels */
.dot-grid {
  background-image: radial-gradient(rgb(var(--mocha-text-rgb) / 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
