@layer reset, book, frame, parts, helpers;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
  img { max-width: 100%; height: auto; }
  a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .075em; }
  button, input, summary { font: inherit; }
}

@layer book {
  @font-face {
    font-family: "STIX Two Text";
    src: url("/resources/stix-two-text-book.woff") format("woff");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
  }
  :root {
    color-scheme: light;
    --paper: #fcfaf4;
    --ink: #283e2e;
    --fern: #396c49;
    --cream: #fffdf5;
    --leaf: #e7eedf;
    --brick: #98462f;
    --line: #b5c1ad;
    --r: 6px;
  }
  html { font-size: 100%; scroll-padding-top: 1.5rem; }
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: "STIX Two Text", Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.55;
    font-weight: 400;
    overflow-wrap: break-word;
  }
  h1, h2, h3 { font-weight: 600; text-wrap: balance; }
  h1 { font-size: clamp(2.5rem, 5.05vw, 4.625rem); line-height: 1.06; letter-spacing: -.025em; }
  h2 { font-size: clamp(1.875rem, 2.55vw, 2.5rem); line-height: 1.16; letter-spacing: -.015em; }
  h3, dt { font-size: 1.625rem; line-height: 1.25; font-weight: 600; }
  p + p { margin-top: 1.1rem; }
  p, li, dd, td { text-wrap: pretty; }
  p { max-width: 68ch; }
  h2 + p, h3 + p { margin-top: 1.25rem; }
  :focus-visible { outline: 3px solid var(--brick); outline-offset: 5px; border-radius: 3px; }
  ::selection { background: var(--brick); color: var(--cream); }
}

@layer frame {
  .w { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
  .mast { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 90px; border-bottom: 1px solid var(--line); }
  .mast p { font-size: 1.125rem; }
  .mast p:first-child { font-size: 1.375rem; font-weight: 600; }
  .intro { padding-block: 64px 60px; text-align: center; }
  .intro h1 { max-width: 19ch; margin-inline: auto; }
  .intro .lead { max-width: 58ch; margin: 26px auto 0; }
  .side { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 48px; text-align: left; }
  .side h1 { max-width: 21ch; margin-inline: 0; }
  .side .lead { margin-inline: 0; }
  .lead { font-size: 1.375rem; line-height: 1.5; }
  .field { background: var(--fern); color: var(--cream); padding-block: 48px; }
  .split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 88px; align-items: start; }
  .depth { display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; padding-block: 80px 64px; align-items: center; }
  .prose h2 { max-width: 20ch; }
  .brief { display: grid; grid-template-columns: 100px minmax(0, 720px); gap: 34px; padding: 44px 48px; background: var(--leaf); border-radius: var(--r); }
  .tail { padding-block: 64px 80px; max-width: 820px; }
  .tail h2 { max-width: 27ch; }
  .pull { max-width: 820px; }
  .slim { padding-block: 48px; }
  .kinds { padding-block: 76px 68px; }
  .kinds > p { margin-top: 20px; }
  .kinds dl { display: grid; gap: 0; margin-top: 30px; }
  .kinds dl > div { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 64px; padding-block: 34px; border-bottom: 1px solid var(--line); }
  .tally { padding-block: 76px; }
  .thd { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
  .sample { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; padding: 50px; background: var(--leaf); border-radius: var(--r); margin-bottom: 76px; align-items: center; }
  .nb { padding-block: 76px 60px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 76px; margin-top: 36px; }
  .note { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--line); }
  .take { padding-block: 64px 56px; max-width: 820px; }
  .help { max-width: 820px; padding: 34px 38px; background: var(--brick); color: var(--cream); border-radius: var(--r); }
  .foot { background: var(--leaf); padding-block: 40px 34px; }
  .foot .w { max-width: 1160px; }
  .lost { max-width: 820px; padding-block: 70px; }
  .lost > p:not(.loc) { margin-inline: auto; }
}

