/* HOLO◈PIXEL whitelist — the main site's "Editorial neon" design, copied by hand.
 * This repo serves static files without a build, so tokens are not imported from
 * `src/styles/global.css`; the `:root` names match it so a diff shows any drift.
 * `@font-face` needs `font-src 'self'` in the CSP (public/_headers). */

@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap;
             src: url('./fonts/unbounded-latin-800-normal.woff2') format('woff2') }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 300; font-display: swap;
             src: url('./fonts/sora-latin-300-normal.woff2') format('woff2') }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 400; font-display: swap;
             src: url('./fonts/sora-latin-400-normal.woff2') format('woff2') }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap;
             src: url('./fonts/sora-latin-600-normal.woff2') format('woff2') }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
             src: url('./fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2') }

:root {
  --bg:   #0c0a12;
  --surf: #151223;
  --fg:   #efeaf5;
  --mute: #9a92ab;
  --rule: #2b2540;
  --accent: #7fe7ff;
  --foil: linear-gradient(100deg, #ff5fd2 0%, var(--accent) 45%, #ffd35c 100%);

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body:    'Sora', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* type scale — nothing below 13px */
  --fs-13: 13px; --fs-15: 15px; --fs-17: 17px; --fs-20: 20px;
  --fs-26: 26px; --fs-34: 34px; --fs-56: 56px;
}

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

/* Required: author styles beat the user-agent `[hidden] { display: none }`, so
 * `button { display: inline-flex }` would otherwise show hidden buttons. */
[hidden] { display: none !important }

body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--fs-17); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Readable on phones too: a mobile visitor must be able to read `#hint`, which
 * says registration needs a desktop browser. */
main {
  max-width: 560px; margin: 0 auto; padding: 48px 16px 64px;
  min-height: 100dvh; display: flex; flex-direction: column; gap: 24px;
}

.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-13); letter-spacing: .14em;
  text-transform: uppercase; color: var(--mute); margin: 0;
}

h1 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.02em; line-height: .98; text-wrap: balance;
  font-size: clamp(var(--fs-34), 9vw, var(--fs-56)); margin: 0;
}
/* One foil word per page. */
h1 .foil {
  background: var(--foil); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.lede { font-size: var(--fs-20); font-weight: 300; color: #cfc6dc; margin: 0 }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0 }

/* `#state` — whether registration is open. Mono: status, not prose. */
#state {
  font-family: var(--font-mono); font-size: var(--fs-13); letter-spacing: .06em;
  text-transform: uppercase; color: var(--mute); margin: 0;
  display: flex; align-items: center; gap: 10px;
}
#state::before {
  content: ''; width: 7px; height: 7px; border-radius: 999px;
  background: var(--mute); flex: none;
}
#state[data-open="true"]::before  { background: var(--accent); box-shadow: 0 0 10px var(--accent) }
#state[data-open="false"]::before { background: #ff5fd2 }

/* The action panel is centred, the rest of the page left-aligned; `max-width`
 * keeps centred lines short enough to read. */
.panel {
  background: var(--surf); border: 1px solid var(--rule); border-radius: 10px;
  padding: 24px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.panel > * { max-width: 46ch }

.note { display: flex; flex-direction: column; gap: 10px; margin: 0 }
.note p { margin: 0; font-size: var(--fs-15); color: var(--mute); line-height: 1.5;
          /* avoid a lone last word in centred text */
          text-wrap: pretty }
.note a { color: var(--fg) }
.note strong { color: var(--fg); font-weight: 600 }

/* The address chooser stays on the page: it appears after the modal closes,
 * next to the `#out` message. */
#accounts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 }

/* ── Wallet picker modal ───────────────────────────────────────────────────────
 * Native <dialog>: `showModal()` provides the focus trap, Esc and ::backdrop.
 * No padding on the dialog itself (`.dlg` has it), so `e.target === picker` means
 * a backdrop click. */
#picker {
  padding: 0; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--surf); color: var(--fg);
  width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
}
#picker::backdrop { background: rgba(12, 10, 18, .82) }
.dlg { padding: 20px 18px; display: flex; flex-direction: column; gap: 14px }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.dlg-head h2 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.01em; font-size: var(--fs-20); margin: 0;
}
#picker-close {
  width: 36px; height: 36px; padding: 0; flex: none;
  background: transparent; color: var(--fg); border-color: var(--rule);
  font-size: var(--fs-15);
}
#picker-close:hover:not(:disabled) { border-color: var(--accent); transform: none; box-shadow: none }

/* Vertical, full-width rows. E2E tests select `#wallets button`, so keep the
 * buttons as direct children. */
#wallets { display: flex; flex-direction: column; gap: 8px; margin: 0 }
#wallets button {
  justify-content: flex-start; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 10px;
  background: transparent; color: var(--fg); border-color: var(--rule);
  font-size: var(--fs-17);
}
#wallets button:hover:not(:disabled) {
  border-color: var(--accent); background: #ffffff08; transform: none; box-shadow: none;
}
#wallets img { border-radius: 6px; flex: none }

button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: var(--fs-15); font-weight: 600;
  padding: 13px 22px; border-radius: 999px;
  background: var(--fg); color: var(--bg); border: 1px solid var(--fg);
  cursor: pointer; transition: transform .2s, box-shadow .2s, opacity .2s;
  /* 44px touch target on phones (padding + 15px line) */
  min-height: 44px;
}
button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px #0008 }
button:disabled { opacity: .45; cursor: not-allowed; transform: none }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }

/* Address buttons are secondary to the wallet choice. */
#accounts button {
  background: transparent; color: var(--fg); border-color: var(--rule);
  font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-13);
}
#accounts button:hover:not(:disabled) { border-color: var(--accent) }

#hint { font-size: var(--fs-15); color: var(--mute); margin: 0 }
#accounts { justify-content: center }

/* `#out` is the only progress feedback, so it is larger than a hint. Centred, with
 * a top rule instead of a side accent. Not success-green: success only means the
 * entry was received; eligibility is checked afterwards. */
#out {
  font-family: var(--font-mono); font-size: var(--fs-15); line-height: 1.5;
  margin: 0; min-height: 1.5em; word-break: break-word; width: 100%;
}
#out:not(:empty) { border-top: 1px solid var(--rule); padding-top: 16px }

/* Reserves space for the Turnstile iframe so the layout does not jump; takes
 * no space while empty. */
#cf:not(:empty) { min-height: 65px }

footer {
  margin-top: auto; padding-top: 24px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: var(--fs-13); color: var(--mute);
  display: flex; flex-wrap: wrap; gap: 8px 20px;
}
footer a { color: var(--mute) }
footer a:hover { color: var(--fg) }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important }
  button:hover:not(:disabled) { transform: none }
}
