/* ─── FONTS ─────────────────────────────────────────── */
@font-face {
  font-family: 'Rosie';
  src: url('fonts/rosie.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

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

:root {
  --bg:        #02020d;
  --ring:      rgba(148, 210, 232, 0.82);
  --ring-fade: rgba(60,  110, 175, 0.04);
  --ink:       #edf2f8;
  --ink-dim:   rgba(237, 242, 248, 0.28);
  --ink-mid:   rgba(237, 242, 248, 0.62);
  --teal:      rgba(110, 195, 220, 0.70);
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* ─── CANVAS (ring + dust, full viewport) ─────────────── */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ─── GRAIN ─────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -30%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainShift 0.09s steps(1) infinite;
}
@keyframes grainShift {
  0%   { background-position:   0px   0px; }
  25%  { background-position: -10px  -5px; }
  50%  { background-position:   5px -10px; }
  75%  { background-position:  -5px   5px; }
}

/* ─── LIGHT SOURCE — large off-axis bloom ───────────── */
.light-source {
  position: fixed;
  top: -30vh;
  left: -15vw;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(40, 80, 200, 0.16) 0%,
    rgba(20, 50, 160, 0.06) 45%,
    transparent 70%
  );
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
  animation: lightDrift 28s ease-in-out infinite alternate;
}
@keyframes lightDrift {
  0%   { transform: translate(0,   0)   scale(1);    opacity: 0.7; }
  50%  { transform: translate(5vw, 3vh) scale(1.08); opacity: 1;   }
  100% { transform: translate(-3vw,6vh) scale(0.94); opacity: 0.8; }
}

/* ─── STAGE ─────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 0;
  pointer-events: none;
}

/* ─── ORBIT CENTRE (logo sits here, ring drawn on canvas around it) */
.orbit-center {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 64px;
  animation: logoReveal 2.8s var(--ease) both;
}
@keyframes logoReveal {
  from { opacity: 0; transform: scale(0.94) translateY(18px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ─── LOGO ───────────────────────────────────────────── */
.logo {
  font-family: 'Rosie', 'Cinzel', Georgia, serif;
  font-size: clamp(56px, 8.5vw, 118px);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  line-height: 1;
  color: var(--ink);
  text-shadow:
    0 0  30px rgba(148, 210, 232, 0.20),
    0 0  80px rgba(100, 175, 215, 0.10),
    0 0 160px rgba(70,  140, 200, 0.06);
  animation: logoBreathe 12s ease-in-out infinite alternate;
  user-select: none;
}
@keyframes logoBreathe {
  0% {
    text-shadow:
      0 0  22px rgba(148, 210, 232, 0.14),
      0 0  60px rgba(100, 175, 215, 0.07),
      0 0 130px rgba(70,  140, 200, 0.04);
  }
  100% {
    text-shadow:
      0 0  40px rgba(168, 225, 248, 0.30),
      0 0 100px rgba(120, 190, 228, 0.16),
      0 0 200px rgba(90,  155, 210, 0.10);
  }
}

/* ─── ENTRY ──────────────────────────────────────────── */
.entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: all;
  animation: entryReveal 3s var(--ease) 0.5s both;
}
@keyframes entryReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ─── ENTER BUTTON ───────────────────────────────────── */
.enter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 44px;
  cursor: pointer;
}

.enter-decor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;
  color: var(--ink-dim);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  pointer-events: none;
  transition: color 0.5s ease;
}
.enter-wrap:hover .enter-decor { color: var(--ink-mid); }

.e-rule {
  display: block;
  height: 1px;
  width: 28px;
  background: currentColor;
  opacity: 0.5;
  transition: width 0.55s var(--ease), opacity 0.5s ease;
}
.enter-wrap:hover .e-rule {
  width: 50px;
  opacity: 0.85;
}

.e-word {
  letter-spacing: 6px;
  text-indent: 6px;
}

/* Google's rendered sign-in button — invisible, click-through to OAuth popup */
.gsi-cloak {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.gsi-cloak > div { width: 100% !important; }

/* ─── ERROR ──────────────────────────────────────────── */
.error {
  display: none;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255, 90, 90, 0.50);
  text-align: center;
  text-transform: lowercase;
}
.error.visible { display: block; }
