/* ==========================================================================
   Hero: name, deployment pipeline with jet takeoff, intro, and contact.
   ========================================================================== */

.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 2.5rem; }

.name {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--name-weight);
  font-size: clamp(3.4rem, 15vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
}

.role {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.25;
}

.meta {
  margin: 0;
  color: var(--steel);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
}

.summary {
  max-width: 40rem;
  margin: 0 0 1rem;
  font-size: 1.2rem;
  line-height: 1.55;
}

/* Pipeline --------------------------------------------------------------- */
/* Stage timing (--at, --ls, --ld, --done-at) is set by takeoff.js so each stage
   checks off as the jet passes; the calc() fallbacks apply if JS doesn't run. */

.pipe-wrap {
  position: relative;
  width: 100%;
  margin-top: 2.6rem;
}

.pipe {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.pipe li {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  color: var(--steel);
  font-size: 0.9rem;
  font-weight: 600;
  animation: label-done 400ms both;
  animation-delay: var(--at, calc(var(--i) * 1s + 0.4s));
}

.pipe li:last-child { flex: 0 0 auto; }

.pipe .dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 3px solid var(--steel);
  border-radius: 50%;
  background: var(--paper);
  animation: node-done 400ms ease-out both;
  animation-delay: var(--at, calc(var(--i) * 1s + 0.4s));
}

.pipe li:last-child .dot { animation-name: node-deploy; }

.pipe .dot svg {
  width: 0.8rem;
  height: 0.8rem;
  opacity: 0;
  animation: check-in 300ms ease-out both;
  animation-delay: calc(var(--at, calc(var(--i) * 1s + 0.4s)) + 0.2s);
}

.pipe .dot svg path { stroke: var(--paper); }
.pipe li:last-child .dot svg path { stroke: var(--signal-ink); }

/* Connector track (::before) and its fill (::after). */
.pipe li:not(:last-child)::before,
.pipe li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(0.7rem - 1.5px);
  left: 1.4rem;
  right: 0;
  height: 3px;
}

.pipe li:not(:last-child)::before { background: var(--rule); }

.pipe li:not(:last-child)::after {
  background: var(--ink);
  transform-origin: left;
  animation: flow var(--ld, 900ms) linear both;
  animation-delay: var(--ls, calc(var(--i) * 1s + 0.5s));
}

.pipe-status {
  margin: 0 0 1.5rem;
  color: var(--steel);
  font-size: 0.95rem;
  animation: fade-in 500ms both;
  animation-delay: var(--done-at, 3.8s);
}

.pipe-status strong { color: var(--ink); }

/* Hold every header animation until takeoff.js starts the run. */
.pipe-wrap:not(.run) .pipe li,
.pipe-wrap:not(.run) .pipe li::after,
.pipe-wrap:not(.run) .pipe .dot,
.pipe-wrap:not(.run) .pipe .dot svg,
.pipe-wrap:not(.run) .speed,
.pipe-wrap:not(.run) ~ .pipe-status { animation-play-state: paused; }

/* Jet -------------------------------------------------------------------- */

.plane-track {
  position: absolute;
  top: -1.85rem;
  left: 0;
  z-index: 2;
  width: 40px;
  height: 20px;
  pointer-events: none;
  will-change: transform;
  transition: opacity 0.8s ease;
}

.plane {
  display: block;
  width: 40px;
  height: 20px;
  transform-origin: 30% 70%;
  will-change: transform, opacity;
}

.plane path { fill: var(--ink); }

.plane-shadow {
  position: absolute;
  left: 6px;
  bottom: -0.55rem;
  width: 28px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.18;
}

/* Speed streaks behind the jet during the takeoff roll. */
.speed {
  position: absolute;
  top: 4px;
  right: 100%;
  width: 26px;
  height: 12px;
  opacity: 0;
  animation: speed-show 3.4s linear both;
  animation-delay: 0.4s;
}

.speed i {
  position: absolute;
  right: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--steel);
  animation: streak 260ms linear infinite;
}

.speed i:nth-child(1) { top: 1px; width: 14px; }
.speed i:nth-child(2) { top: 5px; width: 22px; animation-delay: 90ms; }
.speed i:nth-child(3) { top: 9px; width: 12px; animation-delay: 170ms; }

.contrail {
  position: absolute;
  top: -1.85rem;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

.contrail path {
  fill: none;
  stroke: var(--steel);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: opacity 1.6s ease;
}

.contrail.done path { opacity: 0; }

/* Keyframes -------------------------------------------------------------- */

@keyframes flow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes label-done { from { color: var(--steel); } to { color: var(--ink); } }
@keyframes check-in { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
@keyframes node-done {
  from { background: var(--paper); border-color: var(--steel); }
  to { background: var(--ink); border-color: var(--ink); }
}
@keyframes node-deploy {
  from { background: var(--paper); border-color: var(--steel); transform: scale(1); }
  60% { transform: scale(1.2); }
  to { background: var(--signal); border-color: var(--ink); transform: scale(1); }
}
@keyframes speed-show { 0%, 40% { opacity: 0; } 60%, 92% { opacity: 0.7; } 100% { opacity: 0; } }
@keyframes streak { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-10px); opacity: 0; } }

/* Responsive & motion ---------------------------------------------------- */

@media (max-width: 40rem) {
  .summary { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pipe li,
  .pipe li::after,
  .pipe .dot,
  .pipe .dot svg,
  .pipe-status {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
  }
  .speed,
  .contrail { display: none; }
}
