/* musseltruth.org: a field guide to the sea vegetable */

:root {
  --paper: #f2ead8;
  --paper-light: #f8f3e7;
  --paper-deep: #e8dcc2;
  --ink: #26221d;
  --ink-soft: #5b5246;
  --ink-faint: #8f8472;
  --rule: #c2b393;
  --mussel: #26324a;
  --nacre: #6f4f80;
  --kelp: #55632f;
  --stamp-red: #9a2c22;

  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --fell: "IM Fell English", "EB Garamond", Georgia, serif;
  --fell-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;

  --measure: 40rem;
  --gutter: 16px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  overflow-x: hidden;
}
@media (min-width: 760px) {
  body { font-size: 1.2rem; }
}

a {
  color: var(--mussel);
  text-decoration-thickness: 1px;
  text-underline-offset: .15em;
}
a:hover { color: var(--nacre); }

::selection { background: #d9c9e0; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

h1, h2, h3 {
  font-family: var(--fell);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

/* ------------------------------------------------------------------ */
/* Masthead */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter) .7rem;
  border-bottom: 3px double var(--ink);
  font-family: var(--fell-sc);
  letter-spacing: .12em;
}
.masthead-name {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}
.masthead-sub {
  color: var(--ink-soft);
  font-size: .85rem;
}
@media (min-width: 760px) {
  .masthead { padding-left: 2rem; padding-right: 2rem; }
}

/* ------------------------------------------------------------------ */
/* Hero */

.hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  display: grid;
  gap: 2.5rem;
}
.eyebrow {
  font-family: var(--fell-sc);
  letter-spacing: .14em;
  color: var(--ink-soft);
  font-size: .95rem;
  margin-bottom: 1.2rem;
}
.hero h1 {
  font-size: clamp(3rem, 11vw, 6.4rem);
  line-height: .95;
  letter-spacing: -.01em;
}
.hero-aside {
  font-family: var(--fell);
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--nacre);
  margin: .35rem 0 1.6rem;
}
.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  max-width: 32rem;
}
.hero-cta {
  font-family: var(--fell-sc);
  letter-spacing: .1em;
  font-size: 1.05rem;
  margin-top: 1.8rem;
}
.hero-cta span { color: var(--ink-faint); margin: 0 .5em; }

.hero-plate {
  margin: 0;
  position: relative;
  max-width: 30rem;
  justify-self: center;
  width: 100%;
}
.hero-plate .plate-frame img { aspect-ratio: auto; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 4rem;
    padding: 4.5rem 2rem 6rem;
  }
}

/* ------------------------------------------------------------------ */
/* Plates and labels */

.plate-frame {
  border: 1px solid var(--ink-soft);
  padding: .55rem;
  background: var(--paper-light);
  box-shadow: 0 1px 0 var(--rule), 0 10px 24px -18px rgba(60, 40, 20, .5);
}
.plate-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  mix-blend-mode: multiply;
  filter: sepia(.15) contrast(1.02);
}

