/* One-time welcome overlay. Scoped under #ada-welcome so the desk underneath keeps its own styles.
   Palette, type, and the spinning lens ring match public/css/login.css. */
@font-face {
  font-family: "ADA Playfair";
  src: url("/fonts/playfair-display-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-display-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ADA Inter";
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

#ada-welcome {
  --navy: #1e2d4a;
  --navy-deep: #0d1827;
  --gold: #d0aa48;
  --gold-dark: #b69030;
  --ivory: #f7f4ef;
  --serif: "ADA Playfair", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "ADA Inter", Inter, system-ui, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ada-progress: 0;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  color: var(--ivory);
  background: linear-gradient(150deg, #050b15 0%, #08111e 22%, #111a2f 58%, #1a2843 100%);
  font: 16px/1.6 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-align: center;
  opacity: 1;
  transition: opacity 600ms var(--ease);
}
#ada-welcome.is-reduced { transition-duration: 180ms; }
#ada-welcome.is-dissolving {
  opacity: 0;
  pointer-events: none;
}
#ada-welcome::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  z-index: 3;
  background: linear-gradient(90deg, rgba(208, 170, 72, 0), rgba(208, 170, 72, 0.95), rgba(208, 170, 72, 0));
  background-size: 28% 100%;
  background-repeat: no-repeat;
  animation: ada-hairline 2.4s linear infinite;
}
@keyframes ada-hairline {
  from { background-position: -30% 0; }
  to { background-position: 130% 0; }
}

#ada-welcome .ada-field {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, rgba(247, 244, 239, 0.03) 0 1px, transparent 1px 23px),
    repeating-linear-gradient(45deg, rgba(247, 244, 239, 0.018) 0 1px, transparent 1px 46px);
  animation: ada-focus 1.2s ease-out both, ada-field-drift 8s linear infinite;
}
@keyframes ada-field-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 46px 23px, -32px 46px; }
}
@keyframes ada-focus {
  from { filter: blur(14px); opacity: 0.35; }
  to { filter: blur(0); opacity: 1; }
}

#ada-welcome .ada-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vh, 18px);
  width: min(980px, calc(100vw - 32px));
}

