@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Special+Elite&display=swap');

:root {
  --bg: #050405;
  --text: rgba(250, 246, 240, 0.95);
  --muted: rgba(250, 246, 240, 0.56);
  --faint: rgba(250, 246, 240, 0.16);
  --line: rgba(250, 246, 240, 0.105);
  --blood: rgba(154, 18, 18, 0.9);
  --blood-soft: rgba(154, 18, 18, 0.24);
  --yinmn: rgba(47, 80, 157, 0.96);
  --yinmn-soft: rgba(47, 80, 157, 0.36);
  --yinmn-mid: rgba(47, 80, 157, 0.22);
  --yinmn-faint: rgba(47, 80, 157, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

.stage {
  overflow: hidden;
}

/* Shared */

.act {
  position: relative;
}

.copy {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  text-align: center;
  padding: 0 1rem;
}

.eyebrow {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.30em;
}

.sig {
  animation: signatureTremor 7.2s steps(1,end) infinite;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5.75vw, 5.7rem);
  line-height: 0.98;
  font-weight: 500;
  text-wrap: balance;
  text-shadow: 0 0 34px rgba(5,4,5,0.9);
}

.sub {
  margin: 1.75rem auto 0;
  max-width: 460px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.45;
  font-weight: 300;
}

.lead-line {
  margin: 1.15rem auto 0;
  max-width: 560px;
  color: rgba(250, 246, 240, 0.42);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.45;
  font-weight: 300;
}

.muted {
  color: var(--muted);
}

/* ACT I */

.act-one {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(154,18,18,0.075), transparent 28rem),
    radial-gradient(circle at 20% 88%, rgba(154,18,18,0.06), transparent 32rem),
    #030303;
  animation: introExit 1.8s ease-in-out 4.9s forwards;
}

.organic-void {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.organic-void::before {
  content: "";
  position: absolute;
  inset: -12%;
  opacity: 0.52;
  background:
    repeating-linear-gradient(92deg, transparent 0 12px, rgba(250,246,240,0.014) 13px, transparent 15px),
    radial-gradient(circle at 50% 50%, transparent 0 20rem, rgba(0,0,0,0.26) 32rem, rgba(0,0,0,0.9) 68rem);
  animation: tissueDrift 12s ease-in-out infinite;
}

.living-mass {
  position: relative;
  width: min(58vw, 520px);
  aspect-ratio: 1;
  opacity: 0.92;
  filter: drop-shadow(0 0 72px rgba(154,18,18,0.24));
  animation:
    immediateEmergence 1.4s cubic-bezier(.16,.84,.26,1) forwards,
    massBreath 7.5s ease-in-out infinite,
    massGlitch 8.7s steps(1,end) infinite;
}

.mass-core {
  position: absolute;
  inset: 17%;
  border-radius: 52% 48% 38% 62% / 45% 56% 44% 55%;
  background:
    radial-gradient(circle at 42% 34%, rgba(250,246,240,0.32), transparent 8%),
    radial-gradient(circle at 48% 43%, rgba(154,18,18,0.85), rgba(86,8,8,0.82) 34%, rgba(8,3,3,0.18) 70%),
    conic-gradient(from 120deg, rgba(154,18,18,0.55), transparent, rgba(250,246,240,0.08), transparent, rgba(154,18,18,0.42));
  box-shadow:
    inset 0 0 55px rgba(250,246,240,0.045),
    0 0 62px rgba(154,18,18,0.30);
  animation:
    coreMelt 10.5s ease-in-out infinite,
    corePulse 3.8s cubic-bezier(.2,.7,.2,1) infinite;
}

.mass-ring {
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(154,18,18,0.28);
  border-radius: 46% 54% 57% 43% / 48% 38% 62% 52%;
  filter: blur(0.2px);
  animation: ringFloat 13s ease-in-out infinite;
}

.ring-b {
  inset: 2%;
  border-color: rgba(250,246,240,0.105);
  animation-duration: 17s;
  animation-direction: reverse;
}

.mass-thread {
  position: absolute;
  width: 56%;
  height: 1px;
  left: 22%;
  top: 50%;
  background: linear-gradient(90deg, transparent, rgba(154,18,18,0.64), rgba(250,246,240,0.15), transparent);
  transform-origin: 50% 50%;
  filter: blur(0.1px);
  opacity: 0.74;
  animation: threadShift 9s ease-in-out infinite;
}

.thread-a { transform: rotate(18deg); }
.thread-b { transform: rotate(103deg); animation-delay: -3s; }
.thread-c { transform: rotate(-42deg); animation-delay: -6s; opacity: 0.5; }

.hacker-event {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  animation: hackerFlash 5.05s steps(1,end) forwards;
  z-index: 5;
}

.hacker-event span {
  font-family: "Special Elite", "Courier New", monospace;
  color: rgba(168, 0, 0, 0.96);
  font-size: clamp(1.8rem, 6vw, 6.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow:
    2px 0 rgba(255,0,0,0.30),
    -2px 0 rgba(70,0,0,0.55),
    0 0 18px rgba(154,18,18,0.42);
  transform: skewX(-3deg);
}

/* ACT II */

.act-two {
  background:
    radial-gradient(circle at 50% 12%, rgba(154,18,18,0.075), transparent 27rem),
    radial-gradient(circle at 20% 80%, rgba(250,246,240,0.03), transparent 26rem),
    #050405;
}

.grid-collapse {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.68;
  background-image:
    linear-gradient(rgba(250,246,240,0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250,246,240,0.030) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(circle at 50% 46%, black 0 42%, transparent 82%);
  animation: gridUnease 10s ease-in-out infinite;
}

.grid-glow {
  position: absolute;
  inset: 12%;
  background: radial-gradient(circle at 50% 38%, rgba(154,18,18,0.14), transparent 22rem);
  animation: gridPulse 7s ease-in-out infinite;
}

.grid-break {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154,18,18,0.48), transparent);
  transform: rotate(-8deg);
  opacity: 0.35;
  animation: breakSlide 8s ease-in-out infinite;
}

.b1 { top: 28%; left: 11%; width: 36%; }
.b2 { top: 52%; right: 8%; width: 42%; transform: rotate(6deg); animation-delay: -3s; }
.b3 { bottom: 22%; left: 28%; width: 28%; transform: rotate(2deg); animation-delay: -5s; }

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  color: var(--muted);
  font-size: 1.2rem;
  animation: cue 2.4s ease-in-out infinite;
}

