/* The gate of this brand. The accent comes from brand.css (linked after this file); the rest is defined here. */
:root {
  color-scheme: light;
  --gate-bg: #f6f8fa;
  --gate-fg: #1f2328;
  --gate-dim: #636c76;
  --gate-panel: rgba(255, 255, 255, 0.72);
  --gate-input-bg: rgba(248, 246, 255, 0.7);
  --gate-error: #cf222e;
  --gate-shadow: 0 26px 84px rgba(0, 0, 0, 0.16);
  --gate-font: Inter, "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root.dark {
  color-scheme: dark;
  --gate-bg: #0d1117;
  --gate-fg: #e6edf3;
  --gate-dim: #8d96a0;
  --gate-panel: rgba(22, 27, 34, 0.74);
  --gate-input-bg: rgba(13, 17, 23, 0.55);
  --gate-error: #ff7b72;
  --gate-shadow: 0 26px 84px rgba(0, 0, 0, 0.46);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--gate-bg);
  color: var(--gate-fg);
  font-family: var(--gate-font);
}

.gate-root {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--gate-bg);
}

#gate-field {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.gate-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0) 0%, rgba(6, 10, 18, 0.1) 72%, rgba(3, 6, 13, 0.24) 100%);
}

.gate-lang {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hyperaven-accent-border);
  border-radius: 999px;
  background: var(--gate-panel);
  color: var(--gate-dim);
  font: 700 12px/1 var(--gate-font);
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.gate-lang:hover,
.gate-lang:focus-visible {
  color: var(--gate-fg);
  outline: none;
  border-color: var(--hyperaven-accent);
}

.gate-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.gate-watermark {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(58vw, 760px);
  height: min(58vw, 760px);
  background: var(--gate-fg);
  -webkit-mask: url("/gate/brand/mark.svg") center / contain no-repeat;
  mask: url("/gate/brand/mark.svg") center / contain no-repeat;
  opacity: 0.045;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg);
  animation: gate-drift 18s ease-in-out infinite alternate;
}

.dark .gate-watermark {
  opacity: 0.07;
}

@keyframes gate-drift {
  to {
    transform: translate(calc(-50% + 18px), calc(-50% - 14px)) rotate(-6deg) scale(1.018);
  }
}

.gate-scene {
  position: absolute;
  z-index: 1;
  width: min(1100px, 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 340ms ease,
    transform 430ms cubic-bezier(0.2, 1, 0.3, 1),
    visibility 340ms ease;
}

html[data-stage="hero"] .gate-hero,
html[data-stage="form"] .gate-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* Until the script has run, the hero shows. */
html:not([data-stage]) .gate-hero {
  opacity: 1;
  visibility: visible;
}

.gate-hero {
  position: relative;
  text-align: center;
}

.gate-lockup {
  display: block;
  width: 17.4rem;
  max-width: 70vw;
  height: auto;
  margin: 0 auto 32px;
  filter: var(--gate-logo-filter, none);
}

.dark .gate-lockup,
.dark .gate-card-logo {
  --gate-logo-filter: invert(1);
}

.gate-title {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.gate-title-accent {
  display: inline-block;
  color: var(--hyperaven-accent);
}

.gate-sub {
  max-width: 62ch;
  margin: 18px auto 0;
  color: var(--gate-dim);
  font-size: 15px;
  line-height: 1.62;
}

.gate-cta {
  margin-top: 34px;
  height: 56px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hyperaven-accent) 0%, var(--hyperaven-accent-hover) 100%);
  color: var(--hyperaven-accent-foreground);
  font: 700 15px/1 var(--gate-font);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--hyperaven-accent) 32%, transparent);
  transition:
    transform 170ms ease,
    filter 170ms ease;
}

.gate-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.gate-card {
  width: min(520px, 100%);
  padding: 32px;
  border: 1px solid var(--hyperaven-accent-border);
  border-radius: 24px;
  background: var(--gate-panel);
  box-shadow:
    var(--gate-shadow),
    0 16px 44px color-mix(in srgb, var(--hyperaven-accent) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px) saturate(1.08);
  -webkit-backdrop-filter: blur(6px) saturate(1.08);
}

.gate-card-logo {
  display: block;
  width: 11.9rem;
  height: auto;
  margin-bottom: 22px;
  filter: var(--gate-logo-filter, none);
}

.gate-card h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.07;
  font-weight: 700;
}

.gate-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.gate-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 12px;
  border: 1px solid var(--hyperaven-accent-border);
  border-radius: 16px;
  background: var(--gate-input-bg);
  color: var(--gate-fg);
  font: 700 14px/1.2 var(--gate-font);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.gate-role svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-role span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate-role:not(:disabled):hover {
  border-color: var(--hyperaven-accent);
  transform: translateY(-1px);
}

.gate-role:disabled {
  cursor: default;
}

.gate-role:disabled[aria-pressed="false"] {
  opacity: 0.5;
}

.gate-role[aria-pressed="true"] {
  border-color: var(--hyperaven-accent);
  background: linear-gradient(135deg, var(--hyperaven-accent) 0%, var(--hyperaven-accent-hover) 100%);
  color: var(--hyperaven-accent-foreground);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--hyperaven-accent) 28%, transparent);
}

.gate-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.gate-step {
  display: grid;
  gap: 8px;
}

.gate-form label {
  margin-top: 6px;
  color: var(--gate-fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gate-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--entry-login-input-border);
  border-radius: 14px;
  background: var(--gate-input-bg);
  color: var(--gate-fg);
  font: 500 14px/1 var(--gate-font);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gate-form input:focus {
  border-color: var(--hyperaven-accent);
  box-shadow: 0 0 0 3px var(--hyperaven-accent-subtle);
}

.gate-hint {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hyperaven-accent-subtle);
  color: var(--brand-subtle-text);
  font-size: 12px;
  font-weight: 650;
}

.gate-error {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--gate-error) 30%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--gate-error) 8%, transparent);
  color: var(--gate-error);
  font-size: 12.5px;
  font-weight: 600;
}

.gate-submit {
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--btn-primary-bg) 0%, var(--btn-primary-bg-hover) 100%);
  color: var(--btn-primary-text);
  font: 700 14px/1 var(--gate-font);
  cursor: pointer;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--hyperaven-accent) 28%, transparent);
  transition: transform 160ms ease;
}

.gate-submit:not(:disabled):hover {
  transform: translateY(-1px);
}

.gate-submit:disabled {
  opacity: 0.8;
  cursor: progress;
}

.gate-link {
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--gate-dim);
  font: 650 12px/1.4 var(--gate-font);
  cursor: pointer;
}

.gate-link:hover,
.gate-link:focus-visible {
  color: var(--hyperaven-accent);
  outline: none;
}

.gate-link-center {
  display: block;
  margin: 18px auto 0;
}

.gate-cta:focus-visible,
.gate-role:focus-visible,
.gate-submit:focus-visible {
  outline: 2px solid var(--hyperaven-accent);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .gate-shell {
    padding: 14px;
  }

  .gate-lockup {
    width: 13.7rem;
    margin-bottom: 24px;
  }

  .gate-sub {
    font-size: 14px;
  }

  .gate-cta {
    height: 50px;
    margin-top: 24px;
  }

  .gate-card {
    max-height: calc(100vh - 28px);
    padding: 22px 18px;
    overflow-y: auto;
    border-radius: 20px;
  }

  .gate-card h2 {
    font-size: 28px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .gate-watermark {
    animation: none;
  }

  .gate-scene {
    transition: none;
  }
}
