/* ============================================================
   Good Monster — Coming Soon
   ============================================================ */

:root {
  --bg-top: #1c1d20;
  --bg-bottom: #0a0a0c;
  --ink: #eef2f5;
  --ink-soft: #aab4ba;
  --ink-faint: #6c757c;
  --accent: #7FD4E8;
  --accent-deep: #4fb6d4;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-bottom);
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  /* Brushed titanium: vertical depth + a soft off-axis radial sheen. */
  background:
    radial-gradient(120% 90% at 72% 28%, rgba(80,90,98,0.28), transparent 60%),
    radial-gradient(90% 70% at 20% 90%, rgba(20,22,26,0.6), transparent 70%),
    linear-gradient(160deg, var(--bg-top) 0%, #131418 45%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint brushed-metal grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    96deg, rgba(255,255,255,0.6) 0px, rgba(255,255,255,0) 2px,
    rgba(255,255,255,0) 4px);
}

/* ---- Ambient hero: semi-transparent dielectric mesh ----
   The reference image is layered over the titanium background at low
   opacity and screen-blended, so it reads as glowing geometry embedded
   in deep metal/space rather than a literal photo. */
.hero-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden; 
}
.hero-mesh {
  position: absolute;
  inset: -6%;                 /* bleed so the slow zoom never shows edges */
  background-image: url('/assets/hero.jpg');
  background-size: cover;
  background-position: 60% 38%;
  background-repeat: no-repeat;
  /* Screen blend lifts the white wireframe out of the dark plate and lets
     the titanium gradient show through the black areas. */
  mix-blend-mode: screen;
  opacity: 0;                 /* faded in on load */
  filter: contrast(1.04) brightness(0.96) saturate(0.85);
  will-change: transform, opacity;
  transform: scale(1.04);
  animation: meshDrift 32s ease-in-out infinite alternate,
             meshBreathe 6.5s ease-in-out infinite;
}
/* Offset echo copy — adds the layered depth/duplication of the reference. */
.hero-mesh--echo {
  background-position: 54% 40%;
  opacity: 0;
  filter: blur(3px) brightness(0.85) saturate(0.7);
  transform: scale(1.12) translateX(2%);
  animation: meshDrift 40s ease-in-out infinite alternate-reverse,
             meshBreathe 7.5s ease-in-out infinite;
  mix-blend-mode: screen;
}
.revealed .hero-mesh { opacity: 0.82; transition: opacity 1.2s var(--ease-out); }
.revealed .hero-mesh--echo { opacity: 0.16; transition: opacity 1.4s var(--ease-out); }

@keyframes meshDrift {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.10) translate(-1.6%, -1%); }
}
@keyframes meshBreathe {
  0%, 100% { filter: contrast(1.04) brightness(0.92) saturate(0.85); }
  50%      { filter: contrast(1.08) brightness(1.06) saturate(0.9); }
}

/* Parallax tilt toward cursor (driven by JS custom props). */
.hero-bg {
  transform: translate3d(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 10px), 0);
  transition: transform 0.6s var(--ease-out);
}

/* ---- 3D point-cloud canvas (Three.js) ---- */
#cloud-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s var(--ease-out);
}
/* Once the cloud is live, reveal it and fade the static CSS plate to a
   faint underglow (depth) rather than removing it entirely. */
.cloud-active #cloud-canvas { opacity: 1; }
.cloud-active .revealed .hero-mesh { opacity: 0.14; }
.cloud-active .revealed .hero-mesh--echo { opacity: 0.06; }

/* ---- Vignette to seat the mesh in the frame ---- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    /* left scrim keeps headline legible over the bright mesh */
    linear-gradient(90deg, rgba(8,9,11,0.62) 0%, rgba(8,9,11,0.18) 34%, transparent 56%),
    radial-gradient(75% 75% at 62% 45%, transparent 55%, rgba(6,6,8,0.6) 100%);
}

/* ---- Page content ---- */
.page {
  position: relative;
  z-index: 4;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3.5vw, 2.6rem) clamp(1.4rem, 5vw, 4rem);
}

/* ---- Topbar / wordmark ---- */
.topbar { flex: 0 0 auto; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}
.mark {
  width: 26px; height: 26px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(127,212,232,0.45));
}
.wordmark-text {
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.34em;
  color: var(--ink);
}

/* ---- Hero ---- */
.hero {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}
.hero-copy {
  max-width: 620px;
  width: 100%;
}

.headline {
  font-weight: 300;
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}
.headline .grad {
  display: inline-block;
  font-weight: 500;
  background: linear-gradient(100deg, #eaf6fb 0%, var(--accent) 55%, var(--accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 32px rgba(127,212,232,0.25);
}

.subhead {
  margin-top: clamp(1.2rem, 2.6vw, 1.8rem);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.6vw, 1.12rem);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}
