/* salvete.ai landing page, "Codex" concept: one leaf of an illuminated manuscript, lying on a scriptorium desk.
   A committed look: vellum by day on a dark oak desk, with a candlelit colophon at the foot. Every color is set explicitly. */

/* Texturina (OFL): a readable textura, used for rubrics and headings only. */
@font-face { font-family: 'Texturina'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/texturina-latin-500-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: 'Texturina'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/texturina-latin-ext-500-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; }
/* Alegreya (OFL): a calligraphic book face for reading; its italic is the glossing hand. */
@font-face { font-family: 'Alegreya'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/alegreya-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: 'Alegreya'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/alegreya-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: 'Alegreya'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/alegreya-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: 'Alegreya'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/alegreya-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: 'Alegreya'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/alegreya-latin-700-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: 'Alegreya'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/alegreya-latin-ext-700-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; }
/* Uncial Antiqua (OFL): Lombardic-style versals, used only for single painted capitals and numerals. */
@font-face { font-family: 'Uncial Antiqua'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/uncial-antiqua-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

:root {
  color-scheme: light;
  --vellum: #efe2c4;
  --ink: #2a1d15;          /* iron-gall black-brown */
  --ink-2: #5a3d28;        /* the glossing hand, a paler brown */
  --rubric: #9b2214;       /* vermilion, dark enough for small text */
  --lapis: #1f3c8c;        /* ultramarine */
  --plummet: rgba(110, 92, 72, .38); /* lead-point underdrawing */
  --gold: #c9972f;
  --gold-hi: #f2d585;
  --wash: rgba(201, 151, 47, .26);
  --rule: rgba(150, 72, 42, .24);
  --rule-strong: rgba(150, 72, 42, .45);
  --desk: #1d130c;
  --night-text: #f0e3c4;
  --night-soft: #d6c39f;
  --night-gold: #ecc66e;
  --night-red: #ec8f7c;
  --f-body: 'Alegreya', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --f-display: 'Texturina', 'Alegreya', 'Palatino Linotype', Palatino, Georgia, serif;
  --f-versal: 'Uncial Antiqua', 'Texturina', 'Palatino Linotype', Palatino, Georgia, serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background-color: var(--desk); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--desk) url(img/desk.webp) 0 0 / 640px 640px;
  font: 400 1.1875rem/1.6 var(--f-body);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}
img, svg { max-width: 100%; }
a { color: var(--lapis); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rubric); }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; }
p, h2, h3 { margin: 0; }
p { text-wrap: pretty; }
b { font-weight: 700; }

/* Latin words are marked lang="la" for screen readers; keep every font's Latin-language forms off
   (EB Garamond's turn u into v; Alegreya and Texturina have none, but a fallback font might). */
