/* Dedicated unauthenticated entry for Hux Studio. */

.auth-gate {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 30%, rgb(255 77 77 / 11%), transparent 34%),
    #090909;
  color: #f4f4f4;
}

.auth-gate-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 62%) 72%, transparent 100%);
}

.auth-gate-pending {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100dvh;
  color: #8f8f94;
  font: 500 15px/1.5 var(--font-body, Montserrat, "PingFang SC", system-ui, sans-serif);
}

html.auth-pending .auth-gate-pending {
  display: flex;
}

.auth-gate-content {
  display: none;
  width: min(calc(100% - 64px), 1440px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 34px 0 30px;
}

html.auth-login .auth-gate-content {
  display: flex;
  flex-direction: column;
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
}

.auth-gate-brand-copy {
  display: grid;
  gap: 2px;
}

.auth-gate-brand strong {
  font: 650 18px/1.2 var(--font-heading, "Instrument Sans", "PingFang SC", system-ui, sans-serif);
  letter-spacing: -0.02em;
}

.auth-gate-brand small {
  color: #737378;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.auth-gate-monogram {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #3a3a3d;
  background: #121214;
  color: #ff4d4d;
  font: 700 17px/1 var(--font-heading, "Instrument Sans", system-ui, sans-serif);
}

.auth-gate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
  align-items: stretch;
  width: 100%;
  margin: auto 0;
  border: 1px solid #2c2c30;
  background: rgb(13 13 15 / 88%);
  box-shadow: 0 32px 100px rgb(0 0 0 / 38%);
  backdrop-filter: blur(20px);
}

.auth-gate-intro {
  display: flex;
  flex-direction: column;
  min-height: 570px;
  padding: clamp(48px, 5.8vw, 86px);
  border-right: 1px solid #2c2c30;
  background:
    linear-gradient(125deg, rgb(255 77 77 / 12%), transparent 46%),
    linear-gradient(180deg, rgb(255 255 255 / 1.8%), transparent 38%);
}

.auth-gate-intro .section-kicker {
  color: #ff5757;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.auth-gate-intro h1 {
  max-width: 760px;
  margin: 28px 0 24px;
  font: 650 clamp(46px, 5vw, 76px)/1.04 var(--font-heading, "Instrument Sans", "PingFang SC", system-ui, sans-serif);
  letter-spacing: -0.055em;
}

.auth-gate-intro > p {
  max-width: 660px;
  margin: 0;
  color: #a1a1a7;
  font-size: 17px;
  line-height: 1.8;
}

.auth-gate-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: auto 0 0;
  padding: 0;
  border-top: 1px solid #303034;
  list-style: none;
}

.auth-gate-flow li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  min-width: 0;
  padding: 24px 22px 0 0;
}

.auth-gate-flow li + li {
  padding-left: 22px;
  border-left: 1px solid #303034;
}

.auth-gate-flow span {
  grid-row: 1 / 3;
  color: #ff4d4d;
  font: 650 12px/1.4 var(--font-mono, ui-monospace, monospace);
}

.auth-gate-flow strong {
  color: #e9e9eb;
  font-size: 15px;
  line-height: 1.35;
}

.auth-gate-flow small {
  color: #737378;
  font-size: 12px;
  line-height: 1.65;
}

.auth-gate-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 570px;
  padding: clamp(42px, 4.5vw, 68px);
  background: #111113;
}

.auth-gate-card-index {
  margin-bottom: 54px;
  color: #ff4d4d;
  font: 650 12px/1.4 var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.18em;
}

.auth-gate-card-copy h2,
.auth-gate-card-copy p {
  margin: 0;
}

.auth-gate-card-copy h2 {
  font: 650 30px/1.2 var(--font-heading, "Instrument Sans", "PingFang SC", system-ui, sans-serif);
  letter-spacing: -0.035em;
}

.auth-gate-card-copy p {
  margin-top: 13px;
  color: #8e8e94;
  font-size: 14px;
  line-height: 1.75;
}

.auth-gate-primary,
.auth-gate-secondary {
  width: 100%;
  min-height: 56px;
  border-radius: 0;
  font: 650 15px/1.4 var(--font-body, Montserrat, "PingFang SC", system-ui, sans-serif);
}

.auth-gate-primary {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 15px 18px;
  border: 1px solid #eeeeef;
  background: #eeeeef;
  color: #101012;
  text-align: left;
  overflow: hidden;
}

.auth-gate-primary:hover,
.auth-gate-primary:focus-visible {
  border-color: #ffffff;
  background: #ffffff;
}

.auth-gate-primary:disabled {
  border-color: #303035;
  background: #18181b;
  color: #68686d;
  cursor: wait;
}

.auth-gate-primary .ui-icon {
  width: 20px;
  height: 20px;
}

