/* Ask the Quad. Copy paper on a hallway wall: colored sheets, black toner, tear-off tabs. */

@font-face {
  font-family: "Besley";
  src: url("/assets/fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --wall: #dfe4dc;
  --toner: #000;
  --paper: #fff;
  --yellow: #ffdd33;
  --pink: #ff9fc2;
  --soft: #383c37;
  --focus: #1b3fd6;
  --error: #a8001c;
  --ok: #0b5a2a;

  --display: "Besley", "Rockwell", "Roboto Slab", Georgia, serif;
  --text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;

  --gutter: 1rem;
  --measure: 40rem;
  --page: 70rem;
  --lift: 0 1px 0 rgba(0, 0, 0, 0.18), 0 14px 22px -14px rgba(0, 0, 0, 0.45);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  /* A long link or an unbroken string typed into a form must never push the page sideways. */
  overflow-wrap: break-word;
  background: var(--wall);
  color: var(--toner);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1,
h2,
h3,
legend {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.2rem + 4.6vw, 4.25rem);
  line-height: 1.02;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.55rem, 1.25rem + 1.5vw, 2.25rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

a {
  color: inherit;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.18em;
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--toner);
  color: var(--paper);
  font-weight: 700;
}

.skip-link:focus {
  top: 0.5rem;
}

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

.site-header,
main,
.footer-inner {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1rem 0.75rem;
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding-block: 0.4rem;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  font-weight: 700;
  padding-block: 0.6rem;
}

main {
  display: block;
  padding-bottom: 3rem;
}

.band {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

/* ------------------------------------------------------------ paper */

.sheet {
  background: var(--paper);
  padding: clamp(1.25rem, 0.6rem + 3vw, 2.75rem);
  box-shadow: var(--lift);
}

.sheet > :last-child {
  margin-bottom: 0;
}

.sheet-yellow {
  background: var(--yellow);
}

.sheet-pink {
  background: var(--pink);
}

.sheet-draft {
  background: transparent;
  box-shadow: none;
  border: 2px dashed var(--toner);
}

.fine {
  font-size: 0.94rem;
  color: var(--soft);
}

.sheet-yellow .fine,
.sheet-pink .fine {
  color: var(--toner);
}

.offer {
  padding: 0.75rem 1rem;
  border: 2px dashed var(--toner);
  background: var(--paper);
  max-width: 38rem;
}

.lede {
  font-size: clamp(1.12rem, 1rem + 0.7vw, 1.4rem);
  line-height: 1.4;
  max-width: 34rem;
}

/* ------------------------------------------------------------ buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--toner);
  border-radius: 6px;
  background: transparent;
  color: var(--toner);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-solid {
  background: var(--toner);
  color: var(--paper);
}

.btn-solid:hover {
  background: var(--paper);
  color: var(--toner);
}

.btn-line:hover {
  background: var(--toner);
  color: var(--paper);
}

.btn-big {
  min-height: 3.5rem;
  padding-inline: 1.75rem;
  font-size: 1.15rem;
}

.btn-small {
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
}

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

/* ------------------------------------------------------------ hero flyer */

.hero {
  margin-top: clamp(0.75rem, 3vw, 2rem);
}

.flyer {
  position: relative;
  max-width: 58rem;
  margin-inline: auto;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2)) drop-shadow(0 16px 14px rgba(0, 0, 0, 0.16));
}

/* Two strips of masking tape holding the flyer to the wall. */
.flyer::before,
.flyer::after {
  content: "";
  position: absolute;
  top: -0.7rem;
  z-index: 1;
  width: 5.25rem;
  height: 1.6rem;
  background: rgba(244, 238, 214, 0.86);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.flyer::before {
  left: 9%;
  transform: rotate(-4deg);
}

.flyer::after {
  right: 9%;
  transform: rotate(3deg);
}

.flyer-body {
  background: var(--yellow);
  padding: clamp(2.25rem, 1rem + 6vw, 4.5rem) clamp(1.25rem, 0.25rem + 5vw, 4rem) clamp(1.75rem, 1rem + 3vw, 3rem);
}

.flyer-body h1 {
  max-width: 17ch;
}

.flyer-body .btn {
  flex: 1 1 8.5rem;
}

.tabs {
  display: flex;
  gap: 2px;
  height: clamp(5.75rem, 4.5rem + 5vw, 8rem);
}

.tab {
  --turn: 0deg;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  border-top: 2px dashed rgba(0, 0, 0, 0.55);
  transform: rotate(var(--turn));
  transform-origin: 50% 0;
  animation: tab-settle 700ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.tab span {
  writing-mode: vertical-rl;
  font-size: clamp(0.62rem, 0.5rem + 0.55vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tab:nth-child(1) { --turn: -1.3deg; animation-delay: 300ms; }
.tab:nth-child(2) { --turn: 0.9deg; animation-delay: 345ms; }
.tab:nth-child(3) { --turn: -0.5deg; animation-delay: 390ms; }
.tab:nth-child(4) { --turn: 1.7deg; animation-delay: 435ms; }
.tab:nth-child(5) { --turn: -1deg; animation-delay: 480ms; }
.tab:nth-child(6) { --turn: 0.6deg; animation-delay: 525ms; }
.tab:nth-child(7) { --turn: -1.9deg; animation-delay: 570ms; }
.tab:nth-child(8) { --turn: 1.2deg; animation-delay: 615ms; }
.tab:nth-child(9) { --turn: -0.4deg; animation-delay: 660ms; }
.tab:nth-child(10) { --turn: 1.5deg; animation-delay: 705ms; }

@keyframes tab-settle {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--turn));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab {
    animation: none;
  }
}

/* ------------------------------------------------------------ home sections */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.25rem 0.75rem;
  align-items: start;
  font-size: 1.12rem;
  line-height: 1.4;
}

.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 0.9;
}

