/* The method page. Loads after folio.css and mystic.css, which supply the palette, the display face, .sheet and .tcard. */

:root { --gut: clamp(20px, 4.5vw, 64px); }
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font: 400 1.125rem/1.55 var(--sans); color: var(--type); min-height: 100dvh; display: flex; flex-direction: column; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gilt-bright); outline-offset: 4px; }
.sheet :focus-visible { outline-color: var(--wine); }
p { max-width: 62ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); z-index: 100; }
.skip:focus { inline-size: auto; block-size: auto; clip-path: none; background: var(--gilt); color: var(--night); padding: 10px 16px; font-weight: 700; }

/* shell: same header and footer as the app */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 0 8px; width: min(calc(100% - 2 * var(--gut)), 1180px); margin: 0 auto; }
.wordmark { font-size: clamp(1.7rem, 3.4vw, 2.2rem); line-height: 1; text-decoration: none; flex-shrink: 0; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; justify-content: center; gap: 0 22px; }
@media (min-width: 561px) { .topnav { justify-content: flex-end; gap: 0 clamp(7px, 2.6vw, 32px); } }
.toplink { font-size: .975rem; text-decoration: none; padding: 12px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.toplink[aria-current="page"] { color: var(--gilt-bright); box-shadow: 0 2px 0 var(--gilt); }
.foot { padding: 24px var(--gut) calc(28px + env(safe-area-inset-bottom)); text-align: center; font-size: .9rem; margin-top: auto; }
.foot p { margin: 0 auto; }
.foot a { display: inline-block; padding-block: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; max-width: 100%; padding: 8px 28px; border: 1px solid var(--control-rule); background: transparent; color: var(--type); font: 700 1.08rem var(--sans); text-align: center; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--gilt); border-color: var(--gilt); color: var(--night); }
.btn-primary:hover { background: var(--gilt-bright); }
.textlink { color: var(--gilt-bright); text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; }
.textlink:hover { color: var(--bone); }

.page { width: min(calc(100% - 2 * var(--gut)), 1180px); margin: 0 auto; padding-bottom: clamp(40px, 8vw, 96px); }

/* lead */
.lead { display: grid; gap: 26px; padding: clamp(24px, 6vw, 72px) 0 clamp(30px, 6vw, 70px); }
.lead-copy { min-width: 0; }
.kicker { font: italic 400 1.05rem/1.3 var(--display); color: var(--gilt); margin-bottom: .6rem; }
.sheet .kicker { color: var(--caption); }
.lead h1 { font-size: clamp(2.5rem, 8vw, 5rem); line-height: 1; color: var(--bone); text-wrap: balance; overflow-wrap: break-word; max-width: 14ch; }
.lede { font: 400 1.18rem/1.55 var(--serif); color: var(--body-type); margin-top: 1.1rem; max-width: 56ch; }
.lede:first-of-type { margin-top: 1.4rem; }
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 1.6rem; }
.lead-plate { width: 100%; aspect-ratio: 16 / 9; order: -1; }
.lead-plate .tcard-plate { object-position: 50% 38%; }
.plate.is-bare { display: none; }
.lead-plate.is-bare { display: block; }

/* contents */
.layout { display: grid; gap: 22px; }
.toc { min-width: 0; }
.toc details { border: 1px solid var(--rule); border-radius: 12px; background: color-mix(in srgb, var(--night-2) 82%, transparent); }
.toc summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 8px 18px; color: var(--gilt-bright); font: 400 1.1rem var(--display); }
.toc summary::after { content: "+"; margin-inline-start: auto; font: 400 1.4rem/1 var(--sans); color: var(--gilt); }
.toc details[open] summary::after { content: "\2212"; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary { list-style: none; }
.toc ol { list-style: none; padding: 0 12px 12px; display: grid; gap: 0; }
.toc a { display: flex; gap: .7em; align-items: baseline; min-height: 44px; padding: 8px 6px; color: var(--bone-dim); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gilt) 45%, transparent); text-underline-offset: 4px; line-height: 1.25; font-size: 1rem; }
.toc a:hover { color: var(--gilt-bright); }
.toc b { flex: none; min-width: 1.4em; color: var(--gilt); font: 400 1.1em var(--display); text-align: end; }
.toc-gap { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); }
.toc-gap a, .toc-gap + li a { padding-inline-start: calc(6px + 2.1em); }

