/* A Fenyr learning constellation. Form and text never follow the pointer. */
.welcome-space.immersive-space,
:root[data-theme="dark"] .welcome-space.immersive-space {
  --intro-ink: #1b3449;
  --intro-muted: #526879;
  background: #030711;
  grid-template-columns: minmax(0, 700px) minmax(0, 450px);
  gap: clamp(40px, 6vw, 110px);
  padding: 48px clamp(24px, 5vw, 88px);
  justify-content: center;
  grid-template-areas: "introduction login";
  align-items: center;
  align-content: safe center;
  min-height: 100svh;
  height: auto;
  overflow: visible;
}
.space-point-field {
  z-index: -1;
  opacity: 0.85;
}
.immersive-space .space-introduction {
  grid-area: introduction;
  max-width: 700px;
  padding: 0;
}
.space-introduction > .official-brand-mark {
  margin-bottom: 34px;
  width: 56px;
  height: 50px;
}
.immersive-space .space-introduction .welcome-brand {
  color: #a6bfd0;
  font-size: 12px;
  margin-bottom: 22px;
}
.immersive-space .space-introduction h2 {
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 530;
  line-height: 1.12;
  color: #f5faff;
  letter-spacing: -0.045em;
}
.immersive-space .space-introduction h2 span {
  color: #a4cee8;
}
.immersive-space .space-intro-description {
  color: #adc0d0;
  font-size: 18px;
  margin: 22px 0 34px;
}
.space-preview-cards {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0;
  perspective: 1000px;
}
.space-preview-card {
  --float-rest: 0px;
  width: 33.333%;
  min-width: 0;
  padding: 22px 18px;
  min-height: 210px;
  border-radius: 14px;
  border: 1px solid #ffffff40;
  box-shadow: 0 15px 35px #0004;
  background: #e7f1f8;
  color: #1c3c55;
  transform: rotateY(var(--tilt-y)) rotateX(var(--tilt-x));
  transition: transform 400ms ease-out;
  translate: 0 var(--float-rest);
}
.immersive-space[data-motion="on"] .space-preview-card {
  animation: space-card-float 7s ease-in-out infinite;
}
.immersive-space[data-motion="on"] .practice-preview {
  animation-delay: -2.4s;
  animation-duration: 8s;
}
.immersive-space[data-motion="on"] .growth-preview {
  animation-delay: -4.7s;
  animation-duration: 9s;
}
@keyframes space-card-float {
  0%,
  100% {
    translate: 0 var(--float-rest);
    rotate: -0.6deg;
  }
  50% {
    translate: 0 calc(var(--float-rest) - 14px);
    rotate: 0.6deg;
  }
}
.space-preview-card > .icon {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 20px;
}
.space-preview-card small {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: inherit;
  opacity: 0.8;
}
.space-preview-card h3 {
  font-size: clamp(15px, 1.3vw, 20px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: inherit;
  margin: 10px 0 14px;
}
.space-preview-card p {
  font-size: 12px;
  line-height: 1.5;
  color: inherit;
  opacity: 0.8;
  margin: 0;
}
.practice-preview {
  --float-rest: -12px;
  background: #0c526e;
  color: #e7faff;
}
.growth-preview {
  background: #d6e4e8;
}
.preview-rule {
  height: 3px;
  width: 40%;
  border-radius: 3px;
  margin-top: 20px;
  background: currentColor;
  opacity: 0.25;
}
.immersive-space .sign-in-window {
  grid-area: login;
  min-width: 0;
  background: linear-gradient(140deg, #ffffffed, #edf6f9e6);
  border-radius: 22px;
  padding: 28px 30px 22px;
  border: 1px solid #ffffffbb;
  box-shadow:
    inset 0 1px #fff,
    0 24px 90px #0003;
}
.immersive-space .welcome-topline .official-brand-mark {
  width: 38px;
  height: 34px;
}
.immersive-space .welcome-content h1 {
  font-size: 28px;
}
.immersive-space .space-login-form :is(input, select) {
  border-radius: 10px;
  background: #ffffffaa;
  border-color: #bfced8;
}
.immersive-space .welcome-enter {
  border-radius: 10px;
}
.immersive-space .space-login-form select {
  appearance: auto;
  background-image: none;
  color-scheme: light;
}
:root[data-theme="dark"] .immersive-space .space-login-form select {
  color-scheme: dark;
}
:root[data-theme="dark"] .welcome-space.immersive-space {
  --intro-ink: #e6f3fb;
  --intro-muted: #abc2d3;
}
:root[data-theme="dark"] .immersive-space .sign-in-window {
  background: linear-gradient(140deg, #162c3eeb, #122435ed);
  border-color: #68829659;
  box-shadow:
    inset 0 1px #ffffff14,
    0 24px 90px #0005;
}
:root[data-theme="dark"] .immersive-space .space-login-form :is(input, select) {
  background: #102131;
  border-color: #486074;
}
.immersive-space[data-motion="off"] .space-preview-card {
  animation: none;
  transform: none;
  transition: none;
}
/* Travel belongs to the scenery, never to the editable form during sign-in. */
.immersive-space[data-entering="true"] .space-introduction {
  animation: space-intro-depart 750ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.immersive-space[data-entering="true"] .sign-in-window {
  animation: space-form-depart 650ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.immersive-space[data-entering="true"] .space-preview-card {
  animation-play-state: paused;
}
.space-entry-status {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #f5faff;
  background: none;
  animation: space-entry-reveal 1400ms ease-out both;
}
.space-entry-status .official-brand-mark {
  margin-bottom: 24px;
}
.space-entry-status > span {
  font-size: 11px;
  letter-spacing: 0.19em;
  color: #acc6d9;
}
.space-entry-status h2 {
  font-size: clamp(28px, 4vw, 44px);
  color: inherit;
  letter-spacing: -0.035em;
  margin: 16px 0 12px;
}
.space-entry-status p {
  font-size: 16px;
  color: #adc0d0;
}
@keyframes space-intro-depart {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-9vw) scale(1.12);
  }
}
@keyframes space-form-depart {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(9vw) scale(0.94);
  }
}
@keyframes space-entry-reveal {
  0%,
  20% {
    opacity: 0;
    transform: scale(0.96);
  }
  70%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.space-route-stage {
  min-height: 100svh;
}
.space-entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  isolation: isolate;
  overflow: hidden;
  background: #030711;
  opacity: 1;
  transition:
    opacity 900ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background-color 650ms ease-in-out;
}
.space-entry-overlay[data-phase="arriving"],
.space-entry-overlay[data-phase="revealing"] {
  background: var(--page);
}
.space-entry-overlay[data-phase="arriving"] .space-point-field,
.space-entry-overlay[data-phase="revealing"] .space-point-field {
  opacity: 0;
  transition: opacity 600ms ease;
}
.space-entry-overlay[data-phase="arriving"] .space-entry-status {
  color: var(--ink);
  transition: color 650ms ease;
}
.space-entry-overlay[data-phase="arriving"] .space-entry-status :is(p, span) {
  color: var(--muted);
}
.space-entry-overlay[data-phase="departing"] {
  animation: space-scene-cover 700ms ease-in both;
}
.space-entry-overlay[data-phase="revealing"] {
  opacity: 0;
}
.space-entry-overlay[data-phase="revealing"] .space-entry-status {
  animation: none;
  opacity: 0;
  transition: opacity 450ms ease-out;
}
.space-entry-overlay[data-motion="off"],
.space-entry-overlay[data-motion="off"] .space-entry-status {
  animation: none;
  transition: none;
}
@keyframes space-scene-cover {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 1100px) {
  .welcome-space.immersive-space,
  :root[data-theme="dark"] .welcome-space.immersive-space {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    gap: 28px;
    padding: 28px;
  }
  .immersive-space .space-introduction h2 {
    font-size: clamp(30px, 4vw, 42px);
  }
  .space-introduction > .official-brand-mark {
    width: 42px;
    height: 38px;
    margin-bottom: 24px;
  }
  .space-preview-cards {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin: 32px 0 0;
  }
  .space-preview-card {
    width: 100%;
    padding: 16px 18px;
    min-height: 92px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
  }
  .space-preview-card > .icon {
    grid-row: 1 / 3;
    margin: 0;
  }
  .space-preview-card small {
    grid-column: 2;
    font-size: 12px;
  }
  .space-preview-card h3 {
    grid-column: 2;
    font-size: 16px;
    margin: 6px 0 0;
  }
  .space-preview-card p,
  .preview-rule {
    display: none;
  }
  .practice-preview {
    --float-rest: 0px;
  }
  .immersive-space .sign-in-window {
    padding: 24px;
  }
}
@media (max-width: 719px) {
  .welcome-space.immersive-space,
  :root[data-theme="dark"] .welcome-space.immersive-space {
    grid-template-columns: minmax(0, 450px);
    grid-template-areas: "login" "introduction";
    padding: max(16px, env(safe-area-inset-top)) 16px
      max(24px, env(safe-area-inset-bottom));
    gap: 40px;
    align-content: start;
    align-items: start;
  }
  .space-introduction > .official-brand-mark,
  .immersive-space .space-introduction .welcome-brand {
    display: none;
  }
  .immersive-space .space-introduction h2 {
    font-size: 28px;
  }
  .immersive-space .space-intro-description {
    font-size: 16px;
    margin: 12px 0 0;
  }
  .space-preview-cards {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin: 30px 0 0;
  }
  .space-preview-card {
    display: block;
    width: 33.333%;
    min-height: 140px;
    padding: 16px 12px;
  }
  .space-preview-card > .icon {
    margin-bottom: 12px;
    width: 20px;
    height: 20px;
  }
  .space-preview-card h3 {
    font-size: 14px;
  }
  .immersive-space .sign-in-window {
    width: 100%;
    padding: 20px;
    border-radius: 20px;
  }
  .immersive-space .sign-in-window .welcome-content {
    padding: 16px 0 0;
  }
  .immersive-space .sign-in-window .welcome-brand {
    font-size: 11px;
    margin-bottom: 10px;
  }
  .immersive-space .welcome-content h1 {
    font-size: clamp(24px, 6vw, 28px);
  }
  .immersive-space .welcome-description {
    margin: 12px 0 22px;
    line-height: 1.5;
  }
  .immersive-space .space-login-form :is(input, select) {
    font-size: 16px;
    min-height: 48px;
  }
  .immersive-space .space-login-form label {
    font-size: 14px;
  }
  .immersive-space .welcome-enter {
    min-height: 48px;
    padding: 12px 20px;
  }
  .immersive-space .welcome-help {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.5;
  }
  .immersive-space .welcome-preview {
    margin-top: 12px;
    font-size: 14px;
  }
  .immersive-space .welcome-window-footer {
    margin-top: 12px;
    padding-top: 14px;
    font-size: 12px;
    gap: 8px;
  }
}
@media (max-width: 480px) {
  .space-preview-card {
    min-height: 86px;
    padding: 16px 12px;
  }
  .space-preview-card small {
    font-size: 12px;
  }
  .space-preview-card h3 {
    display: none;
  }
  .space-preview-card > .icon {
    width: 17px;
    height: 17px;
    margin-bottom: 10px;
  }
}
@media (min-width: 720px) and (max-height: 760px) {
  .welcome-space.immersive-space,
  :root[data-theme="dark"] .welcome-space.immersive-space {
    padding-block: 20px;
  }
  .immersive-space .sign-in-window {
    padding: 20px 24px;
  }
  .immersive-space .sign-in-window .welcome-content {
    padding: 14px 0 0;
  }
  .immersive-space .welcome-description {
    margin: 12px 0 20px;
  }
  .immersive-space .welcome-preview {
    margin-top: 10px;
  }
  .immersive-space .welcome-help {
    margin-top: 12px;
  }
  .immersive-space .welcome-window-footer {
    padding-top: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .immersive-space .space-preview-card {
    animation: none !important;
    transform: none;
    transition: none;
  }
  .space-entry-overlay,
  .space-entry-status {
    animation: none;
    transition: none;
  }
}
:root[data-glass="off"] .immersive-space .sign-in-window {
  background: var(--surface);
  backdrop-filter: none;
}
@media (prefers-reduced-transparency: reduce) {
  .immersive-space .sign-in-window {
    background: var(--surface);
    backdrop-filter: none;
  }
}
