/* Miles Rook — site stylesheet. No build step, no external requests. */
:root {
  --paper: #f6f3ec;
  --paper-2: #ece7dc;
  --ink: #1d1c1a;
  --muted: #57534c;
  --rule: #d6cfc1;
  --accent: #9e3220;
  --accent-ink: #ffffff;
  --term-bg: #1a1c1b;
  --term-fg: #d9e4d2;
  --term-dim: #9aa79a;
  --term-hi: #e8b065;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 40rem;
  --wide: 64rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141513;
    --paper-2: #1d1f1c;
    --ink: #e7e3d8;
    --muted: #aaa499;
    --rule: #36382f;
    --accent: #f08b6c;
    --accent-ink: #141513;
    --term-bg: #0d0e0d;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.9rem; font-family: var(--mono); font-size: 0.9rem; z-index: 10;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; letter-spacing: 0.01em;
}
.brand::before { content: "> "; color: var(--accent); }
.brand:hover { color: var(--accent); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-nav a {
  font-family: var(--mono); font-size: 0.92rem; color: var(--ink);
  text-decoration: none; padding: 0.35rem 0; display: inline-block;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"]::before { content: "*"; }

/* Type */
main { padding: 2.5rem 0 4rem; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.85rem); margin-top: 2.4rem; }
h3 { font-size: 1.25rem; margin-top: 1.6rem; }
p, ul, ol, dl, table, pre, blockquote { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: 0.35rem; }
strong { font-weight: 700; }
.lede { font-size: 1.25rem; line-height: 1.5; max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: 0.95rem; }

.eyebrow {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.02em;
  color: var(--muted); margin: 0 0 0.75rem;
}
.eyebrow .prompt { color: var(--accent); }
.subtitle { font-size: 1.25rem; color: var(--muted); margin-top: -0.4rem; }

/* Hero */
.hero { padding: 1rem 0 1.5rem; }
.hero h1 { max-width: 18ch; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }
.button {
  display: inline-block; font-family: var(--mono); font-size: 0.95rem; font-weight: 700;
  padding: 0.75rem 1.1rem; border: 2px solid var(--accent); border-radius: 3px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; line-height: 1.2;
}
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button.secondary { background: transparent; color: var(--accent); }
.button.inert {
  background: transparent; color: var(--muted); border-color: var(--rule);
  border-style: dashed; cursor: not-allowed;
}

/* Cards */
.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 1.25rem; }
@media (min-width: 46rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  border: 1px solid var(--rule); background: var(--paper-2); border-radius: 4px;
  padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column;
}
.card h3 { margin-top: 0.2rem; font-size: 1.5rem; }
.card .eyebrow { margin-bottom: 0.25rem; }
.card p:last-child { margin-bottom: 0; margin-top: auto; }
.status {
  font-family: var(--mono); font-size: 0.88rem; display: inline-block;
  border-left: 3px solid var(--accent); padding: 0.1rem 0 0.1rem 0.6rem; color: var(--ink);
}

/* Callout band */
.band { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 3rem 0 0; padding: 2rem 0; }
.band h2 { margin-top: 0; }

/* Terminal block */
.term {
  background: var(--term-bg); color: var(--term-fg); font-family: var(--mono);
  font-size: 0.9rem; line-height: 1.55; padding: 1rem 1.15rem; border-radius: 4px;
  overflow-x: auto; max-width: var(--measure);
}
.term .hi { color: var(--term-hi); }
.term .dim { color: var(--term-dim); }
figure { margin: 0 0 1.5rem; }
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; max-width: var(--measure); }

/* Table */
.table-wrap { overflow-x: auto; max-width: var(--measure); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
caption { text-align: left; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--muted); }
td.num { font-family: var(--mono); width: 2.5rem; }

/* Definition list */
dl.facts { display: grid; grid-template-columns: 1fr; gap: 0.2rem 1.25rem; max-width: var(--measure); }
@media (min-width: 36rem) { dl.facts { grid-template-columns: 9rem 1fr; } }
dl.facts dt { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); padding-top: 0.25rem; }
dl.facts dd { margin: 0 0 0.6rem; }

/* Book entries */
.book { border-top: 1px solid var(--rule); padding-top: 0.5rem; margin-top: 2.5rem; max-width: var(--measure); }
.hook { font-style: italic; font-size: 1.2rem; border-left: 3px solid var(--rule); padding-left: 1rem; margin-left: 0; }

/* Newsletter form area */
.signup {
  border: 2px solid var(--ink); border-radius: 4px; padding: 1.4rem;
  max-width: var(--measure); background: var(--paper-2);
}
.signup h2 { margin-top: 0; }
.consent { font-size: 0.95rem; color: var(--muted); margin-top: 1rem; margin-bottom: 0; }

ol.steps { counter-reset: step; list-style: none; padding-left: 0; max-width: var(--measure); }
ol.steps li { counter-increment: step; padding-left: 2.4rem; position: relative; }
ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem;
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center;
  border: 1px solid var(--ink); border-radius: 50%;
}

address { font-style: normal; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  a, .button { transition: color 0.15s ease, filter 0.15s ease; }
}
@media print {
  .site-header nav, .skip-link, .actions { display: none; }
  body { background: #fff; color: #000; }
}