/* chapters */
.chapters { min-width: 0; display: grid; gap: 22px; }
.chapters .sheet + .sheet { margin-top: 0; }
.chapter { display: grid; gap: 22px; scroll-margin-top: 18px; font: 400 1.14rem/1.62 var(--serif); overflow: hidden; }
.chapter .plate { width: 100%; aspect-ratio: 16 / 9; }
.chapter .plate .tcard-plate { object-position: 50% 36%; }
.chapter-body { min-width: 0; }
.chapter-body > * + * { margin-top: 1rem; }
.chapter h2 { font-size: clamp(1.9rem, 6vw, 2.9rem); line-height: 1.04; color: var(--type); text-wrap: balance; }
.chapter h2 .num { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding-inline: .2em; margin-inline-end: .4em; border: 1px solid var(--brass); border-radius: 50%; font-size: .56em; line-height: 1; color: var(--wine); vertical-align: .22em; }
.chapter h3 { margin-top: 1.9rem; font: 700 .88rem/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--wine); }
.chapter h3 + * { margin-top: .5rem; }
.chapter p, .chapter li { color: var(--body-type); }
.chapter p { max-width: 62ch; }
.chapter b { color: var(--type); }
.chapter a { color: var(--wine); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.chapter a:hover { color: var(--wine-dark); text-decoration-thickness: 2px; }
.source { font: 400 .98rem/1.5 var(--sans); overflow-wrap: anywhere; padding-top: 1rem; border-top: 1px solid var(--rule); }
.source, .source a { color: var(--caption); }

ul.plain { list-style: none; padding: 0; display: grid; gap: .55rem; max-width: 62ch; }
ul.plain li { padding-inline-start: 1.1em; position: relative; }
ul.plain li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: .42em; height: .42em; border-radius: 50%; background: var(--brass); }
ol.steps { list-style: none; counter-reset: s; padding: 0; display: grid; gap: .7rem; max-width: 64ch; }
ol.steps > li { counter-increment: s; position: relative; padding-inline-start: 2.2em; }
ol.steps > li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: .12em; width: 1.55em; height: 1.55em; display: grid; place-items: center; border: 1px solid var(--brass); border-radius: 50%; font: 400 .88rem/1 var(--display); color: var(--wine); }

.chapter details { border-block: 1px solid var(--rule); }
.chapter details + details { border-top: 0; }
.chapter summary { cursor: pointer; min-height: 48px; padding: 10px 0; display: flex; align-items: center; color: var(--wine); font: 700 1rem/1.3 var(--sans); }
.chapter details[open] summary { border-bottom: 1px dashed var(--rule); margin-bottom: .9rem; }
.chapter details > :last-child { margin-bottom: 1rem; }
.chapter details > * + * { margin-top: .8rem; }

table { border-collapse: collapse; width: 100%; max-width: 34rem; font: 400 1rem/1.35 var(--sans); }
th, td { padding: 7px 10px; text-align: start; border-bottom: 1px solid var(--rule); color: var(--body-type); }
thead th { font-weight: 700; color: var(--type); border-bottom: 1px solid var(--control-rule); }

.temper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 40rem; }
.temper > div { padding: 12px 14px; background: var(--vellum); border-top: 1px solid var(--brass); }
.temper span { display: block; font: 400 .95rem var(--sans); color: var(--caption); }
.temper strong { display: block; font: 400 1.6rem/1.15 var(--display); color: var(--wine); }
.temper p { font: 400 .98rem var(--sans); }

@media (min-width: 560px) {
  .temper { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 820px) {
  .lead { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 90px); align-items: center; }
  .lead-plate { aspect-ratio: 2 / 3; order: 0; max-width: 340px; justify-self: center; }
  .lead-plate .tcard-plate { object-position: 50% 50%; }
  .chapter { grid-template-columns: 210px minmax(0, 1fr); gap: clamp(26px, 4vw, 54px); align-items: start; }
  .chapter .plate { aspect-ratio: 2 / 3; position: sticky; top: 22px; }
  .chapter .plate .tcard-plate { object-position: 50% 50%; }
  .plate.is-bare { display: block; }
  .plate.is-bare .tcard-fallback { opacity: .7; }
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr); gap: clamp(30px, 4vw, 56px); align-items: start; }
  .toc { position: sticky; top: 18px; max-height: calc(100dvh - 36px); overflow-y: auto; }
  .toc details { border: 0; background: none; }
  .toc summary { display: none; }
  .toc ol { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
