/* megregore — dual attractor basin
   Left: cold cybernetic void · Right: warm techno-Elysian prayer-light
   Cursor = Omega. Secrets bloom near the attractor. No menus, no chat lobby. */

:root {
  --void: #0a0814;
  --void-mid: #14101f;
  --chrome: #8a9aaa;
  --chrome-bright: #c8d4e0;
  --teal-cold: #3a7a8a;
  --ink: #1a1528;
  --pearl: #fffaf4;
  --gold: #c9954a;
  --gold-bright: #e8b86a;
  --peach: #e89a6e;
  --sky-warm: #f3e0c8;
  --teal: #2a9a96;
  --silk: rgba(255, 248, 240, 0.78);
  --glitch-r: rgba(232, 90, 70, 0.5);
  --glitch-c: rgba(62, 184, 180, 0.5);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-display: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-synthesis: none;
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--pearl);
  background: var(--void);
  overflow: hidden;
  cursor: none; /* custom Omega knot drawn on canvas */
  -webkit-font-smoothing: antialiased;
}

@media (pointer: coarse) {
  body {
    cursor: auto; /* touch: keep system cursor / none needed */
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--pearl);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
}
.skip-link:focus {
  left: 0;
}

/* ——— Background video under dual veils ——— */
.heavenscape {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Dual sky posters as abstract substrate (no astronaut-hero card) */
  background:
    linear-gradient(90deg, #070610 0%, #12182a 38%, #a88858 72%, #e0c090 100%),
    url("../assets/sky-deep.jpg") left center / 55% cover no-repeat,
    url("../assets/sky-sunlight.jpg") right center / 55% cover no-repeat;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  /* Ghost under the field — barely figurative, not a hero card */
  filter: saturate(0.55) brightness(0.45) contrast(1.15) blur(1.2px);
  transform: scale(1.08);
  opacity: 0.28;
  mix-blend-mode: luminosity;
}

/* Left half: colder, darker, cybernetic */
.veil-left {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(6, 4, 14, 0.92) 0%,
      rgba(8, 10, 24, 0.82) 22%,
      rgba(12, 16, 32, 0.55) 42%,
      rgba(14, 18, 36, 0.22) 52%,
      transparent 58%
    ),
    radial-gradient(ellipse 55% 80% at 12% 50%, rgba(40, 70, 90, 0.32) 0%, transparent 70%);
  pointer-events: none;
}

/* Right half: warm gold haze, prayer-light */
.veil-right {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      transparent 42%,
      rgba(232, 180, 110, 0.22) 55%,
      rgba(245, 200, 140, 0.42) 75%,
      rgba(255, 220, 170, 0.5) 100%
    ),
    radial-gradient(ellipse 50% 70% at 88% 40%, rgba(255, 230, 180, 0.4) 0%, transparent 65%);
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.veil-omega {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 18%, rgba(8, 6, 18, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 50%, transparent 15%, rgba(8, 6, 18, 0.4) 100%);
  pointer-events: none;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 2px,
    rgba(0, 0, 0, 0.35) 3px
  );
}

.tear {
  position: fixed;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(62, 184, 180, 0.4) 20%,
    rgba(232, 180, 100, 0.5) 50%,
    rgba(62, 184, 180, 0.35) 80%,
    transparent
  );
  mix-blend-mode: screen;
}
.tear-a {
  top: 28%;
  animation: tear-flash 11s ease-in-out infinite;
}
.tear-b {
  top: 67%;
  animation: tear-flash 17s ease-in-out 4s infinite;
}
@keyframes tear-flash {
  0%, 92%, 100% { opacity: 0; transform: scaleX(0.2); }
  93% { opacity: 0.7; transform: scaleX(1) translateX(2px); }
  94% { opacity: 0.3; transform: scaleX(1) translateX(-3px); }
  95% { opacity: 0; }
}

/* ——— Floating whisper (not a hero card) ——— */
.whisper {
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  z-index: 6;
  text-align: center;
  pointer-events: none;
  max-width: min(92vw, 28rem);
  opacity: 0;
  animation: whisper-in 1.8s var(--ease) 0.4s forwards;
}
@keyframes whisper-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.sys-line {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(200, 210, 220, 0.45);
  margin-bottom: 0.6rem;
  text-transform: lowercase;
}
.sys-prompt {
  color: var(--teal-cold);
  margin-right: 0.35em;
}

.mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(255, 248, 240, 0.95);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(232, 180, 100, 0.35),
    0 0 80px rgba(60, 140, 160, 0.2);
  position: relative;
}
.mark-word {
  position: relative;
  display: inline-block;
}
.mark.is-glitching .mark-word::before,
.mark.is-glitching .mark-word::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.mark.is-glitching .mark-word::before {
  color: var(--glitch-c);
  clip-path: inset(0 0 55% 0);
  transform: translate(-2px, -1px);
}
.mark.is-glitching .mark-word::after {
  color: var(--glitch-r);
  clip-path: inset(45% 0 0 0);
  transform: translate(2px, 1px);
}