.steps-compact li {
  font-size: 1.0625rem;
  line-height: 1.5;
  grid-template-columns: 1.9rem 1fr;
}

.steps-compact li::before {
  font-size: 1.9rem;
  line-height: 1;
}

.pair {
  display: grid;
  gap: 1.5rem;
}

.pair .sheet {
  display: flex;
  flex-direction: column;
}

.pair .actions {
  margin-top: auto;
  padding-top: 1rem;
}

.stamp {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.1rem 0.6rem;
  border: 2px solid var(--toner);
  border-radius: 4px;
  font-weight: 700;
  transform: rotate(-2deg);
}

.inline-form {
  display: grid;
  gap: 0.6rem;
}

.waitlist .field {
  margin-bottom: 0.75rem;
}

.qa-list {
  display: grid;
  gap: 1.5rem 3rem;
  margin-top: 1.25rem;
}

.qa p {
  margin: 0;
  max-width: var(--measure);
}

.two-up {
  display: grid;
  gap: 2rem;
}

.plain-list {
  padding-left: 1.15rem;
}

.plain-list li {
  margin-bottom: 0.45rem;
}

/* ------------------------------------------------------------ inner pages */

.page-head {
  margin-top: clamp(0.75rem, 3vw, 2rem);
}

.page-head h1 {
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.4rem);
  max-width: 20ch;
}

.form-sheet,
.notice {
  margin-top: 1.5rem;
}

.form-sheet {
  max-width: 46rem;
}

.notice {
  max-width: 46rem;
  border-left: 0.75rem solid var(--toner);
}

.notice-inline {
  padding: 0.75rem 1rem;
  border: 2px solid var(--toner);
  font-weight: 700;
}

.prose {
  margin-top: clamp(0.75rem, 3vw, 2rem);
  max-width: 48rem;
}

.prose h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
}

.prose h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--toner);
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose p,
.prose li {
  max-width: var(--measure);
}

.prose li {
  margin-bottom: 0.3rem;
}

.updated {
  color: var(--soft);
}

.check {
  background: var(--yellow);
  color: var(--toner);
  font-weight: 700;
  padding: 0.05em 0.3em;
}

/* ------------------------------------------------------------ forms */

fieldset {
  min-width: 0;
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border: 0;
  border-top: 2px solid var(--toner);
}

legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

legend + * {
  clear: both;
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 700;
}

.field > label {
  margin-bottom: 0.3rem;
}

.optional {
  font-weight: 400;
  color: var(--soft);
}

.hint {
  margin: 0 0 0.45rem;
  font-size: 0.97rem;
  color: var(--soft);
}

input[type="text"],
input[type="email"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--toner);
  border-radius: 6px;
  background: var(--paper);
  color: var(--toner);
  font: inherit;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.6rem;
  border: 2px dashed var(--toner);
  border-radius: 6px;
  font: inherit;
}

input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--toner);
  border-radius: 6px;
  background: var(--paper);
  color: var(--toner);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.choice {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.choice input {
  width: 1.6rem;
  height: 1.6rem;
  margin: 0.05rem 0 0;
  accent-color: var(--toner);
}

.choice label {
  font-weight: 400;
  padding-block: 0.1rem;
}

.nested {
  margin-left: 2.35rem;
}

.error {
  margin: 0.4rem 0 0;
  color: var(--error);
  font-weight: 700;
}

.choice + .error,
.hint + .error,
.error-indent {
  margin: -0.35rem 0 0.85rem 2.35rem;
}

[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 2px var(--error);
}

.choice-group[aria-invalid="true"] {
  box-shadow: -4px 0 0 var(--error);
}

.choice-group:focus {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
}

.error-summary {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 3px solid var(--error);
}

.error-summary h2,
.error-summary h4 {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.15rem;
}

.error-summary a {
  color: var(--error);
  font-weight: 700;
}

.form-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  font-weight: 700;
}

.form-status:empty {
  min-height: 0;
  margin: 0;
}

.form-status[data-kind="error"] {
  color: var(--error);
}

.form-status[data-kind="ok"] {
  color: var(--ok);
}

