/* The Sounds Mad Society
   Mobile first: base styles are for a 360px phone, enhanced at 640px and 1024px.
   No framework, no build step. */

/* Fonts ------------------------------------------------------------------ */
/* Self-hosted from Fontsource (SIL OFL / Apache 2.0, licences alongside the files). */

@font-face {
  font-family: "IM Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/special-elite-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/special-elite-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens ----------------------------------------------------------------- */

:root {
  --void: #0E0F0D;
  --soot: #1C1E1B;
  --rule: #2A2D29;
  --rule-strong: #4A4D47;
  --parchment: #E6DDC6;
  --parchment-dim: #CFC6AF;
  --faded-ink: #9A9483;
  --ectoplasm: #8EE3A8;
  --stamp: #B5473F;

  --font-display: "IM Fell English", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-type: "Special Elite", "Courier New", Courier, monospace;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius-control: 2px;
  --radius-card: 4px;

  --gutter: 20px;
  --wrap: 1180px;
  --measure: 34em;          /* about 68 characters of body text */
  --section-space: 64px;

  --text-body: 18px;
  --text-small: 16px;
  --text-filing: 15px;
  --text-hero: 56px;
  --text-h1: 44px;
  --text-h2: 34px;
  --text-story: 26px;
  --text-sounds: 26px;

  color-scheme: dark;
}

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
    --section-space: 80px;
    --text-hero: 84px;
    --text-h1: 54px;
    --text-h2: 42px;
    --text-story: 28px;
    --text-sounds: 32px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 48px;
    --section-space: 112px;
    --text-body: 20px;
    --text-small: 17px;
    --text-filing: 16px;
    --text-hero: 120px;
    --text-h1: 64px;
    --text-h2: 52px;
    --text-story: 32px;
    --text-sounds: 40px;
  }
}

/* Base ------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.75;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-story); }

p {
  margin: 0 0 1em;
}

a {
  color: var(--ectoplasm);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}

cite {
  font-style: italic;
}

strong {
  font-weight: 600;
}

::selection {
  background: var(--ectoplasm);
  color: var(--void);
}

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

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ectoplasm);
  color: var(--void);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

.nowrap {
  white-space: nowrap;
}

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

/* Layout ----------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}
.section--ruled {
  border-top: 1px solid var(--rule);
}
.section--flush-top {
  padding-top: 0;
}
.section--page {
  padding-block: calc(var(--section-space) * 0.75) var(--section-space);
}
.section__more {
  margin: 32px 0 0;
}

.split {
  display: grid;
  gap: 48px;
}
@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
  }
  .split--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

.prose-flow > * {
  max-width: var(--measure);
}
.prose-flow > p:last-child {
  margin-bottom: 0;
}

.prose-flow > p,
.band__inner > p {
  color: var(--parchment-dim);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faded-ink);
}

/* Filing information only: case numbers, dates, categories, "filed by". */
.filing {
  font-family: var(--font-type);
  font-size: var(--text-filing);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--faded-ink);
}

.case-no {
  font-family: var(--font-type);
  color: var(--ectoplasm);
}

.story-title {
  font-size: var(--text-story);
}

.link-arrow::after {
  content: " →";
}

.placeholder {
  padding: 16px 20px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-card);
  color: var(--faded-ink);
  font-style: italic;
}

/* Header ----------------------------------------------------------------- */

.site-header {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--parchment);
  text-decoration: none;
}
.brand:hover {
  color: var(--parchment);
}
.brand__mark {
  flex: none;
  width: 40px;
  height: 40px;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.15;
}
@media (min-width: 640px) {
  .brand__name { font-size: 23px; }
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--parchment);
  text-decoration: none;
}
.nav a:hover {
  color: var(--ectoplasm);
}
.nav a[aria-current="page"] {
  color: var(--ectoplasm);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.nav--wide {
  display: none;
}

.nav--narrow summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--faded-ink);
  border-radius: var(--radius-control);
  color: var(--parchment);
  font-size: var(--text-small);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav--narrow summary::-webkit-details-marker {
  display: none;
}
.nav__toggle-icon,
.nav__toggle-icon::before,
.nav__toggle-icon::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
}
.nav__toggle-icon {
  position: relative;
}
.nav__toggle-icon::before,
.nav__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav__toggle-icon::before { top: -5px; }
.nav__toggle-icon::after { top: 5px; }

