/* =========================================================
   Canto — styling
   Vibe: Italian villa by the sea • literature • arts & crafts •
         Renaissance • cozy, warm, hygge.
   ========================================================= */

:root {
  /* Palette: parchment, terracotta, olive, sea-glass, ink, gilt */
  --parchment:    #f3ead6;
  --parchment-2:  #ece1c5;
  --vellum:       #faf3df;
  --terracotta:   #b65a3c;
  --terracotta-d: #8a3f29;
  --olive:        #6f7a4a;
  --olive-d:      #4f5733;
  --sea-glass:    #6fa3a1;
  --sea-glass-d:  #3f6e6c;
  --gilt:         #b8893a;
  --ink:          #2a2218;
  --ink-soft:     #4a3f2e;
  --rule:         #b8a984;

  --serif:    "EB Garamond", "Garamond", "Iowan Old Style", "Palatino", Georgia, serif;
  --display:  "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --wordmark: "Manufacturing Consent", "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);

  /* Warm "villa" wash + subtle paper grain */
  background-color: #e9ddc1;
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(255, 233, 184, 0.55), transparent 55%),
    radial-gradient(ellipse at 88% 100%, rgba(111, 163, 161, 0.22), transparent 60%),
    radial-gradient(ellipse at 50% 30%, rgba(182, 90, 60, 0.10), transparent 65%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 2.5rem 1rem 4rem;
}

/* The "page" — a sheet of parchment with a soft deckled shadow. */
.paper {
  max-width: 760px;
  margin: 0 auto;
  background: var(--parchment);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(0,0,0,0.025) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.02) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 85%, rgba(0,0,0,0.025) 0 1px, transparent 2px);
  background-size: 120px 120px, 180px 180px, 220px 220px;
  border: 1px solid #d4c39b;
  border-radius: 6px;
  padding: 3rem clamp(1.25rem, 5vw, 3.25rem) 2.25rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 0 0 8px rgba(255, 246, 220, 0.5),
    0 24px 60px -20px rgba(60, 40, 20, 0.35),
    0 6px 18px -8px rgba(60, 40, 20, 0.25);
  position: relative;
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; margin-bottom: 2.5rem; }

.ornament {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--gilt);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.wordmark {
  font-family: var(--wordmark);
  font-weight: 400;
  font-size: clamp(4.5rem, 12vw, 7.5rem);
  color: var(--terracotta-d);
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-decoration: none;
  display: inline-block;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.wordmark:hover { color: var(--terracotta); }

.tagline {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 1.25rem;
  letter-spacing: 0.04em;
}

.rule {
  height: 14px;
  margin: 1rem auto;
  max-width: 320px;
  background:
    linear-gradient(to right, transparent 0, var(--rule) 20%, var(--rule) 80%, transparent 100%) center / 100% 1px no-repeat,
    radial-gradient(circle at 50% 50%, var(--gilt) 0 3px, transparent 4px) center / 14px 14px no-repeat;
}
.rule--small { max-width: 180px; height: 10px; opacity: 0.8; }

/* ---------- Intro ---------- */
.intro { text-align: center; margin-bottom: 2rem; }

/* Dictionary-style definition */
.definition {
  display: inline-block;
  text-align: left;
  margin: 0 auto 1.5rem;
  padding: 0.9rem 1.4rem;
  border-left: 3px solid var(--gilt);
  background: rgba(184, 137, 58, 0.07);
  border-radius: 0 3px 3px 0;
  font-family: var(--serif);
  max-width: 36em;
}
.definition dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--terracotta-d);
  margin-bottom: 0.2rem;
}
.pronunciation {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-left: 0.4rem;
}
.pronunciation--simple {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-left: 0.25rem;
}
.definition dd {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
}
.def-meta {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-right: 0.4rem;
}

.lede {
  font-family: var(--display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 36em;
  margin: 0 auto;
}

/* ---------- Card / Form ---------- */
.card {
  background: var(--vellum);
  border: 1px solid #d6c79f;
  border-radius: 4px;
  padding: 1.75rem clamp(1rem, 3vw, 1.75rem);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.5),
    0 2px 0 rgba(184, 137, 58, 0.15);
  position: relative;
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--gilt);
  opacity: 0.55;
}
.card::before { top: 6px; left: 6px;  border-right: none; border-bottom: none; }
.card::after  { bottom: 6px; right: 6px; border-left: none;  border-top: none;    }

