/* ============================================================
   Section 1 · Hero — "Barcelona Rising Above Neopolis"
   Full-bleed night render of the tower is the thesis; the copy
   sits at the lower-left over a midnight scrim.
   ============================================================ */

.section-hero {
  position: relative;
  min-height: 640px;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ground-deep);
  isolation: isolate;
}

/* ---------- media ---------- */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

/* two-slide crossfade carousel: existing hero render + Barcelona facade image,
   stacked and faded between so layout/crop never shifts */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% center;
  transform: scale(1.2);
  animation: hero-settle 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hero-settle {
  to {
    transform: scale(1.12);
  }
}

/* legibility scrim: deepens midnight toward the lower-left where the copy sits */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to top,
      var(--midnight) 0%,
      color-mix(in srgb, var(--midnight) 70%, transparent) 30%,
      color-mix(in srgb, var(--midnight) 20%, transparent) 58%,
      transparent 80%
    ),
    linear-gradient(
      105deg,
      color-mix(in srgb, var(--midnight) 92%, transparent) 0%,
      color-mix(in srgb, var(--midnight) 68%, transparent) 30%,
      color-mix(in srgb, var(--midnight) 12%, transparent) 58%,
      transparent 78%
    ),
    color-mix(in srgb, var(--midnight) 18%, transparent);
}

/* ---------- copy ---------- */
.hero-inner {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--page-x/3) clamp(1rem, 3vh, 1.5rem);
}

.hero-eyebrow {
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.hero-h1 {
  margin: 1.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 5.2vw, 4.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: min(16ch, 100%);
}

.hero-h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.hero-h1 .line > span {
  display: block;
  transform: translateY(110%);
  animation: line-in 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-h1 .line:nth-child(1) > span {
  animation-delay: 0.3s;
}
.hero-h1 .line:nth-child(2) > span {
  animation-delay: 0.42s;
}
.hero-h1 .line:nth-child(3) > span {
  animation-delay: 0.54s;
}

.hero-h1 .place {
  color: var(--ember);
  font-style: italic;
}

.hero-sub {
  margin: 1.5rem 0 0;
  max-width: min(46ch, 100%);
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.15rem);
  line-height: 1.6;
  color: var(--ink-soft);
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem 1.6rem;
  margin-top: 2rem;
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
}

.hero-actions .link-scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition:
    color 0.3s ease,
    gap 0.3s ease;
}

.hero-actions .link-scroll svg {
  width: 1rem;
  height: 1rem;
}

.hero-actions .link-scroll:hover {
  color: var(--ember);
  gap: 0.95rem;
}

/* ---------- highlights marquee (bottom of hero) ---------- */
.hero-marquee {
  position: relative;
  flex: none;
  z-index: 4;
  overflow: hidden;
  border-top: 1px solid var(--hairline);

  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 64s linear infinite;
}

.hero-marquee:hover .marquee-track,
.hero-marquee:focus-within .marquee-track {
  animation-play-state: paused;
}

.hl {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: clamp(18rem, 22vw, 22rem);
  padding: 1.15rem clamp(1.4rem, 2.2vw, 2.4rem);
  border-left: 1px solid var(--hairline);
}

.hl-index {
  display: flex;
  align-items: center;
  margin-bottom: 0.85rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.hl-index::before {
  content: "";
  flex: none;
  width: 1.6rem;
  height: 2px;
  margin-right: 0.75rem;
  background: var(--terracotta);
}

.hl-index b {
  font-weight: 700;
  color: var(--ember);
}

.hl-index i {
  font-style: normal;
}

.hl-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--ember);
}

.hl-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-in {
  to {
    transform: translateY(0);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .marquee-track {
    animation-duration: 48s;
  }
}

@media (max-width: 560px) {
  .hl {
    width: clamp(15rem, 76vw, 19rem);
    padding: 0.9rem 1.4rem;
  }
  .hl-index {
    margin-bottom: 0.6rem;
  }
  .hl-note {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    margin-top: 0.4rem;
  }
  .marquee-track {
    animation-duration: 34s;
  }
  .hero-media img {
    object-position: 54% center;
  }
  .hero-scrim {
    background:
      linear-gradient(
        to top,
        var(--midnight) 0%,
        color-mix(in srgb, var(--midnight) 72%, transparent) 44%,
        color-mix(in srgb, var(--midnight) 24%, transparent) 72%,
        transparent 94%
      ),
      color-mix(in srgb, var(--midnight) 24%, transparent);
  }
  .hero-inner {
    padding: 15px;
  }
  .hero-h1 {
    margin-top: 1rem;
    font-size: clamp(2rem, 8.6vw, 2.8rem);
    max-width: 14ch;
  }
  .hero-sub {
    margin-top: 1rem;
    max-width: 34ch;
    font-size: 0.94rem;
    line-height: 1.55;
  }
  .hero-actions {
    gap: 0.75rem;
    margin-top: 1.4rem;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media img {
    transform: scale(1);
    animation: none;
  }
  .hero-slide {
    transition: none;
  }
  .hero-slide:not(.is-active) {
    display: none;
  }
  .hero-h1 .line > span,
  .hero-eyebrow,
  .hero-sub,
  .hero-actions,
  .hero-marquee {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .marquee-track {
    animation: none;
  }
  .hero-marquee {
    overflow-x: auto;
  }
}
