:root {
  --bg: #050505;
  --fg: #ffffff;
  --muted: #7a7a7a;
  --line: rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: url("noise.png") repeat;
  opacity: 0.055;
  mix-blend-mode: screen;
}

.grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 25vw 25vh;
  opacity: 0.55;
}

.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
}

/* ---------- gate ---------- */

.gate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vw;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gate.leaving {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.kicker {
  margin: 0 0 34px;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-title {
  margin: 0 0 48px;
  font-size: clamp(3.2rem, 11vw, 10rem);
  line-height: 0.84;
  letter-spacing: -0.08em;
  font-weight: 800;
}

form { max-width: 620px; }

label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  transition: border-color 0.25s ease;
}

.field:focus-within { border-color: #fff; }

input {
  flex: 1;
  min-width: 0;
  padding: 14px 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
}

input::placeholder { color: #3d3d3d; }

button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 0 10px 18px;
  transition: color 0.25s ease;
}

button span { display: inline-block; transition: transform 0.25s ease; }
button:hover { color: #fff; }
button:hover span { transform: translate(3px, -3px); }

.error, .hint {
  min-height: 1.2em;
  margin: 18px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.error.shake { animation: shake 0.35s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* ---------- wish ---------- */

.wish {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.wish.visible { opacity: 1; }

.corner-title {
  position: absolute;
  left: 5vw;
  bottom: 10vh;
  max-width: 92vw;
  font-size: clamp(3rem, 13.5vw, 14rem);
  line-height: 0.78;
  letter-spacing: -0.09em;
  font-weight: 800;
  text-transform: uppercase;
}

.corner-title .line {
  display: block;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.corner-title .line:nth-child(2) {
  animation-delay: 0.12s;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.35em); }
  to { opacity: 1; transform: translateY(0); }
}

.credits {
  position: absolute;
  right: 5vw;
  bottom: 4vh;
  max-width: 520px;
  text-align: right;
  font-size: clamp(0.66rem, 1.1vw, 0.82rem);
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.credits a {
  color: #d8d8d8;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: background 0.2s ease, color 0.2s ease;
}

.credits a:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

@media (max-width: 700px) {
  .corner-title { bottom: 20vh; }
  .credits {
    left: 5vw;
    right: 5vw;
    max-width: none;
    text-align: left;
  }
}

/* ---------- legal links ---------- */

.legal-link {
  margin: 26px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.legal-link a,
.credits .terms-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, color 0.2s ease;
}

.legal-link a:hover,
.credits .terms-link:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.credits .terms-link {
  display: block;
  margin-top: 12px;
}

/* ---------- terms page ---------- */

.legal {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 10vh 6vw 14vh;
}

.legal-title {
  margin: 0 0 10px;
  font-size: clamp(2.8rem, 9vw, 7rem);
  line-height: 0.86;
  letter-spacing: -0.08em;
  font-weight: 800;
  text-transform: uppercase;
}

.legal-updated {
  margin: 0 0 54px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal h2 {
  margin: 44px 0 12px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal p,
.legal li {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.65;
  color: #d6d6d6;
}

.legal ol { padding-left: 1.2em; }

.legal a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.legal a:hover { background: #fff; color: #000; border-color: #fff; }

.legal-back {
  display: inline-block;
  margin-top: 56px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
