/* Landing stage blended over the dashboard (scoped). */
#landingStage {
  --ink: #102226;
  --ink-soft: #3d5559;
  --muted: #6b8185;
  --line: rgba(16, 34, 38, 0.1);
  --teal: #0d9488;
  --teal-deep: #0f766e;
  --paper: #faf8f4;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
  font-family: Figtree, "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  overflow: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#landingStage[hidden] {
  display: none !important;
}

#landingStage.is-exiting {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

#landingStage .landing-bg {
  position: absolute;
  inset: 0;
  opacity: 0.88;
  background:
    radial-gradient(ellipse 70% 55% at 78% 28%, rgba(13, 148, 136, 0.16), transparent 58%),
    radial-gradient(ellipse 55% 45% at 12% 82%, rgba(15, 118, 110, 0.1), transparent 55%),
    linear-gradient(165deg, #f7f4ec 0%, #eef6f4 42%, #e7f0ee 100%);
}

#landingStage .landing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 34, 38, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 34, 38, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 75%);
  animation: landingGridDrift 28s linear infinite;
}

@keyframes landingGridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

#landingStage .landing-viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.88;
}

#landingStage .landing-welcome {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  text-align: center;
}

#landingStage .landing-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

#landingStage .landing-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 24px;
  display: grid;
  place-items: center;
  letter-spacing: -0.04em;
  box-shadow:
    0 12px 28px -12px rgba(13, 148, 136, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: landingMarkIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landingStage .landing-brand-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(2.35rem, 6vw, 3.35rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  animation: landingRiseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

#landingStage .landing-brand-name span {
  display: inline-block;
  background: linear-gradient(120deg, var(--ink) 30%, var(--teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#landingStage .landing-headline {
  margin: 0 0 18px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  letter-spacing: -0.025em;
  color: var(--ink-soft);
  animation: landingRiseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

#landingStage .landing-headline-line {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  text-align: left;
}

#landingStage .landing-headline-line[hidden] {
  display: none !important;
}

#landingStage .landing-headline-prefix {
  color: var(--ink-soft);
}

#landingStage .landing-swap-wrap {
  display: inline-block;
  vertical-align: baseline;
  text-align: left;
  white-space: nowrap;
  color: var(--teal-deep);
  clip-path: inset(-0.3em 0 -0.3em 0);
}

#landingStage .landing-swap {
  display: inline-block;
  vertical-align: baseline;
  white-space: nowrap;
  will-change: transform, opacity;
  transition:
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.14s ease;
}

#landingStage .landing-swap.is-exit {
  transform: translateY(-110%);
  opacity: 0;
}

#landingStage .landing-swap.is-enter {
  transform: translateY(110%);
  opacity: 0;
  transition: none;
}

#landingStage .landing-headline-line--en {
  transform: translateX(40px);
}

#landingStage .landing-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#landingStage .landing-lede {
  margin: 0 auto 36px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  animation: landingRiseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

#landingStage .landing-panel {
  text-align: center;
  background: rgba(250, 248, 244, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  padding: 26px 22px 22px;
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 24px 48px -28px rgba(16, 34, 38, 0.28);
  animation: landingRiseIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

#landingStage #enterDashBtn {
  width: 100%;
  margin-top: 0;
  border: none;
  border-radius: 12px;
  padding: 13px 14px;
  font: 600 0.98rem Figtree, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, filter 0.15s;
}

#landingStage #enterDashBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.22) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: landingSheen 4.5s ease-in-out infinite;
}

@keyframes landingSheen {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

#landingStage #enterDashBtn:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

#landingStage #enterDashBtn:active:not(:disabled) {
  transform: scale(0.985);
}

#landingStage #enterDashBtn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  filter: none;
}

#landingStage #enterDashBtn:disabled::after {
  animation: none;
}

#landingStage .landing-or {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#landingStage .landing-or::before,
#landingStage .landing-or::after {
  content: "";
  flex: 0 0 auto;
  width: 48px;
  max-width: 18%;
  height: 1px;
  background: rgba(61, 85, 89, 0.22);
}

#landingStage .landing-secondary {
  display: block;
  width: 100%;
  border: 1px solid rgba(13, 148, 136, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  font: 600 0.95rem Figtree, sans-serif;
  color: var(--teal-deep);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, filter 0.15s;
}

#landingStage .landing-secondary:hover:not(:disabled) {
  background: rgba(230, 247, 244, 0.85);
  border-color: rgba(13, 148, 136, 0.42);
  transform: translateY(-1px);
}

#landingStage .landing-secondary:active:not(:disabled) {
  transform: scale(0.985);
}

#landingStage .landing-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
}

#landingStage .landing-foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  animation: landingRiseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

#landingStage .landing-foot a {
  color: inherit;
  text-decoration: underline;
}

#landingStage .landing-lang {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: landingRiseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

#landingStage .landing-lang .i18n-switcher-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#landingStage .landing-lang .i18n-switcher {
  font: 500 0.85rem Figtree, sans-serif;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.85);
  padding: 7px 10px;
  min-height: 40px;
  cursor: pointer;
}

html.dir-rtl #landingStage .landing-lang {
  right: auto;
  left: max(12px, env(safe-area-inset-left, 0px));
}

@keyframes landingRiseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes landingMarkIn {
  from { opacity: 0; transform: scale(0.7) rotate(-8deg); }
  to { opacity: 1; transform: none; }
}

#landingStage.is-unlocked .landing-welcome {
  animation: landingFarewell 0.55s ease forwards;
}

#landingStage.is-unlocked .landing-bg {
  animation: landingWashOut 0.7s ease forwards;
}

@keyframes landingFarewell {
  to { opacity: 0; transform: translateY(-12px) scale(0.98); }
}

@keyframes landingWashOut {
  to { filter: brightness(1.15); opacity: 0.35; }
}

body.landing-open {
  overflow: hidden;
}

body.landing-reveal .sidebar,
body.landing-reveal .main {
  animation: landingDashIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes landingDashIn {
  from { opacity: 0.65; filter: brightness(1.04); transform: scale(0.992); }
  to { opacity: 1; filter: none; transform: none; }
}

@media (max-width: 520px) {
  #landingStage {
    padding: clamp(20px, 5vw, 32px);
    padding-top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px));
  }
  #landingStage .landing-bg {
    backdrop-filter: blur(128px) saturate(1.1);
    -webkit-backdrop-filter: blur(128px) saturate(1.1);
  }
  #landingStage .landing-lang .i18n-switcher-label {
    display: none;
  }
  #landingStage .landing-lede {
    max-width: 36ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  #landingStage .landing-bg::after,
  #landingStage #enterDashBtn::after {
    animation: none;
  }
  #landingStage,
  #landingStage.is-unlocked .landing-welcome,
  #landingStage.is-unlocked .landing-bg,
  body.landing-reveal .sidebar,
  body.landing-reveal .main {
    animation: none !important;
    transition: none !important;
  }
}