.nav--narrow[open] summary {
  border-color: var(--parchment);
}
.nav--narrow[open] .nav__toggle-icon {
  background: transparent;
}
.nav--narrow[open] .nav__toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}
.nav--narrow[open] .nav__toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav--narrow > nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--soot);
  border-bottom: 1px solid var(--rule);
}
.nav--narrow li + li {
  border-top: 1px solid var(--rule);
}
.nav--narrow a {
  min-height: 56px;
  padding-inline: var(--gutter);
  font-size: 20px;
}

@media (min-width: 720px) {
  .nav--narrow { display: none; }
  .nav--wide { display: block; }
  .nav--wide ul {
    display: flex;
    gap: 32px;
  }
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 40px 48px;
  color: var(--faded-ink);
  font-size: var(--text-small);
}
.site-footer__inner {
  display: grid;
  gap: 16px;
}
.site-footer__motto {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--parchment-dim);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (min-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: 600 var(--text-small)/1.2 var(--font-body);
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button--primary {
  background: var(--ectoplasm);
  border-color: var(--ectoplasm);
  color: var(--void);
}
.button--primary:hover {
  background: var(--parchment);
  border-color: var(--parchment);
  color: var(--void);
}
.button--secondary {
  background: transparent;
  border-color: var(--parchment);
  color: var(--parchment);
}
.button--secondary:hover {
  border-color: var(--ectoplasm);
  color: var(--ectoplasm);
}
.button--block {
  display: flex;
  width: 100%;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}
.actions .button {
  width: 100%;
}
@media (min-width: 640px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .actions .button {
    width: auto;
    min-width: 180px;
  }
  .actions--center {
    justify-content: center;
  }
}

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

.hero {
  padding-block: 40px 72px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__crest {
  position: relative;
  width: 148px;
  margin-bottom: 28px;
}
.hero__crest img {
  width: 100%;
}

/* The one moment of motion: the crest's pupil brightens once, on load.
   A dark disc sits exactly over the pupil (centre 256,262, radius 17 in the
   512 viewBox) and fades away. */
.hero__pupil {
  position: absolute;
  left: 50%;
  top: 51.172%;
  width: 6.8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--void);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: pupil-wake 2.6s ease-out 0.5s both;
  pointer-events: none;
}
@keyframes pupil-wake {
  from { opacity: 0.78; }
  to { opacity: 0; }
}

.hero__kicker {
  margin: 0 0 20px;
  letter-spacing: 0.08em;
}
.hero__sounds {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sounds);
  line-height: 1.2;
  color: var(--parchment-dim);
}
.hero__title {
  max-width: 9em;
  margin: 0.12em 0 0.22em;
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.hero__by {
  margin: 0 0 20px;
  font-size: calc(var(--text-body) + 2px);
}
.hero__when {
  max-width: 30em;
  margin: 0;
  color: var(--ectoplasm);
  letter-spacing: 0.04em;
}
.hero__past {
  max-width: var(--measure);
  margin: 0;
  color: var(--parchment-dim);
}
.hero .actions {
  width: 100%;
  max-width: 360px;
}
@media (min-width: 640px) {
  .hero { padding-block: 56px 96px; }
  .hero__crest { width: 184px; margin-bottom: 32px; }
  .hero .actions { max-width: none; }
}
@media (min-width: 1024px) {
  .hero { padding-block: 64px 120px; }
  .hero__crest { width: 216px; margin-bottom: 36px; }
  .hero__title { max-width: none; }
}

/* Performance details card ----------------------------------------------- */

.details-card {
  padding: 24px;
  background: var(--soot);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
.details-card__heading {
  margin: 0 0 8px;
  font-size: 26px;
}
.details-list {
  margin: 0 0 24px;
}
.details-list__row {
  display: grid;
  gap: 2px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-small);
  line-height: 1.5;
}
@media (min-width: 480px) {
  .details-list__row {
    grid-template-columns: 7.5em minmax(0, 1fr);
    gap: 12px;
  }
}
.details-list__row:last-child {
  border-bottom: 0;
}
.details-list dt {
  color: var(--faded-ink);
}
.details-list dd {
  margin: 0;
}
@media (min-width: 1024px) {
  .details-card { padding: 32px; }
}

/* Case cards ------------------------------------------------------------- */

.case-grid {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}
@media (min-width: 1024px) {
  .case-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.case-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--soot);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
.case-card__filing {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0 0 16px;
}
.case-card__title {
  margin: 0 0 12px;
}
.case-card__title a {
  color: var(--parchment);
  text-decoration-color: var(--rule-strong);
}
.case-card__title a:hover {
  color: var(--ectoplasm);
  text-decoration-color: currentColor;
}
.case-card__excerpt {
  color: var(--parchment-dim);
  font-size: var(--text-small);
  line-height: 1.7;
}
.case-card__filed {
  margin: auto 0 0;
  padding-top: 12px;
  font-size: 14px;
}

.case-card--sealed {
  align-items: flex-start;
  background: transparent;
  border: 1.5px dashed var(--rule-strong);
}
.case-card--sealed .seal {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
}
.case-card--sealed .case-card__filing {
  margin-bottom: 8px;
  color: var(--parchment-dim);
}
.case-card__sealed-line {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
}
.case-card__sealed-note {
  margin: 0;
  color: var(--faded-ink);
  font-size: var(--text-small);
  font-style: italic;
}

.empty-archive {
  max-width: var(--measure);
  padding: 32px 24px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius-card);
}
.empty-archive p:first-child {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.25;
}
.empty-archive p:last-child {
  margin: 0;
}