[lang='la'] { font-feature-settings: 'locl' 0; font-language-override: 'ENG'; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 16px; top: -120px; z-index: 10; padding: .6rem 1rem; background: var(--ink); color: #fbf1dc; font: 700 1rem var(--f-body); }
.skip:focus { top: 16px; color: #fbf1dc; }

/* ---------- The folio: a vellum leaf lying on the desk ---------- */
.folio {
  position: relative;
  isolation: isolate;
  max-width: 1240px;
  margin: clamp(0px, 2.2vw, 30px) auto 0;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
  background-color: var(--vellum);
  background-image:
    radial-gradient(ellipse 70% 40% at 22% 0%, rgba(255, 251, 238, .55), rgba(255, 251, 238, 0) 70%),
    radial-gradient(ellipse 90% 60% at 100% 100%, rgba(150, 105, 50, .16), rgba(150, 105, 50, 0) 70%),
    url(img/vellum.webp);
  box-shadow:
    inset 0 0 110px rgba(125, 85, 35, .26),
    inset 0 0 16px rgba(110, 72, 28, .32),
    0 1px 0 rgba(0, 0, 0, .3),
    0 28px 70px rgba(0, 0, 0, .55),
    0 6px 18px rgba(0, 0, 0, .35);
  display: grid;
  grid-template-columns:
    [full-start] 150px [text-start] minmax(0, 640px) [text-end] 48px
    [gloss-start] 250px [gloss-end] minmax(56px, 1fr) [full-end];
}
/* pricking: the holes that guided the ruling, down the outer edge */
.folio::after {
  content: '';
  position: absolute;
  top: 48px;
  bottom: 48px;
  right: 22px;
  width: 4px;
  z-index: -1;
  background: radial-gradient(circle at 2px 2px, rgba(70, 44, 22, .5) 1.1px, rgba(70, 44, 22, 0) 1.8px) 0 0 / 4px 34px repeat-y;
}
/* frame ruling: double lines bounding the written area, run edge to edge as a scribe ruled them */
.ruling { grid-column: text-start / gloss-end; position: absolute; top: 0; bottom: 0; left: -16px; right: -16px; z-index: -1; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.ruling::before, .ruling::after { content: ''; position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--rule); }
.ruling::before { left: -8px; }
.ruling::after { right: -8px; }

/* running head */
.runhead {
  grid-column: text-start / gloss-end;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 1.5rem;
  padding-block: 1.5rem .85rem;
  border-bottom: 1px solid var(--rule-strong);
}
.mark { font: 500 1.65rem/1 var(--f-display); color: var(--rubric); text-decoration: none; letter-spacing: .01em; }
.mark span { color: var(--lapis); }
.mark:hover { color: var(--rubric); }
.runnav { display: flex; align-items: baseline; gap: 1.4rem; font-size: 1.05rem; }
.runnav a { color: var(--ink); }
.runnav a:hover { color: var(--rubric); }
.runnav .runnav-in { padding: .3rem .85rem; border: 1px solid var(--ink); text-decoration: none; }
.runnav .runnav-in:hover { background: var(--ink); color: #fbf1dc; }

.text { grid-column: full; display: grid; grid-template-columns: subgrid; }
.leaf {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
  row-gap: 1.4rem;
  padding-top: clamp(3.5rem, 2rem + 4.5vw, 5.75rem);
}
.leaf > * { grid-column: text; min-width: 0; }
.leaf > .glosses { grid-column: gloss; }
.leaf > .glosses.span3 { grid-row: 1 / span 3; }
.leaf > .glosses.span2 { grid-row: span 2; }

/* ---------- Glosses: the tutor's hand in the margin ---------- */
.key { font: italic 700 .62em/0 var(--f-body); color: var(--rubric); vertical-align: super; margin-left: .06em; }
.glosses { display: grid; gap: 1.15rem; align-content: start; }
.gl { position: relative; padding-left: 1.05rem; font: italic 400 1rem/1.45 var(--f-body); color: var(--ink-2); }
.gl .k { position: absolute; left: 0; top: 0; font: italic 700 1rem/1.45 var(--f-body); color: var(--rubric); }
.gl b { font-style: normal; color: var(--rubric); }
.gl i { font-style: normal; color: var(--ink); }

/* the coaching note: a manicule points at the line, the answer waits behind a fold */
.gl-try { display: grid; gap: .5rem; padding-left: 0; }
.hand { width: 4rem; height: auto; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.gl-try b { color: var(--rubric); }
.gl-try details { border-top: 1px dotted var(--rule-strong); padding-top: .4rem; }
.gl-try summary { cursor: pointer; font: 500 .95rem/1.4 var(--f-display); font-style: normal; letter-spacing: .03em; color: var(--lapis); width: fit-content; }
.gl-try summary:hover { color: var(--rubric); }
.gl-try details p { margin-top: .35rem; }

/* ---------- Opening of the folio ---------- */
/* The opening sits on four rows so each gloss can stand beside the line it explains. */
.hero { position: relative; padding-top: clamp(2rem, 1rem + 3vw, 3.25rem); row-gap: .9rem; }
.hero > .rubric { grid-row: 1; }
.hero > .opening { grid-row: 2; }
.hero > .lead { grid-row: 3; padding-top: .6rem; }
.hero > .cta { grid-row: 4; padding-top: .3rem; }
.hero > .hero-gl-1 { grid-row: 1 / span 2; }
.hero > .hero-gl-2 { grid-row: 3 / span 2; padding-top: .9rem; }
/* the vine is positioned inside its grid area so its height never stretches the rows */
.hero > .vine { grid-column: full-start / text-start; grid-row: 2 / span 3; position: absolute; top: 0; right: 0; width: 120px; height: auto; overflow: visible; }

.opening { display: flow-root; }
.rubric, .label { font: 500 1.2rem/1.2 var(--f-display); letter-spacing: .07em; color: var(--rubric); }
.ini { position: relative; float: left; width: 15rem; height: auto; margin: 0 1.35rem .4rem 0; filter: drop-shadow(0 1px 1px rgba(60, 35, 10, .35)); }
h1 { margin: 0; font-weight: 400; }
.h1-word { display: block; font: 500 clamp(4.2rem, 2rem + 6.2vw, 7.4rem)/.86 var(--f-display); color: var(--ink); letter-spacing: -.005em; padding-top: .14em; }
.h1-word .key { font-size: .2em; vertical-align: 2.3em; margin-left: .12em; }
.h1-sub { display: block; margin-top: .9rem; font: italic 400 clamp(1.45rem, 1.1rem + 1vw, 1.95rem)/1.22 var(--f-body); color: var(--ink-2); text-wrap: balance; }
.lead { font-size: clamp(1.2rem, 1.1rem + .35vw, 1.34rem); line-height: 1.58; max-width: 38em; }
.status { display: flex; align-items: center; gap: .6rem; font: italic 400 1.1rem/1.4 var(--f-body); color: var(--ink-2); }
.status-dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fbe7a6, #c9972f 55%, #7f5a14); box-shadow: 0 0 0 1px var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem 1rem; margin-top: 1.2rem; }
.mailline { margin-top: .9rem; font-size: 1.05rem; color: var(--ink-2); }
.mailline a { color: var(--lapis); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .55rem 1.35rem .6rem;
  font: 500 1.08rem/1.2 var(--f-display);
  letter-spacing: .015em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-rubric { background: var(--rubric); color: #fbf0d8; border-color: #5e1209; box-shadow: inset 0 0 0 3px var(--rubric), inset 0 0 0 4px var(--gold-hi); }
.btn-rubric:hover { background: #7f1a0f; color: #fbf0d8; box-shadow: inset 0 0 0 3px #7f1a0f, inset 0 0 0 4px var(--gold-hi); }
.btn-ink { color: var(--ink); border-color: var(--ink); background: rgba(255, 250, 236, .25); }
.btn-ink:hover { background: var(--ink); color: #fbf0d8; }

/* ---------- Section rubrics, blue initials and the pen flourish ---------- */
.rub { font: 500 clamp(2.05rem, 1.35rem + 2.4vw, 3.15rem)/1.08 var(--f-display); color: var(--rubric); text-wrap: balance; }
.rub::first-letter { color: var(--lapis); }
.leaf > .label + .rub { margin-top: -.85rem; }

/* The flourish is drawn in lead point first (always visible), then inked in red as it comes into view.
   Without JavaScript, or with reduced motion, it is simply drawn. */
.flourish { display: block; width: min(100%, 21rem); height: auto; overflow: visible; margin-top: -.55rem; }
.fl-guide { fill: none; stroke: var(--plummet); stroke-width: .8; }
.fl-ink { fill: none; stroke: var(--rubric); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.9s cubic-bezier(.5, .05, .3, 1); }
.fl-dots { fill: var(--lapis); transition: opacity .6s ease 1.5s; }
.flourish.wait .fl-ink { stroke-dashoffset: 1; }
.flourish.wait .fl-dots { opacity: 0; }

.open { font-size: 1.22rem; line-height: 1.6; }
.open::first-letter {
  float: left;
  font: 400 3.3em/.86 var(--f-versal);
  color: var(--lapis);
  padding: .16em .2em .1em .2em;
  margin: .04em .14em 0 -.04em;
  background: url(img/penwork-r.svg) 0 0 / 100% 100% no-repeat;
}

/* ---------- How a lesson goes: four steps with versal numerals hanging in the margin ---------- */
.step { position: relative; display: grid; gap: .3rem; }
.step h3 { font: 500 1.55rem/1.15 var(--f-display); color: var(--ink); }
.step p { font-size: 1.14rem; line-height: 1.6; max-width: 36em; }
.num { position: absolute; right: calc(100% + 2.3rem); top: -.12em; font: 400 3.1rem/1 var(--f-versal); letter-spacing: .02em; white-space: nowrap; }
.num-r { color: var(--rubric); }
.num-b { color: var(--lapis); }
.for { font-style: italic; color: var(--ink-2); font-size: 1.12rem; }

/* ---------- The lectio: hover or tap a word to read its note ---------- */
.lectio-intro { font-size: 1.16rem; line-height: 1.6; padding-top: 1.2rem; border-top: 3px double var(--rule-strong); }
.lectio { grid-column: text-start / gloss-end; margin: 0; display: grid; gap: 1rem; }
.lectio-hint { font: 500 .95rem/1.3 var(--f-display); letter-spacing: .06em; color: var(--rubric); }
.lectio-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .9rem .5em;
  font: 400 clamp(2.3rem, 1.4rem + 2.8vw, 3.5rem)/1 var(--f-body);
  color: var(--ink);
  padding-block: .2rem .4rem;
}
.iw { display: inline-flex; flex-direction: column-reverse; align-items: center; }
.ig { font: italic 400 clamp(1rem, .85rem + .45vw, 1.2rem)/1.2 var(--f-body); color: var(--rubric); padding: 0 .3rem .35rem; white-space: nowrap; transition: color .2s ease; }
.wrow { white-space: nowrap; }
.lw { color: var(--ink); text-decoration: none; border-bottom: 2px dotted rgba(155, 34, 20, .6); padding: 0 .05em; transition: background-color .2s ease; }
.lw:hover, .lw.on, .lw:focus-visible { background: var(--wash); color: var(--ink); border-bottom: 2px solid var(--rubric); }
.iw:has(.lw.on) .ig, .iw:has(.lw:hover) .ig { color: var(--lapis); }
.lectio-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; font-size: 1.2rem; }
.lectio-cap span { font-style: italic; }
.lectio-cap cite { font: 500 .98rem/1.3 var(--f-display); font-style: normal; color: var(--rubric); letter-spacing: .02em; }
.notes { list-style: none; margin: -.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem 1.6rem; }
.note { position: relative; padding: .5rem .6rem .55rem 1.45rem; font-size: 1.02rem; line-height: 1.5; color: var(--ink); transition: background-color .2s ease; }
.note::before { content: '¶'; position: absolute; left: .35rem; top: .45rem; font-weight: 700; color: rgba(155, 34, 20, .3); }
.note b { color: var(--rubric); }
.note.on, .note:target { background: var(--wash); }
.note.on::before, .note:target::before { color: var(--rubric); }

.pf { font-weight: 700; }
.pf-r { color: var(--rubric); }
.pf-b { color: var(--lapis); }

/* ---------- The games: a catalogue with Lombardic versals in red and blue ---------- */
.catalogue {
  grid-column: text-start / gloss-end;
  list-style: none;
  margin: .3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}
.catalogue li { display: grid; align-content: start; gap: .3rem; padding: 1rem 1.3rem 1.1rem 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.catalogue li:not(:nth-child(3n + 1)) { padding-left: 1.3rem; border-left: 1px solid var(--rule); }
.c-name { font: 500 1.5rem/1.1 var(--f-display); color: var(--ink); }
.versal {
  display: inline-block;
  font: 400 1.75em/.9 var(--f-versal);
  padding: .14em .16em .08em;
  margin-right: .06em;
  vertical-align: -.08em;
  background: 0 0 / 100% 100% no-repeat;
}
.v-r { color: var(--rubric); background-image: url(img/penwork-b.svg); }
.v-b { color: var(--lapis); background-image: url(img/penwork-r.svg); }
.c-mean { font: italic 400 1.05rem/1.35 var(--f-body); color: var(--ink-2); }
.c-what { font-size: 1.04rem; line-height: 1.4; color: var(--ink); }
.after { font-size: 1.12rem; }

/* ---------- Latin in your English: a glossary ---------- */
.lex { grid-column: text-start / gloss-end; margin: .2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.8rem; }
.lex > div { padding: .7rem 0 .72rem; border-bottom: 1px solid var(--rule); min-width: 0; }
.lex dt { font: 700 1.14rem/1.3 var(--f-body); color: var(--ink); }
.lex dd { margin: .15rem 0 0; font-size: 1.04rem; line-height: 1.45; color: var(--ink-2); }
.lex dd i { color: var(--lapis); }

.amp {
  grid-column: text-start / gloss-end;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem 2.6rem;
  padding: 1.3rem 0;
  border-top: 3px double var(--rule-strong);
  border-bottom: 3px double var(--rule-strong);
}
.amp-signs { display: flex; align-items: flex-end; gap: 1.6rem; }
.amp-cell { display: grid; justify-items: center; align-items: end; gap: .35rem; }
.amp-and { font: italic 400 6.2rem/1 var(--f-body); color: var(--rubric); }
.amp-et { font: italic 400 4.4rem/1 var(--f-body); color: var(--ink); }
.amp-lab { font: 500 .82rem/1.2 var(--f-display); letter-spacing: .05em; color: var(--rubric); white-space: nowrap; }
.tiro { width: 3rem; height: auto; }
.amp figcaption { font-size: 1.12rem; line-height: 1.58; max-width: 36em; }

/* ---------- Our rule, for parents ---------- */
.rule { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.rule li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .2rem; font-size: 1.14rem; line-height: 1.58; }
.rule .pf { line-height: 1.58; }
.rule b { color: var(--ink); }

/* the catchword at the foot of the leaf, as at the end of a quire */
.catch { grid-column: gloss; justify-self: end; align-self: end; margin-top: 1.5rem; padding: .15rem .8rem .2rem; font: italic 400 1.02rem/1.4 var(--f-body); color: var(--ink-2); border: 1px solid rgba(155, 34, 20, .5); border-radius: 0 0 1rem 1rem; }

/* ---------- The colophon, at the desk by candlelight ---------- */
.colophon {
  color: var(--night-text);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: radial-gradient(ellipse 50% 62% at 24% 38%, rgba(236, 160, 70, .2), rgba(236, 160, 70, .06) 55%, rgba(236, 160, 70, 0) 75%);
}
.colophon-in {
  max-width: 1120px;
  margin: 0 auto;
  padding-block: clamp(4rem, 3rem + 5vw, 7rem) clamp(2.5rem, 2rem + 2vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 12.5rem) minmax(0, 40rem);
  justify-content: center;
  align-items: center;
  gap: 2rem 4rem;
}
.flame { width: 100%; height: auto; }
.invite { display: grid; gap: 1.1rem; justify-items: start; }
.explicit { font-size: 1.05rem; color: var(--night-soft); }
.explicit-word { font: 500 1.25rem/1 var(--f-display); color: var(--night-red); letter-spacing: .06em; margin-right: .3rem; }
.explicit i { color: var(--night-text); }
.colophon h2 { font: 500 clamp(2.2rem, 1.5rem + 2.6vw, 3.4rem)/1.08 var(--f-display); color: var(--night-gold); }
.fl-night .fl-guide { stroke: rgba(240, 227, 196, .22); }
.fl-night .fl-ink { stroke: var(--night-gold); }
.fl-night .fl-dots { fill: var(--night-red); }
.invite > p { font-size: 1.2rem; line-height: 1.6; max-width: 36rem; }
.addr a { font: 500 clamp(1.45rem, 1.2rem + 1vw, 1.9rem)/1.2 var(--f-display); color: var(--night-gold); text-decoration-color: rgba(236, 198, 110, .5); overflow-wrap: anywhere; }
.addr a:hover { color: #fff1c8; }
.invite .actions { margin-top: .2rem; }
.btn-gold { color: #241509; border-color: #5e430f; background: linear-gradient(135deg, #f6dd92 0%, #d4a43f 40%, #f1cf74 62%, #b78427 100%); box-shadow: inset 0 1px 0 rgba(255, 249, 225, .7); }
.btn-gold:hover { color: #241509; background: linear-gradient(135deg, #fbe7ac 0%, #ddb050 40%, #f6da88 62%, #c69332 100%); }
.btn-night { color: var(--night-text); border-color: rgba(240, 227, 196, .7); }
.btn-night:hover { color: #1d130c; background: var(--night-text); }
.invite > .small { font-size: 1rem; color: var(--night-soft); }
.colophon :focus-visible { outline-color: var(--night-gold); }

/* the colophon proper: a tapering block, as scribes set them, then the legal line */
.colophon-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding-block: 2.2rem 3rem;
  border-top: 1px solid rgba(236, 198, 110, .2);
  display: grid;
  gap: .8rem;
  justify-items: center;
  text-align: center;
  font-size: 1rem;
  color: var(--night-soft);
}
.cul { font: italic 400 1.12rem/1.5 var(--f-body); color: var(--night-text); }
.cul span { display: block; }
.cul span:last-child { font: 500 1.15rem/1.6 var(--f-display); font-style: normal; letter-spacing: .12em; color: var(--night-red); }
.footnav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; }
.footnav a { color: var(--night-text); }
.footnav a:hover { color: var(--night-gold); }

/* ---------- One orchestrated moment on load: the initial is inked, then gilded, then the vine grows ----------
   Declared outside any media query so a resize or rotation never replays it; reduced motion turns it off below. */
.ini-paint { animation: c-fade .9s ease-out .2s backwards; }
.ini-ink { stroke-dasharray: 1; animation: c-ink 1.5s cubic-bezier(.55, .1, .35, 1) .1s backwards; }
.ini-halo { animation: c-fade .5s ease-out .9s backwards; }
.ini-gold { animation: c-fade 1s ease-out 1.15s backwards; }
.ini-shine { animation: c-shine 1.2s ease-in-out 2.15s both; }
.vine-join { animation: c-fade .5s ease-out 1.05s backwards; }
.vine-bar { transform-box: fill-box; transform-origin: 50% 0; animation: c-grow 1.4s cubic-bezier(.3, .1, .2, 1) 1.25s backwards; }
.vs { stroke-dasharray: 1; animation: c-ink .6s ease-out backwards; }
.vl { transform-box: fill-box; transform-origin: 50% 50%; animation: c-leaf .55s cubic-bezier(.3, 1.4, .5, 1) backwards; }
.vs1 { animation-delay: 1.3s; }  .vl1 { animation-delay: 1.65s; }
.vs2 { animation-delay: 1.5s; }  .vl2, .vl3 { animation-delay: 1.85s; }
.vs3 { animation-delay: 1.7s; }  .vl4, .vl5 { animation-delay: 2.05s; }
.vs4 { animation-delay: 1.9s; }  .vl6, .vl7 { animation-delay: 2.25s; }
.vs5 { animation-delay: 2.1s; }  .vl8, .vl9 { animation-delay: 2.45s; }
.vs6 { animation-delay: 2.3s; }  .vl10, .vl11 { animation-delay: 2.65s; }
.vs7, .vs8 { animation-delay: 2.5s; } .vl12, .vl13, .vl14 { animation-delay: 2.85s; }
/* the candle takes one slow breath when the colophon comes into view (landing.js adds .lit); a single
   breath, under five seconds, so nothing on the page keeps moving */
.flame-glow { transform-box: fill-box; transform-origin: 50% 60%; }
.colophon.lit .flame-glow { animation: c-breathe 4.8s ease-in-out 1; }

@keyframes c-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes c-fade { from { opacity: 0; } }
@keyframes c-grow { from { transform: scaleY(0); } }
@keyframes c-leaf { from { opacity: 0; transform: scale(.3); } }
@keyframes c-shine { from { transform: translateX(0); } to { transform: translateX(330px); } }
@keyframes c-breathe { 50% { opacity: .78; transform: scale(.96); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .flourish.wait .fl-ink { stroke-dashoffset: 0; }
  .flourish.wait .fl-dots { opacity: 1; }
}

/* ---------- Narrower folios ---------- */
@media (max-width: 1179px) {
  .folio { grid-template-columns: [full-start] 104px [text-start] minmax(0, 1fr) [text-end] 28px [gloss-start] 200px [gloss-end] 30px [full-end]; }
  .hero > .vine { width: 104px; }
  .ini { width: 13rem; }
  .h1-word { font-size: clamp(4.2rem, 1.6rem + 5.6vw, 6.4rem); }
  .num { right: calc(100% + 1.9rem); font-size: 2.5rem; }
  .catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .catalogue li:nth-child(even) { padding-left: 1.3rem; border-left: 1px solid var(--rule); }
  .lex, .notes { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .rule li { margin-left: -2.9rem; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 1.3rem; }
}

/* Below 900px: one column. Margin glosses drop in under the passage they explain. */
@media (max-width: 899px) {
  .folio { margin-top: 0; grid-template-columns: [full-start] minmax(0, 1fr) [text-start gloss-start] minmax(0, 40rem) [text-end gloss-end] minmax(0, 1fr) [full-end]; box-shadow: inset 0 0 60px rgba(125, 85, 35, .22), inset 0 0 10px rgba(110, 72, 28, .3); }
  .folio::after, .ruling, .hero > .vine { display: none; }
  .leaf > .glosses.span3, .leaf > .glosses.span2 { grid-row: auto; }
  /* the opening's glosses fold in under the lines they explain; the Tully gloss waits until after the buttons */
  .hero > .rubric { grid-row: 1; }
  .hero > .opening { grid-row: 2; }
  .hero > .hero-gl-1 { grid-row: 3; }
  .hero > .lead { grid-row: 4; padding-top: .3rem; }
  .hero > .cta { grid-row: 5; }
  .hero > .hero-gl-2 { grid-row: 6; padding-top: .85rem; margin-top: .6rem; }
  .glosses { gap: .8rem; padding: .85rem 0 .2rem; border-top: 1px solid var(--rule-strong); }
  .glosses::before { content: 'Glosses'; font: 500 .9rem/1 var(--f-display); letter-spacing: .08em; color: var(--rubric); }
  .glosses.coach::before { content: none; }
  .glosses.coach { border-top: 0; padding: .9rem 1rem 1rem; background: rgba(255, 249, 232, .45); box-shadow: inset 0 0 0 1px var(--rule); }
  .step { padding-left: 4rem; }
  .num { right: auto; left: 0; top: .05em; width: 3.4rem; text-align: center; font-size: 2.2rem; }
  .colophon-in { grid-template-columns: minmax(0, 1fr); gap: 1rem; max-width: 40rem; padding-top: 3.5rem; }
  .flame { width: 6.5rem; }
}
@media (max-width: 759px) {
  body { font-size: 1.125rem; }
  .runhead { padding-block: 1.1rem .7rem; }
  .runnav { gap: 1rem; }
  .ini { width: 8.4rem; margin: .1rem .95rem .4rem 0; }
  .h1-word { font-size: clamp(3.4rem, 1.2rem + 10vw, 4.4rem); padding-top: .1em; }
  .h1-sub { font-size: 1.32rem; margin-top: .55rem; }
  .lead { font-size: 1.16rem; }
  .actions .btn { flex: 1 1 14rem; }
  .lectio-line { row-gap: 1.5rem; column-gap: .35em; }
  .amp { grid-template-columns: minmax(0, 1fr); }
  .amp-signs { gap: 1.2rem; }
  .amp-and { font-size: 4.6rem; }
  .amp-et { font-size: 3.2rem; }
  .tiro { width: 2.3rem; }
}
@media (max-width: 599px) {
  .catalogue { grid-template-columns: minmax(0, 1fr); }
  .catalogue li:nth-child(even) { padding-left: 0; border-left: 0; }
}
@media (max-width: 479px) {
  .runnav-ask { display: none; }
  .open::first-letter { font-size: 3em; }
}
