/* DeskDude access gate.
   Same direction as the rest of the site: premium utilitarian minimalism,
   warm monochrome canvas, off-black warm ink, muted pastel feedback,
   serif headline, flat 1px-bordered card.
   Tokens mirror styles-about-rebuild.css so the gate reads as part of
   the site rather than a separate screen.
   Motion is restrained: one gentle entry, and small acknowledgements. */

@import url("/assets/fonts/local-fonts.css");

:root {
  /* warm monochrome canvas */
  --bg: #faf8f4;
  --bg-alt: #f3efe6;
  --surface: #ffffff;
  --surface-sunken: #f6f3ec;
  --border: #e6e0d2;
  --border-strong: #d8cfba;

  /* off-black warm ink, never pure black */
  --ink: #2a251d;
  --ink-muted: #726a5b;
  --ink-faint: #a89d87;
  --cream: #fbf9f4;

  /* muted pastel accents, flat and washed out */
  --pastel-sage-bg: #e7edde;
  --pastel-sage-ink: #3f5f3a;
  --pastel-clay-bg: #f4e6da;
  --pastel-clay-ink: #8a4a25;

  --glow: rgba(232, 220, 199, 0.75);

  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-quick: 160ms;
  --motion-standard: 280ms;

  color-scheme: light;
}

/* warm dark-ink canvas, never pure black, same family as the light palette */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1712;
    --bg-alt: #241e17;
    --surface: #2a231b;
    --surface-sunken: #16120d;
    --border: #3d352a;
    --border-strong: #55493a;

    --ink: #f0e9db;
    --ink-muted: #b7ab93;
    --ink-faint: #776b56;

    --pastel-sage-bg: #26311f;
    --pastel-sage-ink: #b9d1a8;
    --pastel-clay-bg: #3a281d;
    --pastel-clay-ink: #e8b795;

    --glow: rgba(58, 40, 29, 0.55);

    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.gate {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* one static warm light pool, the same idea as the hero */
body.gate::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, var(--glow) 0%, rgba(0, 0, 0, 0) 62%);
  pointer-events: none;
}

.gate-sheet {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: gate-sheet-in 540ms var(--ease) both;
}

@keyframes gate-sheet-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate-body {
  padding: 40px 34px 32px;
}

.gate-eyebrow {
  display: block;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.gate-heading {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.gate-note {
  margin: 10px 0 28px;
  font-size: 15px;
  color: var(--ink-muted);
}

.gate-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.gate-cell {
  width: 100%;
  height: 58px;
  min-width: 0;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--ink);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  caret-color: var(--ink-muted);
  transition:
    border-color var(--motion-quick) var(--ease),
    background-color var(--motion-quick) var(--ease);
}

.gate-cell:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--surface);
}

.gate-cell.is-filled {
  border-color: var(--border-strong);
  background: var(--surface);
}

.gate-feedback {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 16px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink-muted);
  transition: opacity var(--motion-quick) var(--ease);
}

/* muted pastel tag, the same chip language as the site's tags */
.gate-feedback.is-tagged {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.gate-feedback.is-error {
  background: var(--pastel-clay-bg);
  color: var(--pastel-clay-ink);
}

.gate-feedback.is-success {
  background: var(--pastel-sage-bg);
  color: var(--pastel-sage-ink);
}

.gate-submit {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--cream);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--motion-quick) var(--ease),
    opacity var(--motion-quick) var(--ease);
}

@media (prefers-color-scheme: dark) {
  .gate-submit {
    color: #1c1712;
    background: #f0e9db;
    border-color: #f0e9db;
  }

  .gate-submit:hover:not(:disabled) {
    background: #ffffff;
  }
}

.gate-submit:hover:not(:disabled) {
  background: #1f1b15;
}

.gate-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

/* a small nudge, not a shake */
.gate-sheet.is-rejected {
  animation: gate-nudge 240ms var(--ease);
}

@keyframes gate-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-3px);
  }
  70% {
    transform: translateX(3px);
  }
}

.gate-sheet.is-approved {
  animation: gate-sheet-out 420ms var(--ease) 260ms forwards;
}

@keyframes gate-sheet-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (max-width: 400px) {
  body.gate {
    padding: 16px;
  }

  .gate-body {
    padding: 30px 20px 24px;
  }

  .gate-heading {
    font-size: 29px;
  }

  .gate-cells {
    gap: 6px;
  }

  .gate-cell {
    height: 52px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-sheet,
  .gate-sheet.is-approved,
  .gate-sheet.is-rejected {
    animation: none;
  }

  .gate-cell,
  .gate-submit,
  .gate-feedback {
    transition: none;
  }
}