/* Share band ------------------------------------------------------------- */

.band {
  padding-block: var(--section-space);
  background: var(--soot);
  border-block: 1px solid var(--rule);
}
.band__inner > * {
  max-width: var(--measure);
  margin-inline: auto;
}
@media (min-width: 640px) {
  .band__inner {
    text-align: center;
  }
}

/* Forms ------------------------------------------------------------------ */

.field__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: var(--text-small);
}

.input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--soot);
  /* --faded-ink rather than --rule-strong: form control edges need 3:1
     contrast (WCAG 1.4.11). Faded ink is 5.5:1 on soot, 6.2:1 on void. */
  border: 1px solid var(--faded-ink);
  border-radius: var(--radius-control);
  color: var(--parchment);
  font: 400 var(--text-body)/1.4 var(--font-body);
}
.input--textarea {
  min-height: 14em;
  line-height: 1.65;
  resize: vertical;
}
.input::placeholder {
  color: var(--faded-ink);
  opacity: 1;
}
.input:focus-visible {
  border-color: var(--ectoplasm);
  outline-offset: 1px;
}

.newsletter-form__row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 640px) {
  .newsletter-form__row {
    flex-direction: row;
  }
  .newsletter-form__row .input {
    flex: 1;
  }
}

.turnstile {
  min-height: 65px;
  margin-top: 16px;
}

.newsletter .field {
  margin-bottom: 0;
}
.newsletter-form__error {
  margin-bottom: 16px;
}
.newsletter__done {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--ectoplasm);
  border-radius: var(--radius-card);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.3;
}
.newsletter-page {
  max-width: 36em;
  margin-top: 40px;
}
.narrow {
  max-width: calc(44em + 2 * var(--gutter));
}
.unsubscribe-form {
  max-width: 32em;
  margin-inline: auto;
}
.unsubscribe-form .error-summary {
  text-align: left;
}

.small-print {
  margin: 16px 0 0;
  color: var(--faded-ink);
  font-size: 15px;
  line-height: 1.6;
}

/* Story form ---------------------------------------------------------------- */

.tell {
  display: grid;
  gap: 48px;
}
.tell__intro h1 {
  max-width: 11em;
}
@media (min-width: 1024px) {
  .tell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 80px;
    align-items: start;
  }
}

.next-steps {
  margin-top: 40px;
  padding: 24px;
  background: var(--soot);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
.next-steps__heading {
  margin-bottom: 16px;
  font-size: 26px;
}
.next-steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.next-steps__list li {
  position: relative;
  padding-left: 48px;
  color: var(--parchment-dim);
  font-size: var(--text-small);
  line-height: 1.6;
  counter-increment: step;
}
.next-steps__list li + li {
  margin-top: 16px;
}
.next-steps__list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--faded-ink);
  border-radius: 50%;
  color: var(--ectoplasm);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 30px;
  text-align: center;
}

.story-form {
  padding: 24px 20px;
  background: var(--soot);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
.story-form .input {
  background: var(--void);
}
@media (min-width: 640px) {
  .story-form { padding: 40px; }
}

.field {
  margin: 0 0 28px;
}
.field__hint {
  margin: -4px 0 8px;
  color: var(--faded-ink);
  font-size: 15px;
  line-height: 1.5;
}
.field__error {
  margin: 0 0 8px;
  color: var(--parchment);
  font-weight: 600;
  font-size: var(--text-small);
  line-height: 1.5;
}
.field__error::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  background: var(--stamp);
  transform: rotate(45deg) translateY(-2px);
}
.field--error {
  padding-left: 16px;
  border-left: 3px solid var(--stamp);
}
.field--error .input {
  border-color: var(--parchment);
}

