/* Shared styles for the prerendered /writing pages.
   Deliberately light-only: matches the home + resume pages, which are paper.
   Palette and faces are lifted from PageHome so this reads as the same site. */

:root {
  --paper:  #fbfaf6;
  --surface:#f4f1e7;
  --sunk:   #efebdf;
  --ink:    #1a1817;
  --soft:   #3d3935;
  --faded:  #5e5750;
  --hair:   rgba(26,24,23,0.10);
  --rule:   rgba(26,24,23,0.18);
  --accent: #8b3a1f;
  --pass:   #3f6b46;

  --serif:   "Newsreader", "Source Serif 4", "Times New Roman", Georgia, serif;
  --display: "Newsreader", "Cormorant Garamond", Georgia, serif;
  --mono:    "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 92px 24px 130px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---- shared bits ---- */
.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faded);
  margin: 0;
}

.backlink {
  position: fixed;
  top: 22px;
  left: 28px;
  z-index: 50;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(26,24,23,0.55);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-bottom-color .2s;
}
.backlink:hover { color: var(--ink); border-bottom-color: var(--rule); }
.backlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

hr.hair { border: none; border-top: 1px solid var(--rule); margin: 0; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(139,58,31,0.32); }
a:hover { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

p { margin: 0; text-wrap: pretty; }
strong { font-weight: 600; }

ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 11px; }
li::marker { color: rgba(26,24,23,0.28); }

/* ---- masthead ---- */
.masthead { display: flex; flex-direction: column; gap: 18px; }

h1 {
  font-family: var(--display);
  font-size: clamp(31px, 6.5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 500;
  text-wrap: balance;
  margin: 0;
}

.dek {
  font-size: 19px;
  line-height: 1.55;
  color: var(--soft);
  margin: 0;
  text-wrap: pretty;
}

.byline { font-size: 15px; color: var(--faded); margin: 0; font-style: italic; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--faded);
  font-variant-numeric: tabular-nums;
}

/* ---- article ---- */
article { display: flex; flex-direction: column; gap: 40px; }
section { display: flex; flex-direction: column; gap: 19px; }
.sec-head { display: flex; flex-direction: column; gap: 7px; }

h2 {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 500;
  text-wrap: balance;
  margin: 10px 0 0;
}

h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin: 8px 0 0;
}

.tldr {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 2px solid var(--accent);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.tldr p, .tldr li { font-size: 16px; line-height: 1.6; }

.define {
  border: 1px solid var(--hair);
  background: var(--sunk);
  padding: 21px 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.define .term {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.define p { font-size: 16px; line-height: 1.58; color: var(--soft); }

/* status strip — every layer reported healthy */
.strip { display: flex; flex-direction: column; gap: 10px; }
.strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  overflow-x: auto;
}
.cell {
  background: var(--surface);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.cell .layer {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faded);
}
.cell .verdict {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--pass);
  display: flex;
  align-items: center;
  gap: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pass); flex: none; }
.cell.bad .verdict { color: var(--accent); }
.cell.bad .dot { background: transparent; border: 1px solid var(--accent); }
.strip-note { font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--faded); }

pre.code {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--sunk);
  border: 1px solid var(--hair);
  padding: 18px 20px;
  margin: 0;
  overflow-x: auto;
  color: var(--soft);
}
pre.code .cm { color: var(--faded); }
code.inl {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--sunk);
  border: 1px solid var(--hair);
  padding: 1px 5px;
}

.qa { display: flex; flex-direction: column; gap: 22px; }
.qa-item { display: flex; flex-direction: column; gap: 7px; }
.qa-q { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.4; margin: 0; text-wrap: balance; }
.qa-a { font-size: 16px; line-height: 1.6; color: var(--soft); margin: 0; }

.takeaway { border-top: 1px solid var(--rule); padding-top: 30px; display: flex; flex-direction: column; gap: 19px; }
.kicker {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

/* ---- engagement footer (shared with home) ---- */
.hire { display: flex; flex-direction: column; gap: 20px; }
.hire-grid { display: flex; flex-direction: column; gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.eng { background: var(--surface); padding: 20px 22px; display: flex; flex-direction: column; gap: 7px; }
.eng-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.eng-name { font-family: var(--display); font-size: 20px; line-height: 1.2; margin: 0; }
.eng-len { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faded); }
.eng-sum { font-size: 16px; line-height: 1.58; color: var(--soft); margin: 0; }
.eng-who { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; color: var(--faded); margin: 0; }
.hire-cta { font-family: var(--display); font-style: italic; font-size: 21px; color: var(--accent); }

/* ---- index list ---- */
.postlist { display: flex; flex-direction: column; }
.post-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hair);
  border-top: none;
}
.post-row:first-child { border-top: 1px solid var(--rule); }
.post-title {
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.post-title a { color: var(--ink); border-bottom: none; }
.post-title a:hover { color: var(--accent); }
.post-dek { font-size: 16.5px; line-height: 1.55; color: var(--soft); margin: 0; }
.post-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faded);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 76px 20px 100px; }
  .backlink { top: 16px; left: 20px; }
}
