@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat.v1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000000; /* sampled edge colour of the artwork */
  --field: #121110;
  --field-focus: #181614;
  --edge: #6f6759; /* field border, 3.7:1 on black */
  --cream: #f6ecd6; /* the logo lettering */
  --soft: #b9ad95;
  --gold: #c9a15a; /* the logo ring */
  --error: #f3a391;
  --error-field: #241310;

  --sans: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* space, 4px base */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --gutter: 1.25rem;
  --radius: 10px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--black);
  color-scheme: dark;
  scrollbar-color: var(--edge) var(--black);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  caret-color: var(--gold);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold);
  color: var(--black);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: var(--s4);
  top: -4rem;
  z-index: 2;
  padding: var(--s3) var(--s4);
  background: var(--cream);
  color: var(--black);
  border-radius: var(--radius);
}

.skip:focus {
  top: var(--s4);
}

/* ---------- page: the logo, then the form, close together ---------- */

.page {
  display: grid;
  flex: 1;
  align-content: start;
  justify-items: center;
  gap: var(--s5);
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: var(--s4) var(--gutter) var(--s7);
}

.brand {
  width: min(100%, 30rem, 42svh);
}

.logo {
  width: 100%;
}

.ask {
  width: 100%;
  max-width: 28rem;
  outline: none;
}

.lost h1,
h2 {
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}

.intro {
  margin-top: var(--s2);
  color: var(--soft);
  text-align: center;
}

/* ---------- form ---------- */

form {
  margin-top: var(--s5);
}

.row {
  display: grid;
  gap: 0 var(--s3);
}

.field {
  margin-bottom: var(--s4);
}

label {
  display: block;
  margin-bottom: var(--s2);
  color: var(--soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: var(--s3) var(--s4);
  background: var(--field);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--cream);
  font: inherit;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

input {
  min-height: 3rem;
}

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

input:hover,
textarea:hover {
  border-color: var(--soft);
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  background: var(--field-focus);
  border-color: var(--gold);
}

/* Keep browser autofill inside the palette. */
input:-webkit-autofill {
  -webkit-text-fill-color: var(--cream);
  box-shadow: 0 0 0 100px var(--field) inset;
}

[aria-invalid="true"] {
  background: var(--error-field);
  border-color: var(--error);
}

.hint {
  margin-top: var(--s1);
  color: var(--soft);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.field-error,
.alert {
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 500;
}

.field-error {
  margin-top: var(--s1);
}

.field-error:empty {
  display: none;
}

/* Live regions stay in the accessibility tree while empty, so late messages are announced. */
.alert:empty,
#turnstile-error:empty {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.alert {
  margin-bottom: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--error-field);
  border: 1px solid var(--error);
  border-radius: var(--radius);
}

.turnstile {
  min-height: 65px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: var(--s2) var(--s5);
  background: var(--cream);
  border: 0;
  border-radius: var(--radius);
  color: var(--black);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}

.btn:hover {
  background: #ffffff;
}

.btn:active {
  transform: scale(0.985);
}

.btn[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.notice {
  margin-top: var(--s4);
  color: var(--soft);
  text-align: center;
}

.success {
  margin-top: var(--s5);
  padding: var(--s6) var(--s5);
  background: var(--field);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  text-align: center;
  outline: none;
}

.success h3 {
  margin-bottom: var(--s2);
  color: var(--gold);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
}

.success p {
  color: var(--soft);
}

/* ---------- footer and 404 ---------- */

.footer {
  padding: var(--s5) var(--gutter);
  color: var(--soft);
  font-size: 0.75rem;
  text-align: center;
}

.lost {
  display: grid;
  flex: 1;
  place-content: center;
  gap: var(--s4);
  max-width: 22rem;
  margin: 0 auto;
  padding: var(--s7) var(--gutter);
}

/* ---------- larger screens ---------- */

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

/* Larger screens: the logo is the hero, the form sits below it. */
@media (min-width: 960px) {
  :root {
    --gutter: 2.5rem;
  }

  .page {
    gap: var(--s6);
    padding-block: var(--s6) var(--s7);
  }

  .brand {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 78svh;
  }

  .brand picture {
    width: min(100%, 44rem, 82svh);
  }

  .ask {
    max-width: 32rem;
  }

  h2 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .logo {
    animation: settle 900ms var(--ease) both;
  }

  @keyframes settle {
    from {
      opacity: 0.001;
      transform: scale(0.975);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  input,
  textarea {
    transition: none;
  }
}
