@font-face {
  font-family: "Berlonapixel";
  src: url("assets/BerlonapixelRegularDemo-rv0E7.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080b0f;
  --bg-deep: #050608;
  --fg: #0b2448;
  --muted: rgba(11, 36, 72, 0.7);
  --soft: rgba(11, 36, 72, 0.45);
  --card: rgba(10, 14, 18, 0.7);
  --border: rgba(232, 237, 242, 0.12);
  --glow: rgba(179, 214, 255, 0.35);
  --accent: #b5c9d8;
  --danger: #c7a8a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --mono: "Courier New", "Lucida Console", monospace;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --display: "Berlonapixel", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--display);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  transition: opacity 0.5s ease;
}

.enter-page {
  color: #ffffff;
}

.enter-page .terminal-input {
  color: #ffffff;
}

.enter-page .terminal-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.enter-page .terminal-btn {
  color: #ffffff;
}

.scream-page {
  background: #ffffff;
  color: #9a9a9a;
  font-family: Arial, Helvetica, sans-serif;
  display: block;
}

.scream-message {
  margin: 8px;
  font-size: 11px;
  letter-spacing: 0.02em;
}

body.fade-out {
  opacity: 0;
}

.page {
  min-height: 100vh;
  position: relative;
  background: #000;
}

/* QR Screen (Landing override) */
.qr-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.qr-screen .qr-image {
  width: min(90vw, 720px);
  height: auto;
  image-rendering: pixelated;
}

.qr-active .qr-screen {
  display: flex;
}

.qr-active .hero,
.qr-active .backdrop,
.qr-active #veil {
  display: none;
}

.backdrop {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

.layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--mx, 0px) * 1px), calc(var(--my, 0px) * 1px), 0);
  transition: transform 0.4s ease;
}

.layer-depth {
  background-image:
    url("assets/rabbit%20hole.JPG");
  opacity: 1;
  filter: none;
}

.layer-portal {
  background-image:
    url("assets/rabbit%20hole.JPG");
  opacity: 1;
  filter: none;
}

.page.landing .layer-portal {
  background-image:
    url("assets/cathedralblue.JPG");
  background-position: center;
  opacity: 1;
  filter: none;
}

.page.landing .layer-depth {
  background-image:
    url("assets/cathedralblue.JPG");
  background-position: center;
}

.page.arg .layer-portal {
  background-position: center;
}

.layer-halo {
  background-image:
    radial-gradient(circle at 50% 40%, rgba(181, 201, 216, 0.12), transparent 55%),
    radial-gradient(circle at 60% 60%, rgba(179, 214, 255, 0.08), transparent 45%);
  opacity: 0;
}

.film {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: screen;
  opacity: 0;
  z-index: 3;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 18px;
  position: relative;
  z-index: 2;
}

.hero-inner {
  max-width: 720px;
}

.eyebrow {
  letter-spacing: 0.38em;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.glitch {
  font-size: clamp(56px, 10vw, 124px);
  letter-spacing: 0.18em;
  position: relative;
  margin: 12px 0 10px;
  text-transform: uppercase;
  color: var(--fg);
  font-family: var(--display);
  text-shadow:
    0.04em 0 0 rgba(0, 150, 255, 0.7),
    -0.04em 0 0 rgba(255, 0, 80, 0.55);
  animation: glitch-skew 2.2s infinite steps(2, end);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  color: var(--fg);
  opacity: 0.7;
  mix-blend-mode: screen;
}

.glitch::before {
  text-shadow: -0.12em 0 rgba(0, 140, 255, 0.7);
  clip-path: inset(0 0 60% 0);
  animation: glitch-slice 1.6s infinite steps(2, end);
}

.glitch::after {
  text-shadow: 0.12em 0 rgba(255, 40, 120, 0.6);
  clip-path: inset(58% 0 0 0);
  animation: glitch-slice 1.9s infinite steps(2, end) reverse;
}

@keyframes glitch-slice {
  0% { transform: translate(0, 0); opacity: 0.2; }
  20% { transform: translate(-3px, 1px); opacity: 0.6; }
  40% { transform: translate(3px, -1px); opacity: 0.4; }
  60% { transform: translate(-2px, 2px); opacity: 0.7; }
  80% { transform: translate(2px, -2px); opacity: 0.5; }
  100% { transform: translate(0, 0); opacity: 0.25; }
}

@keyframes glitch-skew {
  0%, 100% { transform: skewX(0deg); }
  15% { transform: skewX(1.5deg); }
  35% { transform: skewX(-1deg); }
  50% { transform: skewX(0.6deg); }
  70% { transform: skewX(-1.2deg); }
}

.subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.whisper {
  margin-top: 18px;
  font-size: 14px;
  color: var(--soft);
  letter-spacing: 0.08em;
}

.sigil {
  display: inline-block;
  margin-top: 26px;
  font-size: 22px;
  opacity: 0.25;
  transition: opacity 0.4s ease;
}

.sigil:focus-visible,
.sigil:hover {
  opacity: 0.55;
}

.sigil.awake {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.12); opacity: 0.75; }
}