.field { margin-bottom: 1.25rem; }
.field:last-of-type { margin-bottom: 0.5rem; }

label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--olive-d);
  margin-bottom: 0.4rem;
}

input[type="file"],
select,
textarea,
input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff8e7;
  border: 1px solid #c9b682;
  border-radius: 3px;
  padding: 0.55rem 0.7rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
select { appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--olive-d) 50%),
    linear-gradient(135deg, var(--olive-d) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

input[type="file"]:focus,
select:focus,
textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(182, 90, 60, 0.15);
  background: #fffbef;
}

textarea { resize: vertical; min-height: 3em; font-family: var(--serif); }

.help { color: var(--ink-soft); font-size: 0.92rem; margin: 0.4rem 0 0; font-style: italic; }

.error {
  display: block;
  background: #fff0ed;
  border: 2px solid var(--terracotta);
  border-left-width: 5px;
  border-radius: 3px;
  color: var(--terracotta-d);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 0.9rem;
  margin: 0.6rem 0 0;
}

/* ---------- Button: pressed wax / book-cover feel ---------- */
.btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.75rem 1.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #fff8e7;
  background: linear-gradient(180deg, var(--terracotta) 0%, var(--terracotta-d) 100%);
  border: 1px solid var(--terracotta-d);
  border-radius: 3px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.12),
    0 2px 0 rgba(0,0,0,0.10);
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.10),
    0 1px 0 rgba(0,0,0,0.08); }

.btn--ghost {
  background: transparent;
  color: var(--olive-d);
  border: 1px solid var(--olive);
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
  letter-spacing: 0.06em;
  box-shadow: none;
  margin-top: 1rem;
}
.btn--ghost:hover { background: rgba(111, 122, 74, 0.08); }

/* ---------- Result manuscript ---------- */
.eyebrow {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--sea-glass-d);
  text-align: center;
  margin: 0;
}
.manuscript {
  margin: 0 0 2rem;
  padding: 2rem clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), transparent 30%),
    var(--vellum);
  border: 1px solid #d6c79f;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}
.manuscript__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  text-align: center;
  margin: 0.25rem 0 0.5rem;
  color: var(--ink);
}
.manuscript__body {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  background: transparent;
  color: var(--ink);
  margin: 1rem 0 0;
  padding: 0;
}
/* When markdown.js has rendered into HTML, drop the pre-wrap and style the
   produced elements as a proper manuscript. */
.manuscript__body.md-rendered { white-space: normal; }
.manuscript__body.md-rendered > :first-child { margin-top: 0; }
.manuscript__body.md-rendered > :last-child  { margin-bottom: 0; }

