@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(./fonts/SpaceGrotesk-700.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url(./fonts/SpaceGrotesk-500.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url(./fonts/JetBrainsMono-400.woff2) format('woff2'); }

:root { --teal: #00d68f; --cream: #ece4d3; --red: #ff4d5e; --bg: #0c0e11; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  overflow: hidden;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: default;
  user-select: none;
}

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; }
.bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% 78%, rgba(0,214,143,.11), transparent 70%),
    radial-gradient(50% 40% at 50% -10%, rgba(236,228,211,.05), transparent 70%),
    var(--bg);
}
#bg3d {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 2s ease;
}
#bg3d.on { opacity: 1; }
.dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(236,228,211,.07) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(70% 70% at 50% 50%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, black, transparent 85%);
}

/* ---------- lab artifacts ---------- */
.art { position: absolute; }
.art.machine {
  left: -3%; bottom: -6%; width: min(34vw, 420px); height: auto;
  opacity: .14; transform: rotate(-4deg);
  pointer-events: none;
}
.art.log {
  right: 6%; bottom: 13%;
  display: flex; flex-direction: column; gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .05em;
  color: rgba(0,214,143,.6);
  background: rgba(8,10,12,.55);
  border: 1px solid rgba(0,214,143,.16);
  border-radius: 8px; padding: 14px 18px;
}
.art.log .t { color: rgba(0,214,143,.9); animation: blink 1.1s steps(1) infinite; }
.art.tag {
  left: 26px; bottom: 24px; transform: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: .45em; text-indent: .45em;
  color: rgba(236,228,211,.3);
}