.truth, .identity, .return, .contact {
  min-height: 55svh;
  display: grid;
  place-content: center;
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.truth::before, .identity::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(154,18,18,0.065), transparent 28rem);
  pointer-events: none;
}

.line, .identity p, .return p, .contact p {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 1.02;
  font-weight: 500;
  position: relative;
}

/* Guided sequence */

.sequence {
  position: relative;
  z-index: 1;
  min-height: 86svh;
  display: grid;
  place-items: center;
  padding: 5rem 2rem;
}

.sequence-card {
  width: min(980px, 100%);
  min-height: 48svh;
  display: grid;
  place-items: center;
  position: relative;
  border-top: 1px solid rgba(250,246,240,0.11);
  border-bottom: 1px solid rgba(250,246,240,0.11);
  background:
    radial-gradient(circle at 50% 50%, rgba(154,18,18,0.075), transparent 22rem),
    linear-gradient(90deg, transparent, rgba(250,246,240,0.025), transparent);
  overflow: hidden;
}

.sequence-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 28%, rgba(154,18,18,0.055), transparent 72%),
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(250,246,240,0.015) 18px, transparent 19px);
  opacity: 0.68;
  animation: sequenceField 8s ease-in-out infinite;
}

.sequence-label {
  position: absolute;
  top: 1.2rem;
  left: 1.3rem;
  margin: 0;
  color: rgba(250,246,240,0.34);
  font-size: 0.75rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 500;
}

.mutating-lines {
  position: relative;
  width: min(820px, 100%);
  height: 10rem;
  display: grid;
  place-items: center;
}

.mline {
  position: absolute;
  margin: 0;
  width: 100%;
  text-align: center;
  color: rgba(250,246,240,0.90);
  font-size: clamp(1.9rem, 4.6vw, 4.4rem);
  line-height: 1.03;
  font-weight: 500;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  filter: blur(10px);
  animation: thoughtMutation 21s cubic-bezier(.18,.74,.28,1) infinite;
}