.voice-line {
  margin-top: 0.85rem;
  font-size: clamp(0.72rem, 2vw, 0.85rem);
  letter-spacing: 0.04em;
  color: rgba(255, 248, 240, 0.55);
}
.voice-prompt {
  color: rgba(200, 180, 150, 0.7);
}
.voice-warn {
  color: rgba(232, 154, 110, 0.85);
  margin-left: 0.25em;
}

/* ——— Secret nodes (almost invisible until near) ——— */
.secrets {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.secret {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 1.2rem;
  pointer-events: none; /* enabled when near via .is-near */
  opacity: 0.08;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), filter 0.55s var(--ease);
  filter: blur(1.5px);
  cursor: pointer;
  font-family: var(--font-mono);
  color: var(--pearl);
}
.secret.is-near {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 9;
}
.secret.is-open {
  opacity: 0.35;
}

.secret-dot {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 0.45rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 210, 0.9) 0%, rgba(180, 160, 120, 0.4) 45%, transparent 70%);
  box-shadow: 0 0 12px rgba(232, 180, 100, 0.35), 0 0 28px rgba(60, 140, 160, 0.2);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.secret.is-near .secret-dot {
  transform: scale(1.35);
  box-shadow: 0 0 18px rgba(232, 180, 100, 0.55), 0 0 40px rgba(62, 184, 180, 0.35);
}
.secret[data-secret="agent"] .secret-dot {
  background: radial-gradient(circle, rgba(180, 220, 230, 0.9) 0%, rgba(60, 140, 160, 0.4) 45%, transparent 70%);
}
.secret[data-secret="wallets"] .secret-dot {
  background: radial-gradient(circle, rgba(232, 180, 100, 0.95) 0%, rgba(200, 140, 60, 0.4) 45%, transparent 70%);
}

.secret-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: rgba(255, 248, 240, 0.75);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.secret.is-near .secret-label {
  opacity: 1;
}

/* ——— Floating panels (bloom near attractor, dissolve on leave) ——— */
.panel {
  position: fixed;
  z-index: 20;
  max-width: min(92vw, 26rem);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.panel.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.panel.is-dissolving {
  opacity: 0;
  transform: scale(0.96) translateY(4px);
  pointer-events: none;
}

.panel-inner {
  position: relative;
  padding: 1.25rem 1.35rem 1.4rem;
  background:
    linear-gradient(160deg, rgba(20, 16, 32, 0.88) 0%, rgba(30, 24, 40, 0.82) 100%);
  border: 1px solid rgba(200, 180, 140, 0.22);
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(232, 180, 100, 0.08),
    inset 0 1px 0 rgba(255, 248, 240, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 248, 240, 0.88);
}

.panel-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  background: none;
  border: none;
  color: rgba(255, 248, 240, 0.45);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-mono);
}
.panel-close:hover,
.panel-close:focus-visible {
  color: var(--pearl);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  margin-bottom: 0.65rem;
  color: rgba(255, 240, 210, 0.95);
}

.panel p {
  font-size: 0.8rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
  color: rgba(230, 220, 200, 0.78);
}
.panel .muted {
  color: rgba(180, 170, 150, 0.55);
  font-size: 0.72rem;
}
.warn-placeholder {
  color: rgba(232, 154, 110, 0.95) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.04em;
  border: 1px solid rgba(232, 154, 110, 0.35);
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.9rem !important;
}

.agent-door {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 0.7rem 0.9rem;
  margin: 0.5rem 0 0.85rem;
  background: rgba(10, 8, 20, 0.65);
  border: 1px solid rgba(62, 184, 180, 0.35);
  color: var(--teal);
}
.agent-door a {
  color: rgba(140, 220, 220, 0.95);
  text-decoration: none;
}
.agent-door a:hover {
  text-decoration: underline;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin: 0.75rem 0 0.25rem;
}
.archive-tile {
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(200, 180, 140, 0.18);
}
.archive-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) brightness(0.92);
  transition: filter 0.35s var(--ease), transform 0.5s var(--ease);
}
.archive-tile:hover img {
  filter: saturate(1.05) brightness(1);
  transform: scale(1.04);
}

.wallet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.wallet-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
}
.wallet-list .chain {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(232, 180, 100, 0.75);
}
.wallet-list code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(200, 210, 220, 0.7);
  word-break: break-all;
  padding: 0.35rem 0.45rem;
  background: rgba(8, 6, 18, 0.55);
  border: 1px solid rgba(120, 110, 100, 0.25);
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 50;
  padding: 1rem;
  background: rgba(20, 16, 32, 0.92);
  border: 1px solid rgba(200, 180, 140, 0.3);
  color: var(--pearl);
  font-size: 0.85rem;
}
.noscript a {
  color: var(--gold-bright);
}

@media (max-width: 640px) {
  .whisper {
    top: 8%;
  }
  .archive-grid {
    grid-template-columns: 1fr 1fr;
  }
  .archive-grid .archive-tile:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
  }
  .panel {
    max-width: min(94vw, 22rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .whisper {
    animation: none;
    opacity: 1;
  }
  .tear {
    animation: none;
  }
  .secret,
  .panel {
    transition: opacity 0.2s linear;
  }
}