.stay {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--ink);
  letter-spacing: 0.16em;
  font-weight: 400;
  animation: breathe 3.6s var(--ease-out) infinite;
}
.cursor {
  width: 2px;
  height: 1.05em;
  margin-left: 0.25rem;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(127,212,232,0.8);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%,49%{opacity:1;} 50%,100%{opacity:0;} }
@keyframes breathe { 0%,100%{opacity:0.75;} 50%{opacity:1;} }

/* ---- Email capture ---- */
.notify { margin-top: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 460px; }

.field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.4rem 0.4rem 0.5rem;
  border-radius: 999px;
  background: rgba(20,24,28,0.45);
  border: 1px solid rgba(150,180,195,0.18);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.field:focus-within {
  border-color: rgba(127,212,232,0.55);
  box-shadow: 0 0 0 1px rgba(127,212,232,0.25), 0 0 28px rgba(127,212,232,0.22);
}
.field input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.6rem 0.55rem 0.8rem;
}
.field input::placeholder { color: var(--ink-faint); }

#notify-btn {
  flex: 0 0 auto;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #04181d;
  background: linear-gradient(180deg, #c3edf7, var(--accent));
  box-shadow: 0 2px 16px rgba(127,212,232,0.25);
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out), filter 0.35s var(--ease-out);
  white-space: nowrap;
}
#notify-btn:hover {
  box-shadow: 0 4px 30px rgba(127,212,232,0.55);
  filter: brightness(1.06);
  transform: translateY(-1px);
}
#notify-btn:active { transform: translateY(0); }
#notify-btn:disabled { cursor: default; opacity: 0.9; }

.form-msg {
  min-height: 1.2em;
  margin-top: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.form-msg.show { opacity: 1; transform: none; }
.form-msg.success { color: var(--accent); }
.form-msg.error { color: #e8a3a3; }

.check {
  display: inline-block;
  width: 1.05em; height: 1.05em;
  vertical-align: -0.18em;
  margin-right: 0.45rem;
}
.check path {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 0.6s var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- Footer ---- */
.footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.2rem, 3vw, 2rem);
}
.social { display: flex; gap: 1.1rem; }
.social a {
  color: var(--ink-soft);
  width: 20px; height: 20px;
  display: inline-flex;
  transition: color 0.3s var(--ease-out), filter 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.social a:hover {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(127,212,232,0.7));
  transform: translateY(-2px);
}
.social svg { width: 100%; height: 100%; }
.copyright {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.revealed .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.revealed .reveal[data-reveal="1"] { transition-delay: 0.15s; }
.revealed .reveal[data-reveal="2"] { transition-delay: 0.8s; }
.revealed .reveal[data-reveal="3"] { transition-delay: 1.25s; }
.revealed .reveal[data-reveal="4"] { transition-delay: 1.55s; }

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .vignette {
    background: radial-gradient(85% 65% at 50% 32%, transparent 50%, rgba(6,6,8,0.78) 100%);
  }
}
@media (max-width: 768px) {
  .page { padding: 1.4rem 1.3rem 2rem; }
  .topbar { text-align: center; }
  .wordmark { justify-content: center; }
  .hero { align-items: flex-end; padding-bottom: 0.5rem; }
  .hero-copy { max-width: 100%; text-align: left; }
  .headline { font-size: clamp(2rem, 8.4vw, 2.8rem); line-height: 1.08; }
  .subhead { margin-top: 1rem; }
  .field { flex-wrap: wrap; border-radius: 22px; }
  .field input { flex: 1 1 100%; }
  #notify-btn { flex: 1 1 100%; }
  .footer { flex-direction: column-reverse; gap: 1.1rem; text-align: center; }

  /* The bright mesh wash-out is the mobile problem. The 3D cloud is lifted
     up + scaled in scene.js; here we confine the fallback plate to the top
     and lay a strong dark gradient over the lower half where text lives. */
  .hero-mesh { background-position: 58% 14%; background-size: 168% auto; }
  .cloud-active .revealed .hero-mesh,
  .cloud-active .revealed .hero-mesh--echo { opacity: 0.10; }
  .revealed .hero-mesh { opacity: 0.55; }   /* fallback plate, dimmer on mobile */

  /* Heavy bottom-up scrim so text always sits on near-solid dark. */
  .vignette {
    background:
      linear-gradient(180deg,
        transparent 0%,
        rgba(8,9,11,0.10) 30%,
        rgba(8,9,11,0.72) 52%,
        rgba(8,9,11,0.94) 70%,
        #0a0a0c 100%);
  }
}

/* Extra-small phones: a touch more breathing room + safe-area padding. */
@media (max-width: 420px) {
  .headline { font-size: clamp(1.85rem, 9vw, 2.4rem); }
  .wordmark-text { font-size: 0.82rem; letter-spacing: 0.28em; }
  .page { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .cursor, .stay, .hero-mesh, .hero-mesh--echo { animation: none !important; }
  .hero-bg { transition: none; transform: none; }
  .cursor { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
  .revealed .reveal { transition: none; }
  body { background-attachment: scroll; }
  
}
