/* ==========================================================================
   Shopfront Studios — Hero installation
   --------------------------------------------------------------------------
   An editorial opening scene for the live Three.js sculpture. The layer order
   is deliberate: atmosphere, CSS fallback, WebGL canvas, technical frame,
   labels. Nothing in the visual stage receives pointer events.
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding-block: clamp(1.25rem, 2.8vw, 2.5rem) clamp(1.25rem, 2.8vw, 2.25rem);
  overflow: clip;
}

/* The previous CSS hero supplied its own ambient wash; the installation owns
   its atmosphere now. */
.hero::before {
  content: none;
}

.hero-atmosphere {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-atmosphere__beam {
  position: absolute;
  top: -32%;
  right: -6%;
  width: min(72rem, 82vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 52% 50%, rgba(124, 92, 255, 0.25), transparent 44%),
    radial-gradient(circle at 38% 42%, rgba(76, 201, 255, 0.13), transparent 34%),
    radial-gradient(circle at 63% 63%, rgba(79, 216, 255, 0.08), transparent 32%);
  filter: blur(10px);
  opacity: 0.95;
}

.hero-atmosphere__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(207, 196, 230, 0.065) 1px, transparent 1px),
    linear-gradient(rgba(207, 196, 230, 0.045) 1px, transparent 1px);
  background-size: 5rem 5rem;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 62% 44%, #000 0%, transparent 76%);
  mask-image: radial-gradient(ellipse 75% 70% at 62% 44%, #000 0%, transparent 76%);
  opacity: 0.7;
}

.hero-atmosphere__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.14;
}

.hero-rail {
  display: none;
}

.hero-shell {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: clamp(1.35rem, 3vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   Top line
   -------------------------------------------------------------------------- */

.hero-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: clamp(0.7rem, 1.5vw, 1rem);
  border-bottom: 1px solid var(--color-line);
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
  animation: hero-fade-down 0.8s 0.08s var(--ease-out) both;
}

.hero-eyebrow__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-accent);
}

.hero-eyebrow__mark::before {
  content: "";
  width: 0.28rem;
  height: 0.28rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px rgba(79, 216, 255, 0.7);
}

.hero-eyebrow__slash {
  color: var(--color-text-faint);
  opacity: 0.6;
}

.hero-render {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-render__dot {
  width: 0.3rem;
  height: 0.3rem;
  flex: none;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(79, 216, 255, 0.4);
  animation: hero-signal 2.6s ease-out infinite;
}

.hero[data-hero-render="fallback"] .hero-render__dot {
  background: #ffb15c;
  animation: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Body composition
   -------------------------------------------------------------------------- */

.hero-body {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 3rem);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

h1.hero-title {
  max-width: none;
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.062em;
  text-wrap: nowrap;
}

.hero-title__line {
  display: block;
  overflow: hidden;
  padding-block: 0.03em 0.05em;
  margin-block: -0.03em -0.05em;
}

.hero-title__line > span {
  display: block;
  transform-origin: 0 100%;
  animation: hero-line-in 1.05s var(--ease-out) both;
}

.hero-title__line:nth-child(1) > span {
  animation-delay: 0.16s;
}

.hero-title__line:nth-child(2) > span {
  animation-delay: 0.24s;
}

.hero-title__line:nth-child(3) > span {
  animation-delay: 0.32s;
}

.hero-title__line:nth-child(4) > span {
  animation-delay: 0.4s;
}

.hero-title em {
  color: var(--color-accent);
  font-style: normal;
}

.hero-title__outline {
  color: transparent;
  -webkit-text-stroke: 1.35px rgba(207, 196, 230, 0.62);
}

@supports not (-webkit-text-stroke: 1px currentColor) {
  .hero-title__outline {
    color: var(--color-text-soft);
  }
}

.hero-lede {
  max-width: 34rem;
  margin: clamp(1.4rem, 2.7vw, 2.15rem) 0 0;
  color: var(--color-text-soft);
  font-size: var(--text-base);
  line-height: 1.7;
  text-wrap: pretty;
  animation: hero-rise 0.95s 0.52s var(--ease-out) both;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: clamp(1.3rem, 2.4vw, 1.85rem);
  animation: hero-rise 0.95s 0.64s var(--ease-out) both;
}

.hero-ctas .btn {
  min-height: 3rem;
  padding-inline: 1.15rem;
}

.hero-cta--ghost {
  border-color: var(--color-line-strong);
  background: rgba(255, 255, 255, 0.015);
}

.hero-cta--ghost:hover {
  border-color: rgba(207, 196, 230, 0.45);
  background: rgba(243, 238, 255, 0.045);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: clamp(1.2rem, 2.2vw, 1.65rem) 0 0;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
  animation: hero-rise 0.85s 0.76s var(--ease-out) both;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-meta span::before {
  content: "";
  width: 0.22rem;
  height: 0.22rem;
  flex: none;
  border-radius: 50%;
  background: var(--color-line-strong);
}

.hero-meta span:first-child::before {
  background: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Sculpture stage
   -------------------------------------------------------------------------- */

.hero-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: clamp(15rem, 64vw, 24rem);
  overflow: visible;
  perspective: 900px;
  pointer-events: none;
}

.hero-stage__aura {
  position: absolute;
  z-index: 0;
  inset: -14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(124, 92, 255, 0.24), transparent 48%),
    radial-gradient(circle at 35% 62%, rgba(76, 201, 255, 0.11), transparent 40%),
    radial-gradient(circle at 66% 38%, rgba(79, 216, 255, 0.07), transparent 36%);
  filter: blur(7px);
  opacity: 0.95;
}

.hero-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  opacity: 1;
}

.hero-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-stage.is-fallback .hero-canvas {
  visibility: hidden;
  opacity: 0;
}

/* Technical frame — intentionally light so the sculpture remains the subject. */
.hero-stage__reticle {
  position: absolute;
  z-index: 3;
  inset: 4.5%;
  border: 1px solid rgba(207, 196, 230, 0.11);
  border-radius: 50%;
  pointer-events: none;
  animation: hero-reticle 90s linear infinite;
}

.hero-stage__reticle::before,
.hero-stage__reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 0.55rem;
  background: rgba(79, 216, 255, 0.5);
  transform: translateX(-50%);
}