.auth-gate-arrow {
  justify-self: end;
}

.github-login-indicator {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  justify-self: end;
}

.github-login-arrow,
.github-login-loader {
  position: absolute;
  inset: 0;
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.github-login-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(3px);
}

.github-login-loader > span {
  width: 2px;
  height: 7px;
  background: #ff555b;
  transform-origin: center;
}

.auth-gate-primary.is-connecting:disabled {
  border-color: #7d3236;
  background: linear-gradient(90deg, #201719 0%, #17171a 48%, #211719 100%);
  color: #ffffff;
  cursor: progress;
}

.auth-gate-primary.is-connecting::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ff4d52 42%, #ff7579 54%, transparent 100%);
  content: "";
  transform: translateX(-68%);
  animation: auth-github-progress 900ms cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.auth-gate-primary.is-connecting .ui-icon:first-child {
  background-color: #ff5b60;
}

.is-connecting .github-login-arrow {
  opacity: 0;
  transform: translate(3px, -3px);
}

.is-connecting .github-login-loader {
  opacity: 1;
  transform: translateY(0);
}

.is-connecting .github-login-loader > span {
  animation: auth-github-signal 720ms ease-in-out infinite;
}

.is-connecting .github-login-loader > span:nth-child(2) {
  animation-delay: 90ms;
}

.is-connecting .github-login-loader > span:nth-child(3) {
  animation-delay: 180ms;
}

.identity-github-login.is-connecting {
  cursor: progress;
}

@keyframes auth-github-progress {
  0% { transform: translateX(-68%); }
  100% { transform: translateX(68%); }
}

@keyframes auth-github-signal {
  0%, 100% { opacity: 0.35; transform: scaleY(0.55); }
  50% { opacity: 1; transform: scaleY(1); }
}

.auth-gate-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #66666c;
  font-size: 12px;
}

.auth-gate-divider::before,
.auth-gate-divider::after {
  height: 1px;
  background: #2d2d31;
  content: "";
}

.auth-gate-secondary {
  border: 1px solid #38383d;
  background: transparent;
  color: #d5d5d8;
}

.auth-gate-secondary:hover,
.auth-gate-secondary:focus-visible {
  border-color: #68686f;
  background: #17171a;
  color: #ffffff;
}

.auth-gate-card-note,
.auth-gate-status {
  margin: 14px 0 0;
  color: #707076;
  font-size: 12px;
  line-height: 1.65;
}

.auth-gate-status:not(:empty) {
  padding: 12px 14px;
  border-left: 2px solid #ff4d4d;
  background: rgb(255 77 77 / 7%);
  color: #c7c7cb;
}

.auth-gate-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  padding-top: 24px;
  color: #66666c;
  font-size: 12px;
}

.auth-gate-footer span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.auth-gate-footer span::before {
  width: 5px;
  height: 5px;
  background: #ff4d4d;
  content: "";
}

@media (max-width: 980px) {
  .auth-gate-content {
    width: min(calc(100% - 32px), 760px);
    padding: 22px 0;
  }

  .auth-gate-layout {
    grid-template-columns: 1fr;
    margin: 30px 0;
  }

  .auth-gate-intro,
  .auth-gate-card {
    min-height: auto;
  }

  .auth-gate-intro {
    padding: 52px 40px 42px;
    border-right: 0;
    border-bottom: 1px solid #2c2c30;
  }

  .auth-gate-flow {
    margin-top: 48px;
  }

  .auth-gate-card {
    padding: 42px 40px 48px;
  }

  .auth-gate-card-index {
    margin-bottom: 28px;
  }
}

@media (max-width: 620px) {
  .auth-gate-content {
    width: min(calc(100% - 20px), 520px);
    padding: 16px 0 22px;
  }

  .auth-gate-layout {
    margin: 22px 0;
  }

  .auth-gate-intro,
  .auth-gate-card {
    padding: 34px 24px;
  }

  .auth-gate-intro h1 {
    margin-top: 22px;
    font-size: clamp(38px, 12vw, 54px);
  }

  .auth-gate-intro > p {
    font-size: 15px;
  }

  .auth-gate-flow {
    grid-template-columns: 1fr;
  }

  .auth-gate-flow li {
    padding: 18px 0;
  }

  .auth-gate-flow li + li {
    padding-left: 0;
    border-top: 1px solid #28282c;
    border-left: 0;
  }

  .auth-gate-footer {
    display: grid;
    gap: 10px;
    padding: 0 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate *,
  .auth-gate *::before,
  .auth-gate *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }

  .auth-gate-primary.is-connecting::after {
    right: 18px;
    left: 18px;
    transform: none;
  }

  .is-connecting .github-login-loader > span {
    opacity: 0.85;
    transform: none;
  }
}