.line-a { animation-delay: 0s; }
.line-b { animation-delay: 3.5s; color: rgba(250,246,240,0.68); }
.line-c { animation-delay: 7s; }
.line-d { animation-delay: 10.5s; color: rgba(250,246,240,0.68); }
.line-e { animation-delay: 14s; }
.line-f { animation-delay: 17.5s; color: rgba(250,246,240,0.68); }

.identity {
  min-height: 68svh;
}

/* ACT III */

.act-three {
  min-height: 145svh;
  background:
    radial-gradient(circle at 50% 24%, rgba(47,80,157,0.22), transparent 30rem),
    radial-gradient(circle at 76% 76%, rgba(47,80,157,0.17), transparent 33rem),
    radial-gradient(circle at 12% 90%, rgba(47,80,157,0.16), transparent 34rem),
    linear-gradient(180deg, #050405 0%, #050711 48%, #030613 100%);
  position: relative;
}

.blue-presence {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.blue-orb {
  position: absolute;
  width: min(78vw, 760px);
  aspect-ratio: 1;
  left: 50%;
  top: 21%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(47,80,157,0.34), transparent 39%),
    radial-gradient(circle, rgba(250,246,240,0.055), transparent 62%);
  filter: blur(2px);
  animation: blueBreath 8s ease-in-out infinite;
}

.blue-orb-small {
  width: min(44vw, 420px);
  left: 74%;
  top: 71%;
  opacity: 0.78;
  background:
    radial-gradient(circle, rgba(47,80,157,0.24), transparent 44%),
    radial-gradient(circle, rgba(250,246,240,0.035), transparent 65%);
  animation-duration: 10.5s;
  animation-delay: -4s;
}

.blue-line {
  position: absolute;
  width: 1px;
  height: 52%;
  background: linear-gradient(transparent, rgba(47,80,157,0.56), transparent);
  top: 10%;
  animation: blueLine 11s ease-in-out infinite;
}

.l1 { left: 34%; }
.l2 { right: 32%; animation-delay: -5s; }
.l3 { left: 58%; height: 65%; opacity: 0.72; animation-delay: -8s; }

.return {
  min-height: 72svh;
}

.return p {
  max-width: 1120px;
  margin-inline: auto;
}

.contact {
  min-height: 70svh;
}

.contact p {
  font-size: clamp(1.8rem, 4vw, 4rem);
}

.contact a {
  margin-top: 2rem;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  border-bottom: 1px solid rgba(47,80,157,0.90);
  padding-bottom: 0.25rem;
  position: relative;
  box-shadow: 0 10px 40px rgba(47,80,157,0.08);
}

.seal {
  margin: 5.4rem auto 0;
  width: min(620px, 100%);
  text-align: left;
  border-top: 1px solid rgba(250,246,240,0.18);
  padding-top: 1.4rem;
  color: rgba(250,246,240,0.86);
  filter: drop-shadow(0 0 30px rgba(47,80,157,0.14));
}

.seal-brand {
  margin: 0 0 1.3rem !important;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem) !important;
  letter-spacing: 0.30em;
  font-weight: 500 !important;
  color: rgba(250,246,240,0.62);
}

.seal-title {
  margin: 0 !important;
  font-size: clamp(1.8rem, 4vw, 3.8rem) !important;
  line-height: 1.05 !important;
  font-weight: 700 !important;
  letter-spacing: -0.035em;
}

.seal-sub {
  margin: 1.35rem 0 0 !important;
  font-size: clamp(0.9rem, 1.6vw, 1.25rem) !important;
  line-height: 1.1 !important;
  letter-spacing: 0.06em;
  color: rgba(250,246,240,0.56);
  font-weight: 500 !important;
}

/* Animations */

@keyframes hackerFlash {
  0%, 90%, 93%, 96%, 100% { opacity: 0; transform: translateX(0); }
  91% { opacity: 0.95; transform: translateX(-4px); }
  92% { opacity: 0.35; transform: translateX(5px); }
  94% { opacity: 0.8; transform: translateX(2px); }
  95% { opacity: 0.18; transform: translateX(-2px); }
}

@keyframes signatureTremor {
  0%, 91%, 100% { transform: translateX(0); opacity: 1; }
  92% { transform: translateX(1px); opacity: 0.78; }
  93% { transform: translateX(-1px); opacity: 1; }
}

