/* Per-chapter adjustments. Each page sets data-ink on <main> for its chapter ink. */

[data-page="home"] .spread { margin-top: 0; }

.story-link__title em::before { content: "\2014\00a0"; color: var(--ink-3); }

.chapter-note {
  margin-top: var(--s3);
  padding: var(--s2) var(--s3);
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-2);
}

.chapter-note a { font-weight: 600; }

.prose + .meta { margin-top: var(--s3); }

.diagram { margin: var(--s3) 0 0; }
.diagram figcaption { text-align: center; color: var(--ink-3); margin-bottom: var(--s1); }
.diagram__node--core small { display: inline-block; margin-top: 0.15rem; padding: 0 0.3em; border-radius: 4px; background: var(--paper); color: var(--ink-2); }
.diagram + .chips { margin-top: var(--s3); }

.plate--photo { margin-top: var(--s3); }
.plate--photo img { mix-blend-mode: normal; aspect-ratio: 16 / 9; object-fit: cover; }

.figure-row + .plate--photo,
.browser + .plate--photo { margin-top: var(--s4); }

.vignettes .beat { padding-top: var(--s3); }
.vignettes .beat:first-child { border-top: 0; }

/* Hire Me letter */
.letter__to { color: var(--ink-2); }
fieldset.field { min-width: 0; margin-inline: 0; padding: 0; border: 0; }
fieldset.field legend { margin-bottom: 0.35rem; padding: 0; font-weight: 600; font-size: var(--text-sm); }
select.input {
  appearance: none;
  padding-right: 2.5rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 1.15rem center / 6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--ink) 50%) right 0.8rem center / 6px 6px no-repeat,
    var(--paper);
  cursor: pointer;
}
.contact-list button { cursor: pointer; font: inherit; color: inherit; }
.ending p:last-child > a:only-child { white-space: nowrap; }
.ending a .icon { display: inline-block; width: 1rem; height: 1rem; vertical-align: -0.15em; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s3);
}

/* Visitors' Book: the blank note you write on, and the board of the latest ten. */
.note-form {
  position: relative;
  margin-top: var(--s4);
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2rem);
  background:
    linear-gradient(172deg, rgb(255 255 255 / 0.3), transparent 30%),
    linear-gradient(to top left, rgb(80 60 20 / 0.14), transparent 14%),
    var(--note-yellow);
  box-shadow: 0 1px 1px rgb(2 4 10 / 0.1), 4px 18px 22px -12px rgb(2 4 10 / 0.5);
  rotate: -0.6deg;
}

.note-form__tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 128px;
  height: 28px;
  translate: -50% 0;
  rotate: -3deg;
  background: rgb(244 236 217 / 0.75);
  box-shadow: 0 1px 2px rgb(2 4 10 / 0.15);
}

.note-form .input { background: rgb(255 255 255 / 0.5); }
.note-form .input:focus { background: rgb(255 255 255 / 0.75); }
.note-form textarea.input { min-height: 7rem; font-family: var(--font-display); font-style: italic; font-size: var(--text-lg); }
.note-form__count [data-count].is-low { color: var(--terracotta-text); font-weight: 600; }

/* The honeypot: off screen for people, still in the form for bots. */
.note-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
  gap: var(--s4) var(--s3);
  margin-top: var(--s3);
  padding: var(--s4) var(--s3) var(--s3);
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  background:
    radial-gradient(circle, rgb(27 32 50 / 0.1) 1px, transparent 1.6px) 0 0 / 14px 14px,
    var(--paper-shade);
  list-style: none;
}

.board .sticky {
  min-height: 9.5rem;
  font-size: var(--text-sm);
  animation: sticky-sway 7s ease-in-out infinite var(--sway-delay, 0s);
}

.board .sticky.is-sticking { animation: sticky-in 650ms var(--ease-out) both, sticky-sway 7s ease-in-out 650ms infinite; }

.board__empty {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-style: italic;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .board .sticky,
  .board .sticky.is-sticking { animation: none; }
}

/* Gerald welcome film: portrait phone-shaped player */
.gerald-film {
  margin: var(--s3) 0 0;
  max-width: min(100%, 22rem);
}
.gerald-film video {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 1.25rem;
  background: #0d1426;
  box-shadow: 0 18px 40px rgb(14 20 36 / 0.28);
}
.gerald-film figcaption {
  margin-top: var(--s2);
  color: var(--ink-3);
  font-size: var(--text-sm);
}