.manuscript__body.md-rendered h1,
.manuscript__body.md-rendered h2 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--terracotta-d);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin: 1.6rem 0 0.55rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
}
.manuscript__body.md-rendered h1 { font-size: 1.95rem; }
.manuscript__body.md-rendered h2 { font-size: 1.55rem; }
.manuscript__body.md-rendered h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--olive-d);
  margin: 1.1rem 0 0.35rem;
  letter-spacing: 0.01em;
}
.manuscript__body.md-rendered h4,
.manuscript__body.md-rendered h5,
.manuscript__body.md-rendered h6 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0.9rem 0 0.3rem;
  letter-spacing: 0.02em;
}
.manuscript__body.md-rendered p {
  margin: 0.55rem 0 0.9rem;
}
/* Italicized one-line summaries the model emits between ### and body */
.manuscript__body.md-rendered h3 + p > em:only-child {
  display: block;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.manuscript__body.md-rendered ul,
.manuscript__body.md-rendered ol {
  margin: 0.4rem 0 0.9rem;
  padding-left: 1.4rem;
}
.manuscript__body.md-rendered li { margin: 0.2rem 0; }
.manuscript__body.md-rendered li > ul,
.manuscript__body.md-rendered li > ol {
  margin: 0.2rem 0 0.2rem;
}
.manuscript__body.md-rendered strong { color: var(--ink); font-weight: 700; }
.manuscript__body.md-rendered em { color: var(--ink-soft); }
.manuscript__body.md-rendered code {
  font-family: "Courier New", monospace;
  font-size: 0.92em;
  background: rgba(184, 137, 58, 0.12);
  padding: 0 0.25em;
  border-radius: 2px;
}
.manuscript__body.md-rendered blockquote {
  border-left: 3px solid var(--gilt);
  margin: 0.8rem 0;
  padding: 0.2rem 0.9rem;
  color: var(--ink-soft);
  background: rgba(184, 137, 58, 0.05);
  font-style: italic;
}
.manuscript__body.md-rendered a {
  color: var(--sea-glass-d);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Drop cap on the first paragraph only */
.manuscript__body.md-rendered > p:first-child::first-letter {
  font-family: var(--display);
  font-size: 3.4em;
  line-height: 0.85;
  float: left;
  padding: 0.15em 0.12em 0 0;
  color: var(--terracotta-d);
}

/* ---------- Transcripts ---------- */
.transcripts {
  margin-top: 1.5rem;
  font-family: var(--serif);
}
.transcripts > summary {
  cursor: pointer;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--olive-d);
  padding: 0.25rem 0;
}
.transcripts__name { margin: 0.75rem 0 0.25rem; color: var(--ink-soft); }
.transcripts__text {
  background: rgba(111, 122, 74, 0.08);
  border-left: 3px solid var(--olive);
  border-radius: 0 3px 3px 0;
  padding: 0.65rem 0.9rem;
  white-space: pre-wrap;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.error-block {
  background: #fff0ed;
  border: 2px solid var(--terracotta);
  border-left-width: 5px;
  border-radius: 3px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--terracotta-d);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(182,90,60,0.12);
}
.error-block ul { margin: 0.35rem 0 0 1.25rem; padding: 0; }

.again {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
  margin: 1.5rem 0 1rem;
}

/* ---------- Colophon ---------- */
.colophon {
  margin-top: 2rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.colophon a { color: var(--sea-glass-d); text-decoration: none; border-bottom: 1px dotted; }
.colophon a:hover { color: var(--terracotta-d); }
.colophon .dot { color: var(--gilt); margin: 0 0.4rem; }
.colophon .latin {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gilt);
  margin: 0.5rem 0 0;
  letter-spacing: 0.04em;
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  body { padding: 1rem 0.5rem 2.5rem; font-size: 18px; }
  .paper { padding: 2rem 1.1rem 1.5rem; border-radius: 4px; }
  .wordmark { font-size: 4.25rem; }
}

/* =========================================================
   Loading overlay + Canto Quest mini-game
   ========================================================= */
.canto-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 14, 6, 0.78);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  animation: canto-fade-in 0.35s ease;
}
@keyframes canto-fade-in { from { opacity: 0; } to { opacity: 1; } }

.canto-overlay__inner {
  background: var(--parchment);
  border: 1px solid #d4c39b;
  border-radius: 6px;
  padding: 1.75rem clamp(1rem, 3vw, 2rem) 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow:
    0 0 0 8px rgba(255, 246, 220, 0.35),
    0 24px 60px -10px rgba(0,0,0,0.55);
  text-align: center;
}

.canto-overlay__ornament {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--gilt);
  line-height: 1;
}
.canto-overlay__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.65rem;
  color: var(--terracotta-d);
  margin: 0.4rem 0 0.3rem;
  letter-spacing: 0.02em;
}
.canto-overlay__sub {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
}

.canto-overlay__eta {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--display);
  color: var(--olive-d);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.canto-overlay__eta-label { font-style: italic; opacity: 0.8; font-size: 0.95rem; }
.canto-overlay__eta-time {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--terracotta-d);
  font-variant-numeric: tabular-nums;
}

.canto-overlay__bar {
  width: 100%;
  height: 8px;
  background: rgba(184, 137, 58, 0.18);
  border: 1px solid #d4c39b;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.25rem 0 1rem;
}
.canto-overlay__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--terracotta) 0%, var(--gilt) 100%);
  transition: width 1s linear;
}
.canto-overlay__bar-fill.is-indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg,
    var(--terracotta) 0%, var(--gilt) 50%, var(--terracotta) 100%);
  background-size: 200% 100%;
  animation: canto-shimmer 1.6s linear infinite;
}
@keyframes canto-shimmer { from { background-position: 0 0; } to { background-position: -200% 0; } }