/* ---------- copy ---------- */
.copy {
  position: absolute; left: 50%; bottom: 106px; transform: translateX(-50%);
  text-align: center; z-index: 4;
}
.copy h1, .copy .soon { display: grid; justify-content: center; }
.copy .sizer { grid-area: 1 / 1; visibility: hidden; white-space: pre; }
.copy .typed { grid-area: 1 / 1; text-align: left; white-space: pre; justify-self: start; }
.copy h1 {
  color: var(--cream);
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700; letter-spacing: -0.045em; line-height: 1;
  text-shadow: 0 0 70px rgba(0,214,143,.18);
}
.wave {
  margin: 22px auto 0; height: 34px; width: min(72vw, 460px);
  display: flex; align-items: center; gap: 3px;
}
.wave i {
  flex: 1; height: 8%; min-height: 2px; border-radius: 2px;
  background: rgba(0,214,143,.4);
  transition: height .18s ease;
}
.wave.live i { background: rgba(0,214,143,.8); transition: height .06s linear; }
.copy .by {
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .4em; text-indent: .4em;
  color: rgba(236,228,211,.5);
  opacity: 0;
}
.copy .by2 {
  margin-top: 12px;
  font-size: 9.5px; letter-spacing: .5em; text-indent: .5em;
  color: rgba(236,228,211,.32);
}
.copy .by.in { animation: blurIn .5s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes blurIn {
  from { opacity: 0; filter: blur(10px); transform: translateY(6px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
.copy .soon {
  margin-top: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: .3em; text-indent: .3em;
  color: var(--teal);
}
.cursor { animation: blink 1.1s steps(1) infinite; font-size: 10px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- recording chrome ---------- */
.frame { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.frame i { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(236,228,211,.35); }
.frame .tl { top: 18px; left: 18px; border-top-width: 1.5px; border-left-width: 1.5px; }
.frame .tr { top: 18px; right: 18px; border-top-width: 1.5px; border-right-width: 1.5px; }
.frame .bl { bottom: 18px; left: 18px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.frame .br { bottom: 18px; right: 18px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.recbadge {
  position: fixed; top: 27px; right: 56px; z-index: 12;
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .25em;
  color: rgba(236,228,211,.4);
  opacity: 0; transition: opacity .6s ease;
}
.recbadge.on { opacity: 1; }
.recbadge .reddot { width: 8px; height: 8px; border-radius: 50%; background: rgba(236,228,211,.25); }
.recbadge.live { color: var(--red); }
.recbadge.live .reddot { background: var(--red); box-shadow: 0 0 10px rgba(255,77,94,.8); animation: blink 1s steps(1) infinite; }

.hint {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: .4em; text-indent: .4em;
  color: rgba(236,228,211,.28);
  opacity: 0; transition: opacity 1s ease;
}
.hint.on { opacity: 1; }

.chips {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 12; display: flex; gap: 10px;
  opacity: 0; transition: opacity .8s ease;
}
.chips.on { opacity: 1; }
.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: .22em; text-indent: .22em;
  padding: 9px 18px; border-radius: 20px;
  background: rgba(10,12,14,.65);
  border: 1px solid rgba(236,228,211,.18);
  color: rgba(236,228,211,.5);
  cursor: pointer;
}
.chip.sel { border-color: rgba(0,214,143,.7); color: var(--teal); }

.recframe {
  position: fixed; inset: 10px; z-index: 9; pointer-events: none;
  border: 2px solid rgba(255,77,94,.5); border-radius: 14px;
  opacity: 0; transition: opacity .25s ease;
}
.recframe.on { opacity: 1; animation: recpulse 1.6s ease-in-out infinite; }
@keyframes recpulse { 50% { border-color: rgba(255,77,94,.18); } }

/* ---------- clips ---------- */
.clip {
  position: fixed; z-index: 8;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-radius: 12px;
  background: rgba(12,14,17,.92);
  border: 1px solid rgba(236,228,211,.14);
  box-shadow: 0 24px 60px rgba(0,0,0,.65), 0 4px 14px rgba(0,0,0,.5);
  transform: translate(-50%, -50%) scale(.85);
  transition: left .8s cubic-bezier(.16,1,.3,1), top .8s cubic-bezier(.16,1,.3,1),
              transform .8s cubic-bezier(.16,1,.3,1), opacity .5s ease;
}
.clip.placed { transform: translate(0, 0) scale(1); }
.clip.fade { opacity: 0; }
.clip .ic { display: flex; }
.clip .ic svg { width: 22px; height: 22px; color: var(--teal); }
.clip .meta { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.clip .meta b {
  font-family: 'JetBrains Mono', monospace; font-weight: 400;
  font-size: 11px; letter-spacing: .1em; color: var(--red);
  white-space: nowrap;
}
.clip .meta span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; letter-spacing: .25em; color: rgba(236,228,211,.4);
}
.clip .mini { display: flex; align-items: flex-end; gap: 2.5px; height: 24px; }
.clip .mini i { width: 2.5px; border-radius: 1px; background: rgba(0,214,143,.65); }

/* ---------- film ---------- */
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 10;
  background:
    radial-gradient(120% 95% at 50% 45%, transparent 45%, rgba(0,0,0,.5) 100%),
    linear-gradient(180deg, rgba(0,0,0,.28), transparent 16%, transparent 82%, rgba(0,0,0,.4));
}
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 11; opacity: .05;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2'/%3E%3C/filter%3E%3Crect width='170' height='170' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); } 80% { transform: translate(3%,3%); }
}

@media (max-width: 760px) {
  .art.log, .art.tag, .art.machine { display: none; }
  .hint { font-size: 8px; letter-spacing: .22em; text-indent: .22em; max-width: 62vw; top: 22px; }
  .recbadge { right: 16px; top: 20px; font-size: 9px; }
  .copy { bottom: 92px; width: 94vw; }
  .copy .by { font-size: 9px; letter-spacing: .24em; text-indent: .24em; }
  .copy .by2 { font-size: 8.5px; }
  .chip { padding: 8px 13px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .cursor, .recbadge.live .reddot, .recframe.on { animation: none; }
  .wave i { transition: none; }
}

body.nocursor { cursor: none; }
body.nocursor .chip { cursor: none; }
