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

:root {
  --bg: #1e3c72;        /* navy */
  --bg-2: #2a5298;      /* cobalt */
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --peach: #f79b50;     /* warm accent */
  --sky: #61a7f2;       /* cool accent */
  --px: 0;   /* pointer x, -1..1 (set by app.js) */
  --py: 0;   /* pointer y, -1..1 */
}

html, body { height: 100%; }

body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(135deg, var(--bg-2), var(--bg) 70%) fixed var(--bg);
  color: var(--fg);
  font-family: 'Inter Tight', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--peach); color: var(--bg); }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Atmosphere ---------- */
.aurora, .grid, .grain { position: fixed; inset: 0; pointer-events: none; z-index: -1; }

.aurora span {
  position: absolute;
  width: min(80vmax, 1100px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  translate: calc(-50% + var(--px) * 40px) calc(-50% + var(--py) * 40px);
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora span:first-child { background: var(--sky); opacity: 0.7; left: 15%; top: 10%; }
.aurora span:last-child  { background: var(--peach); opacity: 0.55; left: 80%; top: 85%; animation-delay: -11s; }

@keyframes drift {
  to { transform: rotate(40deg) scale(1.15) translateY(-6vmin); }
}

.grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 20%, transparent 75%);
}

.grain {
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Bars ---------- */
.bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.8rem;
  font-weight: 500;
}
.status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--peach);
  box-shadow: 0 0 0 0 rgba(247, 155, 80, 0.7);
  animation: ping 2s ease-out infinite;
}
@keyframes ping { to { box-shadow: 0 0 0 10px rgba(247, 155, 80, 0); } }

.secrets b { color: var(--peach); font-weight: 600; }

.progress {
  flex: 1;
  max-width: 240px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.progress span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--peach));
  animation: build 2.8s cubic-bezier(.65, 0, .35, 1) infinite;
}
.progress.done span { animation: fill 1.4s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes build {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}
@keyframes fill { from { width: 0; } to { width: 100%; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 1rem clamp(1rem, 4vw, 3rem) 2rem;
}

.mark {
  all: unset;
  display: block;
  position: relative;
  width: clamp(170px, 30vmin, 320px);
  aspect-ratio: 1;
  margin-bottom: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  mix-blend-mode: screen; /* drops the JPG's black backdrop into the page; on .mark since its transform isolates children */
  transform: perspective(800px) rotateX(calc(var(--py) * -10deg)) rotateY(calc(var(--px) * 10deg));
}
.mark:focus-visible { outline: 1px dashed var(--peach); outline-offset: 12px; }
.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle, #000 50%, transparent 68%);
          mask-image: radial-gradient(circle, #000 50%, transparent 68%);
}
.mark.has-3d img { visibility: hidden; } /* the 3D scene draws the logo inside the sphere */
.mark canvas {
  position: absolute;
  inset: -45%;
  width: 190%;
  height: 190%;
  pointer-events: none;
}
@keyframes float { 50% { translate: 0 -10px; } }

.eyebrow { margin-bottom: 1.25rem; }

.title {
  font-weight: 300;
  font-size: clamp(2.75rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  padding-right: 0.06em;
  background: linear-gradient(100deg, var(--fg) 0%, #cfe6ff 40%, var(--peach) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: sheen 8s ease-in-out infinite alternate;
}
@keyframes sheen { to { background-position: 100% 0; } }

.lede {
  margin-top: 1.5rem;
  max-width: 34ch;
  text-wrap: balance;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Easter-egg UI ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  z-index: 20;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  translate: -50% 12px;
  transition: opacity .3s, translate .3s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
}
.toast.show { opacity: 1; translate: -50% 0; }

.tape {
  position: fixed;
  left: -10vw;
  right: -10vw;
  top: 50%;
  z-index: 10;
  padding: 0.85rem 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--peach);
  color: var(--bg);
  font: 600 0.95rem/1 'JetBrains Mono', monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-block: 7px solid;
  border-image: repeating-linear-gradient(45deg, var(--bg) 0 12px, var(--peach) 12px 24px) 7;
  rotate: -7deg;
  pointer-events: none;
  animation: tapeIn .5s cubic-bezier(.2, .7, .2, 1);
}
.tape + .tape { rotate: 5deg; top: 56%; background: var(--sky); border-image-source: repeating-linear-gradient(45deg, var(--bg) 0 12px, var(--sky) 12px 24px); }
.tape span { display: inline-block; animation: marquee 10s linear infinite; }
.tape + .tape span { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes tapeIn { from { scale: 1 0; } }

/* ---------- Entrance ---------- */
.mark, .eyebrow, .title, .lede {
  opacity: 0;
  filter: blur(8px);
  animation-name: reveal, var(--loop, none);
  animation-duration: 1.1s, 7s;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1), ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: forwards, none;
}
.mark    { --loop: float; }
.eyebrow { animation-delay: 0.25s; }
.title   { animation-delay: 0.35s; }
.lede    { animation-delay: 0.5s; }
@keyframes reveal { to { opacity: 1; filter: blur(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mark, .eyebrow, .title, .lede { opacity: 1; filter: none; }
}
