/* fernspellingdictionary.online
   Direction: a nature-printed plate. Bradbury and Evans printed The Ferns of
   Great Britain in the 1850s by pressing real fronds into soft lead, then
   inking the plate in two colours: a green black for the plant and a rust for
   the ripe spore cases. Those two inks on a grey-green laid paper are the whole
   palette here. The signature element is the comparison plate, where a row of
   sori sits under two spellings and a filled rust one marks each letter
   position where the ear and the label disagree.
   System font stacks only. No external resource of any kind is loaded. */

:root {
  /* the bloom on an equisetum stem */
  --paper: #dfe3d8;
  --paper-lift: #eaece2;
  --paper-edge: #c3cbb9;
  /* nature-print green black */
  --ink: #172219;
  --ink-soft: #4f5c50;
  /* a living stipe */
  --rachis: #2c5943;
  /* a ripe sorus */
  --sorus: #8a3a17;
  /* lycopodium powder */
  --spore: #a3861f;
  /* the inked plate itself */
  --plate: #1a2820;
  --plate-ink: #e3e8db;
  --plate-sorus: #cf6c31;

  --font-text: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L",
    "Iowan Old Style", Georgia, serif;
  --font-ui: Candara, Optima, "Gill Sans Nova", "Gill Sans MT", "Segoe UI",
    system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono",
    monospace;

  --s-xxs: 0.66rem;
  --s-xs: 0.76rem;
  --s-sm: 0.88rem;
  --s-md: 1rem;
  --s-lg: 1.22rem;
  --s-xl: 1.55rem;
  --s-2xl: 2.05rem;
  --s-3xl: clamp(2.05rem, 5.4vw, 3.3rem);

  --gutter: 8.5rem;
  --gap: 2.4rem;
  --pad: 1.5rem;
}

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

html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--s-md);
  line-height: 1.66;
  color: var(--ink);
  background-color: var(--paper);
  /* laid paper: chain lines, almost below the threshold of seeing */
  background-image: repeating-linear-gradient(
    90deg, rgba(23, 34, 25, 0.021) 0 1px, transparent 1px 3px);
}

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--rachis);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(44, 89, 67, 0.38);
  text-underline-offset: 0.2em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease,
    text-decoration-thickness 0.18s ease;
}

a:hover {
  color: var(--sorus);
  text-decoration-color: var(--sorus);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--sorus);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--plate);
  color: var(--plate-ink);
  padding: 0.7rem 1.1rem;
  font-family: var(--font-ui);
  z-index: 10;
}

.skip:focus { left: 0.6rem; top: 0.6rem; }

/* ------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.6rem;
  max-width: 50.5rem;
  margin: 0 auto;
  padding: 1.5rem var(--pad) 1.1rem;
  border-bottom: 1px solid var(--paper-edge);
}

.wordmark {
  font-family: var(--font-ui);
  font-size: var(--s-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-lead { color: var(--rachis); }
.wordmark:hover { color: var(--sorus); }
.wordmark:hover .wordmark-lead { color: var(--sorus); }

.masthead-nav { display: flex; flex-wrap: wrap; gap: 0 1.4rem; }

.masthead-nav a {
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.masthead-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--sorus);
}

/* ---------------------------------------------------------------- sheet */

.sheet {
  position: relative;
  max-width: 50.5rem;
  margin: 0 auto;
  padding: 0 var(--pad) 4rem;
}

.block {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
  padding: 2rem 0;
}

/* the rachis: a fern's midrib, dashed the way the pinnae step off it. It runs
   only beside the annotated blocks, so it never crosses full-width content. */
.block:not(.block-wide) {
  background-image: repeating-linear-gradient(
    to bottom, rgba(44, 89, 67, 0.5) 0 9px, transparent 9px 21px);
  background-size: 1px 100%;
  background-repeat: no-repeat;
  background-origin: content-box;
  background-clip: content-box;
  background-position: calc(var(--gutter) + (var(--gap) / 2)) 0;
}

.block + .block { padding-top: 1.6rem; }

.block-wide { grid-template-columns: minmax(0, 1fr); }
.block-wide > .marginal { display: none; }

.marginal {
  margin: 0.55rem 0 0;
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  text-align: right;
  color: var(--ink-soft);
}

.block-body { min-width: 0; max-width: 38rem; }
.block-wide > .block-body { max-width: none; }

/* ------------------------------------------------------------ typography */

h1, h2, h3 { font-family: var(--font-text); font-weight: 600; }

h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: var(--s-2xl);
  line-height: 1.12;
  letter-spacing: -0.012em;
}

.hero-heading {
  font-size: var(--s-3xl);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin: 0.4rem 0 0.9rem;
}

.leaf-heading { font-size: clamp(1.7rem, 4vw, 2.4rem); max-width: 22ch; }

