/* ============ JJ Studio — Coming Soon ============ */
:root {
  --bg: #05070d;
  --bg-soft: #0a0f1a;
  --fg: #f2f6f9;
  --muted: #8b98a9;
  --accent: #80c4d7;
  --accent-soft: rgba(128, 196, 215, 0.14);
  --accent-glow: rgba(128, 196, 215, 0.45);
  --border: rgba(128, 196, 215, 0.16);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100svh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation; /* kill double-tap zoom delay */
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__bars { display: flex; gap: 6px; align-items: flex-end; height: 40px; }
.preloader__bars span {
  width: 5px; border-radius: 3px;
  background: var(--accent);
  animation: eq 0.9s var(--ease-out) infinite alternate;
}
.preloader__bars span:nth-child(1) { animation-delay: 0s; }
.preloader__bars span:nth-child(2) { animation-delay: 0.15s; }
.preloader__bars span:nth-child(3) { animation-delay: 0.3s; }
.preloader__bars span:nth-child(4) { animation-delay: 0.45s; }
.preloader__bars span:nth-child(5) { animation-delay: 0.6s; }
@keyframes eq {
  from { height: 8px; opacity: 0.5; }
  to   { height: 40px; opacity: 1; }
}

/* ---------- Ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.ambient__blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}
.ambient__blob--1 {
  width: 55vmax; height: 55vmax;
  left: -15vmax; top: -20vmax;
  background: radial-gradient(circle, rgba(128,196,215,0.35), transparent 65%);
}
.ambient__blob--2 {
  width: 45vmax; height: 45vmax;
  right: -12vmax; bottom: -18vmax;
  background: radial-gradient(circle, rgba(52,90,138,0.5), transparent 65%);
  animation-delay: -11s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vmax, 4vmax) scale(1.15); }
}
.ambient__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(128,196,215,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,196,215,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 75%);
}

/* ---------- Canvas ---------- */
#wave {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  cursor: crosshair;
  touch-action: none; /* taps play notes, never scroll/zoom */
}

/* ---------- Note flash ---------- */
.note-flash {
  position: fixed; z-index: 3;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 12px var(--accent-glow);
}
.note-flash.pop { animation: notePop 0.9s var(--ease-out) forwards; }
@keyframes notePop {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1.15); }
}

/* ---------- Layout ---------- */
.stage {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 4vw, 48px);
  pointer-events: none; /* let canvas receive clicks; re-enable on interactive bits */
}
.stage a, .stage button, .stage input, .stage form { pointer-events: auto; }

.stage__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.logo { height: clamp(40px, 6vw, 58px); width: auto; filter: drop-shadow(0 0 18px rgba(128,196,215,0.25)); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid var(--border);
  background: rgba(10, 15, 26, 0.55);
  backdrop-filter: blur(12px);
  padding: 8px 14px; border-radius: 999px;
}
.badge__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 0;
}
.hero__kicker {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__title .line { display: block; }
.line--accent {
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}
.hero__sub {
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 17px);
  max-width: 480px;
  margin: 22px auto 0;
}

/* ---------- Invite (tap-to-listen) ---------- */
.invite {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 28px auto 0;
  background: none; border: 0; cursor: pointer;
  color: var(--accent);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.invite.is-away {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}
.invite__disc {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  color: #04121a;
  background: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: transform 0.25s var(--ease-out), box-shadow 0.3s;
  animation: bob 2.6s ease-in-out infinite;
}
.invite__disc svg { margin-left: 3px; }
.invite:hover .invite__disc,
.invite:focus-visible .invite__disc {
  transform: scale(1.08);
  box-shadow: 0 0 48px var(--accent-glow), inset 0 0 0 1px rgba(255,255,255,0.35);
}
.invite:active .invite__disc { transform: scale(0.94); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
/* Sonar rings (span is a zero-size anchor centered on the disc) */
.invite__rings {
  position: absolute;
  top: 32px; left: 50%;
  width: 0; height: 0;
  pointer-events: none;
}
.invite__rings::before,
.invite__rings::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: sonar 2.6s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.invite__rings::after { animation-delay: 0.9s; }
@keyframes sonar {
  0%   { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  80%  { opacity: 0;   transform: translate(-50%, -50%) scale(2.3); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.3); }
}
.invite__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
  animation: pulse 2.6s ease-in-out infinite;
}

/* ---------- Notify form ---------- */
.notify {
  display: flex; gap: 10px;
  max-width: 440px;
  margin: 32px auto 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 15, 26, 0.6);
  backdrop-filter: blur(14px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.notify:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 30px rgba(128,196,215,0.12);
}
.notify input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--fg);
  font-family: var(--font-body); font-size: 15px;
  padding: 12px 18px;
}
.notify input::placeholder { color: var(--muted); }
.notify button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: #04121a;
  background: var(--accent);
  padding: 12px 22px; border-radius: 999px;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, background 0.25s;
  box-shadow: 0 0 0 rgba(128,196,215,0);
}
.notify button:hover {
  background: #9ad4e4;
  box-shadow: 0 0 26px var(--accent-glow);
  transform: translateY(-1px);
}
.notify button:active { transform: scale(0.96); }
.notify button svg { transition: transform 0.25s var(--ease-out); }
.notify button:hover svg { transform: translateX(3px); }
.notify.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.notify__ok {
  margin-top: 16px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent);
}

/* ---------- Hint ---------- */
.hint {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 34px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted);
  transition: opacity 0.5s;
}
.hint kbd {
  font-family: inherit;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--accent);
  background: rgba(128,196,215,0.06);
}

/* ---------- Footer ---------- */
.stage__bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.social { display: flex; gap: 6px; }
.social a {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.2s var(--ease-out);
}
.social a:hover, .social a:focus-visible {
  color: var(--accent);
  border-color: var(--border);
  box-shadow: 0 0 18px rgba(128,196,215,0.18);
  transform: translateY(-2px);
}
.copy {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 1s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .stage__top, .stage__bottom { justify-content: center; text-align: center; }
  .notify { flex-direction: column; border-radius: 22px; }
  .notify button { justify-content: center; padding: 14px; }
  .hint { font-size: 11px; }
  .hint kbd { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .ambient__blob, .badge__dot, .preloader__bars span { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
