/*
 * The project briefs: one question to a screen, then a name and an address.
 *
 * Shared by the three pages under /brief/. Like the privacy policy these are
 * flat documents outside the React build — nothing here scrolls, draws or
 * plays — set in the site's typeface and its black-side inks so a client who
 * arrives from a link still knows whose door they are at.
 *
 * Without JavaScript every step is simply shown, one under the other, and the
 * form posts natively. The stepping is added by `brief.js`, which puts `.js` on
 * the root before first paint.
 */

@font-face {
  font-family: 'GT Walsheim Pro';
  src: url('/fonts/GT-Walsheim-Pro-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'GT Walsheim Pro';
  src: url('/fonts/GT-Walsheim-Pro-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'GT Walsheim Pro';
  src: url('/fonts/GT-Walsheim-Pro-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --black: #000000;
  --surface: #0f0f0f;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.42);
  --headline: #dbdbdb;
  --body: #9e9e9e;
  --quiet: #6b6b6b;
  --wrong: #e0816f;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--black);
  color: var(--body);
  font-family: 'GT Walsheim Pro', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #dbdbdb; color: #000; }

:focus-visible {
  outline: 1px solid rgba(219, 219, 219, 0.7);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ frame */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 14px var(--gutter);
  background: var(--black);
}

.bar__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--body);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}
.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--headline);
  transition: width 0.5s var(--ease-out);
}

.brief {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) var(--gutter) 48px;
}

/* ------------------------------------------------------------------ steps */

.step:focus { outline: none; }

.step {
  margin: 0 0 72px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.step__count {
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--quiet);
}

.step__title {
  /* A legend will not take most layout properties; it is floated out of the
     fieldset's border box so it behaves like the heading it is. */
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  color: var(--headline);
  font-weight: 500;
  font-size: clamp(28px, 4.6vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.step__title + * { clear: both; }

.step__hint {
  margin: 0 0 32px;
  color: var(--body);
}

.options {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 18px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--headline);
  font-size: 18px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), padding 0.3s var(--ease-out);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option__key {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.option__text small {
  display: block;
  margin-top: 2px;
  color: var(--body);
  font-size: 14px;
}

/* The tick: a hairline box that fills. Round for one-of, square for any-of. */
.option__tick {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.option--one .option__tick { border-radius: 50%; }

@media (hover: hover) {
  .option:hover { background: var(--surface); padding-left: 12px; }
}

.option:has(input:focus-visible) {
  outline: 1px solid rgba(219, 219, 219, 0.7);
  outline-offset: -1px;
}

.option:has(input:checked) { background: var(--surface); }
.option:has(input:checked) .option__key { color: var(--headline); }
.option:has(input:checked) .option__tick {
  background: var(--headline);
  border-color: var(--headline);
  box-shadow: inset 0 0 0 3px var(--black);
}

/* ----------------------------------------------------------------- fields */

.fields { display: grid; gap: 28px; }

.field { display: grid; gap: 8px; }

.field label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--body);
}
.field label span { color: var(--quiet); letter-spacing: 0.1em; }

.field input,
.field textarea {
  width: 100%;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--headline);
  font: inherit;
  font-size: 22px;
  letter-spacing: -0.01em;
  caret-color: var(--headline);
  transition: border-color 0.3s var(--ease-out);
}
.field textarea { min-height: 7rem; resize: vertical; font-size: 18px; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--headline); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--headline);
  transition: background-color 600000s 0s;
}

.field__error {
  min-height: 1.2em;
  margin: 0;
  color: var(--wrong);
  font-size: 13px;
}

.privacy { margin: 8px 0 0; font-size: 13px; color: var(--quiet); }
.privacy a { color: var(--body); text-underline-offset: 0.18em; }

.honey { position: absolute; left: -9999px; }

/* --------------------------------------------------------------- controls */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid var(--headline);
  border-radius: 999px;
  background: var(--headline);
  color: var(--black);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}
.btn:hover { background: #f4f3f0; }
.btn[disabled] { opacity: 0.35; cursor: default; }
.btn[disabled]:hover { background: var(--headline); }

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--body);
  padding-left: 0;
}
.btn--ghost:hover { background: transparent; color: var(--headline); }

.form-error { margin: 16px 0 0; color: var(--wrong); font-size: 14px; }

.done { display: none; }
.done h1 {
  margin: 0 0 16px;
  color: var(--headline);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.done p { max-width: 32rem; margin: 0 0 12px; }
.done a { color: var(--headline); text-underline-offset: 0.18em; }

/* --------------------------------------------- stepped, once JS is running */

.js .step { display: none; margin: 0; }
.js .step.is-active { display: block; animation: arrive 0.5s var(--ease-out) both; }
.js .step.is-back { animation-name: arrive-back; }
.js .controls--nojs { display: none; }

.is-done .brief form { display: none; }
.is-done .done { display: block; animation: arrive 0.6s var(--ease-out) both; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes arrive-back {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 600px) {
  .option { font-size: 16px; padding-top: 16px; padding-bottom: 16px; }
  .bar__label { font-size: 10px; letter-spacing: 0.14em; }
  .field input { font-size: 20px; }
}
