:root {
  color-scheme: dark;
  font-family: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", Arial, sans-serif;
  background: #0b111a;
  color: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
button:focus-visible, input:focus-visible { outline: 2px solid #ee8584; outline-offset: 4px; }

.scene, .workspace { isolation: isolate; min-height: 100svh; }
.scene {
  --unit: min(100vw, 100svh);
  --ease-out: cubic-bezier(.2, .72, .22, 1);
  position: relative;
  overflow: clip;
}

.sky {
  position: fixed;
  inset: -8%;
  z-index: -1;
  pointer-events: none;
  background: #0b111a url("/brand/sky.webp?v=2") center center / cover;
  animation: sky-drift 66s ease-in-out infinite alternate;
}

@keyframes sky-drift {
  from { transform: translate(-1.1%, -.5%) scale(1.01); }
  to { transform: translate(1.7%, 1.3%) scale(1.075); }
}

.brand {
  position: absolute;
  z-index: 1;
  top: 50svh;
  left: 50%;
  width: calc(var(--unit) * .775);
  transform: translate(-50%, -50%);
}

.emblem { position: relative; aspect-ratio: 1551 / 1104; }
.emblem-drift {
  position: absolute;
  inset: 0;
  --drift: min(.6svh, 5px);
  animation: emblem-drift 20s ease-in-out infinite alternate;
}

@keyframes emblem-drift {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-1 * var(--drift))); }
}

.piece {
  position: absolute;
  user-select: none;
  pointer-events: none;
}

.piece-center { width: 27.079%; left: 36.815%; top: 31.069%; }
.piece-left, .piece-right {
  width: 17.376%;
  top: 37.862%;
  opacity: 0;
  transition: transform 480ms var(--ease-out), opacity 210ms ease;
}
.piece-left { left: 19.600%; transform: translateX(126%) scale(.84); }
.piece-right { left: 63.701%; transform: translateX(-126%) scale(.84); }
.piece-frame {
  inset: 0;
  width: 100%;
  opacity: 0;
  transform: scale(.79);
}
.scene[data-step="expanded"] :is(.piece-left, .piece-right),
.scene[data-step="login"] :is(.piece-left, .piece-right) {
  opacity: 1;
  transform: none;
}
.scene[data-step="login"] .piece-frame {
  opacity: 1;
  transform: none;
  transition: transform 310ms var(--ease-out), opacity 230ms ease-out;
}

.emblem-trigger {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(44px, 29%);
  height: max(44px, 42%);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}
.scene[data-step="expanded"] .emblem-trigger { width: 63%; }

.scene[data-step="login"] .brand {
  top: max(60px, 15.1svh);
  width: clamp(88px, calc(var(--unit) * .141), 185px);
  transition: top 510ms var(--ease-out) 190ms, width 510ms var(--ease-out) 190ms;
}
.scene[data-step="login"] .emblem-drift { --drift: 0px; }

.wordmark-window {
  position: absolute;
  top: calc(100% + 9%);
  inset-inline: -1%;
  overflow: hidden;
}
.wordmark {
  display: block;
  width: 100%;
  animation: wordmark-in 320ms var(--ease-out) 140ms both;
}
@keyframes wordmark-in {
  from { opacity: 0; transform: translateY(-95%); }
  to { opacity: 1; transform: none; }
}

.login {
  position: relative;
  width: min(52rem, calc(var(--unit) * .65));
  padding-block: max(205px, 40.6svh) 2rem;
  margin-inline: auto;
  text-align: center;
  animation: login-in 295ms var(--ease-out) 425ms both;
}
@keyframes login-in {
  from { opacity: 0; visibility: hidden; transform: translateY(12px); }
  to { opacity: 1; visibility: visible; transform: none; }
}
.login h1 {
  margin: 0 0 clamp(1.25rem, 3.8svh, 3.4rem);
  font-size: clamp(1.75rem, 3.2svh, 3.3rem);
  line-height: 1.25;
  outline: none;
}
.login-card {
  display: grid;
  grid-template-columns: minmax(8rem, .32fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.9rem, 2.45svh, 1.9rem) clamp(.75rem, 1.7svh, 1.5rem);
  padding: clamp(1rem, 3svh, 2.4rem);
  border-radius: clamp(1.7rem, 5.5svh, 4.4rem);
  background: #fdfdfd;
  color: #505050;
}
.login-card label { font-size: clamp(.88rem, 2.05svh, 1.7rem); font-weight: 700; }
.login-card label span { display: block; white-space: nowrap; }
.login-card label span + span { margin-top: .2em; font-size: .77em; font-weight: 400; }
.login-card input, .team-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e6e6e6;
  color: #25282c;
  font-size: 1rem;
}
.login-card input { height: clamp(2.75rem, 6svh, 4.7rem); }
.action {
  min-height: 44px;
  padding: .6rem 1.55rem;
  border: 1px solid #ad4747;
  border-radius: 999px;
  background: #9b2f31;
  color: #fff;
  font-weight: 700;
}
.action:hover:enabled { background: #ad3a3d; }
.login-submit { min-width: 10rem; margin-top: 1rem; }
.login-status { min-height: 1.4em; margin: .75rem 0 0; color: #ffc3c3; }

.workspace { padding: 0 clamp(1.1rem, 5vw, 4.5rem) 2rem; }
.workspace-header {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #ffffff32;
}
.workspace-header img { width: 120px; }
.quiet-action {
  min-height: 44px;
  padding: .4rem .75rem;
  border: 1px solid #ffffff44;
  border-radius: .7rem;
  color: inherit;
  background: #121c29;
}
.workspace-body { max-width: 56rem; margin-inline: auto; padding-top: clamp(2rem, 9svh, 5rem); }
.workspace-body h1 { margin: 0 0 .5rem; font-size: clamp(2rem, 6vw, 3.4rem); }
.workspace-role { margin: 0 0 1.75rem; color: #f4a6a6; }
.team {
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid #ffffff25;
  border-radius: 1.5rem;
  background: #151e2c;
}
.team h2 { margin: 0 0 1.2rem; }
.team-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .85rem; align-items: end; }
.team-form label { display: grid; gap: .55rem; font-size: .9rem; }
.team-form input { border-radius: .65rem; }
.team-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.team-list li { padding: .65rem 0; border-bottom: 1px solid #ffffff26; overflow-wrap: anywhere; }

@media (max-width: 650px) {
  .login { width: min(31rem, calc(100% - 2rem)); }
  .team-form { grid-template-columns: 1fr; }
  .team-form .action { justify-self: start; }
}
@media (max-width: 390px) {
  .login-card { grid-template-columns: 1fr; text-align: start; gap: .6rem; }
  .login-card input:first-of-type { margin-bottom: .3rem; }
  .login-card label span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .sky, .emblem-drift { animation: none; }
  .scene[data-step] .brand, .scene[data-step] .piece { transition: none; }
  .wordmark, .login { animation-duration: 1ms; animation-delay: 0ms; }
}
