:root {
  --paper: #f6f1e7;
  --ink: #1d1b16;
  --muted: #7a7466;
  --line: #cfc6b3;
  --accent: #0e8f89;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 24px 32px;
  flex: 1;
}

.mark {
  display: block;
  margin-bottom: 56px;
  /* The mark is aqua on transparent; on paper it needs to be dark. */
  filter: brightness(0.35) saturate(1.4);
}

p {
  margin: 0 0 1.3em;
}

/* The example phrases (the lead-in "It can" is plain text): a thin underline set below the text. On hover a small hand-drawn icon pops in
   after the phrase and the underline stays put. Lead-in words are never underlined. */
.ex {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
}

/* A zero-size anchor at the end of the phrase, so the icon follows the text across line breaks. */
.reaction-anchor {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0;
}

.reaction {
  position: absolute;
  bottom: 0.95em;
  left: -0.1em;
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 2px 6px rgb(29 27 22 / 0.12);
  color: var(--accent);
  pointer-events: none;
}

.reaction svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .ex:hover .reaction {
    display: flex;
    animation: pop 0.22s ease-out both;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.7) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.actions {
  margin-top: 2.2em;
}

.link,
.go {
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.link {
  padding: 0;
  border: 0;
  background: linear-gradient(transparent 90%, var(--accent) 90%);
}

.link:hover {
  color: var(--accent);
}

.early {
  margin-top: 1.6em;
}

.early label {
  display: block;
  margin-bottom: 0.4em;
  color: var(--muted);
  font-size: 15px;
}

.row {
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.go {
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
}

.go:disabled {
  opacity: 0.55;
  cursor: default;
}

.note {
  margin: 0.8em 0 0;
  color: var(--muted);
  font-size: 15px;
}

.status {
  min-height: 1.5em;
  margin: 0.6em 0 0;
  font-size: 16px;
}

.status.ok {
  color: #1f6b3a;
}

.status.err {
  color: #a3261f;
}

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

footer {
  padding: 28px 24px 36px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 480px) {
  body {
    font-size: 18px;
  }

  main {
    padding-top: 48px;
  }

  .row {
    flex-direction: column;
  }
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

footer {
  font-size: 15px;
}

footer a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
}

footer a:hover {
  text-decoration-color: var(--ink);
}

h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 600;
}

h2 {
  margin: 1.6em 0 0.3em;
  font-size: 18px;
  font-weight: 600;
}