.field-pair {
  display: grid;
}
@media (min-width: 640px) {
  .field-pair {
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
}

.fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}
.fieldset > legend {
  padding: 0;
  margin-bottom: 12px;
}

.choices--radios {
  display: grid;
  gap: 4px;
}
@media (min-width: 640px) {
  .choices--radios { grid-template-columns: 1fr 1fr; gap: 4px 20px; }
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
/* Real inputs, drawn by us so their edges meet 3:1 contrast whatever the browser. */
.choice input {
  flex: none;
  display: grid;
  place-content: center;
  width: 24px;
  height: 24px;
  margin: 8px 0 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--void);
  border: 2px solid var(--faded-ink);
  cursor: pointer;
}
.choice input[type="radio"] {
  border-radius: 50%;
}
.choice input[type="checkbox"] {
  border-radius: var(--radius-control);
}
.choice input::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--ectoplasm);
  transform: scale(0);
}
.choice input[type="radio"]::before {
  border-radius: 50%;
}
.choice input[type="checkbox"]::before {
  width: 14px;
  height: 14px;
  clip-path: polygon(14% 44%, 0 58%, 40% 98%, 100% 22%, 86% 8%, 38% 70%);
}
.choice input:checked {
  border-color: var(--ectoplasm);
}
.choice input:checked::before {
  transform: scale(1);
}
.choice input:focus-visible {
  outline: 2px solid var(--ectoplasm);
  outline-offset: 3px;
}
.field--error .choice input[aria-invalid="true"] {
  border-color: var(--parchment);
}
@media (forced-colors: active) {
  .choice input { appearance: auto; -webkit-appearance: auto; }
  .choice input::before { display: none; }
}
.choice label {
  flex: 1;
  padding-block: 8px;
  min-height: 44px;
  font-size: var(--text-small);
  line-height: 1.55;
  cursor: pointer;
}
.choice--check {
  flex-wrap: wrap;
}
.choice--check + .choice--check {
  margin-top: 12px;
}
.choice--check .field__error {
  flex-basis: 100%;
}
.choice--check label {
  color: var(--parchment-dim);
}
.choice--check label strong {
  color: var(--parchment);
}

.story-form__submit {
  margin-top: 28px;
}
.story-form__submit .button {
  width: 100%;
}
@media (min-width: 640px) {
  .story-form__submit .button { width: auto; min-width: 260px; }
}
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.error-summary {
  margin-bottom: 32px;
  padding: 20px;
  border: 2px solid var(--stamp);
  border-radius: var(--radius-card);
  background: var(--void);
}
.error-summary:focus {
  outline: 2px solid var(--ectoplasm);
  outline-offset: 3px;
}
.error-summary__title {
  margin-bottom: 12px;
  font-size: 24px;
}
.error-summary__list {
  margin: 0;
  padding-left: 1.2em;
  font-size: var(--text-small);
  line-height: 1.55;
}
.error-summary__list li + li {
  margin-top: 8px;
}

/* A filed case: the confirmation page and published case files ------------- */

.file-card {
  position: relative;
  max-width: 44em;
  padding: 32px 24px;
  background: var(--soot);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}
@media (min-width: 640px) {
  .file-card { padding: 48px; }
}

/* Rubber stamp. Stamp red is 3.2:1 on soot, so it stays at 24px or larger
   to meet WCAG AA for large text. */
.stamp {
  display: inline-block;
  margin: 0 0 24px;
  padding: 4px 14px 2px;
  border: 3px solid var(--stamp);
  border-radius: var(--radius-control);
  color: var(--stamp);
  font-family: var(--font-type);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  transform-origin: left center;
}
@media (min-width: 640px) {
  .stamp {
    position: absolute;
    top: 40px;
    right: 40px;
    margin: 0;
    font-size: 32px;
    transform: rotate(-9deg);
    transform-origin: center;
  }
}

.received__case {
  margin: 0 0 12px;
  font-size: 18px;
}
.received__case .case-no {
  font-size: 30px;
  letter-spacing: 0.06em;
}
@media (min-width: 640px) {
  .received__case .case-no { font-size: 36px; }
}
.received {
  margin-inline: auto;
}
.received h1 {
  margin-bottom: 0.4em;
}

/* Case files archive ------------------------------------------------------ */