.specimen-heading {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5.2vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

h2 {
  position: relative;
  margin: 0 0 0.7rem;
  font-size: var(--s-lg);
  line-height: 1.25;
}

h2 a { text-decoration-color: rgba(44, 89, 67, 0.25); }

/* pinnae: each section heading steps off the rachis with a short rust tick */
.block:not(.block-wide) .tick::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: calc(var(--gap) / -2 - 0.5px);
  width: calc(var(--gap) / 2);
  height: 1px;
  background: var(--sorus);
}

.eyebrow {
  margin: 0 0 0.15rem;
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sorus);
}

.lead {
  font-size: var(--s-lg);
  line-height: 1.5;
  color: var(--ink);
  max-width: 34rem;
}

.why { max-width: 34rem; }

.gloss {
  font-family: var(--font-ui);
  font-size: var(--s-sm);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 32rem;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--sorus); }
.crumb-sep { color: var(--paper-edge); }

.verdict {
  display: inline-block;
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 2px solid var(--sorus);
  font-size: var(--s-xl);
  line-height: 1.3;
  max-width: 28ch;
}

.say-line {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono);
  font-size: var(--s-lg);
  color: var(--sorus);
  letter-spacing: -0.01em;
}

.say-key {
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin-right: 0.5rem;
}

.latin-line {
  margin: 0;
  font-style: italic;
  color: var(--ink-soft);
}

/* -------------------------------------------------- the letters of a name */

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 1.1rem 0 1.3rem;
}

.lt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 0.1rem 0.32rem 0.2rem;
  border-bottom: 2px solid var(--spore);
}

.lt-space { border-bottom-color: transparent; width: 0.7rem; }

/* ------------------------------------------------------------- the plate */

.plate {
  --cell: clamp(1.05rem, calc(56vw / var(--n)), 3rem);
  width: fit-content;
  max-width: 100%;
  margin: 1.9rem 0 0.9rem;
  padding: 1.5rem 1.3rem 1.15rem;
  background: var(--plate);
  color: var(--plate-ink);
  border-radius: 2px;
  overflow-x: auto;
}

.plate-line {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
}

.plate-line-sori { padding: 0.4rem 0; }

.plate-tag {
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  text-align: right;
  color: rgba(227, 232, 219, 0.58);
}

.glyphs {
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  justify-content: start;
}

.glyph {
  display: block;
  font-family: var(--font-mono);
  font-size: calc(var(--cell) * 0.78);
  line-height: 1.3;
  text-align: center;
  color: rgba(227, 232, 219, 0.52);
}

.glyph-off { color: var(--plate-ink); font-weight: 700; }

.glyph-gap::before,
.glyph-space::before {
  content: "";
  display: block;
  height: 2px;
  margin: 0.62em auto 0;
}

.glyph-gap::before { width: 45%; background: rgba(227, 232, 219, 0.2); }
.glyph-space::before { width: 62%; background: var(--plate-sorus); opacity: 0.8; }

.sori { align-items: center; }

.sorus {
  width: calc(var(--cell) * 0.3);
  height: calc(var(--cell) * 0.3);
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  justify-self: center;
  border: 1px solid rgba(227, 232, 219, 0.26);
}

.sorus-ripe {
  background: var(--plate-sorus);
  border-color: var(--plate-sorus);
  box-shadow: 0 0 0 3px rgba(207, 108, 49, 0.15);
}

.plate figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  margin-top: 1.05rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(227, 232, 219, 0.16);
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  letter-spacing: 0.02em;
  color: rgba(227, 232, 219, 0.66);
}

.plate figcaption b {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--plate-ink);
}

.plate figcaption .cap-class { color: var(--plate-sorus); }

.plate-note {
  max-width: 34rem;
  font-size: var(--s-sm);
  color: var(--ink-soft);
}