.hero-stage__reticle::before {
  top: -0.3rem;
}

.hero-stage__reticle::after {
  bottom: -0.3rem;
}

.hero-stage__corner {
  position: absolute;
  z-index: 3;
  width: 1.4rem;
  height: 1.4rem;
  border-color: rgba(207, 196, 230, 0.24);
  border-style: solid;
  pointer-events: none;
}

.hero-stage__corner--tl {
  top: 2%;
  left: 2%;
  border-width: 1px 0 0 1px;
}

.hero-stage__corner--br {
  right: 2%;
  bottom: 2%;
  border-width: 0 1px 1px 0;
}

.hero-stage__tag {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.58rem;
  border: 1px solid var(--color-line);
  background: rgba(12, 6, 24, 0.56);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.46rem;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.hero-stage__tag i {
  color: var(--color-accent);
  font-style: normal;
}

.hero-stage__tag--one {
  top: 3%;
  left: 1%;
}

.hero-stage__tag--two {
  right: 0;
  bottom: 18%;
}

.hero-stage__tag--three {
  bottom: 1%;
  left: 8%;
}

/* --------------------------------------------------------------------------
   CSS fallback sculpture
   --------------------------------------------------------------------------
   Visible immediately, and left in place if WebGL, the CDN or the module
   fails. Hidden only after the first WebGL frame has been painted.
   -------------------------------------------------------------------------- */

.hero-stage__fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.65s var(--ease-out), visibility 0s 0s;
}

.hero-stage.is-live .hero-stage__fallback {
  visibility: hidden;
  opacity: 0;
  transition: none;
}

.hero-fallback__laptop {
  width: min(96%, 35rem);
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.5));
  animation: hero-laptop-float 9s var(--ease-in-out) infinite alternate;
}

@keyframes hero-laptop-float {
  from {
    transform: translateY(4px);
  }
  to {
    transform: translateY(-6px);
  }
}

/* --------------------------------------------------------------------------
   Footer line
   -------------------------------------------------------------------------- */

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  padding-top: clamp(0.9rem, 1.7vw, 1.2rem);
  border-top: 1px solid var(--color-line);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
  animation: hero-rise 0.85s 0.86s var(--ease-out) both;
}

.hero-foot__index {
  color: var(--color-text-muted);
}

.hero-foot__coords {
  text-align: right;
}

.hero-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-text-faint);
  transition: color var(--duration-base) var(--ease-out);
}

.hero-scroll-cue:hover {
  color: var(--color-accent);
}

.hero-scroll-cue__track {
  position: relative;
  display: block;
  width: 1px;
  height: 1.9rem;
  overflow: hidden;
  background: var(--color-line-strong);
}

.hero-scroll-cue__track i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 0.55rem;
  border-radius: 3px;
  background: var(--color-accent);
  transform: translateX(-50%);
  animation: hero-scroll-dot 2.6s var(--ease-in-out) infinite;
}

