/* ================================================================
   Robbie Crabtree — Writing pages
   Dark editorial. EB Garamond for the words, Helvetica Neue for the
   document chrome. Hairline rules. No images.
   ================================================================ */

:root {
  --ink-bg: #0E0C08;
  --ink-elev: #18140E;
  --paper: #ECE3CD;
  --paper-dim: #A39B83;
  --paper-mute: #6E6753;
  --paper-faint: #4A4538;
  --rule: rgba(236,227,205,0.13);
  --rule-strong: rgba(236,227,205,0.28);
  --accent: #C97765;

  --serif: 'EB Garamond', 'Times New Roman', Georgia, serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --max: 760px;
  --gutter: clamp(20px, 4vw, 44px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
::selection { background: var(--paper); color: var(--ink-bg); }

body {
  margin: 0;
  background: var(--ink-bg);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
}

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

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 120px;
}

/* ================================================================
   Topbar
   ================================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 64px;
}

.brand {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--paper);
}
.brand .dot,
.brand .ox { color: var(--accent); margin-left: 1px; }

.nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
  transition: color .15s, border-color .15s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--paper); border-bottom-color: var(--paper); }

/* ================================================================
   Hero / memo head
   ================================================================ */

.hero {
  padding: 8px 0 36px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
}

.kicker {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.10em;
  color: var(--paper);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.kicker .memo-id { color: var(--paper); font-weight: 500; }
.kicker .memo-meta { color: var(--paper-dim); font-weight: 400; letter-spacing: 0; }

/* ================================================================
   Headings
   ================================================================ */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--paper);
  letter-spacing: -0.008em;
}

h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.06;
  margin: 16px 0 24px;
  max-width: 22ch;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--accent); }

h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
  margin: 64px 0 18px;
  max-width: 24ch;
  text-wrap: balance;
}

h3 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  margin: 36px 0 10px;
  max-width: 28ch;
}

/* ================================================================
   Body
   ================================================================ */

p, li {
  font-size: 18px;
  line-height: 1.7;
  color: var(--paper-dim);
  margin: 0 0 18px;
}

.hero p {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.5;
  color: var(--paper-dim);
  max-width: 38ch;
  margin: 0;
}
.hero p strong { color: var(--paper); font-weight: 500; }

strong { color: var(--paper); font-weight: 500; }
em { font-style: italic; }

ul, ol { padding-left: 0; margin: 0 0 18px; list-style: none; }
ul li, ol li { margin-bottom: 8px; padding-left: 28px; position: relative; }
ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 14px;
  height: 1px;
  background: var(--paper-dim);
}
ol { counter-reset: olc; }
ol li {
  padding-left: 40px;
  counter-increment: olc;
}
ol li::before {
  content: counter(olc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.85;
}

.section { margin-bottom: 12px; }

/* ================================================================
   Callout
   ================================================================ */

.callout {
  margin: 48px 0;
  padding: 28px 32px;
  background: var(--ink-elev);
  border: 1px solid var(--rule);
  position: relative;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: var(--paper);
}

.callout::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 1px;
  background: var(--paper);
}

.callout strong {
  color: var(--paper);
  font-style: normal;
  font-weight: 500;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.10em;
  display: block;
  margin-bottom: 12px;
}

/* ================================================================
   CTA
   ================================================================ */

.cta {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.cta > p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--paper-dim);
  max-width: 38ch;
  margin: 0 0 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 13px 22px;
  background: var(--paper);
  color: var(--ink-bg);
  border: 1px solid var(--paper);
  transition: background .2s, color .2s, transform .25s cubic-bezier(.2,.7,.2,1);
}
.button:hover { background: transparent; color: var(--paper); transform: translateY(-1px); }

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.links-grid a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--rule);
  transition: background .25s ease;
}

.links-grid a:last-child { border-right: none; padding-right: 0; }
.links-grid a:not(:first-child) { padding-left: 24px; }
.links-grid a:hover { background: var(--ink-elev); }
.links-grid a:hover strong { color: var(--paper); }

.links-grid strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  color: var(--paper);
  transition: color .2s ease;
}

.links-grid span {
  display: block;
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.55;
  font-family: var(--serif);
  margin: 0;
}

.links-grid a::before {
  content: 'Further reading';
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--paper-dim);
  margin-bottom: 2px;
}

/* ================================================================
   Footer
   ================================================================ */

.memo-foot {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--paper-dim);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.memo-foot a:hover { color: var(--paper); }

@media (max-width: 720px) {
  main { padding: 24px var(--gutter) 80px; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav { gap: 18px; }
  .hero { margin-bottom: 40px; }
  p, li { font-size: 17px; }
  .links-grid { grid-template-columns: 1fr; }
  .links-grid a, .links-grid a:not(:first-child) {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 22px 0;
  }
  .links-grid a:last-child { border-bottom: none; }
  .links-grid a:hover { background: transparent; }
  .memo-foot { flex-direction: column; gap: 8px; }
}
