@import url("https://fonts.cdnfonts.com/css/thegoodmonolith");

@font-face {
  font-family: "PP Neue Montreal";
  src: url("https://fonts.cdnfonts.com/s/64587/PPNeueMontreal-Medium.woff2")
    format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #0d0d0d;
  --surface: rgb(24 24 24 / 82%);
  --surface-strong: #181818;
  --text: #f7f7f4;
  --muted: rgb(247 247 244 / 58%);
  --line: rgb(255 255 255 / 16%);
  --line-strong: rgb(255 255 255 / 42%);
  --error: #ffb4b4;
  --font-body: "TheGoodMonolith", "Courier New", monospace;
  --font-title: "PP Neue Montreal", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

html:has(body.is-loading) {
  overflow: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 46%, rgb(85 111 126 / 13%), transparent 30%),
    var(--background);
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.5;
}

body.is-loading {
  overflow: hidden;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms ease, visibility 500ms ease;
}

.loading-screen.is-finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-animation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.loading-brand {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 30px;
  color: #d1cec7;
  background: rgb(0 0 0 / 58%);
  box-shadow: 0 0 80px 45px rgb(0 0 0 / 64%);
  pointer-events: none;
}

.loading-brand__symbol {
  width: 46px;
  height: auto;
}

.loading-brand__wordmark {
  display: flex;
  align-items: center;
  color: #d1cec7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
}

.loading-brand__wordmark strong {
  margin: 0 2px;
  padding: 2px 4px;
  border: 1px solid currentColor;
  font-family: "Courier New", monospace;
  font-size: 0.82em;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.loading-brand small {
  color: rgb(209 206 199 / 66%);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.45rem;
  letter-spacing: 0.03em;
}

.loading-label {
  position: absolute;
  right: 24px;
  bottom: 20px;
  z-index: 1;
  margin: 0;
  color: rgb(255 255 255 / 64%);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("https://img.freepik.com/premium-photo/white-dust-scratches-black-background_279525-2.jpg?w=640");
  background-repeat: repeat;
  mix-blend-mode: screen;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.webgl-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #111;
}

#space {
  width: 100%;
  height: 100%;
  display: block;
}

.site-header,
.site-footer,
.login-layout,
.scroll-hint,
.warp-copy,
.closing-content {
  position: relative;
  z-index: 2;
}

.login-hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(
    180deg,
    rgb(13 13 13 / 38%),
    rgb(13 13 13 / 12%) 70%,
    transparent
  );
}

.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  letter-spacing: 0.08em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 18px;
}

.brand-circle {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 300ms ease;
}

.brand-circle--left {
  left: 0;
  transform: translateY(-50%);
}

.brand-circle--right {
  left: 10px;
  transform: translateY(-50%);
  mix-blend-mode: exclusion;
}

.brand:hover .brand-circle--left {
  transform: translate(-4px, -50%);
}

.brand:hover .brand-circle--right {
  transform: translate(4px, -50%);
}

.header-meta,
.site-footer p {
  margin: 0;
  color: var(--muted);
}

.login-layout {
  width: min(1180px, calc(100% - 64px));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: clamp(48px, 10vw, 160px);
  align-items: center;
  padding: 64px 0;
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px 24px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.scroll-line {
  width: 64px;
  height: 1px;
  background: var(--line-strong);
  transform-origin: left;
  animation: scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%,
  100% {
    transform: scaleX(0.35);
    opacity: 0.45;
  }

  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.intro-panel {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(4rem, 9vw, 8.5rem);
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.intro-copy {
  max-width: 450px;
  margin: 36px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-card {
  width: 100%;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / 28%);
  backdrop-filter: blur(18px);
}

.card-heading {
  margin-bottom: 34px;
}

.card-heading .eyebrow {
  margin-bottom: 10px;
}

.error {
  display: none;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid rgb(255 180 180 / 36%);
  color: var(--error);
  background: rgb(130 25 25 / 18%);
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.login-tab {
  position: relative;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 250ms ease;
}

.login-tab:hover,
.login-tab:focus-visible,
.login-tab--active {
  color: var(--text);
}

.login-tab--active::after {
  transform: scaleX(1);
}

.login-panel[hidden] {
  display: none;
}

.field {
  margin-bottom: 22px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1rem;
  transition: border-color 180ms ease, background-color 180ms ease;
}

input:focus {
  border-color: var(--text);
  background: rgb(255 255 255 / 3%);
}

.field-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.password-reset-link {
  display: inline-block;
  margin: -4px 0 24px;
  color: var(--muted);
  text-underline-offset: 4px;
}

.password-reset-link:hover,
.password-reset-link:focus-visible {
  color: var(--text);
}

.submit-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--text);
  color: #111;
  background: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 200ms ease, background-color 200ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  color: var(--text);
  background: transparent;
}

.warp-journey {
  position: relative;
  z-index: 1;
  height: 500vh;
}

.warp-copy {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(30px) scale(0.96);
  will-change: opacity, filter, transform;
}

.warp-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.warp-copy h2 {
  font-size: clamp(3.5rem, 9vw, 8rem);
}

.closing-section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 64px 24px;
  background: linear-gradient(180deg, transparent, rgb(13 13 13 / 92%) 30%);
}

.closing-content {
  width: min(760px, 100%);
  text-align: center;
}

.closing-content h2 {
  font-size: clamp(3rem, 8vw, 7rem);
}

.closing-content > p:not(.eyebrow) {
  max-width: 540px;
  margin: 30px auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.back-to-top {
  color: var(--text);
  text-underline-offset: 5px;
}

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: rgb(13 13 13 / 92%);
}

@media (max-width: 820px) {
  .login-layout {
    width: min(100% - 40px, 540px);
    grid-template-columns: 1fr;
    gap: 52px;
    padding: 48px 0 72px;
  }

  .login-hero {
    min-height: auto;
  }

  .intro-panel {
    text-align: center;
  }

  .intro-copy {
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .loading-label {
    right: 16px;
    bottom: 14px;
  }

  .loading-brand {
    gap: 9px;
    padding: 18px 22px;
  }

  .loading-brand__symbol {
    width: 38px;
  }

  .site-header,
  .site-footer,
  .scroll-hint {
    padding: 20px;
  }

  .header-meta,
  .site-footer p:last-child {
    display: none;
  }

  .login-layout {
    width: calc(100% - 24px);
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(3.4rem, 19vw, 5.2rem);
  }

  .login-card {
    padding: 26px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .loading-screen {
    transition-duration: 200ms !important;
  }
}