#ada-welcome .ada-hello {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ivory);
}
#ada-welcome .ada-hello span {
  color: var(--gold);
  background-image: linear-gradient(100deg, #b69030 0%, #f7f4ef 42%, #d0aa48 58%, #b69030 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ada-hello-sheen 2.2s linear infinite;
}
@keyframes ada-hello-sheen {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

#ada-welcome .ada-lens {
  position: relative;
  width: min(46vh, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
#ada-welcome .ada-lens::before {
  content: "";
  position: absolute;
  inset: -70%;
  pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(247, 244, 239, 0.045) 0 1px, transparent 1px 28px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 22%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 22%, transparent 62%);
  animation: ada-focus 1.2s ease-out both, ada-spin 18s linear infinite;
}
#ada-welcome .lens-glass {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(208, 170, 72, 0.12) 0%, rgba(208, 170, 72, 0.04) 34%, transparent 62%),
    repeating-radial-gradient(circle at 50% 50%, rgba(247, 244, 239, 0.07) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 50% 42%, rgba(42, 63, 102, 0.55) 0%, rgba(13, 24, 39, 0.35) 70%);
  box-shadow: inset 0 0 80px rgba(5, 11, 21, 0.65), 0 0 120px rgba(208, 170, 72, 0.06);
  animation: ada-glass 2.6s ease-in-out infinite;
}
@keyframes ada-glass {
  0%, 100% { box-shadow: inset 0 0 80px rgba(5, 11, 21, 0.65), 0 0 28px rgba(208, 170, 72, 0.08); }
  50% { box-shadow: inset 0 0 36px rgba(5, 11, 21, 0.35), 0 0 90px rgba(208, 170, 72, 0.55); }
}
#ada-welcome .lens-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: ada-ring-in 1.2s ease-out both;
}
#ada-welcome .lens-ring circle,
#ada-welcome .lens-ring path {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}
#ada-welcome .ring-outer { stroke: rgba(247, 244, 239, 0.14); stroke-width: 1; }
#ada-welcome .tick { stroke: rgba(247, 244, 239, 0.22); stroke-width: 1; }
#ada-welcome .tick-major { stroke: rgba(208, 170, 72, 0.75); stroke-width: 1.5; }
#ada-welcome .ring-rim { stroke: rgba(247, 244, 239, 0.3); stroke-width: 1.5; }
#ada-welcome .ring-gold { stroke: var(--gold); stroke-width: 4; }
#ada-welcome .ring-arc { stroke: rgba(208, 170, 72, 0.4); stroke-width: 1; }
#ada-welcome .ring-arc-in { stroke: rgba(208, 170, 72, 0.3); }
#ada-welcome .ring-inner { stroke: rgba(208, 170, 72, 0.3); stroke-width: 1; }
#ada-welcome .ring-cross { stroke: rgba(247, 244, 239, 0.28); stroke-width: 1; }
#ada-welcome .ring-spin {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: ada-spin 240s linear infinite;
}
@keyframes ada-spin { to { transform: rotate(360deg); } }
@keyframes ada-ring-in {
  from { opacity: 0.4; transform: scale(1.05); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
#ada-welcome .lens-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#ada-welcome .emblem {
  display: block;
  width: clamp(48px, 10vh, 84px);
  height: auto;
}
/* A gold arc orbits the logo the whole time, so the lens never sits still on a long load. */
#ada-welcome .ada-lens::after {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #d0aa48;
  border-right-color: rgba(208, 170, 72, 0.4);
  animation: ada-spin 2.8s linear infinite;
  pointer-events: none;
}
#ada-welcome.is-act-2 .ada-lens::after { animation-duration: 1.6s; border-top-color: #f7f4ef; }
#ada-welcome.is-act-3 .ada-lens::after { animation-duration: 1.1s; animation-direction: reverse; }
#ada-welcome.is-act-4 .ada-lens::after {
  animation-duration: 0.7s;
  border-top-color: #d0aa48;
  border-right-color: #f7f4ef;
  border-bottom-color: rgba(208, 170, 72, 0.45);
}

#ada-welcome .say {
  margin: 0;
  font-size: clamp(14px, 2vh, 18px);
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #d1d5db;
  animation: ada-say 2.4s ease-in-out infinite;
}
@keyframes ada-say {
  0%, 100% { letter-spacing: 0.12em; color: #d1d5db; }
  50% { letter-spacing: 0.28em; color: #d0aa48; }
}
#ada-welcome .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.24em;
  text-align: center;
  text-transform: none;
  color: var(--gold);
}
#ada-welcome .eyebrow::before,
#ada-welcome .eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, rgba(208, 170, 72, 0), rgba(208, 170, 72, 0.7));
  animation: ada-rule 1.8s ease-in-out infinite;
}
@keyframes ada-rule {
  0%, 100% { width: 10px; opacity: 0.35; }
  50% { width: 46px; opacity: 1; }
}
#ada-welcome .eyebrow::after { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  #ada-welcome,
  #ada-welcome::before,
  #ada-welcome::after,
  #ada-welcome *,
  #ada-welcome *::before,
  #ada-welcome *::after {
    animation: none !important;
    transition: none !important;
  }
  #ada-welcome { transition: opacity 180ms linear; }
}

@media (max-width: 720px) {
  #ada-welcome .ada-lens { width: min(58vw, 300px); }
  #ada-welcome .eyebrow { letter-spacing: 0.16em; font-size: 10px; gap: 10px; }
  #ada-welcome .eyebrow::before,
  #ada-welcome .eyebrow::after { width: 18px; }
}