.specimen-label {
  background: var(--paper-light);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -5px;
  padding: .9rem 1.1rem .8rem;
  box-shadow: 0 2px 6px -2px rgba(60, 40, 20, .35);
  font-size: .95rem;
  line-height: 1.35;
}
.label-latin {
  display: block;
  font-family: var(--fell);
  font-size: 1.25rem;
  margin: 0;
}
.label-common {
  display: block;
  font-family: var(--fell-sc);
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin: 0 0 .5rem;
  font-size: .95rem;
}
.specimen-label dl {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.specimen-label dt, .specimen-label dd {
  margin: 0;
  padding: .22rem 0;
  border-bottom: 1px dotted var(--rule);
}
.specimen-label dt {
  font-family: var(--fell-sc);
  letter-spacing: .06em;
  color: var(--ink-soft);
  padding-right: .9rem;
  font-size: .85rem;
}
.specimen-label dd { font-style: italic; }

.hero-label {
  width: min(16rem, 85%);
  margin: -2.2rem 0 0 1rem;
  position: relative;
  transform: rotate(-2deg);
}
@media (min-width: 900px) {
  .hero-label {
    position: absolute;
    left: -3.5rem;
    bottom: -2.5rem;
    margin: 0;
  }
}

/* ------------------------------------------------------------------ */
/* Chapters */

.chapter {
  padding: 3.5rem var(--gutter);
  position: relative;
}
.chapter + .chapter::before {
  /* ornamental rule between chapters */
  content: "";
  display: block;
  width: min(14rem, 60%);
  height: 7px;
  margin: 0 auto 3.5rem;
  border-top: 1px solid var(--ink-soft);
  border-bottom: 1px solid var(--ink-soft);
  position: relative;
  top: -3.5rem;
  margin-bottom: 0;
}
.chapter-head {
  text-align: center;
  max-width: var(--measure);
  margin: 0 auto 2.2rem;
}
.chapter-num {
  font-family: var(--fell);
  font-size: 1.6rem;
  color: var(--nacre);
  margin: 0 0 .2rem;
}
.chapter-head h2 {
  font-size: clamp(2rem, 6vw, 2.9rem);
}
.chapter-sub {
  font-family: var(--fell);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.25rem;
  margin: .5rem 0 0;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}
.prose .intro {
  font-size: 1.2em;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

.ref {
  font-size: .62em;
  line-height: 0;
  font-variant-numeric: lining-nums;
  margin-left: .08em;
}
.ref a { text-decoration: none; color: var(--nacre); }
.ref a:hover { text-decoration: underline; }

/* Marginal notes: inline on small screens, hung in the margin on wide ones */
.marginal {
  display: block;
  font-size: .9rem;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-soft);
  margin: 1rem 0 0;
}
.marginal-mark {
  font-style: normal;
  color: var(--nacre);
  margin-right: .25em;
}
.marginal.specimen-label {
  font-style: normal;
  color: var(--ink);
  max-width: 17rem;
  margin: 1.4rem 0 .4rem auto;
  transform: rotate(1.5deg);
}
.label-row {
  display: block;
  border-top: 1px dotted var(--rule);
  padding: .2rem 0;
  font-style: italic;
}
.label-row b {
  font-family: var(--fell-sc);
  font-weight: 400;
  font-style: normal;
  letter-spacing: .06em;
  color: var(--ink-soft);
  font-size: .85rem;
  margin-right: .5rem;
}

@media (min-width: 1180px) {
  .chapter .prose { position: relative; left: -6rem; }
  .marginal {
    float: right;
    clear: right;
    width: 13rem;
    margin: .3rem -16rem 0 0;
  }
  .marginal.specimen-label {
    width: 14rem;
    margin: .3rem -17.5rem 0 0;
  }
}

.dropcap::first-letter {
  font-family: var(--fell);
  float: left;
  font-size: 4.1em;
  line-height: .8;
  padding: .08em .1em 0 0;
  color: var(--nacre);
}
.dropcap { font-size: 1.25em; }

.pull {
  font-family: var(--fell);
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  line-height: 1.3;
  text-align: center;
  color: var(--mussel);
  margin: 2.2rem auto 0;
  max-width: 30rem;
}

/* ------------------------------------------------------------------ */
/* The Lineup */

.plate-entry {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.8rem 0;
  display: grid;
  gap: 1.6rem;
  border-top: 1px solid var(--rule);
}
.prose + .plate-entry { border-top: 0; }
.plate {
  margin: 0;
  max-width: 21rem;
  width: 100%;
  justify-self: center;
}
.plate-top, .plate-bottom {
  text-align: center;
  color: var(--ink-soft);
}
.plate-top {
  font-family: var(--fell-sc);
  letter-spacing: .14em;
  font-size: .85rem;
  margin-bottom: .45rem;
}
.plate-bottom {
  font-family: var(--fell);
  font-size: 1.05rem;
  margin-top: .45rem;
}
.plate .plate-frame img { background: var(--paper-light); }
.defense .plate { max-width: 38rem; }
.plate-text h3 {
  font-size: clamp(1.8rem, 5vw, 2.3rem);
}
.trait {
  font-family: var(--fell);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--nacre);
  margin: .2rem 0 1rem;
}
.verdict {
  font-style: italic;
  margin-top: 1.3rem;
  padding-top: .8rem;
  border-top: 1px dotted var(--rule);
}
.verdict-word {
  font-family: var(--fell-sc);
  font-style: normal;
  letter-spacing: .1em;
  color: var(--kelp);
  margin-right: .3em;
}
.defense-eyebrow {
  font-family: var(--fell-sc);
  letter-spacing: .12em;
  color: var(--kelp);
  margin: 0 0 .35rem;
}
.plate-entry.defense { border-top: 3px double var(--ink-soft); }

@media (min-width: 760px) {
  .plate-entry {
    grid-template-columns: 19rem 1fr;
    gap: 3.2rem;
    align-items: center;
    padding: 3.5rem 0;
  }
  .plate-entry.flip { grid-template-columns: 1fr 19rem; }
  .plate-entry.flip .plate { order: 2; }
  .plate-entry.defense { grid-template-columns: 1fr; max-width: 40rem; gap: 2rem; }
}

/* ------------------------------------------------------------------ */
/* The Field Key */

