/* The pages that stand outside the theme: the page for an address the site does not have, and the
   cheat sheet. They read the tokens in ingence.css, and carry only what the theme would otherwise
   give them: a reset, the header, the footer and the sheet itself. Nothing here loads anything. */

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

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
p code, li code, td code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3em; }

.wrap { width: min(100% - 2.5rem, 1120px); margin-inline: auto; }

.brand {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .files { stroke: currentColor; }
.brand .made { fill: var(--accent); }

.site-header { border-bottom: 1px solid var(--line); background: var(--page); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 60px; flex-wrap: wrap; padding-block: 0.6rem;
}
.nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; font-size: 1rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.95rem; padding-block: 2rem 3rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }

/* The page for an address the site does not have */
.nf { padding-block: 4rem 5rem; display: grid; gap: 1.25rem; max-width: 60ch; }
.nf .code { font-family: var(--font-mono); color: var(--ink-soft); }
.nf ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }

/* The cheat sheet: US Letter or A4, light whatever the chosen scheme when printed */
.sheet {
  background: var(--panel); color: var(--ink);
  width: 8.5in; min-height: 11in; padding: 0.55in 0.6in; margin: 2rem auto;
  border: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr auto; gap: 0.3in;
  font-size: 10.5pt; line-height: 1.4;
}
.sheet h1 { font-size: 20pt; }
.sheet h2 { font-size: 11pt; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.1in; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3in; border-bottom: 2px solid var(--ink); padding-bottom: 0.15in; }
.sheet-head .brand { font-size: 20pt; }
.sheet-head .brand svg { width: 34px; height: 34px; }
.sheet-head p { color: var(--ink-soft); font-size: 9.5pt; max-width: 62ch; text-align: right; }
.sheet-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0.35in; align-content: start; }
.block { display: grid; gap: 0.12in; align-content: start; }
.sheet .cmd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.12in; }
.sheet .cmd > div > code { font-size: 9.5pt; display: block; margin-bottom: 0.02in; width: max-content; max-width: 100%; }
.block > * + h2 { margin-top: 0.15in; }
.cmd .what small { display: block; color: var(--ink-soft); }
.sheet .legend { display: grid; grid-template-columns: max-content 1fr; gap: 0.08in 0.15in; align-items: center; }
.help { display: grid; gap: 0.06in; }
.soft { color: var(--ink-soft); }
.sheet-foot { border-top: 1px solid var(--line); padding-top: 0.12in; display: flex; justify-content: space-between; gap: 0.3in; color: var(--ink-soft); font-size: 9pt; }
.print-bar { text-align: center; padding: 1rem; font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .sheet { width: auto; min-height: 0; padding: 1.25rem; margin: 0; border: 0; }
  .sheet-cols { grid-template-columns: minmax(0, 1fr); }
  .sheet-head { flex-direction: column; align-items: flex-start; }
  .sheet-head p { text-align: left; }
}

@media print {
  html, html[data-theme="dark"] {
    --ink: #16181d; --ink-soft: #5b6270; --line: #d9dce3; --page: #ffffff; --panel: #ffffff;
    --accent: #1f5fa8; --code-bg: #f2f3f6; --acq: #0b6b57; --later: #8a4a10; --doubt: #a11b3a;
    --person: #c2185b; --problem: #d03b3b;
  }
  body { background: #fff; }
  .sheet { margin: 0; border: 0; width: auto; min-height: 0; padding: 0; gap: 0.2in; font-size: 9.5pt; }
  .sheet h1 { font-size: 18pt; }
  .no-print { display: none !important; }
  @page { margin: 0.5in; }
}