@layer parts {
  .loc { font-size: 1.125rem; color: var(--brick); margin-bottom: 20px; font-weight: 600; }
  .myth { padding-right: 22px; }
  .myth > p:last-child { font-size: 1.75rem; line-height: 1.3; max-width: 22ch; }
  .tag { font-size: 1.125rem; font-weight: 600; margin-bottom: 16px; }
  .field h2 { max-width: 26ch; }
  .field .tag + h2 { margin-top: 0; }
  .clay { background: var(--brick); }
  .sprig { display: block; width: 72px; height: 72px; color: var(--fern); }
  .hm .sprig { width: 104px; height: 104px; }
  .art { min-width: 0; }
  .art img { display: block; width: 100%; aspect-ratio: 1024 / 704; object-fit: cover; border-radius: var(--r); background: var(--leaf); color: var(--ink); font-size: 1rem; line-height: 1.6; }
  .sample .art img { background: #d6e1cc; }
  figcaption { font-size: 1.0625rem; line-height: 1.45; margin-top: 14px; }
  .go, .out { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 50px; padding: 12px 17px; border-radius: var(--r); line-height: 1.35; font-size: 1.125rem; margin-top: 24px; }
  .go { background: var(--brick); color: var(--cream); text-decoration: none; font-weight: 600; }
  .out { padding-left: 0; color: var(--brick); margin-top: 16px; }
  .out + p { margin-top: 16px; }
  .go span, .out span { flex: 0 0 auto; }
  .src { margin-top: 44px; border-radius: var(--r); background: var(--leaf); overflow: clip; }
  summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; list-style: none; min-height: 62px; padding: 15px 22px; font-weight: 600; font-size: 1.25rem; }
  summary::-webkit-details-marker { display: none; }
  details[open] summary { border-bottom: 1px solid var(--line); }
  details[open] summary > span { transform: rotate(45deg); }
  .si { padding: 16px 22px 20px; }
  .si > p { font-size: 1.125rem; margin-bottom: 12px; }
  .sl { list-style: none; padding: 0; }
  .sl a { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 52px; padding-block: 12px; font-size: 1.125rem; line-height: 1.4; }
  .sl a span { flex: 0 0 auto; }
  table { width: 100%; border-collapse: collapse; margin-top: 36px; table-layout: fixed; font-size: 1.25rem; }
  caption { text-align: left; font-size: 1.0625rem; margin-bottom: 15px; }
  thead { background: var(--fern); color: var(--cream); }
  th, td { text-align: left; vertical-align: top; padding: 20px 24px; }
  th { font-weight: 600; }
  th:first-child { width: 24%; }
  thead th:first-child { border-radius: var(--r) 0 0 0; }
  thead th:last-child { border-radius: 0 var(--r) 0 0; }
  tbody tr { border-bottom: 1px solid var(--line); }
  tbody tr:nth-child(even) { background: var(--leaf); }
  .ck { padding: 0; list-style: none; margin-top: 20px; }
  .ck li { position: relative; padding: 14px 0 14px 35px; border-bottom: 1px solid var(--line); max-width: 68ch; }
  .ck li::before { content: ""; position: absolute; left: 0; top: 24px; width: 14px; height: 14px; border: 1.5px solid var(--brick); border-radius: 4px; }
  .ft { font-size: 1.375rem; font-weight: 600; margin-bottom: 16px; }
  .foot ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; }
  .foot li { min-width: 0; }
  .foot a { min-height: 55px; padding: 12px 0; display: flex; align-items: center; gap: 12px; justify-content: space-between; font-size: 1.125rem; line-height: 1.35; }
  .foot a[aria-current] { font-weight: 600; text-decoration-style: double; }
  .fl { margin-top: 28px; font-size: 1.0625rem; max-width: 75ch; }
  .field :focus-visible, .help :focus-visible { outline-color: var(--cream); }
}

