/* Shared reading styles for /p/, the Mac checklist, and the CVE tracker.
   Artwork keeps its own presentation. See /p/RULES.md. */

:root {
  color-scheme: dark;
  --bg: #03060d;
  --surface: #0b121d;
  --fg: #919faf;
  --heading: #b3c0d1;
  --muted: #7f8fa4;
  --line: #203046;
  --accent: #8ba7c8;
  --control: #65778d;
  --success: #62d995;
  --face: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.8 var(--face);
  overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; }
.wrap {
  max-width: 47rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Skip link — hidden until focused. Target the first section's id. */
.skip {
  position: absolute;
  z-index: 2;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--bg);
  color: var(--fg);
  padding: 0.4rem 0.6rem;
}
.skip:focus { transform: none; }

/* Osprey portrait back to the apex — circular crop, thin ring on hover/focus. */
.home {
  display: block;
  width: fit-content;
  margin: 1.35rem auto 1.6rem;
  color: var(--accent);
  text-decoration: none;
}
.home .mark {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  outline: 1px solid transparent;
  outline-offset: 0;
  transition: outline-color 0.15s ease;
}
.home:hover .mark,
.home:focus-visible .mark { outline-color: var(--fg); }

h1 {
  margin: 0;
  font-size: 2.4em;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--heading);
}
h2 {
  margin: 0 0 1rem;
  font-size: 1.25em;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--heading);
}
h3 {
  margin: 1.75rem 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--heading);
}
p { margin: 1em 0 0; }
strong { color: var(--heading); font-weight: 600; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lede { margin-top: 1.4rem; font-size: 1.06em; line-height: 1.75; }
.fine { color: var(--muted); font-size: 0.92em; }
section { margin-top: 3rem; scroll-margin-top: 1.75rem; }
code { font-family: inherit; font-size: 0.92em; background: var(--surface); padding: 0.12em 0.25em; border-radius: 3px; overflow-wrap: anywhere; }

/* Commands remain selectable and wrap without widening the reading column. */
pre {
  margin: 1em 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font: inherit;
  font-size: 0.92em;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
pre code { font-size: inherit; padding: 0; background: none; }

.command-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  max-width: 100%;
}
.command-inline > code { min-width: 0; }
.command-block {
  position: relative;
  margin-top: 1em;
}
.command-block > pre { margin: 0; padding-top: 3rem; }
.command-block > .command-copy { position: absolute; top: 0.5rem; right: 0.5rem; }
.command-copy {
  flex: none;
  min-width: 4.25em;
  min-height: 1.5rem;
  padding: 0.15em 0.4em;
  border: 1px solid var(--control);
  border-radius: 3px;
  background: var(--surface);
  color: var(--accent);
  font: 0.75rem/1.4 var(--face);
  white-space: nowrap;
  cursor: pointer;
}
.command-copy:hover { border-color: var(--accent); }
.command-copy-note { display: block; color: var(--muted); font-size: 0.875em; }

ol.steps, ul.plain { margin: 0.6rem 0 0; padding-left: 1.35em; }
ol.steps li, ul.plain li { margin-top: 0.7em; padding-left: 0.3em; }
ol.steps li:first-child, ul.plain li:first-child { margin-top: 0; }

/* Tool/resource lists: unstyled, with breathing room between entries. */
.tools { margin: 0.4rem 0 0; padding: 0; list-style: none; }
.tools li { margin-top: 0.7rem; }
.tools strong { font-weight: 600; }

/* Notes and cautions: muted, 2px left border, short bold label. */
.caveat {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
  font-size: 0.92em;
  color: var(--muted);
}
.caveat-label {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
  color: var(--fg);
}

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

@media (max-width: 560px) {
  .wrap { padding: 0 1.25rem 4rem; }
  h1 { font-size: 1.85em; letter-spacing: -0.025em; }
}

@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #eee; --heading: #111; --fg: #222; --muted: #444; --line: #bbb; --accent: #222; --control: #555; }
  .skip, .home { display: none; }
  .command-copy, .command-copy-note { display: none; }
  .command-block > pre { padding-top: 1rem; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
