:root {
  --ink: #08080b;
  --paper: #f1f0ea;
  --muted: #8a8884;
  --lime: #d9ff43;
  --violet: #a749ff;
  --coral: #ff755b;
  --well-x: 72%;
  --well-y: 50%;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  color: var(--paper);
  font-family: var(--font-geist-sans), Arial, Helvetica, sans-serif;
  overflow: hidden;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at var(--well-x) var(--well-y), rgba(167, 73, 255, 0.055), transparent 27%),
    radial-gradient(circle at 51% 45%, #111117 0, var(--ink) 57%);
}

.gravity-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.is-ready .gravity-canvas {
  opacity: 1;
}

.bloom-core {
  position: absolute;
  z-index: 1;
  left: var(--well-x);
  top: var(--well-y);
  width: clamp(42px, 5.8vw, 92px);
  aspect-ratio: 1;
  border: 1px solid rgba(217, 255, 67, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-12deg) scaleY(0.45);
  background: #030305;
  box-shadow:
    0 0 24px rgba(217, 255, 67, 0.13),
    inset 0 0 18px #000;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.is-ready .bloom-core {
  opacity: 1;
}

.field-horizon {
  position: absolute;
  z-index: 1;
  right: 4vw;
  bottom: 15.5vh;
  width: min(37vw, 560px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(241, 240, 234, 0.16) 24%, rgba(241, 240, 234, 0.36) 72%, transparent);
  transform: rotate(-2deg);
  transform-origin: right center;
  opacity: 0.62;
  pointer-events: none;
}

.field-horizon::after {
  content: "";
  position: absolute;
  right: 18%;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 16px var(--lime);
}

.grain {
  position: absolute;
  inset: -50%;
  z-index: 3;
  opacity: 0.075;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  transform: rotate(0.01deg);
}

.identity {
  position: absolute;
  z-index: 4;
  left: clamp(28px, 4.8vw, 78px);
  top: 50%;
  transform: translateY(-48%);
  max-width: 47vw;
  pointer-events: none;
  opacity: 0;
  animation: identity-in 1s 120ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.identity h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(4.2rem, 8.5vw, 9.2rem);
  font-weight: 650;
  line-height: 0.84;
  letter-spacing: -0.084em;
  white-space: nowrap;
}

.identity .at-sign {
  color: #fbfaf4;
  text-shadow: 0 0 30px rgba(217, 255, 67, 0.08);
}

.identity p {
  margin: clamp(30px, 4.7vh, 50px) 0 0 0.35rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.48rem);
  font-weight: 580;
  line-height: 1;
  letter-spacing: -0.025em;
}

.sensor-trigger {
  position: absolute;
  z-index: 5;
  right: clamp(26px, 5vw, 80px);
  bottom: clamp(24px, 6vh, 62px);
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(241, 240, 234, 0.68);
  background: transparent;
  cursor: pointer;
  transition: color 220ms ease, transform 220ms ease;
}

.sensor-trigger:hover,
.sensor-trigger:focus-visible,
.sensor-trigger[data-active="true"] {
  color: var(--lime);
  transform: rotate(12deg);
}

.sensor-trigger:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 5px;
}

.reticle,
.reticle::before,
.reticle::after {
  position: absolute;
  display: block;
  content: "";
}

.reticle {
  inset: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.72;
}

.reticle::before {
  left: 50%;
  top: -11px;
  width: 1px;
  height: calc(100% + 22px);
  background: currentColor;
}

.reticle::after {
  left: -11px;
  top: 50%;
  width: calc(100% + 22px);
  height: 1px;
  background: currentColor;
}

.sensor-trigger::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-note {
  position: absolute;
  left: clamp(28px, 4.8vw, 78px);
  bottom: 3rem;
  color: var(--muted);
}

@keyframes identity-in {
  from { opacity: 0; transform: translateY(-42%); }
  to { opacity: 1; transform: translateY(-48%); }
}

@media (max-width: 720px) {
  :root {
    --well-x: 64%;
    --well-y: 37%;
  }

  .site-shell {
    background:
      radial-gradient(circle at var(--well-x) var(--well-y), rgba(167, 73, 255, 0.07), transparent 32%),
      radial-gradient(circle at 58% 36%, #111117 0, var(--ink) 66%);
  }

  .identity {
    top: auto;
    left: 7vw;
    bottom: 16vh;
    max-width: 90vw;
    transform: none;
  }

  .identity h1 {
    font-size: clamp(3.3rem, 16.5vw, 6.5rem);
  }

  .identity p {
    margin-top: 22px;
    font-size: 1rem;
  }

  .sensor-trigger {
    right: 6vw;
    bottom: 4vh;
    width: 54px;
    height: 54px;
  }

  .field-horizon {
    right: 5vw;
    bottom: 10vh;
    width: 46vw;
  }

  .bloom-core {
    width: clamp(38px, 12vw, 62px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gravity-canvas,
  .bloom-core,
  .sensor-trigger {
    transition: none;
  }

  .identity {
    animation: none;
    opacity: 1;
    transform: translateY(-48%);
  }

  @media (max-width: 720px) {
    .identity { transform: none; }
  }
}