@layer helpers {
  .skip { position: absolute; top: 8px; left: 8px; transform: translateY(-180%); background: var(--cream); color: var(--ink); padding: 12px 20px; min-height: 48px; z-index: 5; border-radius: var(--r); font-size: 1.125rem; }
  .skip:focus { transform: translateY(0); }
  @media (hover: hover) {
    .go:hover { background: #803a27; }
    .sl a:hover, .out:hover, .foot a:hover { text-decoration-thickness: .14em; }
    summary:hover { background: #dce6d1; }
  }
  @media (max-width: 900px) {
    .w { width: calc(100% - 56px); }
    .split { gap: 40px; grid-template-columns: 1fr 1.5fr; }
    .depth { gap: 36px; }
    .kinds dl > div { grid-template-columns: 230px minmax(0, 1fr); gap: 34px; }
    .sample { padding: 34px; gap: 34px; }
    .pair { gap: 40px; }
    .foot ul { grid-template-columns: 1fr 1fr; gap: 8px 32px; }
  }
  @media (max-width: 660px) {
    body { font-size: 1.1875rem; line-height: 1.55; }
    .w { width: calc(100% - 40px); }
    .mast { min-height: 74px; gap: 12px; }
    .mast p { font-size: 1rem; }
    .mast p:first-child { font-size: 1.125rem; }
    .intro { padding-block: 40px 38px; text-align: left; }
    .intro h1 { margin-inline: 0; max-width: 18ch; }
    .intro .lead { font-size: 1.25rem; margin-top: 22px; }
    .side { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .hm { display: none; }
    .loc { font-size: 1.0625rem; margin-bottom: 16px; }
    .field { padding-block: 34px; }
    .split { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .myth { padding-right: 0; }
    .myth > p:last-child { font-size: 1.5rem; max-width: 29ch; }
    .tag { margin-bottom: 10px; font-size: 1.0625rem; }
    .depth { grid-template-columns: minmax(0, 1fr); padding-block: 48px; gap: 30px; }
    .brief { grid-template-columns: minmax(0, 1fr); padding: 26px 24px; gap: 12px; }
    .sm .sprig { width: 44px; height: 44px; }
    .tail { padding-block: 46px 52px; }
    .kinds { padding-block: 48px 36px; }
    .kinds dl > div { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 28px; }
    .kinds dl { margin-top: 18px; }
    dt, h3 { font-size: 1.5rem; }
    .tally { padding-block: 48px; }
    .thd, .sample, .pair { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .thd p { margin: 0; }
    .sample { padding: 26px 24px; margin-bottom: 48px; }
    .sample h2 { overflow-wrap: normal; }
    table { font-size: 1.125rem; margin-top: 28px; }
    th, td { padding: 16px 12px; }
    th:first-child { width: 30%; }
    .nb { padding-block: 48px 40px; }
    .pair { margin-top: 28px; gap: 36px; }
    .note { margin-top: 36px; padding-top: 26px; }
    .take { padding-block: 42px; }
    .help { padding: 28px 24px; }
    .src { margin-top: 32px; }
    summary { padding-inline: 16px; font-size: 1.1875rem; }
    .si { padding-inline: 16px; }
    .go, .out { font-size: 1.125rem; max-width: 100%; }
    .foot { padding-block: 32px; }
    .foot ul { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .foot a { min-height: 52px; border-bottom: 1px solid var(--line); }
    .fl { font-size: 1.0625rem; }
    .lost > p:not(.loc) { margin-inline: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto; animation: none; transition: none; }
  }
  @media print {
    body { background: white; color: black; font-size: 12pt; }
    .w { width: 100%; }
    .field, .help, .brief, .sample, .foot { background: white; color: black; }
    .skip, .hm, .sm, .art, .foot nav { display: none; }
    .intro, .tail, .kinds, .tally, .take, .nb { padding-block: 16pt; }
    .src { break-inside: avoid; }
    .go, .out { color: black; background: white; }
  }
}
