/* yt-autopilot public site — single stylesheet, no external requests. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #4a505c;
  --ink-faint: #767d8c;
  --rule: #e3e0da;
  --accent: #9a3412;
  --accent-soft: #fdf3ec;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --surface: #1b1d24;
    --ink: #eceef2;
    --ink-soft: #b2b8c4;
    --ink-faint: #868d9b;
    --rule: #2c2f38;
    --accent: #f0a37a;
    --accent-soft: #241c18;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- masthead ----------------------------------------------------------- */

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

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand span { color: var(--accent); }

nav.site { display: flex; gap: 1.25rem; font-size: 0.9375rem; }

/* Standalone controls, so they carry their own >=24px tap area rather than
   relying on the 21px line box the text happens to produce. */
nav.site a {
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-block;
  padding: 0.28rem 0;
}
nav.site a:hover,
nav.site a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* --- type --------------------------------------------------------------- */

main { padding: 3rem 0 4rem; }

h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.standfirst {
  font-size: 1.125rem;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
  max-width: 36rem;
}

h2 {
  font-size: 1.1875rem;
  letter-spacing: -0.005em;
  margin: 2.75rem 0 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.4rem;
  font-weight: 650;
}

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

li { margin-bottom: 0.4rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  word-break: break-word;
}

strong { font-weight: 650; }

.meta {
  font-size: 0.875rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  margin: 0 0 2.25rem;
}

/* --- blocks ------------------------------------------------------------- */

/* A link that is the whole of its line is a control, not running text, so it
   does not get WCAG 2.5.8's inline-text exemption and carries its own tap
   area. */
p.lone-link a {
  display: inline-block;
  padding: 0.25rem 0;
}

.note {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}

.note p:last-child { margin-bottom: 0; }

.scroller { overflow-x: auto; margin: 0 0 1.5rem; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: 0.9375rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.85rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
}

td code { background: none; padding: 0; color: var(--ink-soft); }

dl { margin: 0 0 1.5rem; }
dt { font-weight: 650; margin-top: 1rem; }
dd { margin: 0.2rem 0 0; color: var(--ink-soft); }

/* --- footer ------------------------------------------------------------- */

footer.site {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.75rem 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

footer.site p { margin: 0 0 0.4rem; }
footer.site a {
  color: var(--ink-soft);
  display: inline-block;
  padding: 0.22rem 0;
}

@media (max-width: 30rem) {
  nav.site { gap: 1rem; font-size: 0.875rem; }
  main { padding: 2.25rem 0 3rem; }
}