.canto-overlay__note {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}
.canto-overlay__games {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.canto-overlay__games a {
  color: var(--gilt);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.canto-overlay__games a:hover { border-color: var(--gilt); }

.canto-overlay__quote {
  margin: 1.4rem 0 0.6rem;
  padding: 1rem 1.2rem;
  background: rgba(243, 234, 214, 0.35);
  border-top: 1px solid rgba(184, 137, 58, 0.25);
  border-bottom: 1px solid rgba(184, 137, 58, 0.25);
  text-align: center;
}
.canto-overlay__quote-label {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gilt);
}
.canto-overlay__quote blockquote {
  margin: 0;
  font-family: var(--serif);
}
.canto-overlay__quote blockquote p {
  font-size: 1.05rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 0.3rem;
}
.canto-overlay__quote blockquote footer {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- ETA / patience table ---------- */
.eta-table {
  margin-top: 2.5rem;
  padding: 1.4rem clamp(1rem, 3vw, 1.6rem);
  background: rgba(184, 137, 58, 0.06);
  border-left: 3px solid var(--gilt);
  border-radius: 0 4px 4px 0;
}
.eta-table__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--terracotta-d);
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}
.eta-table__lede {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
  font-size: 1rem;
}
.eta-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--serif);
  font-size: 1rem;
  background: var(--vellum);
  border: 1px solid #d6c79f;
  border-radius: 3px;
  overflow: hidden;
}
.eta-table th {
  font-family: var(--display);
  font-weight: 600;
  text-align: left;
  color: var(--olive-d);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.85rem;
  background: rgba(111, 122, 74, 0.08);
  border-bottom: 1px solid #d6c79f;
}
.eta-table td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px dotted #d6c79f;
  color: var(--ink);
}
.eta-table tbody tr:last-child td { border-bottom: none; }
.eta-table tbody tr:nth-child(even) td { background: rgba(184, 137, 58, 0.04); }
.eta-table td:first-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-soft);
}
.eta-table td:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--terracotta-d);
}
.eta-table__foot {
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0.85rem 0 0;
}

/* ---------- Transcript view: cleaned/raw toggle ---------- */
.transcripts__toggle {
  display: inline-flex;
  margin: 0.6rem 0 0.4rem;
  border: 1px solid #d6c79f;
  border-radius: 4px;
  overflow: hidden;
  background: var(--vellum);
}
.transcripts__tab {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  border-right: 1px solid #d6c79f;
  transition: background-color .15s ease, color .15s ease;
}
.transcripts__tab:last-child { border-right: none; }
.transcripts__tab:hover { background: rgba(184, 137, 58, 0.08); color: var(--ink); }
.transcripts__tab.is-active {
  background: var(--terracotta-d);
  color: #fff8e7;
}
.transcripts__hint {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}
.transcripts__item {
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dotted #d6c79f;
}
.transcripts__item:last-child { border-bottom: none; }

/* ---------- Samples page ---------- */
.sample-source {
  margin: 0 0 2rem;
  padding: 1.25rem clamp(1rem, 3vw, 1.6rem);
  background: var(--vellum);
  border: 1px solid #d6c79f;
  border-left: 3px solid var(--gilt);
  border-radius: 0 4px 4px 0;
}
.sample-source__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--olive-d);
  margin: 0 0 0.4rem;
  letter-spacing: 0.04em;
}
.sample-source__name {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.sample-toc {
  margin: 1rem 0 2rem;
  padding: 0.9rem 1.2rem;
  background: rgba(184, 137, 58, 0.05);
  border: 1px dotted #d6c79f;
  border-radius: 3px;
}
.sample-toc__title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
}
.sample-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}
.sample-toc li::before {
  content: "❦";
  color: var(--gilt);
  margin-right: 0.35rem;
  font-size: 0.85em;
}
.sample-toc a {
  color: var(--terracotta-d);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
}
.sample-toc a:hover { text-decoration: underline; }

/* ---------- Upload-size readout ---------- */
.upload-summary {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-style: italic;
  color: var(--olive-d);
  font-size: 0.95rem;
}
.upload-summary--over {
  color: var(--terracotta-d);
  font-style: normal;
  font-weight: 600;
}

