/* ─────────────────────────────────────────────────────────────────────────
   Echo Vale — Hero
   ───────────────────────────────────────────────────────────────────────── */

/* ── Scroll container ────────────────────────────────────────────────────── */
.hero-scroll {
  height: 260vh;
  position: relative;
  background: #0a0d0c;
}

/* ── Sticky stage ────────────────────────────────────────────────────────── */
.hero-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  perspective: 1500px;
}

/* ── WebGL canvas ────────────────────────────────────────────────────────── */
#webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: .55;
  pointer-events: none;
}

/* ── Background blur ─────────────────────────────────────────────────────── */
.hero-blur {
  position: absolute;
  inset: -8%;
  z-index: 0;
  background: linear-gradient(rgba(5, 8, 7, .3), rgba(5, 8, 7, .72)),
              url('../assets/images/hero-cloud-house-blur.webp')
              center / cover;
  filter: blur(24px) saturate(.7);
  transform: scale(1.12);
  opacity: .9;
}

/* ── Photo shell ─────────────────────────────────────────────────────────── */
.hero-shell {
  width: min(92vw, 1500px);
  height: min(82svh, 880px);
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(233, 237, 230, .21);
  border-radius: 3px;
  background: #111715;
  box-shadow: 0 50px 160px rgba(0, 0, 0, .65);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Hero image ──────────────────────────────────────────────────────────── */
.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  will-change: transform, filter;
}
.hero-media img:first-child    { z-index: 0; }
.hero-media img.hero-media-transition {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.06);
  transition: opacity .85s var(--ease-in-out), transform 1.1s var(--ease-out);
  will-change: opacity, transform;
}
.hero-media img.hero-media-transition.is-visible { opacity: 1; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(4,7,6,.84) 0%, rgba(4,7,6,.35) 38%, rgba(4,7,6,.03) 69%),
    linear-gradient(0deg, rgba(4,7,6,.72), transparent 42%);
}

/* ── Decorative gridlines ────────────────────────────────────────────────── */
.hero-gridlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: .22;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent calc(25% - 1px), rgba(255,255,255,.15) 25%, transparent calc(25% + 1px)),
    linear-gradient(90deg, transparent calc(75% - 1px), rgba(255,255,255,.15) 75%, transparent calc(75% + 1px));
}

