/* Hero: masked project timeline behind the headline and brief box. */
.hero {
  position: relative;
  padding: 9.5rem 0 7rem;
  overflow: hidden;
  text-align: center;
}

/* One mask for ruler, clips and playhead keeps the headline area clear. */
.timeline {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 40% 44% at 50% 47%, transparent 62%, #000 100%);
          mask-image: radial-gradient(ellipse 40% 44% at 50% 47%, transparent 62%, #000 100%);
}

.ruler {
  position: absolute;
  top: 3.2rem;
  left: 0;
  right: 0;
  height: 20px;
  font: 400 11px / 20px var(--font-mono);
  color: #b9b9be;
}

.ruler span { position: absolute; transform: translateX(-50%); }

.tracks { position: absolute; top: 5.6rem; left: 0; right: 0; }

.track {
  position: relative;
  height: 68px;
  border-top: 1px solid var(--color-line);
  overflow: hidden;
}

.lane {
  position: absolute;
  top: 6px;
  left: 0;
  display: flex;
  width: max-content;
  animation: lane-slide var(--dur, 60s) linear infinite;
}

.lane.is-reverse { animation-direction: reverse; }

.clip {
  flex: none;
  height: 54px;
  border-radius: 12px;
  background: var(--color-clip);
  display: flex;
  align-items: flex-end;
  padding: 0 10px 8px;
  font: 500 10px / 1 var(--font-mono);
  color: #b3b3b8;
  letter-spacing: 0.02em;
}

.clip.is-holo { background: var(--holo-soft); color: #6b6b70; }

.playhead {
  position: absolute;
  top: 3rem;
  left: 0;
  width: 1px;
  height: calc(2.6rem + 7 * 68px);
  background: var(--color-ink);
  opacity: 0.85;
  animation: playhead 18s linear infinite;
}

.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  width: 13px;
  height: 16px;
  border-radius: 3px 3px 7px 7px;
  background: var(--color-ink);
}

@keyframes playhead {
  from { transform: translateX(-10px); }
  to { transform: translateX(100vw); }
}

/* ---------- Headline ---------- */
.hero-inner { position: relative; z-index: 2; }

.hero-title {
  margin: 0 auto;
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-title .row { display: block; text-wrap: balance; }

.hero-title .w,
.hero-title .hchip {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.25em);
  animation: word-in 900ms var(--ease) forwards;
  animation-delay: calc(120ms + var(--i, 0) * 70ms);
}

.hchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.06em;
  height: 0.78em;
  margin: 0 0.04em;
  border-radius: 0.2em;
}

.hchip svg { width: 0.42em; height: 0.42em; }

.hchip-holo { width: 1.55em; background: var(--holo); background-size: 220% 220%; }

.hero-title .hchip-holo.is-live {
  animation: word-in 900ms var(--ease) forwards, holo-shift 5s ease-in-out infinite alternate;
  animation-delay: calc(120ms + var(--i, 0) * 70ms), 0s;
}

.hchip-dark { width: 1.3em; background: var(--color-ink); color: var(--color-lime); }
.hchip-dark svg { width: 0.5em; height: 0.5em; }
.hchip-cursor { width: 0.9em; height: 0.9em; }
.hchip-cursor svg { width: 0.78em; height: 0.78em; }
.hchip-cursor.is-live svg { animation: cursor-bob 2.4s ease-in-out infinite; }

@keyframes cursor-bob { 50% { transform: translate(-3px, -4px) rotate(-6deg); } }

.hero-sub {
  margin: 1.75rem auto 0;
  max-width: 34rem;
  color: var(--color-ink-soft);
  font-size: var(--text-lg);
  opacity: 0;
  animation: fade-up 800ms var(--ease) 700ms forwards;
}

/* ---------- Brief box ---------- */
.brief {
  position: relative;
  max-width: 680px;
  margin: 2.5rem auto 0;
  text-align: left;
  background: #fff;
  border: 1px solid #e3e3e6;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  opacity: 0;
  animation: fade-up 800ms var(--ease) 850ms forwards;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.brief:focus-within {
  border-color: #c9c9ce;
  box-shadow: 0 0 0 4px rgba(36, 83, 255, 0.08), var(--shadow-float);
}

.brief textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 1rem 1rem 0;
  font: inherit;
  font-size: 1rem;
  color: var(--color-ink);
}

.brief textarea:focus { outline: none; }
.brief textarea::placeholder { color: #a1a1a6; }

.brief-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.7rem 0.7rem 1rem;
}

.brief-hint { font: 400 0.75rem / 1 var(--font-mono); color: #a1a1a6; }

.brief-send {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-ink);
  color: #fff;
  cursor: pointer;
  transition: transform var(--duration-fast) ease;
}

.brief-send:hover { transform: translateY(-2px); }
.brief-send svg { width: 16px; height: 16px; }

.brief-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 1000ms forwards;
}

/* ---------- Responsive ---------- */
@media (min-width: 761px) {
  .hero-title .row { white-space: nowrap; }
}

@media (max-width: 760px) {
  .hero { padding: 5.25rem 0 3.5rem; }
  .ruler,
  .playhead { display: none; }
  .tracks { top: 1.5rem; }
  /* Wider clear zone: on a narrow screen the copy fills most of the width. */
  .timeline {
    -webkit-mask-image: radial-gradient(ellipse 75% 42% at 50% 42%, transparent 55%, #000 100%);
            mask-image: radial-gradient(ellipse 75% 42% at 50% 42%, transparent 55%, #000 100%);
  }
  .hero-sub { margin-top: 1.25rem; font-size: 1.05rem; }
  .brief { margin-top: 1.75rem; }
  .brief textarea { min-height: 72px; }
}

@media (max-width: 480px) {
  /* The code chip would wrap onto its own line on narrow phones. */
  .hchip-dark { display: none; }
}

@media (hover: none) {
  .brief-hint { display: none; }
}