/* Honeypot: off screen for people, present for bots. */
.hp {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------ account and admin */

.account-block,
.admin-block {
  margin-top: 2rem;
  min-width: 0;
}

.account-block h2,
.account-block h3,
.admin-block h2,
.admin-block h3 {
  overflow-wrap: anywhere;
}

.row > * {
  min-width: 0;
}

.flash {
  margin: 1.5rem 0 0;
  background: var(--paper);
  border-left-width: 0.75rem;
}

.balance-figure {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.balance-amount {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 2rem + 3vw, 3.75rem);
  line-height: 1.05;
}

.balance-bar {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: 1.4rem;
  margin: 0 0 0.9rem;
  border: 2px solid var(--toner);
  border-radius: 0;
  background: var(--paper);
  color: var(--toner);
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}

.balance-bar::-webkit-progress-bar {
  background: var(--paper);
}

.balance-bar::-webkit-progress-value {
  background: var(--toner);
}

.balance-bar::-moz-progress-bar {
  background: var(--toner);
}

.request,
.response {
  margin-top: 1rem;
}

.request h3,
.response h3 {
  font-size: 1.35rem;
}

.asked {
  margin: 1rem 0 0.2rem;
  font-weight: 700;
}

.answer {
  margin: 0 0 0.5rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--toner);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Lists of orders, students, responses and payouts. */
.rows {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  border-top: 2px solid var(--toner);
}

.row {
  display: grid;
  gap: 0.2rem 1.25rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  overflow-wrap: anywhere;
}

.row-main {
  font-weight: 700;
}

.row-meta {
  color: var(--soft);
}

.row > form,
.row > details,
.row-actions {
  grid-column: 1 / -1;
}

.row-actions {
  margin-top: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0 0.55rem;
  border: 2px solid var(--toner);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.badge[data-state="Paid"],
.badge[data-state="In progress"],
.badge[data-state="Payout due"],
.badge[data-state="Submitted"],
.badge[data-state="Follow-up asked"],
.badge[data-state="Awaiting payment"],
.badge[data-state="Waiting for email confirmation"] {
  background: var(--yellow);
}

.badge[data-state="Accepted"],
.badge[data-state="Bonus"],
.badge[data-state="Delivered"],
.badge[data-state="Active"] {
  background: var(--toner);
  color: var(--paper);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tile {
  padding: 0.9rem 1rem;
  background: var(--paper);
  box-shadow: var(--lift);
}

.tile strong {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1.1;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--toner);
}

.admin-nav a {
  padding: 0.5rem 0.1rem;
  font-weight: 700;
}

.admin-nav a[aria-current="page"] {
  padding-inline: 0.5rem;
  background: var(--toner);
  color: var(--paper);
  text-decoration: none;
}

.admin-nav-end {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

#admin-main:focus,
#account-view:focus {
  outline: none;
}

.facts {
  display: grid;
  gap: 0 1.25rem;
  margin: 0 0 1rem;
}

.facts dt {
  margin-top: 0.5rem;
  font-weight: 700;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ledger {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
}

.ledger th,
.ledger td {
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  text-align: left;
  vertical-align: top;
}

.ledger th {
  border-bottom: 2px solid var(--toner);
}

.ledger .num {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.inline-edit {
  margin-top: 1.25rem;
}

.inline-edit label {
  margin-bottom: 0.3rem;
}

.bot-check {
  margin: 1rem 0;
  min-height: 65px;
}

.summary-text {
  font-size: 1.05rem;
}

.results {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--toner);
}

.results h4 {
  margin: 1.25rem 0 0;
  font-size: 1.1rem;
}

/* Under a "how many to email" box: who will be emailed, updated as you type. */
.plan {
  margin: 0.5rem 0 0;
  font-weight: 700;
}

.field input[inputmode="numeric"] {
  max-width: 10rem;
}

.confirm {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.confirm-question {
  font-weight: 700;
}

details > summary {
  padding-block: 0.5rem;
  font-weight: 700;
  cursor: pointer;
}

.payout-form,
.follow-up form,
.student-edit[open] {
  padding: 0.25rem 0 0.5rem;
}

.empty {
  padding: 0.75rem 0;
}

input[type="number"],
input[type="search"],
input[type="datetime-local"] {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--toner);
  border-radius: 6px;
  background: var(--paper);
  color: var(--toner);
  font: inherit;
}

/* ------------------------------------------------------------ footer */

.site-footer {
  margin-top: 2rem;
  padding-block: 2rem 3rem;
  border-top: 2px solid var(--toner);
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
}

.footer-biz {
  font-style: normal;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.footer-nav a {
  padding-block: 0.6rem;
  font-weight: 700;
}

.footer-note {
  margin: 0;
  color: var(--soft);
}

/* ------------------------------------------------------------ wider screens */

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }

  .inline-form {
    grid-template-columns: minmax(0, 22rem) auto;
    justify-content: start;
  }

  .flyer-body .btn {
    flex: 0 0 auto;
  }

  .pair,
  .two-up {
    grid-template-columns: 1fr 1fr;
  }

  .qa-list {
    grid-template-columns: 1fr 1fr;
  }

  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .facts dt {
    margin-top: 0.3rem;
  }

  .facts dd {
    margin-top: 0.3rem;
  }

  .row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) auto;
    align-items: baseline;
  }
}

@media (min-width: 56rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .steps-compact {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-note {
    grid-column: 1 / -1;
  }
}
