/* ABYSS — nocturne 01 */

.abyss-body {
  --accent: #8ff4ff;
  --accent-ink: #031014;
  --ink: #02070a;
  --gold: #c9a86a;
  --violet: #b18bff;
  background: #02070a;
}

#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 18%, #06202a 0%, #030e13 42%, #010507 78%),
    #010507;
}

#stage {
  z-index: 1;
  pointer-events: auto;
}

#stage canvas {
  touch-action: none;
}

.abyss-body.ar-running #stage,
.abyss-body.ar-running #backdrop {
  display: none;
}

.abyss-body.ar-running #camerafeed {
  display: block;
}

/* -- top bar ------------------------------------------------------- */

.abyss-body .brand {
  color: #f2fbfc;
  font-size: 11px;
  letter-spacing: 0.36em;
  font-family: var(--font-display);
}

.abyss-body .brand-mark {
  border-color: rgba(201, 168, 106, 0.7);
  background: rgba(2, 8, 10, 0.45);
}

.abyss-body .brand-mark svg {
  stroke: var(--gold);
}

.abyss-body .status {
  border-color: rgba(143, 244, 255, 0.2);
  font-family: var(--font-ui);
}

/* -- landing ------------------------------------------------------- */

.hero-sheet {
  justify-content: flex-end;
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(3, 10, 14, 0.1) 0%, rgba(2, 6, 9, 0.45) 46%, rgba(1, 4, 6, 0.96) 100%);
  padding: 20px;
  padding-bottom: calc(22px + var(--safe-bottom));
}

.hero {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.abyss-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(48px, 15vw, 104px);
  line-height: 0.88;
  letter-spacing: -0.01em;
  margin: 10px 0 14px;
  color: #eaf6f7;
  text-shadow: 0 0 60px rgba(90, 220, 240, 0.22);
}

.hero .kicker {
  color: var(--gold);
  letter-spacing: 0.3em;
}

.hero-copy {
  max-width: 46ch;
  color: rgba(228, 244, 246, 0.66);
}

.hero .primary {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
}

.text-link {
  margin-top: 14px;
  color: rgba(228, 244, 246, 0.55);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(143, 244, 255, 0.25);
  padding-bottom: 2px;
  transition: color 160ms var(--ease);
}

.text-link:hover {
  color: var(--accent);
}

.poster-card {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid rgba(201, 168, 106, 0.18);
  border-radius: 16px;
  background: rgba(4, 12, 16, 0.5);
  backdrop-filter: blur(14px);
}

.poster-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 106, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(228, 244, 246, 0.5);
}

.poster-copy strong {
  font-size: 12.5px;
  color: #eaf6f7;
  letter-spacing: 0.06em;
}

.poster-copy a {
  color: var(--accent);
  text-decoration: none;
  margin-top: 2px;
}

.hero-legal {
  margin-top: 14px;
  text-align: left;
  max-width: 48ch;
}

@media (min-width: 900px) {
  .hero-sheet {
    justify-content: center;
    align-items: flex-start;
    padding-left: clamp(48px, 8vw, 128px);
    background:
      linear-gradient(100deg, rgba(1, 4, 6, 0.94) 0%, rgba(1, 4, 6, 0.72) 42%, rgba(1, 4, 6, 0) 70%);
  }
  .hero {
    margin: 0;
    max-width: 560px;
    padding-bottom: 10vh;
  }
  .abyss-title {
    font-size: clamp(76px, 7vw, 118px);
  }
  .hero .actions {
    flex-direction: row;
    align-items: center;
  }
  .hero .actions .primary {
    flex: 0 0 auto;
  }
  .poster-card {
    max-width: 460px;
  }
}

/* -- loader sigil -------------------------------------------------- */

.sigil-loader {
  position: relative;
  width: 54px;
  height: 54px;
}

.sigil-loader span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(143, 244, 255, 0.2);
  border-top-color: var(--accent);
}