/* ---------- Samples page — sample cards & format switcher ---------- */
.page-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--terracotta-d);
  text-align: center;
  margin: 0 0 0.4rem;
  letter-spacing: 0.01em;
}
.note-tenet {
  margin: 1rem auto;
  max-width: 56ch;
  padding: 0.9rem 1.1rem;
  background: var(--vellum);
  border-left: 3px solid var(--olive);
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.sample-card {
  margin: 2.5rem 0;
  padding: 1.5rem clamp(1rem, 3vw, 1.8rem);
  background: var(--vellum);
  border: 1px solid #d6c79f;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(74, 63, 46, 0.08);
}
.sample-card__head { margin-bottom: 1rem; }
.sample-card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--terracotta-d);
  margin: 0.1rem 0 0.3rem;
  letter-spacing: 0.01em;
}
.sample-card__blurb {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.sample-formats {
  margin: 1.2rem 0 1rem;
  padding: 0.75rem 0.9rem;
  background: rgba(184, 137, 58, 0.06);
  border: 1px dotted #d6c79f;
  border-radius: 3px;
}
.sample-formats__label {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.sample-formats__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.sample-formats__btn {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--parchment);
  border: 1px solid #c8b888;
  border-radius: 3px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sample-formats__btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta-d);
}
.sample-formats__btn.is-active {
  background: var(--terracotta-d);
  color: var(--parchment);
  border-color: var(--terracotta-d);
}

.sample-output {
  margin-top: 0.6rem;
  background: #fff9e9;
  color: #000000;
  border: 1px solid #d6c79f;
  border-radius: 3px;
  padding: 1.25rem clamp(1rem, 2.5vw, 1.5rem);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.sample-output__label {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Plain rendering of markdown.js output inside samples — no parchment styling,
   no drop cap, no terracotta/olive headings. Just black text on white. */
.sample-output__body {
  color: #000000;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.sample-output__body.md-rendered { white-space: normal; }
.sample-output__body.md-rendered > :first-child { margin-top: 0; }
.sample-output__body.md-rendered > :last-child  { margin-bottom: 0; }
.sample-output__body.md-rendered h1,
.sample-output__body.md-rendered h2,
.sample-output__body.md-rendered h3,
.sample-output__body.md-rendered h4,
.sample-output__body.md-rendered h5,
.sample-output__body.md-rendered h6 {
  font-family: inherit;
  color: #000000;
  font-weight: 700;
  margin: 1em 0 0.4em;
  line-height: 1.25;
  border: 0;
  padding: 0;
  text-align: left;
  letter-spacing: 0;
}
.sample-output__body.md-rendered h1 { font-size: 1.5rem; }
.sample-output__body.md-rendered h2 { font-size: 1.25rem; }
.sample-output__body.md-rendered h3 { font-size: 1.1rem; }
.sample-output__body.md-rendered h4,
.sample-output__body.md-rendered h5,
.sample-output__body.md-rendered h6 { font-size: 1rem; }
.sample-output__body.md-rendered p { margin: 0.6em 0; }
.sample-output__body.md-rendered strong { color: #000000; font-weight: 700; }
.sample-output__body.md-rendered em { color: #000000; font-style: italic; }
.sample-output__body.md-rendered ul,
.sample-output__body.md-rendered ol {
  margin: 0.5em 0 0.5em 1.4em;
  padding: 0;
}
.sample-output__body.md-rendered li { margin: 0.2em 0; }
.sample-output__body.md-rendered blockquote {
  margin: 0.6em 0;
  padding: 0.2em 0 0.2em 0.9em;
  border-left: 3px solid #cccccc;
  color: #333333;
  font-style: normal;
  background: transparent;
}
.sample-output__body.md-rendered code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f4f4f4;
  color: #000000;
  padding: 0.05em 0.3em;
  border-radius: 2px;
  font-size: 0.92em;
}
.sample-output__body.md-rendered a {
  color: #0645ad;
  text-decoration: underline;
}
/* Explicitly: no drop cap on samples. */
.sample-output__body.md-rendered > p:first-child::first-letter {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  float: none;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

/* nested sample-source inside a card: reduce its outer padding so it fits */
.sample-card .sample-source {
  margin: 0;
  background: var(--parchment);
  border: 1px solid #d6c79f;
  border-left: 3px solid var(--gilt);
  padding: 1rem 1.1rem;
}
.sample-source__label {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Quote of the day (homepage epigraph) ---------- */
.epigraph {
  margin: 1.2rem auto 1.6rem;
  max-width: 56ch;
  padding: 1rem 1.2rem;
  background: var(--vellum);
  border-top: 1px solid #d6c79f;
  border-bottom: 1px solid #d6c79f;
  text-align: center;
}
.epigraph__label {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gilt);
}
.epigraph__quote {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
}
.epigraph__quote p {
  font-size: 1.15rem;
  line-height: 1.55;
  font-style: italic;
  margin: 0 0 0.4rem;
}
.epigraph__source {
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: normal;
}
.epigraph__source em {
  font-style: italic;
}
