/*
 * Stealth-gate cover pages (gate.html / gate-denied.html).
 *
 * The site's "Ledger" design language, inverted for an after-hours feel:
 * iron-gall ink becomes the page, ecru paper becomes the ink, and the crimson
 * double margin rule keeps its place at the left edge. Tokens mirror
 * src/styles/tokens.ts — these pages are static and load no bundle, so the
 * values are restated here.
 */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/gate-assets/fraunces-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/gate-assets/libre-franklin-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/gate-assets/libre-franklin-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/gate-assets/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

:root {
  --ink: #282216; /* iron-gall ink — here, the page */
  --paper: #f2ede1; /* ecru paper — here, the ink */
  --paper-muted: rgba(242, 237, 225, 0.62);
  --paper-faint: rgba(242, 237, 225, 0.16);
  --ruling: rgba(242, 237, 225, 0.05);
  --crimson: #a23920;
  --crimson-soft: #c77860;
  --focus: #9db1e3; /* clerk's blue, lifted for dark ground */
  --green-soft: #9dbfa8; /* banker's green, lifted for dark ground */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Libre Franklin', 'Franklin Gothic Medium', 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  background-color: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  /* Faint page ruling + a pool of lamplight — abstract, no product shown */
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(242, 237, 225, 0.07), transparent 60%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--ruling) 31px, var(--ruling) 32px);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: 8px 0 8px 36px;
  animation: settle 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The crimson double margin rule — the house signature */
.sheet::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--crimson);
}
.sheet::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 1px;
  background: var(--crimson-soft);
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crimson-soft);
  margin-bottom: 24px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.125rem, 6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hint {
  color: var(--paper-muted);
  max-width: 52ch;
  margin-bottom: 40px;
}

.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-muted);
  margin-bottom: 12px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input {
  flex: 1 1 220px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--paper);
  background: rgba(250, 247, 238, 0.06);
  border: 1px solid rgba(242, 237, 225, 0.28);
  border-radius: 2px;
}

.input.code {
  font-family: var(--font-mono);
  letter-spacing: 0.35em;
}

.input::placeholder {
  color: rgba(242, 237, 225, 0.35);
  letter-spacing: normal;
}

.input:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  padding: 12px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.btn:active {
  transform: translateY(1px); /* letterpress */
}

.btn.primary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper);
}

.btn.primary:hover {
  background: #fffef8;
}

.btn.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(242, 237, 225, 0.45);
}

.btn.ghost:hover {
  border-color: var(--paper);
}

.divider {
  height: 1px;
  background: var(--paper-faint);
  margin: 40px 0;
}

.note {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin-bottom: 12px;
}

.note.joined {
  color: var(--green-soft);
}

.note.invalid {
  color: var(--crimson-soft);
}

.body-copy {
  color: var(--paper-muted);
  max-width: 52ch;
  margin-bottom: 32px;
}

a {
  color: var(--paper);
  text-decoration-color: var(--crimson-soft);
  text-underline-offset: 3px;
}

.back {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

footer {
  margin-top: 48px;
}

.footnote {
  font-size: 0.75rem;
  color: var(--paper-muted);
}

.footnote.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  .btn {
    flex: 1 1 100%;
  }
  .sheet {
    padding-left: 24px;
  }
}
