/* ============================================================================
   JERICA'S CITY V12 — Website Opener
   V10 Premium cyberpunk palette. No external fonts, no CDNs.
   bg #080B16 | panel #101728 | text #F4F8FF
   accents: #008CFF #00F5FF #9D4DFF #FF2DAA #B6FF42 #FFB000 #FF365E
   ========================================================================== */

:root {
  --bg: #080b16;
  --panel: #101728;
  --panel-2: #0d1322;
  --text: #f4f8ff;
  --muted: #9fb0cc;
  --blue: #008cff;
  --cyan: #00f5ff;
  --purple: #9d4dff;
  --magenta: #ff2daa;
  --lime: #b6ff42;
  --amber: #ffb000;
  --red: #ff365e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000; /* cinematic black first paint */
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Stage ---------------------------------------------------------------- */
#opener {
  position: fixed;
  inset: 0;
  background: #000;
}

#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#gl.on { opacity: 1; }

/* Vignette + top gradient so UI text stays legible over bright 3D */
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8,11,22,.55), transparent 22%),
    linear-gradient(to top, rgba(8,11,22,.65), transparent 30%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* --- Generic overlay layers ------------------------------------------------ */
.layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s ease, visibility .8s;
  z-index: 10;
}
.layer.show { opacity: 1; visibility: visible; }

/* --- 3000 Studios emblem (built in code, no logo file) --------------------- */
#emblem .mark {
  width: min(200px, 42vw);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(0,245,255,.55))
          drop-shadow(0 0 46px rgba(157,77,255,.35));
  animation: emblem-in 1.6s cubic-bezier(.2,.8,.2,1) both;
}
#emblem .wordmark {
  margin-top: 26px;
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 900;
  letter-spacing: .28em;
  text-indent: .28em; /* keep optical centering with letter-spacing */
  line-height: 1.05;
  background: linear-gradient(90deg, var(--cyan), var(--blue) 40%, var(--purple) 75%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 32px rgba(0,245,255,.25);
  animation: emblem-in 1.6s .25s cubic-bezier(.2,.8,.2,1) both;
}
#emblem .tagline {
  margin-top: 12px;
  font-size: clamp(11px, 2.2vw, 14px);
  letter-spacing: .5em;
  text-indent: .5em;
  color: var(--muted);
  text-transform: uppercase;
  animation: emblem-in 1.6s .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes emblem-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Begin / Welcome-back cards -------------------------------------------- */
.card {
  background: rgba(16,23,40,.88);
  border: 1px solid rgba(0,245,255,.28);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 24px 70px rgba(0,0,0,.6),
    0 0 44px rgba(0,140,255,.18);
  backdrop-filter: blur(8px);
  padding: clamp(22px, 5vw, 40px);
  max-width: 560px;
  width: 100%;
}
.card h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: .06em;
}
.card h1 .accent { color: var(--cyan); }
.card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.card .fine {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: .85;
}
.card .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Buttons ---------------------------------------------------------------- */
.btn {
  appearance: none;
  border: 1px solid rgba(0,245,255,.5);
  background: linear-gradient(180deg, rgba(0,140,255,.28), rgba(0,140,255,.1));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(0,245,255,.35), 0 0 26px rgba(0,245,255,.45);
  outline: none;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary {
  border-color: var(--cyan);
  background: linear-gradient(180deg, var(--blue), #0057b8);
  box-shadow: 0 0 24px rgba(0,140,255,.5);
}
.btn.ghost {
  background: transparent;
  border-color: rgba(159,176,204,.45);
  color: var(--muted);
}
.btn.ghost:hover, .btn.ghost:focus-visible {
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(159,176,204,.3);
}

/* Big ENTER CITY button under the title reveal */
#enter-city {
  font-size: clamp(17px, 3vw, 22px);
  padding: 16px 44px;
  animation: enter-pulse 2.2s ease-in-out infinite;
}
@keyframes enter-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0,245,255,.45), 0 0 0 0 rgba(0,245,255,.25); }
  50%      { box-shadow: 0 0 44px rgba(0,245,255,.8), 0 0 0 10px rgba(0,245,255,0); }
}

/* --- Title reveal ----------------------------------------------------------- */
#title-layer { justify-content: flex-end; padding-bottom: 13vh; pointer-events: none; }
#title-layer.show { pointer-events: auto; }
#city-title {
  margin: 0 0 26px;
  font-size: clamp(44px, 11vw, 120px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: .04em;
  text-align: center;
  /* metallic chrome gradient */
  background: linear-gradient(180deg,
    #ffffff 0%, #dfe9ff 22%, #8fb4ff 38%,
    #2b3f66 50%, #c9d8ff 58%, #ffffff 74%, #7fa8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.6))
          drop-shadow(0 0 34px rgba(0,245,255,.45));
  animation: title-in 1.4s cubic-bezier(.16,1,.3,1) both;
}
#city-title .sub {
  display: block;
  font-size: .32em;
  letter-spacing: .55em;
  text-indent: .55em;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
}
@keyframes title-in {
  from { opacity: 0; transform: translateY(40px) scale(.94); letter-spacing: .16em; }
  to   { opacity: 1; transform: translateY(0) scale(1); letter-spacing: .04em; }
}

/* Phase caption (small location label during the flight) */
#caption {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,.9);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
  white-space: nowrap;
}
#caption.show { opacity: 1; }

/* --- Control bar ------------------------------------------------------------ */
#controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(8,11,22,.85), transparent);
}
#controls .spacer { flex: 1; }
.ctl {
  appearance: none;
  border: 1px solid rgba(159,176,204,.35);
  background: rgba(16,23,40,.8);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px; /* tappable */
  transition: border-color .2s, box-shadow .2s;
}
.ctl:hover, .ctl:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,245,255,.35);
  outline: none;
}
.ctl[aria-pressed="true"] { border-color: var(--magenta); color: var(--magenta); }

/* Volume slider */
.vol { display: flex; align-items: center; gap: 8px; }
.vol label { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
input[type="range"] {
  accent-color: var(--cyan);
  width: 110px;
  height: 24px;
  cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Progress bar (sequence position) */
#progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  z-index: 21;
  background: rgba(159,176,204,.18);
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--magenta));
  transition: width .3s linear;
}

/* Skip link / status for screen readers */
.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;
}
#status { color: var(--muted); font-size: 12px; }

/* Small screens: keep controls usable */
@media (max-width: 640px) {
  #controls { flex-wrap: wrap; justify-content: center; padding-bottom: 18px; }
  .vol input[type="range"] { width: 84px; }
  #caption { bottom: 120px; font-size: 11px; }
  #title-layer { padding-bottom: 20vh; }
}

/* --- Reduced motion: no pulses, no fly-in animations ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
