/* ==========================================================================
   AI-Leverage — canonical team-lead build
   Palette: paper + ink + muted + ember + hairline (five values, nothing more)
   Type: Fraunces (display) / Source Serif 4 (body) / IBM Plex Mono (meta)
   No gradients. No shadows. No animations beyond link-underline on hover.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  --paper: #F5F1E8;
  --ink: #1C1A15;
  --muted: #6E665B;
  --ember: #9A4A1E;
  --hairline: #D8CEBC;

  --measure: 39rem; /* ~640px at 1rem=16.4px; the reading column */
  --outer: 65rem;   /* outer page frame max */

  --gutter-mobile: 1.5rem;
  --gutter-desktop: 4rem;

  --body-size: 19px;
  --body-mobile: 17px;
  --line: 1.65;
}

/* ---------- 2. Reset (light, not aggressive) ---------- */

*,
*::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: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: var(--body-mobile);
  line-height: var(--line);
  font-weight: 400;
  font-feature-settings: "liga", "onum", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (min-width: 640px) {
  body { font-size: var(--body-size); }
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- 3. Page frame ---------- */

.page {
  max-width: var(--outer);
  margin: 0 auto;
  padding: 0 var(--gutter-mobile);
}

@media (min-width: 640px) {
  .page { padding: 0 var(--gutter-desktop); }
}

.column {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---------- 4. Top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.topbar .mark,
.topbar nav a {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.topbar nav a + a { margin-left: 2rem; }

.topbar nav a:hover,
.topbar .mark:hover { color: var(--ember); }

/* ---------- 5. Typography ---------- */

h1, h2, h3 {
  font-family: "Fraunces", "Hoefler Text", Georgia, serif;
  color: var(--ink);
  margin: 0;
  font-feature-settings: "liga", "onum", "kern", "ss01";
  font-variation-settings: "opsz" 144, "SOFT" 50;
  line-height: 1.12;
  letter-spacing: -0.005em;
}

h1 {
  font-size: 2rem;       /* ~32px mobile */
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.01em;
  margin-bottom: 0;
  max-width: 20ch;       /* keep the opening sentence from sprawling */
}

@media (min-width: 640px) {
  h1 { font-size: 3rem; }     /* ~48px */
}

@media (min-width: 1040px) {
  h1 { font-size: 3.25rem; }  /* ~52px */
}

h2 {
  font-size: 1.625rem;   /* ~26px mobile */
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

@media (min-width: 640px) {
  h2 { font-size: 1.875rem; } /* ~30px */
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1.15em;
  hyphens: none;
}

p + p { margin-top: 0; }

em { font-style: italic; }
strong { font-weight: 600; }

/* ---------- 6. Links ---------- */

a {
  color: var(--ember);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 140ms ease;
}

a:hover,
a:focus-visible {
  text-decoration-color: var(--ember);
}

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

/* Body prose links are underlined by default so they read; the hover rule above keeps them consistent elsewhere */
.prose a {
  text-decoration-color: var(--hairline);
}

.prose a:hover {
  text-decoration-color: var(--ember);
}

/* ---------- 7. Meta line ---------- */

.meta {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

.meta--tight { margin-bottom: 0.75rem; }

/* ---------- 8. Hairline divider ---------- */

.hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 3.75rem 0;
}

/* ---------- 9. Hero (Home) ---------- */

.hero {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 9rem;   /* 40% of first viewport = air above H1 */
    padding-bottom: 6rem;
  }
}

.hero__meta {
  margin-bottom: 3rem;
}

/* ---------- 10. Sections ---------- */

section {
  padding: 2rem 0;
}

section > h2 + p {
  margin-top: 0;
}

/* ---------- 11. Lists ---------- */

.prose ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.5em;
}

.prose ul li {
  position: relative;
  padding-left: 1.25em;
  margin-bottom: 0.35em;
}

.prose ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink);
}

.prose ul li:last-child { margin-bottom: 0; }

/* "Refusals" list — tighter, for the 'What this is not' section */
.refusals li {
  padding-left: 1.5em;
  margin-bottom: 0.25em;
}

.refusals li::before {
  content: "—";
  color: var(--muted);
}

/* ---------- 12. Labeled paragraphs (How the work goes) ---------- */

.labelled p {
  margin-bottom: 1.4em;
}

.labelled strong {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-variation-settings: "opsz" 20, "SOFT" 50;
  font-style: italic;
  color: var(--ink);
}

/* ---------- 13. Link-style button (the quiet CTA) ---------- */

.quiet-link {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--hairline);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ember);
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease;
}

.quiet-link:hover,
.quiet-link:focus-visible {
  border-color: var(--ember);
  text-decoration: none;
}

/* ---------- 14. Footer ---------- */

footer {
  margin-top: 6rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--hairline);
}

footer p {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

footer a { color: var(--muted); text-decoration-color: transparent; }
footer a:hover { color: var(--ember); text-decoration-color: var(--ember); }

/* ---------- 15. Writing archive list ---------- */

.archive {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
}

.archive li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}

.archive li:first-child { border-top: 1px solid var(--hairline); }

.archive time {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.archive a {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration-color: transparent;
  line-height: 1.35;
}

.archive a:hover { text-decoration-color: var(--ember); }

@media (max-width: 520px) {
  .archive li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ---------- 16. Essay pages ---------- */

.essay-header {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.essay-header .backlink {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 3rem;
}

.essay-header .backlink:hover { color: var(--ember); }

.essay h1 {
  font-size: 2rem;
  font-weight: 500;
  max-width: 24ch;
  line-height: 1.15;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .essay h1 { font-size: 2.5rem; }
}

.essay .meta { margin-bottom: 0.5rem; }

.essay p { margin-bottom: 1.1em; }

.essay p:first-of-type::first-letter {
  /* A subtle editorial touch: first letter in display face. Not a decorative drop-cap. */
  font-family: "Fraunces", serif;
  font-weight: 500;
}

/* Pull-quote style for essays — simple, no fuss */
.essay blockquote {
  margin: 1.5em 0 1.5em 0;
  padding-left: 1.25em;
  border-left: 1px solid var(--hairline);
  font-style: italic;
  color: var(--ink);
}

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

/* ---------- 17. Hero tuning on small screens ---------- */

@media (max-width: 520px) {
  h1 { font-size: 1.875rem; max-width: 18ch; }
  .hero { padding-top: 4rem; }
  .topbar { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .topbar nav a + a { margin-left: 1.25rem; }
}

/* ---------- 18. Focus and selection ---------- */

::selection {
  background: var(--hairline);
  color: var(--ink);
}

/* ---------- 19. Utilities ---------- */

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

.quiet { color: var(--muted); }
.breath-lg { margin-top: 3.5rem; }
