@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --ink: #efe6d4;
  --muted: #9a907c;
  --gold: #c4a15a;
  --line: rgba(196, 161, 90, 0.35);
  --serif: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", ui-sans-serif, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

html {
  background: #000;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
  height: 100%;
}

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12vh 1.5rem 8vh;
  gap: 3.25rem;
}

.copy {
  max-width: 22rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 6.4vw, 3.35rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.invite {
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
}

form {
  width: min(28rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label span {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

input,
textarea {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 6.5rem;
}

input:focus,
textarea:focus {
  border-bottom-color: var(--gold);
}

button[type="submit"] {
  align-self: center;
  margin-top: 0.75rem;
  padding: 0.7rem 1.8rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

button[type="submit"]:hover,
button[type="submit"]:focus-visible {
  background: var(--gold);
  color: #111;
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hint,
.status {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.status.is-error {
  color: #d9a39a;
}

.status.is-ok {
  color: var(--gold);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#scratch {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  touch-action: none;
  cursor: crosshair;
  transition: opacity 0.9s ease;
}

#scratch.revealed {
  opacity: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 1fr;
  }

  .stage {
    padding-top: 8vh;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  #scratch {
    transition: none;
  }
}