.filter {
  margin-bottom: 32px;
}
.filter__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.filter__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-control);
  color: var(--parchment-dim);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
}
.filter__link:hover {
  border-color: var(--ectoplasm);
  color: var(--ectoplasm);
}
.filter__link[aria-current="page"] {
  background: var(--ectoplasm);
  border-color: var(--ectoplasm);
  color: var(--void);
  font-weight: 600;
}

@media (min-width: 640px) {
  .case-grid--archive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .case-grid--archive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.case-card--held .held-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
}
.held-mark--large {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.pager__status {
  order: -1;
  flex-basis: 100%;
  margin: 0;
  text-align: center;
}
.pager__earlier {
  margin-left: auto;
}
@media (min-width: 640px) {
  .pager__status {
    order: 0;
    flex-basis: auto;
  }
}

/* A single case ------------------------------------------------------------ */

.case-page__back {
  margin: 0 0 24px;
  font-size: var(--text-small);
}
.case-page__back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.case-file {
  max-width: none;
  margin-bottom: 48px;
}
@media (min-width: 640px) {
  .case-file { padding-right: 260px; }
}

.filing-grid {
  display: grid;
  gap: 0;
  margin: 0;
  font-size: var(--text-filing);
}
.filing-grid__row {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 12px;
  padding-block: 8px;
  border-bottom: 1px dashed var(--rule-strong);
}
.filing-grid__row:last-child {
  border-bottom: 0;
}
.filing-grid dt {
  color: var(--faded-ink);
}
.filing-grid dd {
  margin: 0;
  color: var(--parchment);
}
.filing-grid dd.case-no {
  color: var(--ectoplasm);
}
@media (min-width: 1024px) {
  .filing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
  .filing-grid__row:nth-last-child(2):nth-child(odd) {
    border-bottom: 0;
  }
}

.case-page__story {
  max-width: var(--measure);
  margin-inline: auto;
}
.case-page__title {
  font-size: var(--text-h1);
}
.case-page__body p {
  color: var(--parchment-dim);
}

.notice-page .seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
}

.case-nav {
  border-top: 1px solid var(--rule);
}
.case-nav__inner {
  display: grid;
  gap: 12px;
  padding-block: 32px;
}
@media (min-width: 640px) {
  .case-nav__inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}
.case-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  color: var(--parchment);
  text-decoration: none;
}
.case-nav__link:hover {
  border-color: var(--ectoplasm);
}
.case-nav__link--next {
  text-align: right;
}
.case-nav__link--sealed,
.case-nav__link--held {
  border-style: dashed;
  border-color: var(--rule-strong);
}
.case-nav__title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
}
.case-nav__link--sealed .case-nav__title,
.case-nav__link--held .case-nav__title {
  color: var(--faded-ink);
  font-style: italic;
}

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

/* Inner page headings ----------------------------------------------------- */

.page-head {
  padding-block: calc(var(--section-space) * 0.75) 40px;
}
.page-head h1 {
  max-width: 14em;
  margin-bottom: 0.3em;
}
.page-head__lede {
  margin: 0;
  color: var(--parchment-dim);
  font-size: calc(var(--text-body) + 2px);
}

/* Prose pages (privacy, terms) --------------------------------------------- */

.prose {
  max-width: var(--measure);
}
.prose h1 {
  margin-bottom: 0.4em;
}
.prose h2 {
  margin-top: 1.8em;
  font-size: calc(var(--text-h2) * 0.72);
}
.prose h3 {
  margin-top: 1.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: calc(var(--text-body) + 1px);
  line-height: 1.4;
}
.prose p,
.prose li {
  color: var(--parchment-dim);
}
.prose h1 + p em:only-child {
  color: var(--faded-ink);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}
.prose li + li {
  margin-top: 0.4em;
}
.prose table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
@media (min-width: 640px) {
  .prose table { font-size: var(--text-small); }
}
.prose th,
.prose td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  hyphens: auto;
}
.prose th:last-child,
.prose td:last-child {
  padding-right: 0;
}
.prose th {
  border-bottom-color: var(--rule-strong);
  color: var(--parchment);
  font-weight: 600;
}
.prose td {
  color: var(--parchment-dim);
}

/* 404 and other notices ---------------------------------------------------- */

.notice-page__inner {
  text-align: center;
}
.notice-page__inner h1 {
  margin-inline: auto;
}
.notice-page__code {
  margin-bottom: 20px;
}
.notice-page__lede {
  color: var(--parchment-dim);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sounds);
  line-height: 1.3;
}

/* Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero__pupil {
    display: none;
  }
}