.key-wrap {
  max-width: 44rem;
  margin: 2rem auto 0;
}
.key-choose {
  font-family: var(--fell-sc);
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: .6rem;
  text-align: center;
}
#key-specimens {
  list-style: none;
  margin: 0 0 2.4rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem .6rem;
}
#key-specimens button {
  font: inherit;
  font-family: var(--fell);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink-soft);
  border-radius: 2px 10px 10px 2px;
  padding: .3rem .95rem .3rem 1.55rem;
  position: relative;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
/* the punched hole of a specimen tag */
#key-specimens button::before {
  content: "";
  position: absolute;
  left: .55rem;
  top: 50%;
  width: .42rem;
  height: .42rem;
  margin-top: -.21rem;
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
  background: var(--paper);
}
#key-specimens button:hover { background: var(--paper-deep); }
#key-specimens button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-light);
  border-color: var(--ink);
}

.key {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1.1rem;
}
.couplet {
  position: relative;
  padding: .55rem 0 .55rem 0;
  transition: opacity .3s;
}
.couplet + .couplet { border-top: 1px dotted var(--rule); }
.lead {
  display: flex;
  align-items: baseline;
  margin: 0;
  padding: .12rem 0;
  transition: opacity .3s, color .3s;
}
.lead-num {
  flex: 0 0 2.4rem;
  font-variant-numeric: lining-nums;
  color: var(--ink-soft);
}
.lead-text { flex: 0 1 auto; }
.lead-dots {
  flex: 1 1 1.5rem;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--ink-faint);
  margin: 0 .45rem;
  transform: translateY(-.28em);
}
.lead-to {
  font-family: var(--fell-sc);
  letter-spacing: .06em;
  font-variant-numeric: lining-nums;
}
.remark {
  margin: 0 0 0 2.4rem;
  font-style: italic;
  color: var(--nacre);
}
.remark:empty { display: none; }
.remark:not(:empty) { margin-top: .25rem; }

.key.running .couplet:not(.active):not(.done) { opacity: .4; }
.couplet.skipped { opacity: .3; }
.couplet.active::before {
  /* manicule */
  content: "\261E";
  position: absolute;
  left: -2.1rem;
  top: .45rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--nacre);
}
@media (max-width: 820px) {
  .couplet.active::before { left: auto; right: 0; top: -.6rem; font-size: 1.2rem; }
}
.lead.chosen .lead-text {
  text-decoration: underline;
  text-decoration-color: var(--nacre);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}
.lead.chosen .lead-to { color: var(--nacre); }
.lead.rejected { opacity: .38; }

.key-result {
  margin: 2.4rem auto 0;
  text-align: center;
}
.result-label {
  display: inline-block;
  min-width: 15rem;
  position: relative;
  padding: 1.1rem 1.6rem 1.2rem;
  transform: rotate(-1deg);
}
.stamp {
  font-family: var(--fell-sc);
  font-size: 1.55rem;
  letter-spacing: .08em;
  border: 3px double currentColor;
  padding: .15rem .8rem;
  margin: .6rem 0 0;
  display: inline-block;
  transform: rotate(-7deg);
  mix-blend-mode: multiply;
  opacity: .88;
}
.stamp.plantae { color: var(--kelp); }
.stamp.animalia { color: var(--stamp-red); }
.key-result.show .stamp { animation: stamp-in .32s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp-in {
  from { transform: rotate(-7deg) scale(1.9); opacity: 0; }
  to { transform: rotate(-7deg) scale(1); opacity: .88; }
}
@media (prefers-reduced-motion: reduce) {
  .key-result.show .stamp { animation: none; }
}
.key-result-note {
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 1.1rem;
}
.key-noscript {
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* The Pledge */

.counter {
  text-align: center;
  margin: 0 auto 2.6rem;
}
.counter-num {
  display: block;
  font-family: var(--fell);
  font-size: clamp(3.4rem, 12vw, 5.4rem);
  line-height: 1;
  color: var(--mussel);
  font-variant-numeric: lining-nums;
}
.counter-text {
  font-family: var(--fell-sc);
  letter-spacing: .1em;
  color: var(--ink-soft);
}

.thanks {
  text-align: center;
  font-family: var(--fell);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--kelp);
  margin: -1rem auto 2.2rem;
}

.pledge-form {
  max-width: 36rem;
  margin: 0 auto;
}
.pledge-text {
  font-family: var(--fell);
  font-size: 1.3rem;
  line-height: 1.75;
}
.inline-field input {
  font: inherit;
  font-family: var(--fell);
  font-style: italic;
  color: var(--mussel);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 .2rem;
  width: 11em;
  max-width: 100%;
}
.inline-field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); opacity: 1; }
.inline-field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--nacre);
  box-shadow: 0 1px 0 var(--nacre);
}