@keyframes ink-in {
  from { transform: scale(0.15); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.plate.animate .sorus {
  animation: ink-in 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  animation-delay: calc(var(--i) * 26ms + 80ms);
}

/* ------------------------------------------------------------- listings */

.cards {
  display: grid;
  gap: 1.6rem 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.card { border-top: 2px solid var(--ink); padding-top: 0.8rem; }

.card-title { margin: 0 0 0.4rem; font-size: var(--s-md); line-height: 1.3; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.card-text {
  font-size: var(--s-sm);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 0.8rem;
}

.card-list { list-style: none; margin: 0 0 0.9rem; padding: 0; }

.card-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.55rem;
  padding: 0.28rem 0;
  border-top: 1px solid var(--paper-edge);
}

.card-list a {
  font-family: var(--font-mono);
  font-size: var(--s-sm);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.card-list a:hover { border-bottom-color: var(--sorus); }

.card-say {
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.card-foot { margin: 0; }

.tally {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 100%;
}

.tally-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  max-width: 11rem;
}

.tally-dot {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: var(--sorus);
  opacity: 0.72;
}

.tally-num {
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.inline-names {
  font-family: var(--font-mono);
  font-size: var(--s-sm);
  margin-bottom: 0.7rem;
}

/* --------------------------------------------------------- specimen list */

.specimens { border-top: 1px solid var(--paper-edge); }

.specimen {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--paper-edge);
}

.specimen-name {
  margin: 0 0 0.15rem;
  font-family: var(--font-mono);
  font-size: var(--s-xl);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.specimen-name a { text-decoration: none; border-bottom: 2px solid transparent; }
.specimen-name a:hover { border-bottom-color: var(--sorus); }

.specimen-say {
  margin: 0 0 0.1rem;
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sorus);
}

.specimen-latin {
  margin: 0 0 0.65rem;
  font-style: italic;
  font-size: var(--s-sm);
  color: var(--ink-soft);
}

.specimen-text { font-size: var(--s-sm); margin-bottom: 0.7rem; max-width: 36rem; }

/* -------------------------------------------- recorded spellings on a name */

.rends {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  border-top: 1px solid var(--paper-edge);
}

.rend {
  display: grid;
  grid-template-columns: minmax(7.5rem, 12rem) minmax(0, 1fr);
  column-gap: 1.6rem;
  align-items: baseline;
  padding: 0.8rem 0.7rem;
  margin: 0 -0.7rem;
  border-bottom: 1px solid var(--paper-edge);
  transition: background-color 0.16s ease;
}

.rend:hover { background-color: var(--paper-lift); }

.rend-word {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: var(--s-lg);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.rend:hover .rend-word { border-bottom-color: var(--sorus); }

.rend-class {
  grid-column: 1;
  grid-row: 2;
  font-family: var(--font-ui);
  font-size: var(--s-xxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-soft);
}

.rend-answer {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  font-size: var(--s-sm);
  line-height: 1.5;
  color: var(--ink-soft);
}

.sibs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.sibs a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--s-sm);
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  text-decoration: none;
  background: var(--paper-lift);
}

.sibs a:hover { border-color: var(--sorus); background: var(--paper); }

.sister-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }

.sister-nav a {
  font-family: var(--font-ui);
  font-size: var(--s-sm);
  text-decoration: none;
  border-bottom: 1px solid var(--paper-edge);
  padding-bottom: 2px;
}

.sister-nav a:hover { border-bottom-color: var(--sorus); }

/* ------------------------------------------------------------- sitemap */

.map {
  list-style: none;
  margin: 0 0 1.9rem;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
}

.map li { break-inside: avoid; padding: 0.16rem 0; }

.map a {
  font-family: var(--font-mono);
  font-size: var(--s-sm);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.map a:hover { border-bottom-color: var(--sorus); }

.pager {
  display: flex;
  gap: 1.2rem;
  margin: 1.2rem 0 0;
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pager span { color: var(--sorus); }
.pager a { text-decoration: none; border-bottom: 1px solid var(--paper-edge); }

/* ------------------------------------------------------------- colophon */

.colophon {
  background: var(--plate);
  color: rgba(227, 232, 219, 0.72);
  margin-top: 1rem;
}

.colophon-inner {
  max-width: 50.5rem;
  margin: 0 auto;
  padding: 2.4rem var(--pad) 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 3rem;
  justify-content: space-between;
}

.colophon-note {
  margin: 0;
  max-width: 24rem;
  font-size: var(--s-sm);
  line-height: 1.55;
}

.footer-nav { display: flex; flex-direction: column; gap: 0.45rem; }

.footer-nav a {
  font-family: var(--font-ui);
  font-size: var(--s-xs);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(227, 232, 219, 0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 232, 219, 0.18);
  padding-bottom: 2px;
}

.footer-nav a:hover {
  color: #fff;
  border-bottom-color: var(--plate-sorus);
}

.colophon :focus-visible { outline-color: var(--plate-sorus); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 63rem) {
  .block:not(.block-wide) { background-image: none; }
  .block { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 0; }
  .block + .block { padding-top: 1.2rem; }
  .marginal { text-align: left; margin: 0 0 0.6rem; }
  .block-wide > .marginal { display: none; }
}

@media (max-width: 40rem) {
  :root { --pad: 1.1rem; }
  .plate { --cell: clamp(0.95rem, calc(78vw / var(--n)), 2.1rem); padding: 1.1rem 0.9rem 0.9rem; width: auto; }
  .plate-line { grid-template-columns: 3.2rem minmax(0, 1fr); column-gap: 0.6rem; }
  .plate-tag { font-size: 0.58rem; letter-spacing: 0.12em; }
  .map { columns: 1; }
  .rend { grid-template-columns: minmax(0, 1fr); }
  .rend-answer { grid-column: 1; grid-row: 3; margin-top: 0.3rem; }
  .colophon-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
