:root {
  color-scheme: dark;
  --bg: #07060b;
  --ink: #f7f4ff;
  --muted: #b7afc6;
  --line: rgba(255, 255, 255, 0.12);
  --card: rgba(16, 12, 22, 0.78);
  --violet: #7c3aed;
  --magenta: #e879f9;
  --danger: #fecdd3;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
}

img { max-width: 100%; }

a { color: inherit; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(880px 520px at 92% -10%, rgba(232, 121, 249, 0.28), transparent 62%),
    radial-gradient(720px 480px at -8% 108%, rgba(124, 58, 237, 0.32), transparent 58%),
    linear-gradient(180deg, #120818 0%, var(--bg) 42%);
}

.top, main { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: block;
}

.brand-word {
  height: 22px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav form { margin: 0; }

.nav a, .nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, 0.08); }

.hero, .auth, .narrow, .sheet {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100dvh - 120px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--magenta);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5.2vw, 4.8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.048em;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 38rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-art {
  margin: 0;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(88, 28, 135, 0.38);
  background: #000;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.steps article, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.steps span {
  display: block;
  margin-bottom: 10px;
  color: var(--magenta);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.steps strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.steps p, .panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 56px;
  align-items: center;
  min-height: calc(100dvh - 120px);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 22px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0 14px;
}

input[name="key"], input[name="code"] {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

input:focus {
  outline: none;
  border-color: #d946ef;
  box-shadow: 0 0 0 4px rgba(217, 70, 239, 0.2);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  text-decoration: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(100deg, #7c3aed 0%, #c026d3 58%, #f0abfc 140%);
  box-shadow: 0 10px 28px rgba(192, 38, 211, 0.32);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

.hero-actions .btn { width: auto; min-width: 180px; }

.return {
  display: block;
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.return a { color: var(--ink); }

.error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--danger);
}

.note {
  margin: 16px 0 0;
  color: var(--muted);
}

.note a { color: var(--ink); }

.narrow { max-width: 880px; padding-top: 4vh; }
.narrow .btn-primary { width: auto; min-width: 200px; margin-top: 8px; }

.sheet { max-width: 720px; padding-top: 2vh; }

.sheet section, .panel {
  margin-top: 16px;
}

.sheet section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}

.quiet {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.quiet:hover { background: rgba(255, 255, 255, 0.06); }

.qr {
  display: block;
  width: 220px;
  height: auto;
  margin: 8px 0 4px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
}

.codes ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.codes li {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

:focus-visible {
  outline: 2px solid #f0abfc;
  outline-offset: 3px;
}

input:focus-visible { outline: none; }

@media (max-width: 860px) {
  .hero, .auth {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
    padding-top: 12px;
  }

  .hero-art { order: -1; }

  .steps, .codes ul { grid-template-columns: 1fr; }

  .brand-word { height: 18px; }

  h1 { font-size: clamp(2.4rem, 11vw, 3.3rem); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
