/* Vault-558 — Cosmic Gothic (onyx / gold / violet)
   Presentation only — no wallet / claim / earn chrome */

:root {
  --onyx: #0a0710;
  --onyx-2: #120a18;
  --onyx-3: #1a1024;
  --gold: #e6c477;
  --gold-dim: #a8894a;
  --violet: #7b4dff;
  --violet-soft: #a78bfa;
  --veil: rgba(10, 7, 16, 0.72);
  --hair: rgba(230, 196, 119, 0.35);
  --glow: 0 0 40px rgba(123, 77, 255, 0.35);
  --font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--onyx);
  color: #f3e9d7;
  font-family: var(--font-ui);
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(123, 77, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(230, 196, 119, 0.06), transparent 50%),
    linear-gradient(180deg, var(--onyx-2), var(--onyx));
}

.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;
}

/* —— Chrome —— */
.vault-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--hair);
  background: rgba(10, 7, 16, 0.55);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.vault-chrome .mark {
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
}

.vault-chrome .badge {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--violet-soft);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

body.is-unlocked .vault-chrome .badge {
  opacity: 1;
  transform: none;
}

/* —— States —— */
.vault-stage { position: relative; min-height: calc(100vh - 3.5rem); }

.state {
  padding: 2.5rem 1.25rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.state[hidden] { display: none !important; }

/* —— Locked seal —— */
.seal {
  position: relative;
  max-width: 420px;
  margin: 0 auto 2rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.seal-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid var(--hair);
  box-shadow: inset 0 0 60px rgba(123, 77, 255, 0.15), var(--glow);
  background:
    radial-gradient(circle at 50% 40%, rgba(123, 77, 255, 0.2), transparent 55%),
    radial-gradient(circle at 50% 50%, var(--onyx-3), var(--onyx));
}

.seal-ring::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(230, 196, 119, 0.25);
  animation: spin 48s linear infinite;
}

.seal-core {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-display);
}

.seal-core .sigil {
  font-size: clamp(2.8rem, 8vw, 3.6rem);
  letter-spacing: 0.35em;
  color: var(--gold);
  text-indent: 0.35em;
  text-shadow: 0 0 24px rgba(230, 196, 119, 0.45);
}

.seal-core .sub {
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  color: var(--violet-soft);
  text-transform: uppercase;
}

@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.38em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

h1 {
  font-family: var(--font-display);
  text-align: center;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
  color: #f8efd8;
}

.deck {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 2rem;
  color: rgba(243, 233, 215, 0.72);
  line-height: 1.55;
  font-size: 0.98rem;
}

.hint {
  text-align: center;
  margin: 1.25rem 0 0;
  font-family: var(--font-display);
  letter-spacing: 0.45em;
  font-size: 0.85rem;
  color: var(--violet-soft);
}

/* —— Unlock controls —— */
.unlock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.glyphs {
  display: flex;
  gap: 0.85rem;
}

.glyph {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1rem;
  border: 1px solid var(--hair);
  background:
    linear-gradient(160deg, rgba(123, 77, 255, 0.18), transparent 55%),
    var(--onyx-3);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.glyph:hover, .glyph:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.glyph.is-lit {
  border-color: var(--violet-soft);
  box-shadow: 0 0 28px rgba(167, 139, 250, 0.45);
  color: #fff;
}

.buffer {
  font-family: var(--font-display);
  letter-spacing: 0.55em;
  min-height: 1.5rem;
  color: var(--gold);
  font-size: 1.1rem;
}

.unlock.is-wrong .glyphs { animation: shake 0.4s var(--ease); }
.unlock.is-wrong .buffer { color: #f0a0c0; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.keypad-toggle {
  background: none;
  border: none;
  color: rgba(243, 233, 215, 0.45);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 3.2rem);
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.keypad[hidden] { display: none !important; }

.key {
  height: 3rem;
  border-radius: 0.65rem;
  border: 1px solid var(--hair);
  background: var(--onyx-3);
  color: #f3e9d7;
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
}

.key:hover, .key:focus-visible {
  outline: none;
  border-color: var(--gold);
  color: var(--gold);
}

.key.wide { grid-column: span 3; font-size: 0.75rem; letter-spacing: 0.2em; }

/* —— Unlock veil —— */
.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(123, 77, 255, 0.55), transparent 45%),
    var(--onyx);
  z-index: 50;
  transition: opacity 0.7s var(--ease);
}

body.is-unlocking .veil { opacity: 1; }

/* —— Gallery —— */
.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.gallery-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 1.45rem;
  margin: 0;
  color: var(--gold);
}

.seal-btn {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--violet-soft);
  cursor: pointer;
}

.seal-btn:hover, .seal-btn:focus-visible {
  outline: none;
  border-color: var(--gold);
  color: var(--gold);
}

.video-slot {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: var(--onyx-3);
  aspect-ratio: 16 / 9;
  margin-bottom: 1.75rem;
  box-shadow: var(--glow);
}

.video-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.video-slot .slot-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(123, 77, 255, 0.18), transparent 40%),
    linear-gradient(0deg, rgba(10, 7, 16, 0.55), transparent 50%);
}

.video-slot.has-media .slot-label { display: none; }

.slot-label strong {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.slot-label span {
  font-size: 0.78rem;
  color: rgba(243, 233, 215, 0.55);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 0.85rem;
  border: 1px solid var(--hair);
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(123, 77, 255, 0.25), transparent 50%),
    linear-gradient(165deg, var(--onyx-3), #0d0814);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 196, 119, 0.55);
}

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

.card .slot-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: end center;
  padding: 1rem;
  background: linear-gradient(transparent 40%, rgba(10, 7, 16, 0.85));
}

.card.has-media .slot-label { display: none; }

.lore {
  margin-top: 2.25rem;
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(243, 233, 215, 0.65);
  letter-spacing: 0.04em;
}

.lore em {
  font-style: normal;
  color: var(--gold);
  font-family: var(--font-display);
  letter-spacing: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
  .seal-ring::before { animation: none; }
  .veil { transition: none; }
  .glyph, .card { transition: none; }
  .unlock.is-wrong .glyphs { animation: none; }
}

.seal{position:relative}
.seal-door{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:.85;pointer-events:none;border-radius:50%}
body.is-unlocked .seal-door{content:url(/vault/assets/door-open.webp)}
