/* CCU Initiation Portal Styles */
:root {
  --bg: #050607;
  --gold: #d4af37;
  --gold-soft: #b9952b;
  --emerald: #00b388;
  --ink: #0a0c0d;
  --text: #e8e6e3;
  --muted: #a8a7a2;
  --ring: rgba(212,175,55,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
main { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 2rem; }

/* Background: stars + matrix particles */
#stars, #matrix {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(1000px 700px at 50% -20%, rgba(0,179,136,0.12), transparent 60%);
  z-index: 0;
}
#matrix::before, #matrix::after {
  content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient( to bottom, rgba(0,179,136,0.08) 0 1px, transparent 1px 24px );
  animation: scroll 10s linear infinite;
}
#matrix::after { animation-duration: 16s; opacity: .5; }
@keyframes scroll { to { transform: translateY(24px); } }

.phase { display: none; max-width: 980px; text-align: center; z-index: 1; }
.phase.visible { display: block; animation: fadeIn .8s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Crest + Halo */
.crest-wrap { position: relative; display: inline-block; margin-bottom: 1.25rem; }
.crest { width: 120px; height: 120px; filter: drop-shadow(0 0 12px rgba(212,175,55,0.25)); }
.halo {
  position: absolute; inset: -24px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ring), 0 0 60px 8px rgba(0,179,136,0.18), inset 0 0 120px rgba(212,175,55,0.12);
  animation: pulse 3.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.console { max-width: 640px; margin: 0 auto; }
.type { font-family: "Playfair Display", serif; font-size: 1.25rem; opacity: .9; }
.type.delay-1 { animation: appear 1.2s ease both; animation-delay: .9s; margin-bottom: 1rem; }
@keyframes appear { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }

.btn {
  border: 1px solid var(--gold-soft); color: var(--text);
  background: linear-gradient(180deg, rgba(212,175,55,0.12), rgba(212,175,55,0.03));
  padding: .9rem 1.25rem; border-radius: 999px; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(212,175,55,.12); border-color: var(--gold); }
.btn.primary { margin-top: .75rem; }
.btn.gold { background: linear-gradient(180deg, rgba(212,175,55,0.2), rgba(212,175,55,0.05)); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.title {
  font-family: "Playfair Display", serif;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  font-size: clamp(1.4rem, 1.1rem + 1.5vw, 2.4rem);
  margin: 0 0 1rem; color: var(--gold);
  text-shadow: 0 0 32px rgba(212,175,55,0.14);
}

.oath { font-size: 1.05rem; line-height: 1.85; color: var(--text); opacity: .95; }
.oath p { margin: .85rem 0; }
.oath .tag { color: var(--emerald); font-weight: 600; margin-top: 1rem; }

.accept { margin-top: 1.25rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.check { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.check input { width: 18px; height: 18px; }

/* Access Key Ceremony */
.seal h2 { margin: 0; font-family: "Playfair Display", serif; color: var(--gold); font-size: 1.6rem; }
.seal p { margin: .25rem 0 1.25rem; color: var(--muted); }

.key-wrap { position: relative; width: 240px; height: 160px; margin: 0 auto 1rem; }
.key-shaft {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 180px; height: 4px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 22px rgba(212,175,55,0.35);
  animation: shaft 2.8s ease-in-out infinite;
}
@keyframes shaft { 50% { transform: translate(-50%,-50%) scaleX(1.06);} }
.key-head {
  position: absolute; top: calc(50% - 12px); left: calc(50% + 72px);
  width: 56px; height: 24px; border: 1px solid var(--gold-soft); border-radius: 16px;
  box-shadow: inset 0 0 24px rgba(212,175,55,0.18), 0 0 30px rgba(0,179,136,0.18);
  background: radial-gradient(40% 100% at 50% 50%, rgba(212,175,55,0.15), transparent);
  backdrop-filter: blur(2px);
}
.key-head .dot { position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); transform: translateY(-50%); box-shadow: 0 0 16px rgba(212,175,55,0.45); }
.key-head .d1 { left: 8px; animation: blink 1.6s infinite; }
.key-head .d2 { left: 24px; animation: blink 1.6s .2s infinite; }
.key-head .d3 { left: 40px; animation: blink 1.6s .4s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.motto { font-style: italic; color: var(--muted); margin-bottom: 1rem; }
.btn.enter { border-width: 2px; padding: 1rem 1.5rem; }

/* Transfer */
.transfer { display: grid; place-items: center; gap: 1rem; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(212,175,55,0.2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.foot { text-align: center; color: var(--muted); padding: 1.25rem 1rem 2rem; font-size: .85rem; }
.tagline { margin: .15rem 0 0; color: #c0b68a; }

@media (max-width: 560px) {
  .oath { font-size: 1rem; }
  .key-wrap { transform: scale(.9); }
}