@keyframes thoughtMutation {
  0% { opacity: 0; transform: translateY(22px) scale(0.985); filter: blur(12px); letter-spacing: -0.02em; }
  7% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); letter-spacing: -0.02em; }
  13% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  16% { opacity: 0.82; transform: translateY(-3px) scale(1.006); filter: blur(0.4px); letter-spacing: -0.03em; }
  19% { opacity: 0; transform: translateY(-18px) scale(1.012); filter: blur(10px); }
  100% { opacity: 0; transform: translateY(-18px) scale(1.012); filter: blur(10px); }
}

@keyframes sequenceField {
  0%, 100% { transform: translateX(-3%); opacity: 0.42; }
  50% { transform: translateX(3%); opacity: 0.72; }
}

@keyframes introExit {
  0%, 64% { min-height: 100svh; opacity: 1; }
  100% { min-height: 34svh; opacity: 0.22; }
}

@keyframes immediateEmergence {
  0% { opacity: 0.36; transform: scale(0.94); filter: blur(3px) drop-shadow(0 0 40px rgba(154,18,18,0.18)); }
  100% { opacity: 0.96; transform: scale(1); filter: blur(0.15px) drop-shadow(0 0 72px rgba(154,18,18,0.24)); }
}

@keyframes massBreath {
  0%, 100% { transform: scale(0.985) rotate(0deg); }
  46% { transform: scale(1.035) rotate(2.5deg); }
  62% { transform: scale(1.01) rotate(-1deg); }
}

@keyframes massGlitch {
  0%, 92%, 100% { translate: 0 0; }
  93% { translate: -4px 2px; }
  94% { translate: 3px -1px; }
  95% { translate: 0 0; }
}

@keyframes coreMelt {
  0%, 100% { border-radius: 52% 48% 38% 62% / 45% 56% 44% 55%; }
  34% { border-radius: 44% 56% 53% 47% / 52% 42% 58% 48%; }
  68% { border-radius: 61% 39% 44% 56% / 41% 61% 39% 59%; }
}

@keyframes corePulse {
  0%, 63%, 100% { transform: scale(1); opacity: 0.88; }
  8% { transform: scale(1.06); opacity: 1; }
  15% { transform: scale(0.985); }
  23% { transform: scale(1.035); }
}

@keyframes ringFloat {
  0%, 100% { transform: rotate(0deg) scale(0.98); opacity: 0.44; }
  50% { transform: rotate(22deg) scale(1.04); opacity: 0.72; }
}

@keyframes threadShift {
  0%, 100% { opacity: 0.32; filter: blur(0.1px); }
  44% { opacity: 0.82; filter: blur(0.7px); }
  52% { opacity: 0.24; }
}

@keyframes tissueDrift {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(1.5%) rotate(0.5deg); }
}

@keyframes gridUnease {
  0%, 100% { transform: translate3d(0,0,0) skewX(0deg); opacity: 0.55; }
  50% { transform: translate3d(-10px,8px,0) skewX(-0.7deg); opacity: 0.78; }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.28; transform: scale(0.98); }
  50% { opacity: 0.62; transform: scale(1.04); }
}

@keyframes breakSlide {
  0%, 100% { opacity: 0.18; translate: 0 0; }
  48% { opacity: 0.58; translate: 16px -8px; }
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(8px); opacity: 0.75; }
}

@keyframes blueBreath {
  0%, 100% { opacity: 0.56; transform: translate(-50%, -50%) scale(0.95); }
  52% { opacity: 0.92; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes blueLine {
  0%, 100% { opacity: 0.18; transform: translateY(0); }
  50% { opacity: 0.62; transform: translateY(28px); }
}

@media (max-width: 820px) {
  .living-mass {
    width: 84vw;
  }

  .hero {
    padding: 1.25rem;
  }

  .lead-line {
    max-width: 320px;
  }

  .sequence {
    min-height: 72svh;
    padding: 4rem 1.25rem;
  }

  .sequence-card {
    min-height: 44svh;
  }

  .mutating-lines {
    height: 11rem;
  }

  .mline {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .act-one {
    animation: introExitMobile 1.8s ease-in-out 4.9s forwards;
  }

  .seal {
    text-align: left;
    margin-top: 4rem;
  }
}

@keyframes introExitMobile {
  0%, 64% { min-height: 100svh; opacity: 1; }
  100% { min-height: 26svh; opacity: 0.18; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .act-one {
    min-height: 44svh;
    opacity: 0.35;
  }
}
