/* Relative Dating Practice: an outcrop in a field notebook. Pale limestone page, basalt-dark section bars, iron-oxide
   rust for actions, and the cross sections themselves always on white paper, in black line art like a Regents exam. */
:root {
  --bg: #ebe6dc;
  --paper: #fbfaf7;
  --ink: #22201c;
  --muted: #57524a;
  --line: #cfc7b8;
  --edge: #8f877a;
  --basalt: #2d2b28;
  --basalt-ink: #f4efe6;
  --accent: #9a3412;
  --accent-ink: #ffffff;
  --accent-soft: #f4e3d7;
  --ok: #1d6a37;
  --ok-soft: #dff0e4;
  --bad: #a3231b;
  --bad-soft: #f8e1dd;
  --warn: #7a5200;
  --warn-soft: #f6ecd4;
  --focus: #1d5fd1;
  --head: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r: 4px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1917;
    --paper: #24221f;
    --ink: #ece7de;
    --muted: #b6aea2;
    --line: #3e3a34;
    --edge: #6f685d;
    --basalt: #0f0e0d;
    --basalt-ink: #f4efe6;
    --accent: #f0a274;
    --accent-ink: #1d0e05;
    --accent-soft: #3a2418;
    --ok: #8fd8a6;
    --ok-soft: #16301f;
    --bad: #ff9d90;
    --bad-soft: #3b1c18;
    --warn: #f0c66b;
    --warn-soft: #362b13;
    --focus: #8ab8ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero { padding: 22px 0 4px; max-width: 780px; }
h1 { font: 800 clamp(1.85rem, 5.2vw, 2.7rem)/1.05 var(--head); font-stretch: condensed; margin: 0 0 8px; letter-spacing: -0.01em; }
.lede { margin: 0; color: var(--muted); max-width: 64ch; }
h2 { font: 800 1.45rem/1.2 var(--head); font-stretch: condensed; margin: 0 0 10px; }

/* setup */
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: var(--r); overflow: hidden; }
.segb { font: inherit; font-weight: 650; min-height: 44px; padding: 8px 14px; border: 0; background: var(--paper); color: var(--muted); cursor: pointer; }
.segb + .segb { border-left: 1px solid var(--edge); }
.segb[aria-pressed="true"] { background: var(--basalt); color: var(--basalt-ink); }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 650; }
select, input { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); min-height: 44px; padding: 6px 10px; }
select { max-width: 100%; }
.btn { font: inherit; font-weight: 650; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 6px 14px; }
.btn:hover { filter: brightness(0.95); }
.link { font: inherit; background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.setcode { color: var(--muted); font-size: 0.95rem; }
.setcode b { color: var(--ink); }
.levelnote { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 0.95rem; }

.note { margin: 12px 0; padding: 10px 12px; border-left: 5px solid var(--warn); background: var(--warn-soft); }
.note.info { border-left-color: var(--accent); background: var(--accent-soft); }
.note .link { min-height: 0; padding: 0; font-weight: 650; }
.clear-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.clear-ask[hidden] { display: none; }
.clear-ask .link { min-height: 44px; padding: 0 4px; }

/* sections */
.sets:focus { outline: none; }
.xs { margin: 16px 0 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.xs-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; background: var(--basalt); color: var(--basalt-ink); padding: 8px 16px; border-radius: var(--r) var(--r) 0 0; }
.xs-head h2 { margin: 0; font-size: 1.3rem; color: var(--basalt-ink); }
.xs-head .of { font-weight: 500; opacity: 0.75; }
.xs-score { margin: 0; font-size: 0.92rem; }
.drawing { padding: 40px 16px; color: var(--muted); min-height: 300px; margin: 0; }
.fig { margin: 0; padding: 12px 12px 0; }
.fig svg { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); }
.figview { overflow: hidden; }
.zoom { padding: 4px 12px; min-height: 44px; background: transparent; color: var(--basalt-ink); border-color: var(--basalt-ink); }
.sets.zoomed .figview { overflow-x: auto; }
.sets.zoomed .figview svg { width: 200%; max-width: none; }
@media (min-width: 900px) { .zoom { display: none; } .sets.zoomed .figview svg { width: 100%; } .sets.zoomed .figview { overflow: hidden; } }
.fig figcaption { padding: 8px 2px 0; font-size: 0.95rem; color: var(--muted); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0 14px; font-size: 0.92rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 38px; height: 23px; background: #fff; flex: none; }
.fig .legend { padding: 0 2px 12px; } /* the key sits in the figure, so it stays beside the drawing on wide screens */
.qs { list-style: none; counter-reset: q; margin: 10px 0 0; padding: 0; }
.q { counter-increment: q; position: relative; padding: 12px 16px 6px 52px; border-top: 1px solid var(--line); }
.q::before { content: counter(q); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); font: 700 0.85rem/23px var(--sans); text-align: center; }
.q.is-right::before { background: var(--ok); color: var(--paper); border-color: var(--ok); }
.qt { margin: 0 0 8px; max-width: 64ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { position: relative; font: 700 1.05rem var(--mono); min-width: 48px; min-height: 44px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; padding: 0 10px; }
.chip[aria-pressed="true"] { background: var(--basalt); color: var(--basalt-ink); border-color: var(--basalt); }
.chip small { position: absolute; right: -4px; top: -6px; font: 700 0.7rem/1 var(--sans); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 2px 5px; }
.arow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ain input { width: 11em; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.ain input::placeholder { letter-spacing: 0; text-transform: none; }
.link.small { padding: 10px 6px; }
.opts { border: 0; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.opt input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fbwrap:empty { display: none; }
.fb { margin: 8px 0 0; padding: 7px 10px; border-radius: var(--r); max-width: 66ch; }
.fb.right { background: var(--ok-soft); color: var(--ok); }
.fb.wrong, .fb.unread { background: var(--bad-soft); color: var(--bad); }
.work > summary { cursor: pointer; color: var(--muted); font-size: 0.93rem; padding: 10px 0; min-height: 44px; display: flex; align-items: center; list-style: none; }
.work > summary::-webkit-details-marker { display: none; }
.work > summary::before { content: "+"; margin-right: 6px; font: 700 1rem var(--mono); }
.work[open] > summary::before { content: "\2212"; }
.ans { margin: 0 0 6px; }
.why { margin: 0 0 10px; padding-left: 1.2em; font-size: 0.94rem; }
.why li { margin: 3px 0; }
.why1 { margin: 0 0 10px; font-size: 0.94rem; max-width: 66ch; }

@media (min-width: 1060px) {
  /* drawing beside its questions; it stays in view while the questions scroll */
  .xs { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .xs-head { grid-column: 1 / -1; }
  .fig { grid-column: 1; grid-row: 2; }
  .qs { grid-column: 2; grid-row: 2 / span 2; margin: 0; border-left: 1px solid var(--line); }
  .q:first-child { border-top: 0; }
  .fig { position: sticky; top: 8px; align-self: start; }
}

.share { margin: 18px 0 8px; }
.print-row { display: flex; align-items: flex-end; gap: 8px 10px; flex-wrap: wrap; }
.print-row label { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; font-weight: 650; }
.share-out label { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; font-weight: 650; }
.share-out input { width: 100%; }
.recent { margin-top: 12px; border-top: 1px solid var(--line); }
.recent summary { cursor: pointer; padding: 11px 0; font-weight: 650; min-height: 44px; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 4px 0; }
.recent small { display: block; color: var(--muted); }
.code { font-family: var(--mono); letter-spacing: 0.06em; }
.hint { color: var(--muted); font-size: 0.92rem; }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 160%); background: var(--basalt); color: var(--basalt-ink); padding: 10px 14px; border-radius: var(--r); max-width: calc(100% - 32px); transition: transform 0.2s; z-index: 20; }
.toast.on { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* content */
.content { padding: 22px 0 8px; max-width: 800px; }
.content h2 { margin-top: 30px; }
.content p { max-width: 68ch; }
.rules { padding-left: 1.2em; max-width: 68ch; }
.rules li { margin: 4px 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 11px 0; font-weight: 650; min-height: 44px; }
.faq details p { margin: 0 0 12px; }
.sources { font-size: 0.92rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 22px; }

footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 16px 0 28px; color: var(--muted); font-size: 0.92rem; }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 6px 0; }
.sb-more { line-height: 1.8; }
.sb-footer a { color: var(--ink); }
.nf-box { margin: 12px 0; max-width: 62ch; color: var(--muted); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 640px) {
  .hero { padding-top: 14px; }
  .xs { margin-left: -16px; margin-right: -16px; border-left: 0; border-right: 0; border-radius: 0; }
  .xs-head { border-radius: 0; }
  .fig { padding: 6px 0 0; }
  .fig svg { border-left: 0; border-right: 0; }
  .fig figcaption { padding: 8px 12px 0; }
  .legend, .fig .legend { padding: 0 12px 10px; gap: 4px 12px; font-size: 0.88rem; }
  .q { padding: 12px 12px 6px 46px; }
  .q::before { left: 10px; }
  .segb { padding: 8px 11px; }
}

/* print: only the worksheet and key, black and white */
.print-root { display: none; }
@page { margin: 0.5in 0.55in; }
@media print {
  body { background: #fff; color: #000; font: 10.5pt/1.35 var(--sans); }
  main, footer, .toast, .skip { display: none !important; }
  .print-root { display: block; }
  .psec, .pkey { break-after: page; page-break-after: always; }
  .print-root > :last-child { break-after: auto; page-break-after: auto; }
  .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt; border-bottom: 2pt solid #000; margin-bottom: 6pt; }
  .ph h2 { font: 800 15pt var(--head); font-stretch: condensed; margin: 0; }
  .ph p { margin: 0; font-size: 9.5pt; }
  .pmeta { display: flex; justify-content: space-between; gap: 12pt; margin: 2pt 0 6pt; }
  .pfig svg { display: block; width: 100%; height: auto; max-height: 3.9in; }
  .kfig svg { display: block; width: 62%; height: auto; margin: 0 0 4pt; }
  .legend { list-style: none; display: flex; flex-wrap: wrap; gap: 3pt 12pt; margin: 4pt 0 0; padding: 0; font-size: 9pt; }
  .legend li { display: flex; align-items: center; gap: 4pt; }
  .legend .sw { width: 30pt; height: 18pt; }
  .pstate { margin: 5pt 0 4pt; font-size: 9.5pt; font-style: italic; }
  .pq { margin: 0; padding-left: 16pt; }
  .pq > li { break-inside: avoid; page-break-inside: avoid; padding: 5pt 0 4pt; }
  .pqt { margin: 0 0 3pt; }
  .pord { margin: 6pt 0 2pt; display: flex; align-items: flex-end; gap: 8pt; }
  .blank { display: inline-block; width: 0.42in; border-bottom: 0.8pt solid #000; height: 14pt; }
  .popts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2pt 13pt; }
  .popts li { display: flex; align-items: center; gap: 5pt; }
  .circle { display: inline-block; width: 9pt; height: 9pt; border: 0.8pt solid #000; border-radius: 50%; }
  .pk { margin: 0; padding-left: 16pt; }
  .pk > li { break-inside: avoid; page-break-inside: avoid; padding: 3pt 0 4pt; border-bottom: 0.6pt solid #bbb; }
  .pk p { margin: 0; }
  .pkq { font-size: 9pt; color: #333; }
  .pka { font-weight: 700; margin-top: 1pt !important; }
  .pks { margin: 1pt 0 0; padding-left: 12pt; font-size: 8.8pt; line-height: 1.3; }
  .pks1 { font-size: 8.8pt; line-height: 1.3; }
}
