/* Daily Bard - study library, app page, legal pages, and printable resources.
   Palette comes from the app's Theme.swift so the site and app read as one
   edition. Playfair Display (display) + EB Garamond (text). No build step for
   CSS; pages are generated by scripts/build.mjs. See DESIGN.md. */

:root {
  --ivory: #F6F0E3;
  --parchment: #EFE5CF;
  --ink: #2B2318;
  --sepia: #5A4632;
  --oxblood: #6E1F1F;
  --gold: #9A7B2D;        /* rules, ornaments, large display only */
  --gold-ink: #73581A;    /* gold that passes AA as small text */
  --line: #C9B98F;
  --line-soft: #DDD0AC;
  --on-oxblood: #F6F0E3;
  --link: #6E1F1F;        /* oxblood as text; lightened in dark mode for AA */
  --mount-a: #EFE5CF;
  --mount-b: #D9C9A2;
  --shadow: 43 35 24;
  --shadow-a: 0.16;
  --max: 1120px;
  --measure: 40rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --text: "EB Garamond", Georgia, "Times New Roman", serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ivory: #201A12;
    --parchment: #2A2318;
    --ink: #EFE5CF;
    --sepia: #B9A88A;
    --oxblood: #B4494A;
    --gold: #C2A25A;
    --gold-ink: #C9AB66;
    --line: #5A4B33;
    --line-soft: #43382A;
    --on-oxblood: #FBF6EA;
    --link: #E39A93;
    --mount-a: #D8CCB0;
    --mount-b: #B9A985;
    --shadow: 0 0 0;
    --shadow-a: 0.5;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  scrollbar-color: var(--line) transparent;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: oldstyle-nums;
}

::selection { background: color-mix(in srgb, var(--gold) 38%, transparent); color: var(--ink); }

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

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1.05em; text-wrap: pretty; }

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

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--ivory); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 0.75rem; color: var(--ivory); }

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

/* Folio label: gold, tracked small capitals. Used for real metadata only
   (a passage's source, a file's type), never as a decorative kicker. */
.folio, .eyebrow {
  font-family: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-ink);
  margin: 0 0 0.9rem;
  font-variant-numeric: lining-nums;
}

