html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;   /* must match the iframe rule on the blog side */
  scrollbar-width: thin;
  scrollbar-color: rgb(128 128 128 / .6) transparent;
}

:root {
  --width: 860px;
  --font-main: ui-rounded, "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Quicksand", "Nunito", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-secondary: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --font-scale: .95em;

  /* light device */
  --text-color: #1c1c1f;
  --inverse: #ebebed;                  /* text on top of a --text-color fill */
  --surface: rgb(128 128 128 / .12);   /* cards, inputs */
  --line: rgb(128 128 128 / .5);       /* borders */
  --shadow: rgb(128 128 128 / .4);     /* hard offset shadows */
  --bar: color-mix(in srgb, var(--text-color) 60%, transparent);  /* accent bars, underlines */
  --ok: #1f7a45;
  --error: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #ebebed;
    --inverse: #1c1c1f;
    --ok: #5fbf8a;
    --error: #ff7b72;
  }
}

body {
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  margin: 0 auto;
  padding: 8px 6px 20px 0;   /* no left padding: lines up with the blog's text column */
  max-width: var(--width);
  text-align: left;
  background-color: transparent;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  color: var(--text-color);
}

main {
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  color: inherit;
}

h1#title {
  line-height: 1.6;
  border-bottom: dotted;
}

#title {
  display: none;
}

/* "Messages" */
h3 {
  display: inline-block;
  margin: 1.2em 0 .3em;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--bar);
  font-size: .95em;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

a {
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--bar);
}

a:hover {
  text-decoration-color: currentColor;
}

strong, b, em, i {
  color: inherit;
}

hr {
  border: 0;
  border-top: 3px dotted var(--line);
  margin: 1.2em 0;
}

code {
  font-family: monospace;
  padding: 2px 5px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  border-radius: 3px;
}

footer {
  padding: 25px 0;
  text-align: center;
}

.inline {
  width: auto !important;
}

.highlight,
.code {
  padding: 1px 15px;
  background-color: var(--surface);
  color: inherit;
  border-radius: 3px;
  margin-block-start: 1em;
  margin-block-end: 1em;
  overflow-x: auto;
}

.sr-only {
  display: none;
}

.button-link {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--bar);
  cursor: pointer;
  font: inherit;
}

.button-link:hover {
  text-decoration-color: currentColor;
}

br {
  content: "";
  margin: 2px;
  display: block;
  font-size: 24%;
}

:is(p, div, span, h4, h5):has(+ blockquote) {
  margin: 1.4em 0 .5em;
  font-size: .85em;
  line-height: 1.3;
}

:is(p, div, span, h4, h5):has(+ blockquote) a {
  font-family: var(--font-main);
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}

:is(p, div, span, h4, h5):has(+ blockquote) a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

blockquote {
  margin: 0 0 1.2em;
  padding: .9em 1.1em;
  background-color: var(--surface);
  border: 2px solid var(--line);
  border-left: 4px solid var(--bar);
  border-radius: 3px;
  box-shadow: 4px 4px 0 var(--shadow);
  color: inherit;
  font-style: italic;
}

blockquote p {
  margin: 0;
}

blockquote p + p {
  margin-top: .5em;
}

.guestbook-message-reply {
  position: relative;
  margin-left: 1.6rem;
  padding-left: 0;
  border-left: 0;
  opacity: 1;
}

.guestbook-message-reply::before {
  content: "↳";
  position: absolute;
  left: -1.3rem;
  top: .2em;
  opacity: .6;
}

.guestbook-message-reply blockquote {
  margin: 0 0 1.2em;
  padding: .9em 1.1em;
  background-color: transparent;
  border-style: dashed;
  border-left-style: solid;
  box-shadow: 3px 3px 0 var(--shadow);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-secondary);
  font-size: .95em;
  color: var(--text-color);
  background-color: var(--surface);
  border: 2px solid var(--line);
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
  color: var(--text-color);
  opacity: .5;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 3px 3px 0 var(--shadow);
}

#text {
  height: 80px;
  min-height: 60px;
  resize: vertical;
}

.guestbooks___pow-container {
  margin: .4em 0 .9em;
}

.guestbooks___pow-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .4em .9em .4em .7em;
  font-family: var(--font-main);
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 2px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease;
}

.guestbooks___pow-checkbox-label:hover,
.guestbooks___pow-checkbox-label:has(input:checked) {
  border-color: var(--text-color);
}

/* custom square checkbox with a drawn check mark */
.guestbooks___pow-checkbox-label input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  border: 2px solid var(--text-color);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.guestbooks___pow-checkbox-label input[type="checkbox"]::before {
  content: "";
  width: .6em;
  height: .6em;
  background-color: var(--text-color);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform .1s ease;
}

.guestbooks___pow-checkbox-label input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.guestbooks___pow-checkbox-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: 3px;
}

.guestbooks___pow-label-text--loading {
  opacity: .7;
}

.guestbooks___pow-label-text--verified {
  color: var(--ok);
}

.guestbooks___pow-label-text--error {
  color: var(--error);
}

#guestbooks___pow-status:not([class*="label-text"]) {
  font-size: 0;
}

#guestbooks___pow-status:not([class*="label-text"])::after {
  content: "I'm not a clanker";
  font-size: .8rem;
}

#guestbooks___pow-status[class*="verified"] {
  font-size: 0;
}

#guestbooks___pow-status[class*="verified"]::after {
  content: "Certified human";
  font-size: .8rem;
}

button[type="submit"],
input[type="submit"] {
  font-family: var(--font-main);
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-color);
  background-color: transparent;
  border: 2px solid var(--text-color);
  border-radius: 3px;
  padding: .5em 1.1em;
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}

button[type="submit"]:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}

button[type="submit"]:active:not(:disabled),
input[type="submit"]:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--shadow);
}

button[type="submit"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: 3px;
}

button[type="submit"]:disabled,
input[type="submit"]:disabled {
  opacity: .4;
  box-shadow: none;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}