@font-face{font-family:Poppins;src:url('/assets/fonts/poppins-600.ttf') format('truetype');font-weight:600;font-style:normal;font-display:swap}
/* X8engine sign-in: split layout, GhostFibers visual on the left, Discord sign-in on the right. */
:root {
  color-scheme: dark;
  --x8-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --x8-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --x8-bg: #0a0a0b;
  --x8-text: #f5f5f4;
  --x8-muted: #a1a1aa;
  --x8-faint: #71717a;
  --x8-line: rgba(255, 255, 255, 0.09);
  --x8-visual: #050506;
  --x8-visual-glow: radial-gradient(120% 80% at 18% 0%, rgba(234, 179, 8, 0.10), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(59, 130, 246, 0.10), transparent 60%);
  --x8-visual-text: #fafafa;
  --x8-visual-shade: linear-gradient(to top, rgba(5, 5, 6, 0.78), rgba(5, 5, 6, 0) 46%);
  --x8-glass: rgba(10, 10, 11, 0.42);
  --x8-glass-line: rgba(255, 255, 255, 0.12);
  --x8-button: #fafafa;
  --x8-button-hover: #ffffff;
  --x8-button-text: #0a0a0b;
  --x8-discord: #5865f2;
  --x8-button-shadow: 0 18px 40px -18px rgba(88, 101, 242, 0.75);
  --x8-field: #161618;
  --x8-field-line: rgba(255, 255, 255, 0.1);
  --x8-accent: #eab308;
  --x8-danger: #f87171;
  --x8-danger-bg: rgba(248, 113, 113, 0.08);
  --x8-danger-line: rgba(248, 113, 113, 0.32);
  --x8-radius: 28px;
  --x8-gutter: clamp(12px, 1.4vw, 20px);
}

html.light {
  color-scheme: light;
  --x8-bg: #f4f4f1;
  --x8-text: #18181b;
  --x8-muted: #52525b;
  --x8-faint: #71717a;
  --x8-line: rgba(24, 24, 27, 0.1);
  --x8-visual: #fbfaf6;
  --x8-visual-glow: radial-gradient(120% 80% at 18% 0%, rgba(234, 179, 8, 0.14), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(59, 130, 246, 0.10), transparent 60%);
  --x8-visual-text: #18181b;
  --x8-visual-shade: linear-gradient(to top, rgba(251, 250, 246, 0.85), rgba(251, 250, 246, 0) 46%);
  --x8-glass: rgba(255, 255, 255, 0.62);
  --x8-glass-line: rgba(24, 24, 27, 0.1);
  --x8-button: #18181b;
  --x8-button-hover: #000000;
  --x8-button-text: #fafafa;
  --x8-discord: #ffffff;
  --x8-button-shadow: 0 18px 40px -20px rgba(24, 24, 27, 0.55);
  --x8-field: #ffffff;
  --x8-field-line: rgba(24, 24, 27, 0.14);
  --x8-accent: #a16207;
  --x8-danger: #b91c1c;
  --x8-danger-bg: rgba(185, 28, 28, 0.06);
  --x8-danger-line: rgba(185, 28, 28, 0.28);
}

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

html, body { margin: 0; min-height: 100%; }

body.x8-login {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--x8-bg);
  color: var(--x8-text);
  font-family: var(--x8-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(.x8-login) a { color: inherit; }

.x8-login :focus-visible {
  outline: 2px solid var(--x8-accent);
  outline-offset: 3px;
}

.x8-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--x8-button);
  color: var(--x8-button-text);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.x8-skip:focus { transform: none; }

.x8-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--x8-gutter);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--x8-gutter);
}

/* Visual card */
.x8-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100dvh - 2 * var(--x8-gutter));
  padding: clamp(28px, 4vw, 56px);
  overflow: hidden;
  border-radius: var(--x8-radius);
  background: var(--x8-visual-glow), var(--x8-visual);
  box-shadow: inset 0 0 0 1px var(--x8-line);
  color: var(--x8-visual-text);
}

.x8-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--x8-visual-shade);
  pointer-events: none;
}

.x8-visual-fibers {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.x8-visual-fibers[data-ghost-fibers="ready"] { opacity: 1; }

.ghost-fibers-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.x8-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  align-self: flex-start;
  text-decoration: none;
  border-radius: 18px;
}
/* The X8engine mark stands on its own, without a tile behind it. */
.x8-brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
}
.x8-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
html.light .x8-brand-mark img { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45)); }
.x8-brand-name {
  display: block;
  font-family: Poppins, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.033em;
  line-height: 1.1;
}
.x8-brand-eyebrow {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.62;
}