.veil {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 10, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 4;
}

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

.veil-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 26px 28px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.veil-title {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 10px;
  color: var(--soft);
}

.veil-copy {
  margin: 0 0 18px;
  color: var(--muted);
}

.ghost-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 237, 242, 0.4);
  background: rgba(232, 237, 242, 0.06);
}

.arg-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid #ffffff;
  color: #0b2448;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--display);
  text-rendering: optimizeSpeed;
  clip-path: polygon(12% 0%, 88% 0%, 100% 50%, 88% 100%, 12% 100%, 0% 50%);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.35),
    0 0 18px rgba(11, 36, 72, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.arg-entry:hover {
  border-color: #ffffff;
  transform: translateY(-1px);
  background: rgba(243, 248, 255, 0.96);
}

.arg-header {
  padding: 64px 8vw 24px;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.arg-title {
  font-size: clamp(28px, 4vw, 46px);
  margin: 10px 0 8px;
}

.arg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.nav-link {
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  border-color: rgba(232, 237, 242, 0.35);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  padding: 20px 8vw 60px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px 22px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.4s ease, border-color 0.4s ease;
  backdrop-filter: blur(8px);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 237, 242, 0.22);
}

.puzzle-copy {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cell {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cell.glow {
  background: rgba(179, 214, 255, 0.18);
  border-color: rgba(179, 214, 255, 0.4);
  box-shadow: 0 0 16px rgba(179, 214, 255, 0.25);
}

.cipher {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.cipher-text {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
}

.field input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--fg);
  font-family: var(--mono);
}

.terminal-field {
  gap: 8px;
  letter-spacing: 0.24em;
}

.terminal-field .input-label {
  font-size: 11px;
  color: rgba(11, 36, 72, 0.8);
  text-transform: uppercase;
}

.terminal-input {
  background: rgba(3, 10, 24, 0.92);
  border: 1px solid rgba(7, 26, 54, 0.75);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(11, 36, 72, 0.95);
  box-shadow:
    inset 0 0 14px rgba(2, 6, 12, 0.7),
    0 0 14px rgba(7, 26, 54, 0.2);
  animation: terminal-flicker 3s infinite steps(2, end);
}

.terminal-input::placeholder {
  color: rgba(11, 36, 72, 0.55);
}

.terminal-btn {
  background: rgba(3, 10, 24, 0.95);
  border: 1px solid rgba(7, 26, 54, 0.8);
  color: rgba(11, 36, 72, 0.95);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 10px 16px;
  border-radius: 6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.terminal-btn:hover {
  border-color: rgba(7, 26, 54, 0.95);
  box-shadow: 0 0 14px rgba(7, 26, 54, 0.35);
  transform: translateY(-1px);
}

.simple-input {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

@keyframes terminal-flicker {
  0%, 100% { text-shadow: 0 0 6px rgba(179, 214, 255, 0.1); }
  30% { text-shadow: 0 0 10px rgba(179, 214, 255, 0.2); }
  60% { text-shadow: 1px 0 6px rgba(200, 150, 150, 0.2); }
}

.tone-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tone {
  flex: 1 1 auto;
  min-width: 70px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  cursor: pointer;
}

.timer {
  margin-top: 16px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(179, 214, 255, 0.2), rgba(179, 214, 255, 0.6));
  transition: width 0.4s linear;
}

.reveal {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 12px;
  color: var(--soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arg-footer {
  padding: 0 8vw 40px;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@media (max-width: 720px) {
  .hero-inner {
    max-width: 90vw;
  }

  .puzzle-grid {
    grid-template-columns: 1fr;
  }
}