/* ── Top bar inside shell ────────────────────────────────────────────────── */
.hero-topbar {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(233, 237, 230, .12);
  z-index: 8;
}
.hero-toplinks {
  display: flex;
  gap: 2.4rem;
}
.hero-toplinks a {
  color: rgba(233, 237, 230, .72);
  text-decoration: none;
  font-size: .54rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* ── Copy area ───────────────────────────────────────────────────────────── */
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: clamp(7rem, 11vw, 10rem) clamp(1.5rem, 5vw, 5.5rem) clamp(2rem, 4vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-copy {
  width: min(48rem, 62%);
  will-change: transform, opacity;
}
.hero-copy h1 {
  margin: 1.4rem 0 1.15rem;
  max-width: 780px;
  font: 500 clamp(2.7rem, 5.75vw, 6.7rem)/.88 'Unbounded', sans-serif;
  letter-spacing: -.07em;
  text-transform: uppercase;
}
.hero-copy p {
  color: rgba(233, 237, 230, .72);
  max-width: 31rem;
  font-size: clamp(.8rem, 1vw, 1rem);
  line-height: 1.7;
}
/* Copy fade-in for thumbnail switching */
.hero-copy .project-copy-fade { animation: project-copy-fade .65s var(--ease-out); }
@keyframes project-copy-fade { from { opacity: .18; } to { opacity: 1; } }

/* ── Aside thumbnail card ────────────────────────────────────────────────── */
.hero-aside {
  position: absolute;
  top: 18%;
  right: 3.4%;
  width: clamp(150px, 17vw, 260px);
  z-index: 6;
}
.hero-aside-card {
  position: relative;
  aspect-ratio: 1.35;
  overflow: hidden;
  border: 1px solid rgba(233, 237, 230, .3);
  background: #121716;
}
.hero-aside-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-aside-card::after {
  content: '↗';
  position: absolute;
  top: .6rem;
  right: .7rem;
  font-size: 1.1rem;
  text-shadow: 0 1px 6px #000;
}
.hero-aside p {
  margin: .65rem 0 0;
  display: flex;
  justify-content: space-between;
  color: rgba(233, 237, 230, .62);
}

/* ── Large decorative word ───────────────────────────────────────────────── */
.hero-word {
  position: absolute;
  z-index: 4;
  left: -1.8%;
  bottom: -4.5%;
  margin: 0;
  font: 500 clamp(8rem, 23vw, 24rem)/.72 'Unbounded', sans-serif;
  letter-spacing: -.11em;
  color: #e5ebe3;
  white-space: nowrap;
  text-transform: lowercase;
  will-change: transform;
  mix-blend-mode: screen;
  opacity: .94;
  pointer-events: none;
}
.hero-word::after {
  content: '';
  position: absolute;
  inset: 44% 0 0;
  background: linear-gradient(transparent, rgba(5, 8, 7, .88) 80%);
}

/* ── Bottom stat bar ─────────────────────────────────────────────────────── */
.hero-foot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  z-index: 7;
  position: relative;
}
.hero-foot-item {
  border-top: 1px solid rgba(233, 237, 230, .35);
  padding-top: .9rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem;
}
.hero-foot-item b {
  font: 400 1.35rem 'Unbounded', sans-serif;
}
.hero-foot-item span {
  max-width: 12rem;
  color: rgba(233, 237, 230, .52);
  font-size: .65rem;
  line-height: 1.5;
}

/* ── Peek thumbnails (bottom of shell) ───────────────────────────────────── */
.hero-peek {
  position: absolute;
  z-index: 9;
  left: 29%;
  right: 2.2%;
  bottom: 2.2%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  opacity: 0;
  transform: translateY(130%);
  will-change: transform, opacity;
}
.hero-peek figure {
  margin: 0;
  aspect-ratio: 1.45;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  opacity: .62;
  cursor: pointer;
  transition: opacity .35s var(--ease-out), border-color .35s var(--ease-out),
              box-shadow .35s var(--ease-out), transform .35s var(--ease-out);
}
.hero-peek figure:hover { opacity: .9; }
.hero-peek figure.active {
  opacity: 1;
  border-color: var(--ember);
  box-shadow: 0 0 0 1px rgba(228,75,60,.28), 0 16px 42px rgba(0,0,0,.32);
  transform: translateY(-4px);
}
.hero-peek figure:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}
.hero-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease-out);
}
.hero-peek figure:hover img { transform: scale(1.07); }
.hero-peek figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: .65rem .75rem;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ── Scroll dot index ────────────────────────────────────────────────────── */
.scroll-index {
  position: absolute;
  z-index: 10;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.scroll-index span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(233, 237, 230, .3);
  transition: height .4s, background .4s;
  display: block;
}
.scroll-index span.active {
  height: 28px;
  border-radius: 8px;
  background: var(--ember);
}

/* ── Scroll cue ──────────────────────────────────────────────────────────── */
.scroll-cue {
  position: absolute;
  z-index: 12;
  bottom: 1.6rem;
  right: 1.7rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  color: rgba(233, 237, 230, .58);
}
.scroll-cue i {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}
.scroll-cue i::after {
  content: '↓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  animation: nudge 1.7s ease-in-out infinite;
}

/* ── Mobile hero overrides ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-scroll   { height: 205vh; }
  .hero-shell    { width: 94vw; height: 84svh; }
  .hero-toplinks { display: none; }
  .hero-content  { padding: 6rem 1.3rem 1.4rem; }
  .hero-copy     { width: 100%; }
  .hero-copy h1  { font-size: clamp(2.55rem, 10vw, 5.5rem); }
  .hero-copy p   { max-width: 22rem; }
  .hero-aside    { top: auto; bottom: 8rem; right: 1.2rem; width: 130px; }
  .hero-word     { font-size: 37vw; bottom: 4%; }
  .hero-foot     { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .hero-foot-item:nth-child(n+3) { display: none; }
  .hero-peek     { left: 1rem; right: 1rem; grid-template-columns: repeat(3, 240px); overflow: hidden; }
  .hero-peek figcaption { padding: .5rem; font-size: .52rem; }
}
@media (max-width: 580px) {
  .hero-aside { display: none; }
  .hero-foot  { grid-template-columns: 1fr; }
  .hero-foot-item:nth-child(n+2) { display: none; }
  .hero-word  { bottom: 10%; }
  .hero-peek  { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
}