.field { margin: 1.6rem 0 1.2rem; }
.field label {
  display: block;
  font-family: var(--fell-sc);
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: .2rem;
}
.field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-family: var(--fell);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 2rem;
  color: var(--mussel);
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 .2rem;
  resize: none;
  overflow: hidden;
  min-height: calc(2rem + 1px);
  /* ruled lines */
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(2rem - 1px), var(--rule) calc(2rem - 1px), var(--rule) 2rem);
  background-attachment: local;
}
.field-hint {
  display: block;
  font-size: .9rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: .35rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2rem;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
}
.checks input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--ink);
  background: var(--paper-light);
  display: grid;
  place-content: center;
  cursor: pointer;
}
.checks input::after {
  content: "";
  width: .8rem;
  height: .8rem;
  /* a hand-inked X */
  background:
    linear-gradient(45deg, transparent 44%, var(--mussel) 44%, var(--mussel) 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--mussel) 44%, var(--mussel) 56%, transparent 56%);
  transform: scale(0);
  transition: transform .1s;
}
.checks input:checked::after { transform: scale(1); }

.form-errors {
  margin: 1.2rem 0 0;
  color: var(--stamp-red);
  font-style: italic;
}
.form-errors p { margin: 0 0 .3rem; }

.sign-btn {
  margin-top: 1.4rem;
  font: inherit;
  font-family: var(--fell-sc);
  font-size: 1.15rem;
  letter-spacing: .12em;
  color: var(--paper-light);
  background: var(--ink);
  border: 0;
  border-radius: 1px;
  padding: .7rem 1.8rem .75rem;
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  cursor: pointer;
  transition: background-color .15s, outline-color .15s;
}
.sign-btn:hover { background: var(--mussel); outline-color: var(--mussel); }
.sign-btn:focus-visible { outline: 2px solid var(--nacre); outline-offset: 3px; }

.testimonies {
  max-width: 36rem;
  margin: 4rem auto 0;
}
.testimonies-head {
  font-family: var(--fell-sc);
  letter-spacing: .14em;
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: .7rem;
  border-bottom: 3px double var(--ink-soft);
}
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  transition: opacity .2s;
}
.ledger.fading { opacity: 0; }
.ledger li {
  padding: 1rem 0 .85rem;
  border-bottom: 1px solid var(--rule);
}
.ledger q {
  display: block;
  font-family: var(--fell);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  quotes: "\201C" "\201D";
}
.ledger .signer {
  display: block;
  text-align: right;
  font-family: var(--fell-sc);
  letter-spacing: .08em;
  font-size: .95rem;
  color: var(--ink-soft);
  margin-top: .2rem;
}
.ledger .signer::before { content: "\2014\2009"; }
.ledger li.yours q { color: var(--kelp); }
.ledger li.yours .signer::after {
  content: " (that's you)";
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0;
}
.more {
  text-align: center;
  margin-top: 1.4rem;
  font-family: var(--fell-sc);
  letter-spacing: .08em;
}

/* ------------------------------------------------------------------ */
/* Footer */

.colophon {
  margin-top: 4rem;
  background: var(--paper-deep);
  border-top: 3px double var(--ink-soft);
  padding: 3rem var(--gutter) 2.5rem;
  font-size: .95rem;
  line-height: 1.5;
}
.sources {
  max-width: 44rem;
  margin: 0 auto;
}
.sources h2 {
  font-family: var(--fell-sc);
  letter-spacing: .14em;
  font-size: 1.05rem;
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.sources ol {
  margin: 0;
  padding-left: 1.6rem;
  font-variant-numeric: lining-nums;
}
.sources li { margin-bottom: .55rem; padding-left: .2rem; }
.sources li:target { background: var(--paper-light); }
.colophon-end {
  max-width: 44rem;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}
.colophon-end p { margin-bottom: .4rem; }

/* ------------------------------------------------------------------ */
/* Credits page */

.credits .chapter-head h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
.credit {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}
.credit img {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink-soft);
  padding: .25rem;
  background: var(--paper-light);
}
.credit h2 { font-size: 1.45rem; margin-bottom: .4rem; }
.credit h2 i { color: var(--ink-soft); font-size: .85em; margin-left: .3em; }
.credit p { font-size: 1rem; margin-bottom: .5rem; }
.credit-meta {
  font-style: italic;
  color: var(--ink-soft);
}
.credits .back {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 3px double var(--ink-soft);
  font-family: var(--fell-sc);
  letter-spacing: .08em;
}
@media (min-width: 760px) {
  .credit { grid-template-columns: 7rem 1fr; gap: 1.6rem; }
}
@media (min-width: 1180px) {
  .credits .prose { left: 0; }
}
