/* ==========================================================================
   Hero
   The WebGL canvas fills the section; type sits bottom-left and the object
   floats right. data-stage on .hero (wireframe | clay | lit | final) is set
   by js/hero.js in sync with the 3D material passes, so the title "renders"
   alongside the object.
   ========================================================================== */

.hero {
  /* Stage-driven title look (overridden per stage below) */
  --stage-w: 260;                 /* font weight for this pass */
  --title-fill: transparent;
  --title-stroke: var(--accent);

  position: relative;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  padding: calc(var(--gutter) * 3) var(--gutter) clamp(28px, 7vh, 84px);
  overflow: hidden;
  isolation: isolate;
}

.hero[data-stage="clay"]  { --stage-w: 460; --title-fill: var(--clay); --title-stroke: transparent; }
.hero[data-stage="lit"]   { --stage-w: 620; --title-fill: #dcd9d1;    --title-stroke: transparent; }
.hero[data-stage="final"] { --stage-w: 760; --title-fill: var(--fg);   --title-stroke: transparent; }

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: var(--z-scene);
  display: block;
  width: 100%;
  height: 100%;
}

/* Lens vignette: pulls the eye to the object and keeps the edges in the void */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 75% at 62% 46%, transparent 45%, rgba(6, 7, 8, 0.72) 100%),
    linear-gradient(to top, rgba(6, 7, 8, 0.55), transparent 38%);
}

/* No WebGL: a quiet static stand-in for the object */
.hero.no-webgl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 66% 44%, rgba(236, 235, 230, 0.1), transparent 30%);
}

.hero__content {
  position: relative;
  z-index: var(--z-ui);
  max-width: min(62rem, 64vw);
}

/* --------------------------------------------------------------------------
   Title
   -------------------------------------------------------------------------- */

.hero__title {
  font-size: clamp(3.1rem, 10.4vw, 11rem);
  font-weight: var(--stage-w);
  font-stretch: 116%;
  line-height: 0.86;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--title-fill);
  -webkit-text-stroke: 1px var(--title-stroke);
  transition:
    color 1.2s var(--ease-in-out),
    -webkit-text-stroke-color 1.2s var(--ease-in-out);
}

.hero__title .word {
  display: inline-block;
  white-space: nowrap;
  margin-right: 0.18em;
}

.hero__title .word:last-child {
  margin-right: 0;
}

/* Each letter carries its own weight so it can swell under the pointer.
   --swell (0 to 1) is set per letter by js/hero.js once the intro is done. */
.hero__title .ch {
  display: inline-block;
  font-weight: calc(var(--stage-w) + (900 - var(--stage-w)) * var(--swell, 0));
  transition: font-weight 1.2s var(--ease-in-out);
}

.hero.is-ready .hero__title .ch {
  transition: font-weight 0.45s var(--ease-out);
}

/* --------------------------------------------------------------------------
   Role + showreel button
   -------------------------------------------------------------------------- */

.hero__role {
  margin-top: clamp(1rem, 2.2vh, 1.6rem);
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  font-weight: 400;
  font-stretch: 100%;
  color: var(--fg-muted);
  letter-spacing: 0;
}

.hero__actions {
  margin-top: clamp(1.4rem, 3.4vh, 2.4rem);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.25rem 0.95rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(10, 11, 13, 0.35);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--ease-out), border-color 0.45s var(--ease-out);
}

/* Accent fill sweeps in from the left */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: scaleX(1);
}

.btn:active::before {
  transform: scaleX(1);
  filter: brightness(0.9);
}

/* Play glyph: a ring with a triangle inside */
.btn__icon {
  position: relative;
  width: 26px;
  height: 26px;
  border: 1px solid currentColor;
  border-radius: 50%;
  flex: none;
}

.btn__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  transform: translate(-35%, -50%);
}

.btn__meta {
  padding-left: 0.9rem;
  border-left: 1px solid currentColor;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Viewport shading switcher (bottom right)
   -------------------------------------------------------------------------- */

.hero__modes {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(28px, 7vh, 84px);
  z-index: var(--z-ui);
  display: flex;
  gap: 2px;
  font-family: var(--font-mono);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), background-color 0.3s;
}

.mode-btn__key {
  color: var(--fg-faint);
  font-size: 0.6rem;
}

.mode-btn:hover {
  color: var(--fg);
}

.mode-btn:active {
  background: rgba(236, 235, 230, 0.06);
}

.mode-btn[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--line);
  background: rgba(10, 11, 13, 0.5);
}

.mode-btn[aria-pressed="true"] .mode-btn__key {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Small screens: object floats in the upper half, type sits below it
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
  .hero__content {
    max-width: 100%;
  }

  .hero__modes {
    top: calc(var(--gutter) * 0.75 + 2.6rem);
    bottom: auto;
    left: var(--gutter);
    right: var(--gutter);
    justify-content: space-between;
  }

  .mode-btn {
    padding: 0.5rem 0.55rem;
  }

  .mode-btn__key {
    display: none;
  }

  .hero::after {
    background:
      radial-gradient(ellipse 110% 70% at 50% 36%, transparent 40%, rgba(6, 7, 8, 0.7) 100%),
      linear-gradient(to top, rgba(6, 7, 8, 0.8), transparent 50%);
  }
}

@media (max-width: 380px) {
  .btn__meta {
    display: none;
  }
}
