:root {
  --paper: #ffffff;
  --ink: #1f2322;
  --soft: rgba(31, 35, 34, 0.58);
  --line: rgba(31, 35, 34, 0.24);
  --focus: #006d9f;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --column: 656px;
  --gutter: 40px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141615;
    --ink: #e7e9e7;
    --soft: rgba(231, 233, 231, 0.6);
    --line: rgba(231, 233, 231, 0.3);
    --focus: #4a8fb7;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter);
  background: var(--paper);
  color: var(--ink);
  font: 400 24px/1.32 var(--serif);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a[href]:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.top { display: flex; justify-content: space-between; align-items: flex-start; font: 13px/1 var(--sans); letter-spacing: 0; }
.top nav { display: flex; gap: 20px; padding-top: 4px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.mark img { display: block; }

.words { flex: 1; padding: 88px 0 96px; display: grid; grid-template-columns: minmax(0, var(--column)); align-content: start; }
.words > p { margin: 0 0 30px; }

/* The examples: plain words underlined, as in a sentence; the chosen one is fully underlined. */
.ex[aria-current="true"] { text-decoration-color: currentColor; }

.stage { margin: 4px 0 40px; }
.stage figure { margin: 0; }
.stage[data-chosen] figure:not([hidden]) { animation: show 0.24s ease-out; }
@keyframes show { from { opacity: 0; } }
.stage img, .stage video { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); background: #f4f4f2; }
.stage figcaption { margin-top: 12px; max-width: 60ch; font: 13px/1.45 var(--sans); letter-spacing: 0; color: var(--soft); }

.words > .go { margin-bottom: 6px; }
.go a:not([href]) { color: var(--soft); text-decoration: none; }
.fine { font: 13px/1.45 var(--sans); letter-spacing: 0; color: var(--soft); }
.words > .fine { margin: 0 0 30px; }

/* A turn in the page: the philosophy, then the invitation. */
.words > .turn { margin-top: 72px; }

.ask { display: grid; gap: 22px; margin: 6px 0 0; }
.ask label { display: grid; gap: 6px; font: 13px/1.3 var(--sans); letter-spacing: 0; color: var(--soft); }
.ask input, .ask textarea {
  width: 100%;
  padding: 2px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 24px/1.32 var(--serif);
  letter-spacing: -0.01em;
  resize: none;
  field-sizing: content;
  min-height: calc(1.32em + 10px);
}
.ask input:focus-visible, .ask textarea:focus-visible { outline: none; border-bottom: 2px solid var(--focus); padding-bottom: 7px; }
.ask button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ask button:hover { text-decoration-color: currentColor; }
.ask .fine { margin: -10px 0 0; }
.trap { position: absolute; left: -9999px; }
.thanks { display: none; }
#requested:target { display: block; }
body:has(#requested:target) .ask { display: none; }

.foot { display: flex; gap: 20px; font: 12px/1.4 var(--sans); letter-spacing: 0; color: var(--soft); }

/* Wide screens: the pictures stand beside the words and stay in view while they scroll. */
@media (min-width: 1280px) {
  .words { grid-template-columns: var(--column) minmax(0, 960px); column-gap: 80px; }
  .words > * { grid-column: 1; }
  .words > .stage { grid-column: 2; grid-row: 1 / span 16; align-self: start; position: sticky; top: 32px; margin: 6px 0 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 20px; padding-top: 18px; }
  .words { padding: 56px 0 72px; }
  .words > p { margin-bottom: 24px; }
  .words > .turn { margin-top: 56px; }
  .ask input, .ask textarea { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage[data-chosen] figure:not([hidden]) { animation: none; }
}