/* --------------------------------------------------------------------------
   Entrance keyframes
   -------------------------------------------------------------------------- */

@keyframes hero-line-in {
  from {
    opacity: 0;
    transform: translateY(105%) skewY(1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) skewY(0);
  }
}

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

@keyframes hero-fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-stage-in {
  from {
    opacity: 0;
    transform: scale(0.965);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hero-signal {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 216, 255, 0.42);
  }
  55% {
    box-shadow: 0 0 0 5px rgba(79, 216, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 216, 255, 0);
  }
}

@keyframes hero-reticle {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hero-scroll-dot {
  0% {
    transform: translate(-50%, -0.65rem);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 1.9rem);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Responsive composition
   -------------------------------------------------------------------------- */

@media (max-width: 29.99rem) {
  .hero-ctas {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .hero-foot__coords {
    display: none;
  }

  .hero-foot {
    justify-content: space-between;
  }
}

@media (min-width: 40rem) {
  .hero-stage {
    min-height: clamp(19rem, 54vw, 27rem);
  }

  .hero-stage__tag--one {
    top: 2%;
    left: 3%;
  }

  .hero-stage__tag--two {
    right: 3%;
    bottom: 16%;
  }

  .hero-stage__tag--three {
    bottom: 2%;
    left: 12%;
  }
}

@media (min-width: 56.25rem) {
  .hero {
    display: flex;
    min-height: calc(100svh - var(--header-height));
    padding-block: clamp(1.6rem, 2.4vw, 2.4rem) clamp(1.5rem, 2.4vw, 2rem);
  }

  .hero-shell {
    flex: 1;
    width: 100%;
    max-width: min(var(--container), calc(100% - (var(--gutter) * 2)));
    margin-inline: auto;
    justify-content: space-between;
    gap: clamp(1.5rem, 2.5vw, 2.25rem);
  }

  .hero-body {
    grid-template-columns: minmax(0, 1.02fr) minmax(21rem, 0.98fr);
    gap: clamp(2rem, 4.5vw, 4.5rem);
    padding-block: clamp(1rem, 2.5vw, 2.25rem);
  }

  h1.hero-title {
    font-size: clamp(3.6rem, 6.6vw, 7.4rem);
    line-height: 0.85;
  }

  .hero-lede {
    max-width: 31rem;
    font-size: var(--text-md);
  }

  .hero-stage {
    min-height: clamp(26rem, 40vw, 36rem);
    align-self: center;
  }

  .hero-stage__tag--three {
    display: inline-flex;
  }

  .hero-rail {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: clamp(0.6rem, 1.4vw, 1.5rem);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-faint);
    font-family: var(--font-mono);
    font-size: 0.46rem;
    letter-spacing: 0.24em;
    line-height: 1;
    text-transform: uppercase;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    opacity: 0.72;
    pointer-events: none;
  }

  .hero-rail__line {
    width: 1px;
    height: 2.75rem;
    background: linear-gradient(transparent, var(--color-line-strong), transparent);
  }
}

@media (min-width: 64rem) {
  .hero-ctas .btn {
    padding-inline: 1.35rem;
  }

  .hero-body {
    grid-template-columns: minmax(0, 1fr) minmax(24rem, 0.92fr);
  }
}

@media (min-width: 75rem) {
  h1.hero-title {
    font-size: clamp(5rem, 6.35vw, 7.75rem);
  }

  .hero-stage__tag--two {
    right: 1%;
  }
}

@media (min-width: 87.5rem) {
  .hero-rail {
    left: 1.75rem;
  }
}

/* Short desktop viewports keep the CTAs above the fold. */
@media (min-width: 56.25rem) and (max-height: 50rem) {
  h1.hero-title {
    font-size: clamp(3.3rem, 5.6vw, 5.5rem);
  }

  .hero-lede {
    margin-top: 1.25rem;
    font-size: var(--text-base);
  }

  .hero-ctas {
    margin-top: 1.1rem;
  }

  .hero-meta {
    margin-top: 1rem;
  }

  .hero-stage {
    min-height: clamp(22rem, 34vw, 27rem);
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow,
  .hero-title__line > span,
  .hero-lede,
  .hero-ctas,
  .hero-meta,
  .hero-stage,
  .hero-foot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-render__dot,
  .hero-stage__reticle,
  .hero-scroll-cue__track i,
  .hero-fallback__laptop {
    animation: none !important;
  }

  .hero-stage__fallback,
  .hero-canvas {
    transition: none !important;
  }
}