/* Printer's flower, drawn (see build.mjs ORNAMENT). */
.ornament { display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--gold); margin: 0 auto; max-width: 22rem; }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line)); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 22px; height: 22px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ivory) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 7px; box-shadow: 0 1px 3px rgb(var(--shadow) / 0.25); }
.brand span { font-family: var(--display); font-size: 1.28rem; font-weight: 600; letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: 0.25rem 1.5rem; }
.nav ul { display: flex; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav a.navlink { color: var(--sepia); text-decoration: none; font-size: 1.02rem; padding: 0.5rem 0; display: block; border-bottom: 1px solid transparent; }
.nav a.navlink:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav a.navlink[aria-current] { color: var(--ink); border-bottom-color: var(--oxblood); }
.site-header .btn { padding: 0.5rem 1.1rem; font-size: 1rem; }
@media (max-width: 800px) {
  .site-header .wrap { padding-top: 0.6rem; }
  .nav { order: 3; width: 100%; }
  .nav ul { width: 100%; justify-content: space-between; gap: 0.25rem 0.75rem; border-top: 1px solid var(--line-soft); }
  .nav a.navlink { font-size: 0.98rem; padding: 0.55rem 0 0.5rem; }
}
@media (max-width: 360px) { .nav a.navlink { font-size: 0.9rem; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--text); font-size: 1.06rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2;
  padding: 0.78rem 1.5rem; border-radius: 10px; min-height: 44px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.btn-primary { background: var(--oxblood); color: var(--on-oxblood); box-shadow: 0 2px 10px rgb(110 31 31 / 0.28); }
.btn-primary:hover { color: var(--on-oxblood); transform: translateY(-1px); box-shadow: 0 8px 20px rgb(110 31 31 / 0.34); text-decoration: none; }
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgb(110 31 31 / 0.3); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--parchment); color: var(--ink); border-color: var(--sepia); }
.btn small { font-size: 0.72rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn-row { display: flex; align-items: center; gap: 0.9rem 1rem; flex-wrap: wrap; }
.textlink { font-weight: 600; white-space: nowrap; }
.textlink::after { content: "\00a0\2192"; }

/* ---------- Plate mount: the app's bevelled engraving frame ---------- */
.mount {
  margin: 0; border-radius: 6px; padding: 9px;
  background: linear-gradient(160deg, var(--mount-a), var(--mount-b));
  box-shadow: 0 22px 50px -22px rgb(var(--shadow) / calc(var(--shadow-a) * 2.2)), 0 2px 6px -2px rgb(var(--shadow) / var(--shadow-a));
}
.mount img { border-radius: 3px; width: 100%; aspect-ratio: 800 / 1131; object-fit: cover; }
.mount.sm { padding: 4px; border-radius: 4px; box-shadow: 0 4px 10px -4px rgb(var(--shadow) / calc(var(--shadow-a) * 1.6)); }
.mount.sm img { border-radius: 2px; }
.mount.square img { aspect-ratio: 1; }

/* ---------- Section rhythm ---------- */
section { padding: 4.5rem 0; }
.section-head { max-width: 44rem; margin: 0 0 2.6rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.35em; }
.section-head p { color: var(--sepia); font-size: 1.22rem; margin: 0; max-width: 38rem; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head.center p { margin: 0 auto; }
.rule { border: 0; height: 1px; background: var(--line); margin: 0; }
.tinted { background: var(--parchment); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Home: the annotated leaf ---------- */
.hero { padding: 4rem 0 4.5rem; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr); gap: 3.5rem; align-items: start; }
.hero-copy { padding-top: 1.2rem; }
.hero h1 { font-size: clamp(2.7rem, 5.6vw, 4.3rem); margin-bottom: 0.38em; letter-spacing: -0.02em; }
.hero .lede { font-size: 1.32rem; color: var(--sepia); max-width: 31ch; margin: 0 0 1.8rem; }
.hero-note { margin: 1.3rem 0 0; color: var(--sepia); font-size: 1.02rem; font-style: italic; max-width: 36ch; }

.leaf { display: grid; grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.leaf-plate { transform: rotate(-1.2deg); margin-top: 0.6rem; }
.leaf-sheet { perspective: 1600px; }
.leaf-flip { display: grid; transition: transform 0.8s var(--ease); transform-style: preserve-3d; }
.leaf-face {
  grid-area: 1 / 1; background: var(--parchment); border-radius: 4px; padding: 1.7rem 1.6rem 1.4rem;
  box-shadow: 0 18px 44px -24px rgb(var(--shadow) / calc(var(--shadow-a) * 2.4)), 0 1px 3px rgb(var(--shadow) / var(--shadow-a));
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column;
}
.leaf-verse { font-family: var(--display); font-size: clamp(1.1rem, 1.42vw, 1.26rem); line-height: 1.6; margin: 0; }
.leaf-verse .vl { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.leaf-verse sup, .marginalia .key {
  font-family: var(--text); font-style: italic; font-weight: 600; color: var(--link); font-size: 0.62em; margin-left: 0.12em;
}
.leaf-gloss { font-size: clamp(1.2rem, 1.6vw, 1.38rem); line-height: 1.55; margin: 0; }
.leaf-foot { margin-top: auto; padding-top: 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--sepia); font-size: 0.95rem; font-style: italic; }
.leaf-back { margin-top: 1rem; }
.leaf-turn {
  font: inherit; font-style: normal; font-weight: 600; font-size: 1rem; color: var(--link); background: none; border: 0; padding: 0.5rem 0; cursor: pointer;
  display: none; align-items: center; gap: 0.45rem; min-height: 44px;
}
.leaf-turn svg { width: 1.1em; height: 1.1em; transition: transform 0.5s var(--ease); }
.leaf-turn:hover svg { transform: rotate(180deg); }
.js .leaf-turn { display: inline-flex; }
.js .leaf-back { margin-top: 0; transform: rotateY(180deg); }
.js .leaf.turned .leaf-flip { transform: rotateY(-180deg); }

.marginalia { list-style: none; margin: 1.6rem 0 0; padding: 1.1rem 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; font-size: 1.02rem; line-height: 1.42; color: var(--sepia); }
.marginalia li { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; }
.marginalia .key { font-size: 1rem; margin: 0; }
.marginalia a { font-weight: 600; }

/* ---------- Home: reader routes (a prospectus, not cards) ---------- */
.routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.route { padding: 2rem 2rem 2.1rem; border-left: 1px solid var(--line); }
.route:first-child { border-left: 0; padding-left: 0; }
.route:last-child { padding-right: 0; }
.route h3 { font-size: 1.6rem; margin-bottom: 0.4em; }
.route p { color: var(--sepia); margin-bottom: 1rem; }
.route ul { list-style: none; margin: 0; padding: 0; }
.route li { padding: 0.5rem 0; border-top: 1px solid var(--line-soft); }
.route li a { text-decoration: none; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; }
.route li a::after { content: "\2192"; font-weight: 400; transition: transform 0.25s var(--ease); }
.route li a:hover::after { transform: translateX(4px); }

/* ---------- Catalogue ledger (plays, downloads) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger > li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 0.4rem 1.4rem; align-items: center; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.ledger h3 { font-size: 1.5rem; margin: 0; }
.ledger h3 a { color: var(--ink); text-decoration: none; }
.ledger h3 a:hover { color: var(--link); }
.ledger .hook { color: var(--sepia); margin: 0.1rem 0 0; font-size: 1.08rem; }
.ledger .links { display: flex; gap: 0.3rem 1.3rem; flex-wrap: wrap; font-size: 1.02rem; justify-content: flex-end; }
.ledger .links a { white-space: nowrap; }
.pdf-tag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; color: var(--gold-ink); border: 1px solid var(--line); border-radius: 4px; padding: 0.05rem 0.3rem; margin-left: 0.35rem; vertical-align: 0.12em; font-variant-numeric: lining-nums; text-decoration: none; display: inline-block; }

/* ---------- Contents list with leaders (quote essays) ---------- */
.contents { list-style: none; margin: 0; padding: 0; }
.contents li { border-bottom: 1px solid var(--line-soft); }
.contents a { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.7rem 0; text-decoration: none; color: var(--ink); }
.contents .t { font-family: var(--display); font-size: 1.3rem; font-style: italic; }
.contents .dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-0.25em); min-width: 1.5rem; }
.contents .w { color: var(--sepia); font-size: 1rem; white-space: nowrap; }
.contents a:hover .t { color: var(--link); }

.lines { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 3.5rem; align-items: start; }
.feature { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.feature h3 { font-size: 1.9rem; font-style: italic; margin-bottom: 0.3em; }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a:hover { color: var(--link); }
.feature p { color: var(--sepia); }

/* Quote index: a gallery of plates with their lines */
.plates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.6rem 1.8rem; }
.plates a { text-decoration: none; color: var(--ink); display: block; }
.plates .mount { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.plates a:hover .mount { transform: translateY(-4px) rotate(-0.6deg); }
.plates h3 { font-size: 1.28rem; font-style: italic; margin: 1rem 0 0.15rem; }
.plates a:hover h3 { color: var(--link); }
.plates .w { color: var(--sepia); font-size: 0.98rem; margin: 0; }

/* ---------- Download shelf ---------- */
.shelf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.sheets { position: relative; aspect-ratio: 5 / 4; }
.sheets img {
  position: absolute; width: 46%; top: 6%; border-radius: 2px; background: #fff;
  box-shadow: 0 16px 34px -18px rgb(var(--shadow) / calc(var(--shadow-a) * 2.6)), 0 1px 3px rgb(var(--shadow) / calc(var(--shadow-a) * 1.2));
}
.sheets img:nth-child(1) { left: 0; transform: rotate(-5deg); }
.sheets img:nth-child(2) { left: 27%; top: 2%; transform: rotate(1.5deg); z-index: 1; }
.sheets img:nth-child(3) { left: 54%; top: 8%; transform: rotate(6deg); z-index: 2; }
.filelist { list-style: none; margin: 1.4rem 0 1.8rem; padding: 0; border-top: 1px solid var(--line); }
.filelist li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.filelist .meta { color: var(--sepia); font-size: 0.98rem; white-space: nowrap; font-variant-numeric: lining-nums; }

.dl-table { width: 100%; border-collapse: collapse; font-size: 1.08rem; }
.dl-table th, .dl-table td { text-align: left; padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.dl-table thead th { font-family: var(--text); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; border-bottom-color: var(--sepia); }
.dl-table tbody th { font-family: var(--display); font-weight: 500; font-size: 1.3rem; }
.dl-table tbody th a { color: var(--ink); text-decoration: none; }
.dl-table .meta { display: block; color: var(--sepia); font-size: 0.92rem; font-variant-numeric: lining-nums; }

/* ---------- App: anatomy, features, gallery, price ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; counter-reset: step; }
.step .num { font-family: var(--display); font-size: 1.25rem; color: var(--link); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; margin-bottom: 1rem; }
.step h3 { font-size: 1.5rem; }
.step p { color: var(--sepia); margin: 0; }
.deflist { margin: 0; border-top: 1px solid var(--line); }
.deflist > div { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: 1rem 2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.deflist dt { font-family: var(--display); font-size: 1.45rem; }
.deflist dt small { display: block; font-family: var(--text); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin-top: 0.3rem; }
.deflist dd { margin: 0; color: var(--sepia); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.gallery .mount:nth-child(1) { transform: rotate(-1deg); }
.gallery .mount:nth-child(3) { transform: rotate(1deg); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.split .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.band { text-align: center; }
.price { font-family: var(--display); font-size: clamp(2.6rem, 5vw, 3.6rem); color: var(--ink); margin: 0; line-height: 1.1; font-variant-numeric: lining-nums; }
.price sup { font-size: 0.42em; vertical-align: 0.95em; color: var(--sepia); margin-right: 0.12em; }
.band .sub { color: var(--sepia); font-style: italic; font-size: 1.22rem; margin: 0.3rem 0 1.6rem; }
.band .hero-note { margin-left: auto; margin-right: auto; max-width: 44ch; }
.band .btn-row { justify-content: center; }

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; }
.faq.center { margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.2rem 0;
  font-family: var(--display); font-size: 1.32rem; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 15px; height: 15px;
  background: linear-gradient(var(--link), var(--link)) center / 100% 1.5px no-repeat, linear-gradient(var(--link), var(--link)) center / 1.5px 100% no-repeat;
  transition: transform 0.35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--link); }
.faq details p { color: var(--sepia); margin: 0 0 1.3rem; max-width: 40rem; }

.finale { text-align: center; padding: 5rem 0; }
.finale h2 { font-size: clamp(2.1rem, 4.4vw, 3rem); margin-top: 1.6rem; }
.finale p { color: var(--sepia); font-size: 1.25rem; max-width: 40ch; margin: 0.4rem auto 2rem; }
.finale .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--parchment); padding: 3.5rem 0 2.5rem; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2.5rem; }
.site-footer .brand span { font-size: 1.15rem; }
.site-footer .brand img { width: 30px; height: 30px; }
.foot-about { color: var(--sepia); font-size: 1.02rem; max-width: 30ch; margin: 1rem 0 1.2rem; }
.site-footer h2 { font-family: var(--text); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin: 0.4rem 0 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.1rem 0; }
.site-footer li a, .foot-links a { color: var(--sepia); text-decoration: none; font-size: 1.02rem; display: inline-block; padding: 0.22rem 0; }
.site-footer li a:hover, .foot-links a:hover { color: var(--ink); text-decoration: underline; }
.copyright { color: var(--sepia); font-size: 0.95rem; margin: 2.5rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--line); }

/* ---------- Index page heads ---------- */
.page-head { padding: 3.5rem 0 2.5rem; }
.page-head h1 { font-size: clamp(2.5rem, 5.4vw, 3.8rem); letter-spacing: -0.02em; max-width: 18ch; }
.page-head .lede { font-size: 1.3rem; color: var(--sepia); max-width: 40rem; margin: 0; }
.page-head + section { padding-top: 1rem; }
.crumbs { font-size: 0.98rem; color: var(--sepia); margin: 0 0 1.4rem; }
.crumbs a { color: var(--sepia); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 0.45rem; color: var(--line); }

/* ---------- Article (essays, guides, lesson plans, toolkit) ---------- */
.article-head { padding: 3rem 0 2.6rem; }
.article-head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3.5rem; align-items: center; }
.article-head.plain .wrap { grid-template-columns: minmax(0, 46rem); }
.article-head h1 { font-size: clamp(2.5rem, 5.6vw, 4rem); letter-spacing: -0.02em; margin-bottom: 0.35em; }
.article-head.essay h1 { font-style: italic; }
.article-head.essay h1 { margin-bottom: 0.25em; }
.folio.attribution { margin: 0 0 1.2rem; }
.standfirst { font-size: 1.36rem; line-height: 1.5; color: var(--sepia); max-width: 36rem; margin: 0 0 1.4rem; }
.byline { color: var(--sepia); font-size: 1rem; margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
.byline span + span::before { content: "\00b7"; margin-right: 0.6rem; color: var(--gold); }
.article-head .mount { transform: rotate(1.2deg); }
.article-head figcaption { font-size: 0.92rem; color: var(--sepia); font-style: italic; text-align: center; margin-top: 0.9rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 2rem; margin: 0; border-top: 1px solid var(--line); }
.facts > div { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.facts dd { margin: 0.1rem 0 0; font-size: 1.06rem; }

.takeaway {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem 1.5rem; align-items: center;
  background: var(--parchment); border-radius: 14px; padding: 1.4rem 1.6rem; margin: 2rem 0 0;
  box-shadow: 0 1px 0 rgb(var(--shadow) / 0.1), 0 10px 26px -20px rgb(var(--shadow) / calc(var(--shadow-a) * 2));
}
.takeaway .sheet-icon { width: 46px; height: 58px; color: var(--link); }
.takeaway h2, .takeaway h3 { font-size: 1.4rem; margin: 0 0 0.15rem; }
.takeaway p { margin: 0; color: var(--sepia); font-size: 1.02rem; font-variant-numeric: lining-nums; }
.takeaway .more { grid-column: 2 / -1; font-size: 1.02rem; border-top: 1px solid var(--line); padding-top: 0.9rem; }

.article-body { padding: 0 0 4.5rem; }
.article-body .wrap { display: grid; grid-template-columns: 13.5rem minmax(0, var(--measure)) minmax(0, 1fr); gap: 0 3.5rem; align-items: start; }
.toc { position: sticky; top: 5.5rem; font-size: 1rem; padding-top: 2.4rem; }
.toc h2 { font-family: var(--text); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin: 0 0 0.7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--sepia); text-decoration: none; line-height: 1.3; }
.toc a:hover { color: var(--ink); border-left-color: var(--sepia); }
.toc a.here { color: var(--ink); border-left-color: var(--link); }
.toc .toc-dl { margin-top: 1.2rem; font-weight: 600; }

.prose { grid-column: 2; min-width: 0; font-size: 1.22rem; line-height: 1.66; }
.prose > :first-child { margin-top: 2.4rem; }
.prose h2 { font-size: clamp(1.8rem, 3.4vw, 2.2rem); margin: 2.6em 0 0.6em; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.prose h2:first-child { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.42rem; margin: 1.9em 0 0.45em; }
.prose h4 { font-size: 1.15rem; margin: 1.5em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--gold-ink); }
.prose strong, .prose b { font-weight: 600; }
.prose a { font-weight: 500; }
.prose q { quotes: "\201C" "\201D" "\2018" "\2019"; font-style: italic; }

blockquote.verse { margin: 1.5em 0 1.6em; padding: 0 0 0 1.5rem; border-left: 1px solid var(--gold); }
blockquote.verse p { margin: 0; font-size: 1.06em; line-height: 1.55; }
blockquote.verse cite { display: block; margin-top: 0.6rem; font-style: normal; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; font-variant-numeric: lining-nums; }
blockquote.verse .sp { font-size: 0.74em; letter-spacing: 0.12em; font-weight: 600; color: var(--sepia); margin-right: 0.4em; }

.prose aside.note {
  background: var(--parchment); border-radius: 12px; padding: 1.2rem 1.4rem 1.25rem; margin: 1.8em 0; font-size: 0.95em;
}
.prose aside.note h4 { font-family: var(--text); font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin: 0 0 0.45rem; }
.prose aside.note p:last-child { margin-bottom: 0; }

/* Marginalia: the app note hangs in the outer margin on wide screens. */
.prose aside.app-note {
  font-style: italic; color: var(--sepia); font-size: 0.92em; line-height: 1.45; margin: 1.6em 0;
  padding: 0.9rem 0 0.9rem 3.1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: url("icon-180.png") left 0.95rem / 2.3rem no-repeat; min-height: 4.2rem;
}
.prose aside.app-note p { margin: 0; }
.prose aside.app-note a { font-weight: 600; font-style: normal; }
@media (min-width: 1200px) {
  .prose aside.app-note { float: right; clear: right; width: 15rem; margin: 0.4rem -18.5rem 1rem 0; border-bottom: 0; padding: 3.4rem 0 0; background-position: left 0.9rem; font-size: 0.84em; }
}

.kq { padding: 1.4rem 0 0.4rem; border-top: 1px solid var(--line-soft); counter-increment: kq; position: relative; }
#quotations { counter-reset: kq; }
.kq blockquote.verse { margin-top: 0; margin-bottom: 0.9rem; }
.kq .kq-gloss { font-style: italic; color: var(--sepia); margin-bottom: 0.6rem; }

.table-scroll { overflow-x: auto; margin: 1.4em 0 1.8em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; line-height: 1.45; font-variant-numeric: lining-nums; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--line); }
.prose thead th { font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; border-bottom-color: var(--sepia); }
.prose table.plan td:first-child { white-space: nowrap; color: var(--link); font-weight: 600; width: 5.8rem; }
.prose table.plan td:last-child { color: var(--sepia); width: 30%; }

.worksheet { margin: 3rem 0; padding: 0.4rem 1.8rem 1.4rem; background: var(--parchment); border-radius: 14px; }
.prose .worksheet h2 { border-top: 0; margin-top: 1.2em; padding-top: 0; }
.write-lines { height: 7.5rem; margin: 0.4rem 0 1.4rem; background: repeating-linear-gradient(to bottom, transparent 0 1.82rem, var(--line) 1.82rem calc(1.82rem + 1px)); }
.write-lines.short { height: 3.72rem; }
.write-lines.tall { height: 13rem; }
.fill { display: inline-block; min-width: 5.5em; border-bottom: 1px solid var(--sepia); height: 1em; vertical-align: baseline; }
.checks { list-style: none; padding-left: 0 !important; }
.checks li { padding-left: 1.9rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 0.95rem; height: 0.95rem; border: 1px solid var(--sepia); border-radius: 2px; }

/* End-of-article blocks */
.after { grid-column: 2; min-width: 0; }
.related { margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.7rem; margin-bottom: 0.8rem; }
.app-card {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.6rem; align-items: center;
  background: var(--parchment); border-radius: 16px; padding: 1.7rem; margin-top: 3rem;
  box-shadow: 0 1px 0 rgb(var(--shadow) / 0.1), 0 14px 34px -24px rgb(var(--shadow) / calc(var(--shadow-a) * 2.2));
}
.app-card h2 { font-size: 1.7rem; margin: 0 0 0.4rem; }
.app-card p { color: var(--sepia); margin: 0 0 1rem; font-size: 1.1rem; }
.app-card .fine { font-size: 0.98rem; font-style: italic; margin: 0.9rem 0 0; }
.app-card .mount { transform: rotate(-2deg); }

/* Soft sticky app bar: appears after reading a while, dismissible. */
.appbar {
  position: fixed; left: 50%; bottom: 1rem; z-index: 30; width: min(34rem, calc(100vw - 1.5rem));
  transform: translate(-50%, 160%); transition: transform 0.6s var(--ease), visibility 0s 0.6s; visibility: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.8rem; align-items: center;
  background: var(--ivory); border-radius: 14px; padding: 0.6rem 0.6rem 0.6rem 0.75rem;
  box-shadow: 0 16px 40px -12px rgb(var(--shadow) / calc(var(--shadow-a) * 2.6)), 0 0 0 1px var(--line);
}
.appbar[hidden] { display: none; }
.appbar.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.6s var(--ease), visibility 0s; }
.appbar img { width: 38px; height: 38px; border-radius: 9px; }
.appbar p { margin: 0; font-size: 1rem; line-height: 1.25; color: var(--sepia); }
.appbar p b { display: block; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.appbar .btn { padding: 0.5rem 1rem; font-size: 0.98rem; }
.appbar-x { background: none; border: 0; color: var(--sepia); cursor: pointer; width: 44px; height: 44px; margin: -0.3rem -0.4rem -0.3rem -0.5rem; display: grid; place-items: center; border-radius: 8px; }
.appbar-x:hover { color: var(--ink); background: var(--parchment); }
.appbar-x svg { width: 14px; height: 14px; }

/* ---------- Legal / support pages (hand-written HTML) ---------- */
.legal { padding: 3.5rem 0 4rem; }
.legal .doc { max-width: var(--measure); margin: 0 auto; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 0.2em; }
.legal .updated { color: var(--gold-ink); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.76rem; font-weight: 600; margin-bottom: 2.4rem; }
.legal h2 { font-size: 1.7rem; margin-top: 2.4rem; }
.legal h3 { font-size: 1.3rem; margin-top: 1.6rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: 0.4rem 0; }
.legal a { font-weight: 600; }
.legal .lede { font-size: 1.28rem; color: var(--sepia); }
.back { display: inline-block; margin-bottom: 2rem; color: var(--sepia); text-decoration: none; font-size: 1rem; }
.back:hover { color: var(--ink); }
.callout { background: var(--parchment); border-radius: 12px; padding: 1.1rem 1.3rem; margin: 1.6rem 0; }
.callout p { margin: 0; color: var(--sepia); }

.print-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js .leaf-flip { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .article-body .wrap { grid-template-columns: minmax(0, var(--measure)); justify-content: center; }
  .prose, .after { grid-column: 1; }
  .toc { position: static; padding-top: 0; margin-top: 2rem; }
  .toc ol { border-left: 0; columns: 2; column-gap: 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
  .toc a { padding-left: 0; border-left: 0; break-inside: avoid; }
  .toc .toc-dl { display: none; }
  .plates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { padding: 2.6rem 0 3.5rem; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 2.6rem; }
  .hero-copy { padding-top: 0; }
  .hero .lede { max-width: 38ch; }
  .routes { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
  .route, .route:first-child, .route:last-child { padding: 1.8rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .lines, .shelf, .split { grid-template-columns: minmax(0, 1fr); gap: 2.6rem; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .article-head .wrap { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
  .article-head figure { max-width: 250px; margin: 0 auto; }
  .ledger > li { grid-template-columns: 50px minmax(0, 1fr); }
  .ledger .links { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .wrap { padding: 0 1.15rem; }
  section { padding: 3.2rem 0; }
  .prose { font-size: 1.17rem; }
  .leaf { grid-template-columns: minmax(0, 1fr); }
  .leaf-plate { width: 46%; margin: 0 auto -2.4rem !important; position: relative; z-index: 1; }
  .leaf-face { padding: 3.4rem 1.3rem 1.2rem; }
  .marginalia { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.1rem; }
  .plates h3 { font-size: 1.12rem; }
  .feature { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr); gap: 1.1rem; }
  .feature h3 { font-size: 1.45rem; }
  .contents .t { font-size: 1.14rem; }
  .contents .w { font-size: 0.92rem; }
  .gallery { gap: 0.8rem; }
  .deflist > div { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .takeaway { grid-template-columns: auto minmax(0, 1fr); padding: 1.2rem; }
  .takeaway .btn { grid-column: 1 / -1; }
  .takeaway .more { grid-column: 1 / -1; }
  .app-card { grid-template-columns: minmax(0, 1fr); padding: 1.4rem; }
  .app-card .mount { width: 6.5rem; }
  .worksheet { padding: 0.2rem 1.1rem 1rem; margin-left: -0.4rem; margin-right: -0.4rem; }
  .foot-grid { gap: 2rem 1.5rem; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .toc ol { columns: 1; }
  .appbar p span { display: none; }
  .btn:has(small) { flex-direction: column; gap: 0.2rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .filelist li { flex-direction: column; gap: 0.15rem; }
  .filelist .meta { white-space: normal; }
  blockquote.verse { padding-left: 0.9rem; }
  blockquote.verse p { font-size: 0.96em; }
  .dl-table td::before { content: attr(data-label) ": "; color: var(--sepia); }
  .leaf-plate { margin-top: 0; }
  /* Lesson timing tables stack: time becomes a label above its activity. */
  .prose table.plan, .prose table.plan tbody, .prose table.plan tr, .prose table.plan td { display: block; width: auto; }
  .prose table.plan thead { display: none; }
  .prose table.plan tr { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .prose table.plan td { border: 0; padding: 0.1rem 0; }
  .prose table.plan td:first-child, .prose table.plan td:last-child { width: auto; }
  .prose table.plan td:last-child { font-style: italic; font-size: 0.95em; }
  .dl-table thead { display: none; }
  .dl-table, .dl-table tbody, .dl-table tr, .dl-table th, .dl-table td { display: block; }
  .dl-table tr { padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .dl-table th, .dl-table td { border: 0; padding: 0.2rem 0; }
}

/* ---------- Print: every resource page is also its own PDF ---------- */
@page { size: A4; margin: 19mm 18mm 21mm; }
@page :first { margin: 0; }
@media print {
  :root {
    --ivory: #fff; --parchment: #F6F0E3; --ink: #1F1A12; --sepia: #4F3E2C; --oxblood: #6E1F1F; --link: #6E1F1F; --gold: #9A7B2D; --gold-ink: #6B5217;
    --line: #C9B98F; --line-soft: #DDD0AC; --mount-a: #EFE5CF; --mount-b: #D9C9A2;
  }
  html { scroll-behavior: auto; }
  body { font-size: 11.4pt; line-height: 1.5; background: #fff; }
  .site-header, .site-footer, .toc, .appbar, .skip, .crumbs, .screen-only, .takeaway, .related, .app-card, .article-head figure, .byline { display: none !important; }
  .print-only { display: block; }
  a { color: inherit; text-decoration: none; }
  .prose a[href^="http"] { text-decoration: underline; text-decoration-color: var(--line); }
  .wrap { max-width: none; padding: 0; }
  section { padding: 0; }

  .print-cover {
    position: relative; height: 297mm; padding: 30mm 24mm 22mm; break-after: page; display: flex; flex-direction: column;
    background: #F6F0E3; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .print-cover .pc-brand { display: flex; align-items: center; gap: 4mm; font-family: var(--display); font-size: 15pt; font-weight: 600; }
  .print-cover .pc-brand img { width: 11mm; height: 11mm; border-radius: 2.4mm; }
  .print-cover .pc-kind { margin: 46mm 0 5mm; font-size: 9.5pt; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
  .print-cover h1 { font-size: 40pt; line-height: 1.06; margin: 0 0 8mm; max-width: 13ch; letter-spacing: -0.02em; }
  .print-cover .pc-stand { font-size: 13.5pt; line-height: 1.45; color: var(--sepia); max-width: 92mm; margin: 0; }
  .print-cover .pc-plate { position: absolute; right: 24mm; bottom: 46mm; width: 58mm; }
  .print-cover .pc-plate .mount { padding: 2.2mm; box-shadow: none; transform: rotate(2deg); }
  .print-cover .pc-foot { margin-top: auto; border-top: 0.3mm solid var(--line); padding-top: 5mm; font-size: 10pt; color: var(--sepia); display: flex; justify-content: space-between; gap: 10mm; }
  .print-cover .pc-foot p { margin: 0; max-width: 100mm; }

  .article-head { padding: 0 0 5mm; }
  .article-head .wrap { display: block; }
  .article-head h1 { font-size: 26pt; }
  .article-head .standfirst { font-size: 13pt; max-width: none; }
  .has-cover .article-head h1, .has-cover .article-head .standfirst { display: none; }
  .facts { grid-template-columns: repeat(3, 1fr); break-inside: avoid; }
  .facts dd { font-size: 10.5pt; }
  .article-body { padding: 0; }
  .article-body .wrap { display: block; }
  .prose { font-size: 11.4pt; line-height: 1.52; }
  .prose > :first-child { margin-top: 5mm; }
  .prose h2 { font-size: 18pt; break-after: avoid; margin-top: 1.6em; }
  .prose h3 { font-size: 13.5pt; break-after: avoid; }
  .prose h4 { break-after: avoid; }
  .prose p { orphans: 3; widows: 3; }
  blockquote.verse, .kq, .prose aside.note, .prose tr, .prose li { break-inside: avoid; }
  .prose aside.note { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prose aside.app-note { float: none; width: auto; margin: 1.2em 0; padding: 2.5mm 0 2.5mm 13mm; background-size: 9mm; background-position: left center; min-height: 12mm; font-size: 10.5pt; border-bottom: 0.2mm solid var(--line); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-scroll { overflow: visible; }
  .worksheet { break-before: page; background: none; padding: 0; margin: 0; }
  .worksheet + * { break-before: page; }
  .write-lines { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .after { display: block; }

  .print-back { break-before: page; padding-top: 34mm; text-align: center; }
  .print-back img.pb-logo { width: 54mm; margin: 0 auto 8mm; border: 0.3mm solid var(--line); border-radius: 2mm; }
  .print-back h2 { font-size: 26pt; margin: 0 0 5mm; border: 0; }
  .print-back p { max-width: 118mm; margin: 0 auto 4mm; font-size: 12.5pt; color: var(--sepia); }
  .print-back .pb-get { margin-top: 9mm; font-size: 12pt; color: var(--ink); }
  .print-back .pb-get a { color: var(--link); font-weight: 600; text-decoration: none; }
  .print-back .pb-url { font-size: 10.5pt; font-variant-numeric: lining-nums; }
  .print-back .pb-more { margin-top: 14mm; padding-top: 6mm; border-top: 0.3mm solid var(--line); font-size: 10.5pt; }

  @page {
    @bottom-left { content: "Daily Bard  ·  free Shakespeare study resources  ·  dailybard.app"; font-family: "EB Garamond", Georgia, serif; font-size: 8.5pt; color: #6B5217; }
    @bottom-right { content: counter(page); font-family: "EB Garamond", Georgia, serif; font-size: 9pt; color: #4F3E2C; }
  }
  @page :first { @bottom-left { content: none; } @bottom-right { content: none; } }
}