.sigil-loader span:nth-child(1) {
  animation: spin 1.6s linear infinite;
}
.sigil-loader span:nth-child(2) {
  inset: 7px;
  border-top-color: var(--violet);
  animation: spin 2.2s linear infinite reverse;
}
.sigil-loader span:nth-child(3) {
  inset: 19px;
  border-color: rgba(201, 168, 106, 0.5);
  border-top-color: var(--gold);
  animation: spin 3s linear infinite;
}

/* -- scan frame ---------------------------------------------------- */

.scan-frame {
  position: fixed;
  left: 50%;
  top: 42%;
  width: min(78vw, 340px);
  height: min(78vw, 340px);
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
}

.scan-frame .corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(143, 244, 255, 0.5));
}

.scan-frame .tl {
  left: 0;
  top: 0;
  border-width: 1px 0 0 1px;
  border-radius: 8px 0 0 0;
}
.scan-frame .tr {
  right: 0;
  top: 0;
  border-width: 1px 1px 0 0;
  border-radius: 0 8px 0 0;
}
.scan-frame .bl {
  left: 0;
  bottom: 0;
  border-width: 0 0 1px 1px;
  border-radius: 0 0 0 8px;
}
.scan-frame .br {
  right: 0;
  bottom: 0;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 8px 0;
}

.scan-frame .scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 12%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(143, 244, 255, 0.75), transparent);
  box-shadow: 0 0 18px rgba(143, 244, 255, 0.45);
  animation: scanline 3.2s var(--ease) infinite;
}

@keyframes scanline {
  0% {
    top: 12%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 86%;
    opacity: 0;
  }
}

.scan-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.scan-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 76px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(201, 168, 106, 0.35);
}

.scan-card .actions {
  margin-top: 16px;
}

.scan-card .actions.row {
  gap: 10px;
}

.scan-card .actions.row .primary:first-child {
  flex: 1.4;
}

.scan-card .primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.scan-card .text-link {
  margin-top: 12px;
  font-size: 11.5px;
}

/* -- veil ---------------------------------------------------------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  text-align: center;
  background: #010406;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms var(--ease);
}

.veil.on {
  opacity: 1;
  pointer-events: auto;
}

.veil-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateY(8px);
  transition: transform 1200ms var(--ease);
}

.veil.on .veil-inner {
  transform: translateY(0);
}

.veil-kicker {
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.veil-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(64px, 22vw, 150px);
  line-height: 0.85;
  color: #effbfc;
  text-shadow: 0 0 80px rgba(90, 230, 245, 0.35);
}

.veil-sub {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(228, 244, 246, 0.45);
}

/* -- steps --------------------------------------------------------- */

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 4px;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.steps .kbd {
  margin-top: 1px;
  border-radius: 999px;
  color: var(--accent);
  border-color: rgba(143, 244, 255, 0.24);
}

/* -- qr ------------------------------------------------------------ */

.qr-wrap {
  display: grid;
  place-items: center;
  margin: 18px auto 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f2f2ee;
  width: fit-content;
}

.qr-wrap canvas {
  width: 176px;
  height: 176px;
  image-rendering: pixelated;
}

/* -- AR atmosphere ------------------------------------------------- */

.abyss-body.ar-running::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(0, 4, 6, 0.55) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 20%),
    linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 30%);
}

.abyss-body.ar-running .chrome {
  z-index: 8;
}

.abyss-body.ar-running .scan-frame {
  z-index: 9;
}

.abyss-body.ar-running .bottom {
  padding-bottom: 2px;
}

.abyss-body.ar-running .legal {
  color: rgba(255, 255, 255, 0.32);
}

.abyss-body.scanning #world-controls {
  display: none;
}

.abyss-body:not(.ar-running) #world-controls {
  display: none !important;
}

/* keep the hero readable over the live world */
.hero-sheet .legal a {
  color: rgba(201, 168, 106, 0.8);
}
