/* paperprintouts.com — shared design system.
   Dark-first tokens, matching the house pattern used across the portfolio. */

:root {
  --bg: #14161a;
  --surface: #1c1f25;
  --surface-2: #23272f;
  --line: #333944;
  --ink: #e8eaed;
  --ink-dim: #a3abb8;
  --accent: #6ea8fe;
  --accent-ink: #0b1220;
  --focus: #ffd166;
  --sheet: #ffffff;
  --sheet-ink: #111111;
  --radius: 8px;
  --measure: 68ch;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --line: #d3d7de;
  --ink: #14161a;
  --ink-dim: #59606c;
  --accent: #1a56c4;
  --accent-ink: #ffffff;
  --focus: #a15c00;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #eceef2;
    --line: #d3d7de;
    --ink: #14161a;
    --ink-dim: #59606c;
    --accent: #1a56c4;
    --accent-ink: #ffffff;
    --focus: #a15c00;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 20;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- chrome ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-dim); text-decoration: none; font-size: 0.92rem; }
.site-nav a:hover { color: var(--ink); }

.theme-toggle {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.5rem 1.1rem 3rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.site-footer a { color: var(--ink-dim); }

/* ---- prose ---- */

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.1rem; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2rem; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); line-height: 1.15; margin: 0 0 0.4rem; }
.lede { color: var(--ink-dim); font-size: 1.05rem; margin-top: 0; }

/* ---- tool layout ---- */

.tool {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.4rem;
  align-items: start;
}
@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 4.2rem;
}
@media (max-width: 860px) {
  .panel { position: static; }
}

.panel h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); margin: 0 0 0.8rem; }

.field { margin-bottom: 0.85rem; }
.field > label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-bottom: 0.25rem;
}
.field input[type="number"],
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}
.field textarea { min-height: 7rem; resize: vertical; font-family: var(--mono); font-size: 0.9rem; }
.field input[type="range"] { width: 100%; }
.field .inline { display: flex; align-items: center; gap: 0.5rem; }
.field .inline input[type="checkbox"] { width: 1.05rem; height: 1.05rem; }
.field .inline label { font-size: 0.9rem; color: var(--ink); margin: 0; }
.field .hint { font-size: 0.78rem; color: var(--ink-dim); margin-top: 0.25rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

.stage {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  overflow-x: auto;
}
.stage .sheet {
  background: var(--sheet);
  color: var(--sheet-ink);
  margin: 0 auto;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  display: block;
  max-width: 100%;
  height: auto;
}
.stage-note { color: var(--ink-dim); font-size: 0.85rem; margin: 0 0 0.7rem; }

.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; list-style: none; padding: 0; }
.tool-cards a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
}
.tool-cards a:hover { border-color: var(--accent); }
.tool-cards strong { display: block; margin-bottom: 0.2rem; }
.tool-cards span { color: var(--ink-dim); font-size: 0.9rem; }

details.faq { border-top: 1px solid var(--line); padding: 0.7rem 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { color: var(--ink-dim); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* The eRabb.it mark, last element in the body on every site in the family. */
.erabbit-mark { display: block; width: 10px; margin: 0 0 0 auto; line-height: 0; cursor: default; }
.erabbit-mark img { display: block; width: 10px; height: 10px; }

/* ---- print: the sheet, at true scale, and nothing else ---- */

@media print {
  /* Everything except the sheet itself. The card list is a sibling of .prose,
     not a child, so it needs naming separately or it prints as a second page. */
  .site-header,
  .site-footer,
  .panel,
  .stage-note,
  .prose,
  .tool-cards,
  .skip-link,
  .erabbit-mark,
  h1,
  .lede { display: none !important; }

  body { background: #fff; color: #000; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .tool { display: block; }
  .stage { border: 0; padding: 0; background: #fff; overflow: visible; }
  .stage .sheet { box-shadow: none; margin: 0; max-width: none; }
  /* One sheet per printed page — this is what makes roster autofill work. */
  .stage .sheet + .sheet { break-before: page; page-break-before: always; }
}
