/* ==========================================================================
   Hero — layered composition
   z0 bg · z1 vignette · z2 terrain · z3 orbit · z4 green path · z5 content
   z6 process panel / 04 · z7 header (60)
   ========================================================================== */

.hero {
  position: relative;
  min-height: 900px;
  height: max(100svh, 900px);
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}

/* z0 — static architectural background */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% center;
  transform-origin: 60% 50%;
}

/* z1 — lighting correction */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 8, 6, .55) 0%, rgba(8, 8, 6, 0) 22%, rgba(8, 8, 6, 0) 70%, rgba(8, 8, 6, .5) 100%),
    linear-gradient(90deg, rgba(8, 8, 6, .74) 0%, rgba(8, 8, 6, .47) 32%, rgba(8, 8, 6, .12) 57%, rgba(8, 8, 6, .08) 100%);
}

/* z2 — particle terrain (Canvas 2D) */
.hero__terrain {
  position: absolute;
  right: -2%;
  bottom: 8%;
  width: 65%;
  height: 40%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1200ms var(--ease-reveal);
}
.hero__terrain.is-visible { opacity: 1; }

/* z3 — orbit */
.hero__orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.hero__orbit ellipse {
  fill: none;
  stroke: rgba(243, 240, 232, .42);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

/* z4 — kinetic trajectory */
.hero__path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.hero__path path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hero__path-line { stroke-width: 1.4px; }
.hero__path-glow {
  stroke-width: 9px;
  opacity: .08;
  filter: blur(4px);
}
.hero__path-runner {
  fill: #dfffc2;
  opacity: 0;
}

/* Endpoint — HTML so it never distorts with the SVG viewBox */
.hero__endpoint {
  position: absolute;
  left: 94.7%;
  top: 31.1%;
  z-index: 5;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #eaffd6;
  box-shadow: 0 0 0 1px rgba(125, 255, 0, .55);
  pointer-events: none;
}
.hero__endpoint::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .22;
  filter: blur(6px);
  animation: endpoint-pulse 3.6s ease-in-out infinite;
}

@keyframes endpoint-pulse {
  0%, 100% { transform: scale(1); opacity: .18; }
  50%      { transform: scale(1.12); opacity: .3; }
}

/* z5 — content */
.hero__content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* 19% of the hero height (hero = max(100svh, 900px)), never under the header */
  padding-top: max(calc(19 * max(1svh, 9px)), calc(var(--header-h) + 60px));
}

.hero__copy {
  width: min(46%, 820px);
}

.hero__title {
  margin-top: 26px;
  max-width: 8.2em;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: .91;
  letter-spacing: var(--tracking-display);
  color: var(--text-light);
}

.hero__lede {
  margin-top: 34px;
  max-width: 420px;
  font-size: clamp(1.0625rem, 1.15vw, 1.125rem);
  line-height: 1.55;
  color: rgba(243, 240, 232, .70);
}

.hero__ctas {
  margin-top: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

/* z6 — process panel: opaque architectural plane, NOT glass */
.hero__process { display: contents; }

.hero__panel {
  position: absolute;
  z-index: 12;
  left: 54.5%;
  top: 18%;
  width: clamp(230px, 16.5vw, 285px);
  /* The plane keeps its designed band as a FLOOR and grows for its content:
     the fourth step joined the list here, and a fixed 56% cut it off below the
     card's own border. */
  min-height: 56%;
  background: var(--bg-panel);
  opacity: .98;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 28px 60px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
}

.hero__panel-head {
  padding: 30px 30px 6px;
  font-size: .7rem;
  letter-spacing: .14em;
  color: rgba(243, 240, 232, .58);
}

.hero__steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.step {
  padding: 22px 30px;
}
.step + .step {
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.step__index {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}
.step__title {
  margin-top: 8px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-light);
}
.step__desc {
  margin-top: 10px;
  font-size: .8rem;
  line-height: 1.5;
  color: rgba(243, 240, 232, .58);
}

/* ---- Entrance initial states (only when JS runs) ---------------------- */

.js .hero [data-enter] { opacity: 0; }
.js .hero__title .line__inner { transform: translateY(105%); opacity: .2; }

.line {
  display: block;
  overflow: hidden;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.line__inner { display: block; will-change: transform; }

/* ---- Tablet ------------------------------------------------------------ */

@media (max-width: 1179px) {
  .hero {
    min-height: 940px;
    height: max(100svh, 940px);
  }
  .hero__bg img { object-position: 62% center; }
  .hero__content { padding-top: max(calc(17 * max(1svh, 9.4px)), calc(var(--header-h) + 60px)); }
  .hero__copy { width: min(60%, 560px); }
  .hero__title { font-size: clamp(3.6rem, 7.2vw, 5.4rem); }
  .hero__panel {
    left: 60%;
    width: clamp(220px, 24vw, 250px);
    top: 20%;
    min-height: 50%;
  }
  .hero__endpoint { left: 96%; top: 33%; }
  .hero__terrain { width: 72%; height: 34%; bottom: 4%; }
}

@media (max-width: 1023px) {
  .hero__panel { left: 58%; top: 24%; }
}

/* ---- Mobile: the same layered composition, sized by the copy ----------- */

@media (max-width: 767px) {
  .hero {
    min-height: 100svh;
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }
  .hero__content {
    position: relative;
    height: auto;
    /* never under the fixed header on first paint */
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 56px;
    order: 1;
  }
  .hero__copy { width: 100%; }
  .hero__title {
    font-size: clamp(3.2rem, 15vw, 5.1rem);
    line-height: .92;
    max-width: none;
  }
  .hero__lede { margin-top: 26px; }
  .hero__ctas { margin-top: 30px; gap: 16px; }

  /* z0 stays a cover background behind the copy, as on desktop */
  .hero__bg img { object-position: 62% center; }
  /* z1 stays: the copy needs the darkening to read over the picture */
  .hero__vignette {
    background:
      linear-gradient(180deg, rgba(8, 8, 6, .62) 0%, rgba(8, 8, 6, .28) 30%, rgba(8, 8, 6, .28) 60%, rgba(8, 8, 6, .72) 100%),
      linear-gradient(90deg, rgba(8, 8, 6, .5) 0%, rgba(8, 8, 6, .3) 50%, rgba(8, 8, 6, .2) 100%);
  }

  .hero__orbit,
  .hero__path,
  .hero__endpoint,
  .hero__terrain { display: none; }

  .hero__process {
    display: block;
    order: 2;
    padding: 56px var(--gutter) 72px;
    position: relative;
    z-index: 10;
    background: var(--bg-panel);
  }
  .hero__process::before {
    /* timeline rail */
    content: "";
    position: absolute;
    left: calc(var(--gutter) + 3px);
    top: 120px;
    bottom: 96px;
    width: 1px;
    background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  }
  .hero__panel {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
  }
  .hero__panel-head { padding: 0 0 12px; }
  .hero__steps { display: grid; grid-template-columns: 1fr; }
  .step {
    position: relative;
    padding: 22px 0 22px 30px;
  }
  .step + .step { border-top: 0; }
  .step::before {
    content: "";
    position: absolute;
    left: 0;
    top: 26px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--accent);
  }
  .js .hero__panel,
  .js .hero__panel .step { opacity: 1; }
}
