/* ==========================================================================
   Hero — full-bleed first impression with Three.js depth field
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--xl) var(--gutter) clamp(6rem, 12vw, 9rem);
  overflow: hidden;
}

/* Three.js canvas sits behind everything */
#hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* Blueprint grid behind canvas for depth + brutalist scaffolding */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: clamp(48px, 7vw, 96px) clamp(48px, 7vw, 96px);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 35%, transparent 78%);
  opacity: 0.5;
}

/* coordinates toggle (NYC / LA) */
.coords-toggle {
  border: none; background: none; cursor: pointer; color: var(--text-secondary);
  font: inherit; padding: 0; line-height: 1.5;
}
.coords-toggle .coords-city {
  display: inline; color: var(--accent-deep); font-weight: 500; margin-right: 0.4em;
}
.coords-toggle .coords-val { display: inline; color: var(--text-secondary); }
.coords-toggle .coords-note { display: block; color: var(--text-faint); }
.coords-toggle .coords-city, .coords-toggle .coords-val { transition: opacity 0.3s; }
.coords-toggle.flip .coords-city, .coords-toggle.flip .coords-val { animation: coordflip 0.5s var(--ease); }
@keyframes coordflip { 0% { opacity: 0; transform: translateY(-4px); } 100% { opacity: 1; transform: none; } }
.coords-toggle:hover .coords-city { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent); }

.hero-content { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; width: 100%; }

.hero-title {
  font-size: var(--h1);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: var(--lg);
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: inline-block; }
.hero-title .marker { font-weight: 500; }

.hero-sub {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 auto;
  line-height: 1.5;
}
.hero-sub strong { color: var(--text-primary); font-weight: 600; }

/* Scroll cue — primary call-to-action now that the button is gone */
.scroll-cue {
  position: absolute; bottom: clamp(1.5rem, 4vw, 3rem); left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.32em; text-indent: 0.32em;
  text-transform: uppercase; color: var(--text-secondary);
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: var(--md);
  transition: color 0.3s var(--ease);
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue .bar {
  width: 2px; height: clamp(56px, 9vw, 88px);
  background: linear-gradient(currentColor, transparent);
  animation: scrollpulse 2.4s var(--ease) infinite;
}
@keyframes scrollpulse {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (max-width: 640px) {
  .hero { padding-bottom: clamp(5rem, 18vw, 7rem); }
}

/* ---- Unified hero overlay: sits over the orb and fades out on scroll ---- */
.hero-overlay {
  position: absolute; inset: 0; z-index: 5;
  transition: opacity 0.4s var(--ease-soft), transform 0.6s var(--ease), filter 0.4s var(--ease-soft);
  will-change: opacity, transform;
}
/* the orb is the backdrop now — drop the blueprint grid behind the text */
.hero-overlay::before { display: none; }

/* ======================================================================== 
   Single-line hero headline + scripted load animation (< 3s total)
   ======================================================================== */
.hero-line {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
  color: var(--text-primary);
  opacity: 0;
  animation: hlFade 0.2s ease-out both;             /* 0.0s — soft materialise */
}
.hero-line .hw { display: inline-block; }
@keyframes hlFade { to { opacity: 1; } }

/* "Creativity" — blue-white inner glow builds, peaks, settles to a soft rest */
.hw-cre { animation: creGlow 0.6s ease-out 0.4s both; }   /* 0.4s → 1.0s */
@keyframes creGlow {
  0%   { text-shadow: 0 0 0 rgba(140,220,255,0); }
  65%  { text-shadow: 0 0 22px rgba(150,222,255,0.95), 0 0 50px rgba(70,150,255,0.7); }
  100% { text-shadow: 0 0 12px rgba(150,222,255,0.55), 0 0 28px rgba(70,150,255,0.35); }
}

/* "without" — underline draws itself left → right */
.hw-wo { position: relative; }
.hw-wo::after {
  content: ""; position: absolute; left: 0; bottom: -0.06em; height: 2px; width: 100%;
  background: linear-gradient(90deg, #7fd4ff, #3a78ff);
  box-shadow: 0 0 8px rgba(95,170,255,0.6);
  transform: scaleX(0); transform-origin: left;
  animation: woLine 0.4s var(--ease) 1.1s both;     /* 1.1s → 1.5s */
}
@keyframes woLine { to { transform: scaleX(1); } }

/* "compromise." — irregular electrical flicker, then settles solid */
.hw-co { animation: coFlicker 0.6s linear 1.7s both; }    /* 1.7s → 2.3s */
@keyframes coFlicker {
  0%, 7% { opacity: 1; }
  9%     { opacity: 0.3; }
  13%    { opacity: 1; }
  39%    { opacity: 1; }
  43%    { opacity: 0.32; }
  47%    { opacity: 1; }
  66%    { opacity: 1; }
  69%    { opacity: 0.28; }
  72%    { opacity: 1; }
  100%   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-line, .hw-cre, .hw-co { animation: none; opacity: 1; }
  .hw-wo::after { animation: none; transform: scaleX(1); }
  .hw-cre { text-shadow: 0 0 12px rgba(150,222,255,0.55), 0 0 28px rgba(70,150,255,0.35); }
}
