/* A typed notice sitting on a sheet of used working-out paper. One column of type, pencil scribbles behind. */
:root {
  --paper: #f8f1e0;
  --ink: #1f1c18;
  --muted: #655e52;
  --line: #1f1c18;
  --field: #fffaf0;
  --pencil: #2a2724;
  --scribble-strength: 0.24;
  color-scheme: light;
  --rule: rgba(96, 134, 176, 0.3);
  --margin-rule: rgba(200, 84, 74, 0.45);
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --hand: "Reenie Beanie", "Segoe Print", "Bradley Hand", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--type); font-size: 1.0625rem; line-height: 1.6; }
[hidden] { display: none !important; }
.page { position: relative; min-height: 100vh; }
/* ruled notepad lines over the paper, with a margin line on wider screens */
.page::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.7rem - 1px), var(--rule) calc(1.7rem - 1px), var(--rule) 1.7rem);
  background-position: 0 0.9rem;
}
@media (min-width: 50rem) {
  .page::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 22.5rem); width: 1px; background: var(--margin-rule); z-index: 1; pointer-events: none; }
}

/* pencil working in the background: decoration only */
.scribbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: var(--scribble-strength); color: var(--pencil); }
.scribbles > * { position: absolute; font-family: var(--hand); font-size: 2.1rem; line-height: 1.15; white-space: nowrap; }
.scribbles s { text-decoration-thickness: 2px; }
.scribbles svg { width: 9rem; height: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

main { position: relative; max-width: 39rem; margin-inline: auto; padding: 4rem max(16px, env(safe-area-inset-right, 0px)) 4rem max(16px, env(safe-area-inset-left, 0px)); }
.notice { position: relative; padding: 1.25rem 1rem; margin-inline: -1rem; }
.notice::before { content: ""; position: absolute; inset: 0; z-index: 0; background: color-mix(in srgb, var(--paper) 86%, transparent); }
.notice > * { position: relative; z-index: 2; }
h1 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 2.5rem; }
p { margin: 0 0 1.25rem; text-wrap: pretty; }
.big { font-size: 1.5rem; line-height: 1.35; font-weight: 700; text-wrap: balance; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 2.5rem 0; }

form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.2rem; min-width: 0; }
label { font-size: 0.9rem; color: var(--muted); }
input, select {
  font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 0; padding: 0.5rem 0.6rem; width: 100%; min-width: 0;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%231f1c18' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 0.75rem auto;
}
input, select { height: 2.9rem; }
.pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 26rem) {
  main { padding-top: 2.5rem; padding-bottom: 3rem; }
  .big { font-size: 1.35rem; }
  .pair { grid-template-columns: 1fr; }
}
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button {
  font: inherit; font-weight: 700; color: var(--paper); background: var(--ink);
  border: 1px solid var(--line); border-radius: 0; padding: 0.6rem 1.1rem; cursor: pointer; justify-self: start;
}
button:hover { background: var(--paper); color: var(--ink); }
button[disabled] { opacity: 0.6; cursor: default; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.small { font-size: 0.9rem; color: var(--muted); }
.count { margin: 1.75rem 0 0; color: var(--ink); font-weight: 700; }
.count:not([hidden]) + .promise { margin-top: 0.4rem; }
.promise { margin-top: 1.75rem; }
.sign { margin-top: 2.5rem; margin-bottom: 0; }
.sign .name { display: block; font-family: var(--hand); font-size: 2.6rem; line-height: 1; color: var(--ink); margin: 0.5rem 0 0.35rem; transform: rotate(-3deg); transform-origin: left center; }
a { color: inherit; }

@media (max-width: 420px) { .pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .scribbles > .wide { display: none; }
  .scribbles > * { font-size: 1.7rem; }
  .scribbles svg { width: 6.5rem; }
}

/* the written piece on /why */
h1 a { color: inherit; text-decoration: none; }
h1 a:hover { text-decoration: underline; }
.essay p { margin-bottom: 1.4rem; }
.essay h2 { font-size: 1.0625rem; font-weight: 700; margin: 2.2rem 0 0.8rem; }
#challenge:empty { display: none; }