.x8-tagline {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.25rem, 3.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}


/* Sign-in panel */
.x8-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: clamp(24px, 5vw, 72px) clamp(16px, 4vw, 64px) clamp(16px, 2vw, 24px);
}
.x8-panel-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  margin-block: auto;
}
.x8-panel h1 {
  margin: 0;
  font-size: clamp(2.5rem, 3.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}
.x8-panel h1:focus { outline: none; }
.x8-lede {
  margin: 14px 0 36px;
  color: var(--x8-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.x8-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--x8-button);
  color: var(--x8-button-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}
.x8-discord-mark { flex: none; color: var(--x8-discord); }
a.x8-discord:hover {
  background: var(--x8-button-hover);
  box-shadow: var(--x8-button-shadow);
  transform: translateY(-1px);
}
a.x8-discord:active { transform: translateY(0); }
a.x8-discord[aria-busy="true"] { cursor: progress; opacity: 0.82; transform: none; box-shadow: none; }
a.x8-discord[aria-busy="true"] .x8-discord-mark { animation: x8-pulse 1.1s ease-in-out infinite; }
button.x8-discord:disabled { cursor: not-allowed; opacity: 0.42; }

.x8-note {
  margin: 16px 0 0;
  color: var(--x8-faint);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.x8-error {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--x8-danger-line);
  border-radius: 16px;
  background: var(--x8-danger-bg);
  color: var(--x8-text);
}
.x8-error svg { flex: none; margin-top: 1px; color: var(--x8-danger); }
.x8-error strong { display: block; font-size: 0.9375rem; }
.x8-error p { margin: 4px 0 0; color: var(--x8-muted); font-size: 0.875rem; line-height: 1.45; }
.x8-error:focus { outline: none; }

/* Temporary code sign-in, rendered only while Discord OAuth is not configured. */
.x8-fallback {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--x8-line);
}
.x8-fallback label { font-size: 0.875rem; font-weight: 600; }
.x8-input { position: relative; }
.x8-input input {
  width: 100%;
  min-height: 56px;
  padding: 0 56px 0 20px;
  border: 1px solid var(--x8-field-line);
  border-radius: 999px;
  background: var(--x8-field);
  color: var(--x8-text);
  font: inherit;
  font-size: 1rem;
}
.x8-input input::placeholder { color: var(--x8-faint); }
.x8-input input:focus-visible { outline: 2px solid var(--x8-accent); outline-offset: 2px; }
.x8-input input[aria-invalid="true"] { border-color: var(--x8-danger-line); }
.x8-reveal {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--x8-muted);
  cursor: pointer;
  transform: translateY(-50%);
}
.x8-reveal:hover { color: var(--x8-text); }
.x8-reveal svg { width: 20px; height: 20px; }
.x8-hint { margin: 0; color: var(--x8-faint); font-size: 0.8125rem; line-height: 1.5; }
.x8-hint code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--x8-field);
  box-shadow: inset 0 0 0 1px var(--x8-field-line);
  color: var(--x8-text);
  font-family: var(--x8-mono);
  font-size: 0.8125rem;
}
.x8-submit {
  min-height: 52px;
  margin-top: 6px;
  border: 1px solid var(--x8-field-line);
  border-radius: 999px;
  background: transparent;
  color: var(--x8-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.x8-submit:hover { background: var(--x8-field); }
.x8-submit:disabled { cursor: progress; opacity: 0.6; }

.x8-footer {
  color: var(--x8-faint);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

@keyframes x8-pulse { 50% { opacity: 0.45; } }

@media (max-width: 900px) {
  .x8-shell { grid-template-columns: minmax(0, 1fr); }
  .x8-visual {
    min-height: clamp(280px, 44vh, 440px);
    padding: 28px;
    border-radius: 24px;
  }
  .x8-tagline { font-size: clamp(2rem, 7vw, 2.75rem); }
  .x8-panel { justify-content: flex-start; padding: 28px 8px 16px; }
  .x8-panel-body { margin-block: 0 auto; }
}

@media (max-width: 600px) {
  /* A shorter hero keeps the code field on screen on small phones. */
  .x8-visual { min-height: 200px; padding: 20px 22px; }
  .x8-tagline { font-size: 1.75rem; }
  .x8-brand-mark { width: 46px; height: 46px; }
  .x8-brand-name { font-size: 1.25rem; }
  .x8-panel { padding-top: 20px; }
  .x8-panel h1 { font-size: 2.25rem; }
  .x8-lede { margin-bottom: 20px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .x8-login *, .x8-login *::before, .x8-login *::after {
    animation: none !important;
    transition: none !important;
  }
}
