/* paigez.com — writing pages.
   Site shell (palette, brand, nav, footer) matches index / print / paris.
   Article body is deliberately plain: Inter throughout, tight leading,
   no rules between items. A document, not a magazine spread. */

:root {
  --bg:        #f4f1ec;
  --ink:       #1a1714;
  --ink-soft:  #5a544c;
  --ink-faint: #948b7e;
  --rule:      #d9d3c8;
  --accent:    oklch(0.55 0.08 60);
  --measure:   32rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.4rem, 4vw, 3.25rem);
}

html { scroll-behavior: smooth; }

p { margin: 0 0 0.55rem; }
p:last-child { margin-bottom: 0; }

/* Uppercase utility — same treatment as the rest of the site. */
.eyebrow,
.label,
.nav-links,
.back-link,
.footer-inner,
.notes > h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- topbar ---------- */

.site-header { border: 0; background: none; }

.nav {
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 0 0 2.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem 2rem;
}

.brand {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.brand::after { content: "."; color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.3rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.4s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--ink); }

/* ---------- article ---------- */

main {
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
}

article > header { margin: 0 0 1.5rem; }

.eyebrow { margin: 0 0 0.5rem; }

h1 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.dek {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 0 0 0.3rem;
  color: var(--ink);
}

/* Body prose */
.principle p,
.blueprint-item p,
.failure-mode p,
.recovery p,
.notfound p {
  font-size: 0.9rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.principle a,
.blueprint-item a,
.failure-mode a,
.origin-note a,
.appendix-link a,
.recovery a,
.notes a,
.notfound a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.4s ease, color 0.4s ease;
}
.principle a:hover,
.blueprint-item a:hover,
.failure-mode a:hover,
.origin-note a:hover,
.appendix-link a:hover,
.recovery a:hover,
.notes a:hover,
.notfound a:hover { color: var(--accent); border-color: var(--accent); }

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

/* ---------- origin note ---------- */

/* A quiet biographical line under the dek — not a panel. */
.origin-note {
  margin: 0 0 1.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  font-size: 0.825rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
article > header:has(+ .origin-note) { margin-bottom: 1rem; }

/* ---------- numbered sequences ---------- */

.principles,
.blueprint,
.failure-sequence {
  list-style: none;
  counter-reset: item;
  margin: 0;
  padding: 0;
}

.principle,
.blueprint-item,
.failure-mode {
  counter-increment: item;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.5rem;
  margin: 0 0 1.15rem;
}
.principle:last-child,
.blueprint-item:last-child,
.failure-mode:last-child { margin-bottom: 0; }

.principle::before,
.blueprint-item::before,
.failure-mode::before {
  content: counter(item) ".";
  grid-column: 1;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

.principle > *,
.blueprint-item > *,
.failure-mode > * { grid-column: 2; }

/* ---------- footnote references ---------- */

.note-ref {
  font-size: 0.65em;
  line-height: 0;
  margin-left: 0.1em;
}
.note-ref a {
  color: var(--ink-faint);
  text-decoration: none;
  border: 0;
  transition: color 0.4s ease;
}
.note-ref a:hover { color: var(--accent); border: 0; }

:target { scroll-margin-top: 1.25rem; }

/* ---------- asides ---------- */

.appendix-link,
.recovery {
  margin: 1.5rem 0 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.appendix-link .label,
.recovery .label { margin: 0 0 0.3rem; }
.appendix-link h2,
.recovery h2 { margin: 0 0 0.3rem; }
.appendix-link > a {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom-color: transparent;
}
.appendix-link > a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.diagnostic {
  margin: 1.5rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}
.diagnostic .eyebrow { margin-bottom: 0.5rem; }
.diagnostic h2 { margin-bottom: 0.6rem; }

.signal-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: signal;
}
.signal {
  counter-increment: signal;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.signal:last-child { margin-bottom: 0; }
.signal::before {
  content: counter(signal) ".";
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

/* ---------- back link ---------- */

.back-link {
  display: inline-block;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.4s ease;
}
.back-link:hover { color: var(--accent); }

/* ---------- notes ---------- */

.notes {
  margin: 2rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

.notes > h2 {
  font-weight: 400;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}

.notes > ol {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.notes > ol > li { margin-bottom: 0.6rem; }
.notes > ol > li:last-child { margin-bottom: 0; }
.notes > ol > li::marker { color: var(--ink-faint); }
.notes strong { color: var(--ink); font-weight: 500; }

.note-list { margin: 0.15rem 0; padding-left: 1rem; }
.note-list li::marker { color: var(--ink-faint); }

.note-back {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  border: 0;
  white-space: nowrap;
}
.note-back:hover { color: var(--accent); border: 0; }

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

.site-footer { border: 0; background: none; }

.footer-inner {
  max-width: var(--measure);
  width: 100%;
  margin: 2.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
}
.footer-inner p { margin: 0; }
.footer-inner a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.4s ease, color 0.4s ease;
}
.footer-inner a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 404 ---------- */

.notfound h1 { margin-bottom: 0.5rem; }

/* ---------- entrance ---------- */

.site-header, main, .site-footer {
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.site-header { animation-delay: 0.05s; }
main         { animation-delay: 0.15s; }
.site-footer { animation-delay: 0.3s; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .site-header, main, .site-footer { opacity: 1; transform: none; animation: none; }
}

@media (hover: none) {
  .principle a:hover,
  .blueprint-item a:hover,
  .failure-mode a:hover,
  .notes a:hover,
  .footer-inner a:hover { color: var(--ink); border-color: var(--rule); }
  .nav-links a:hover, .back-link:hover { color: var(--ink-soft); }
}

/* ---------- print ---------- */

@media print {
  .site-header, .site-footer, .back-link, .appendix-link { display: none; }
  body { background: #fff; color: #000; padding: 0; font-size: 10pt; }
  main { max-width: none; }
  .site-header, main, .site-footer { opacity: 1; transform: none; animation: none; }
  a { color: #000; border: 0; }
}
