:root {
  --ink: #1d1b17;
  --paper: #fcfbf8;
  --panel: #f4f1e9;
  --muted: #55524a;
  --hairline: rgba(29, 27, 23, 0.18);
  --accent: #6e2a28;
  --shell: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", Arial, sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shell {
  width: min(100%, calc(var(--shell) + (2 * var(--gutter))));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  min-height: 5rem;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  color: inherit;
  text-decoration: none;
}

.monogram,
.wordmark,
h1 {
  font-family: "Spectral", Georgia, serif;
  font-weight: 500;
}

.monogram {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 9px;
  font-size: 1.2rem;
  line-height: 1;
}

.wordmark {
  font-size: 1.06rem;
  letter-spacing: 0.2em;
  line-height: 1;
}

.header-label,
.back-link,
.eyebrow,
.gate-label,
.gate-status {
  font-family: "IBM Plex Mono", monospace;
}

.header-label {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.back-link {
  color: var(--muted);
  font-size: 0.76rem;
  text-underline-offset: 0.3em;
}

.gate {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: clamp(3rem, 9vw, 7rem);
}

.gate-inner {
  max-width: 51rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.title-rules {
  display: grid;
  gap: 3px;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.title-rules span:first-child {
  height: 3px;
  background: var(--accent);
}

.title-rules span:last-child {
  height: 1px;
  background: var(--hairline);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.gate-note {
  max-width: 54ch;
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
}

.gate-form {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
}

.gate-label {
  display: block;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.gate-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  font: 1rem "IBM Plex Mono", monospace;
  letter-spacing: 0.1em;
}

.gate-input:hover {
  border-color: var(--muted);
}

.gate-input:disabled {
  opacity: 0.55;
}

.gate-submit {
  min-width: 7rem;
  padding: 0.8rem 1.75rem;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  font: 600 0.78rem "Space Grotesk", Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate-submit:hover {
  opacity: 0.88;
}

.gate-submit:disabled {
  cursor: progress;
  opacity: 0.5;
}

.gate-status {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.gate-status[data-state="error"] {
  color: var(--accent);
  font-weight: 500;
}

.gate-fallback {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.gate-fallback a {
  color: var(--accent);
  text-underline-offset: 0.25em;
}

@media (max-width: 720px) {
  .header-label {
    display: none;
  }

  .back-link {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .wordmark {
    display: none;
  }

  .gate-row {
    display: grid;
  }

  .gate-submit {
    min-height: 3rem;
  }
}
