/* avianvisitors.com register page.
   White ground, one ink, one narrow column. Monochrome except the error red.
   Type is the frame's voice (serif + JetBrains Mono); corners are continuous
   squircles drawn by corners.js from the border-radius set here, the same
   system as theodore.net. No dashes, no shadows, no green. */

:root {
  --bg: #ffffff;
  --ink: #1a1a1c;
  --muted: #71706b;
  --faint: #b3b1ab;
  --line: #e2e1dc;
  --red: #a53c38;
  --serif: ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: rgba(26, 26, 28, 0.10); }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(9svh, 56px) 24px 32px;
}

main {
  width: 100%; max-width: 400px;
  flex: 1 1 auto;
  display: flex; flex-direction: column;
}
main > section, main > header { width: 100%; }

/* ---- header: the family voice ---- */
.head { text-align: center; margin-bottom: 44px; }
.head .pre {
  margin: 0 0 10px;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.head h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(42px, 12vw, 54px);
  line-height: 0.95;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- the one field, with its inline arrow ---- */
.fieldrow {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.2px solid var(--line);
  border-radius: var(--r);
  /* No border-color transition: corners.js repaints the border as a squircle
     ring per state change, and a transition poisons its color read. */
}
/* Focus lifts the border toward ink without going fully dark. */
.fieldrow:focus-within { border-color: var(--muted); }
.fieldrow.bad { border-color: var(--red); }
.fieldrow.bad input { color: var(--red); }
/* A murmur, not a rattle: 2px peak, damped fast. */
.fieldrow.shake { animation: shake 300ms cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  20%, 60% { transform: translateX(-2px); }
  40%, 80% { transform: translateX(2px); }
  90% { transform: translateX(-1px); }
}

.fieldrow input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--ink);
  padding: 15px 6px 15px 18px;
  font-family: var(--serif);
  font-size: 17px;
}
.fieldrow input::placeholder { color: var(--faint); }

/* the code field speaks mono, at ticket weight */
#rail { padding-left: 18px; }
#rail .hash {
  font-family: var(--mono);
  font-size: 24px;
  color: var(--faint);
  transition: color 160ms ease;
}
#rail:focus-within .hash { color: var(--muted); }
#rail.bad .hash { color: var(--red); }
#rail input {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.32em;
  padding: 16px 6px 16px 12px;
}

/* inline arrow: the field's own way forward */
.gobtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 6px 8px 6px 0;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 160ms ease, transform 120ms ease, background-color 160ms ease;
}
.gobtn:disabled { opacity: 0.22; cursor: default; }
.gobtn:not(:disabled):hover { background: #f4f3f0; }
.gobtn:not(:disabled):active { transform: scale(0.9); }
.gobtn svg { width: 22px; height: 22px; display: block; }
.gobtn .spin { display: none; }
.gobtn.busy .arrow { display: none; }
.gobtn.busy .spin { display: block; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  margin: 18px 4px 0;
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: var(--faint);
}
.note {
  margin: 10px 4px 0;
  text-align: center;
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
}
.note:empty { display: none; }

/* ---- step two: the hello card's numbered steps, on white ---- */
.chip {
  display: block;
  width: fit-content;
  margin: 0 auto 34px;
  padding: 7px 16px;
  border: 1.2px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* Accordion steps: every section always visible, one open at a time.
   Height rides the 0fr/1fr grid trick so the browser owns the math and the
   slide stays honest whatever the section contains. */
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.step { padding: 22px 0; }
.step + .step { border-top: 1.2px solid var(--line); }

.stephead {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: start;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.stepnum {
  font-family: var(--mono);
  font-size: 42px;
  line-height: 0.9;
  margin-top: 2px;
  color: var(--faint);
  transition: color 240ms ease;
}
.step.open .stepnum { color: var(--ink); }
.steptitle { min-width: 0; }
.steptitle h2 {
  margin: 4px 0 0;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 240ms ease;
}
.step.open .steptitle h2 { color: var(--ink); }
/* the quiet summary a finished, folded section keeps */
.stepsum {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step.open .stepsum, .stepsum:empty { display: none; }

.stepwrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(.2, .7, .3, 1);
}
.step.open .stepwrap { grid-template-rows: 1fr; }
.stepbody {
  overflow: hidden;
  min-height: 0;
  margin-left: 56px;
  padding-top: 10px;
  opacity: 0;
  transition: opacity 220ms ease;
}
.step.open .stepbody { opacity: 1; }
.stepbody .sub {
  margin: 0 0 12px;
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}

/* radios: small ink circles, nothing louder */
.opt { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; cursor: pointer; position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .dot {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  border: 1.2px solid var(--faint);
  border-radius: 50%;
  position: relative;
  top: 2px;
  transition: border-color 140ms ease;
}
.opt input:checked + .dot { border-color: var(--ink); }
.opt input:checked + .dot::after {
  content: "";
  position: absolute; inset: 3.5px;
  border-radius: 50%;
  background: var(--ink);
}
.opt input:focus-visible + .dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt .opt-name { font-size: 17px; }
.opt .opt-sub { display: block; font-style: italic; font-size: 13.5px; color: var(--muted); margin-top: 1px; }

.fwrap { margin: 10px 0 4px; }
.fwrap input { font-family: var(--mono); font-size: 16px; letter-spacing: 0.04em; }
.fwrap input.serif { font-family: var(--serif); font-size: 17px; letter-spacing: 0; }

/* the finish button: outlined, mono, inverts on hover */
.bigbtn {
  width: 100%;
  margin-top: 34px;
  padding: 15px 18px;
  border: 1.2px solid var(--ink);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}
.bigbtn:not(:disabled):hover { background: var(--ink); color: var(--bg); }
.bigbtn:not(:disabled):active { transform: scale(0.985); }
.bigbtn:disabled { opacity: 0.4; cursor: default; }

/* ---- done ---- */
#step-done { text-align: center; padding-top: 8px; }
.donecheck {
  width: 64px; height: 64px;
  margin: 6px auto 30px;
  border: 1.2px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.donecheck svg { width: 30px; height: 30px; display: block; }
.donecheck .tick {
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: draw 480ms 180ms cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.donelead {
  margin: 0 auto;
  max-width: 330px;
  font-size: 21px;
  line-height: 1.45;
}
.donesub {
  margin: 18px 0 0;
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
}

/* ---- footer ---- */
.colophon {
  margin-top: auto;
  padding-top: 64px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
}
.colophon a { color: var(--faint); text-decoration: none; transition: color 140ms ease; }
.colophon a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .fieldrow.shake, .gobtn.busy .spin, .donecheck .tick { animation: none; }
  .donecheck .tick { stroke-dashoffset: 0; }
}
