/* Instrument Error: shared site styles.
   Palette and type roles follow the channel's brand guide v1: near-black ground, off-white
   text, secondary grey, one amber accent; Georgia for headings, the system UI sans-serif
   stack for body text. No web fonts, no frameworks, no external requests. */

:root {
  --bg: #0B0D10;        /* Background */
  --panel: #12161B;     /* Node fill: panels, code */
  --line: #465059;      /* Node outline: hairlines, borders */
  --edge: #7C858F;      /* Edge: link underlines, callout rule */
  --text: #EDE9E3;      /* Text */
  --muted: #9AA3AD;     /* Secondary: labels, meta, footer */
  --accent: #C9A45C;    /* Archive amber: used sparingly */

  /* Owner decisions still open. Deliberately outside the brand palette so that a page
     with an unreplaced placeholder cannot be mistaken for a finished one. */
  --ph-bg: #FFE066;
  --ph-text: #0B0D10;

  --serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, "Liberation Mono", monospace;

  color-scheme: dark;
}

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

html {
  background-color: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

.wrap {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

/* Skip link */

.skip {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  min-height: 4rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

a.wordmark:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* Type */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 6.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3.6vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.45rem;
}

strong {
  font-weight: 600;
}

.label {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The one amber rule under a page's label, as on the channel's cards. */
.rule {
  display: block;
  width: 3.5rem;
  height: 2px;
  margin: 0.8rem 0 1.5rem;
  background: var(--accent);
}

.lede {
  max-width: 38rem;
  font-size: clamp(1.15rem, 2.4vw, 1.3rem);
  line-height: 1.55;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Links */

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--edge);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Home page */

.hero {
  padding-block: clamp(3rem, 10vw, 6rem) clamp(2.5rem, 7vw, 4rem);
}

.cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.2rem;
  border: 1px solid var(--edge);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}

.cta:hover {
  border-color: var(--accent);
}

.section {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.75rem 2.5rem;
  margin: 1.75rem 0 2rem;
  padding: 0;
  list-style: none;
}

.points li,
.points p {
  margin: 0;
}

.credit {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}

.panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.panel > :last-child {
  margin-bottom: 0;
}

/* Policy pages */

.doc {
  padding-block: clamp(2.5rem, 8vw, 4.5rem) 1rem;
}

.doc h2 {
  margin-top: 3rem;
  scroll-margin-top: 1.5rem;
}

.doc h3 {
  margin-top: 1.75rem;
}

.doc .summary {
  margin: 2rem 0;
}

.doc .summary h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.doc .toc {
  margin: 2.5rem 0 1rem;
}

.doc .toc h2 {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  columns: 2 15rem;
  column-gap: 2.5rem;
  padding-left: 1.6rem;
}

.toc li {
  break-inside: avoid;
}

.callout {
  padding-left: 1rem;
  border-left: 2px solid var(--edge);
  font-size: 1.1rem;
}

.scopes dt {
  margin-top: 1rem;
}

.scopes dd {
  margin: 0.35rem 0 0;
}

code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* Owner decisions: replace the whole <mark class="ph"> element before publishing. */
mark.ph {
  padding: 0.1em 0.4em;
  border-radius: 3px;
  outline: 2px dashed var(--ph-bg);
  outline-offset: 2px;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-family: var(--mono);
  font-size: 0.9em;
  font-weight: 700;
  white-space: nowrap;
}

/* Footer */

.site-footer {
  margin-top: 3rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-brand {
  margin: 0;
  font-family: var(--serif);
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a[aria-current="page"] {
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
