/* ==========================================================================
   Edge to Path: Essays (the /essays index and every /essays/<slug> page)
   Loaded after tokens.css and before design.css, like the other page styles.
   Header, menu and footer follow book.html; colors and type come from tokens.
   ========================================================================== */

:root { --voice:var(--bone); --fog-dim:var(--muted-dark); }
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:5rem; }
body {
  background:var(--bone); color:var(--ink); font-family:var(--serif);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
::selection { background:var(--ember); color:var(--bone); }
a { color:inherit; }
img { max-width:100%; }

.skip {
  position:absolute; left:1rem; top:-3rem; z-index:50; background:var(--ink); color:var(--bone);
  text-decoration:none; font-family:var(--sans); font-weight:600; font-size:.78rem;
  letter-spacing:.14em; text-transform:uppercase; padding:.7rem 1.1rem; transition:top .2s ease;
}
.skip:focus-visible { top:1rem; outline:2px solid var(--bone); outline-offset:2px; }

.kicker {
  display:block; font-family:var(--sans); font-weight:600; font-size:.76rem;
  letter-spacing:.22em; text-transform:uppercase; color:var(--ember);
}
.on-dark .kicker { color:var(--muted-dark); }
a.kicker { display:inline-block; text-decoration:none; transition:color .2s ease; }
.on-dark a.kicker:hover { color:var(--bone); }

section {
  padding-block:clamp(4.5rem,9vw,8rem);
  padding-left:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-left));
  padding-right:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-right));
}
.wrap { max-width:72rem; margin:0 auto; }
.col  { max-width:41rem; margin:0 auto; }
.on-dark  { background:var(--slate); color:var(--voice); }
.on-linen { background:var(--linen); }

/* ---------- buttons ---------- */
.btn {
  display:inline-block; text-decoration:none; cursor:pointer;
  font-family:var(--sans); font-weight:600; font-size:.76rem;
  letter-spacing:.18em; text-transform:uppercase;
  padding:.95rem 1.7rem; border:1px solid transparent;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.on-dark .btn-outline { border-color:rgba(242,237,228,.45); color:var(--bone); background:none; }
.on-dark .btn-outline:hover { border-color:var(--bone); }
.btn-row { margin-top:2.2rem; display:flex; gap:1rem; flex-wrap:wrap; align-items:center; }

/* ---------- header (as book.html) ---------- */
header {
  position:fixed; top:0; left:0; right:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:1.4rem clamp(1.25rem,4vw,2.6rem);
  padding-top:calc(1.4rem + env(safe-area-inset-top));
  padding-left:max(clamp(1.25rem,4vw,2.6rem), env(safe-area-inset-left));
  padding-right:max(clamp(1.25rem,4vw,2.6rem), env(safe-area-inset-right));
  background:transparent; transition:background .35s ease, padding .35s ease, box-shadow .35s ease;
}
header.scrolled {
  background:var(--slate);
  padding-top:calc(.85rem + env(safe-area-inset-top)); padding-bottom:.85rem;
  box-shadow:0 1px 0 rgba(242,237,228,.08);
}
.brand { display:block; text-decoration:none; }
nav.desktop { display:flex; align-items:center; gap:2rem; }
nav.desktop a {
  font-family:var(--sans); font-weight:500; font-size:.78rem;
  letter-spacing:.14em; text-transform:uppercase; color:var(--voice);
  text-decoration:none; transition:color .2s ease;
}
nav.desktop a:hover { color:var(--bone); }
nav.desktop a.active { color:var(--bone); border-bottom:1px solid var(--ember); padding-bottom:.2em; }
.menu-btn {
  display:none; width:2.4rem; height:2.4rem; padding:0;
  align-items:center; justify-content:center; flex-direction:column; gap:5px;
  background:none; border:1px solid rgba(242,237,228,.4); color:var(--bone);
  cursor:pointer; touch-action:manipulation;
}
.menu-btn span { display:block; width:1.1rem; height:1px; background:currentColor; }
.mobilemenu {
  display:none; position:fixed; inset:0; z-index:30; background:var(--slate);
  padding:5.5rem 2rem 2rem; flex-direction:column; gap:1.6rem; overscroll-behavior:contain;
}
.mobilemenu.open { display:flex; }
.mobilemenu a { font-family:var(--display); font-size:1.6rem; color:var(--bone); text-decoration:none; }
.mobilemenu .close {
  position:absolute; top:1.4rem; right:1.4rem; background:none; border:none; color:var(--bone);
  font-family:var(--mono); font-size:1.4rem; cursor:pointer; touch-action:manipulation;
}
dialog.mobilemenu { width:100%; max-width:none; height:100%; max-height:none; margin:0; border:0; overflow-y:auto; overscroll-behavior:contain; color:var(--bone); }
dialog.mobilemenu::backdrop { background:var(--slate); }
dialog.mobilemenu .close { min-width:44px; min-height:44px; }
dialog.mobilemenu a { flex-shrink:0; }
dialog.mobilemenu a:hover { text-decoration:underline; text-underline-offset:.2em; }
dialog.mobilemenu :focus-visible, #menu-open:focus-visible { outline:2px solid var(--bone); outline-offset:4px; }
@media (max-width:860px) { nav.desktop { display:none; } .menu-btn { display:inline-flex; } }

/* ---------- opening band: the interior-page intro, set on the reading column ---------- */
.page-intro { padding-top:clamp(8rem,16vw,11rem); }
.page-intro h1.page-title { margin-top:1rem; color:var(--bone); text-wrap:balance; }
.page-intro .definition {
  max-width:38rem; margin-top:1.6rem; color:var(--voice);
  font-family:var(--serif); font-style:italic; font-size:clamp(1.1rem,2.4vw,1.4rem); line-height:1.6; text-wrap:pretty;
}
.byline {
  display:flex; flex-wrap:wrap; gap:.35rem 1.4rem; margin-top:1.9rem;
  font-family:var(--mono); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted-dark); font-variant-numeric:tabular-nums;
}
.byline .who { color:var(--bone); }
/* The Edge Line, as on The Edge, Questions, Safety, Contact and Author; aligned with the text */
.edgeline { display:block; width:min(320px,56%); height:auto; margin:2.6rem 0 0; overflow:visible; }
@media (min-width:1100px) { .essay-intro h1.page-title { margin-right:-10rem; } }

/* ---------- index ---------- */
.index-head {
  display:flex; justify-content:space-between; align-items:baseline; gap:1rem;
  padding-bottom:1rem; border-bottom:1px solid var(--ink);
}
.index-head .kicker { margin:0; color:var(--ink); }
.count { font-family:var(--mono); font-size:.72rem; letter-spacing:.06em; color:var(--graphite); text-decoration:none; }
a.count:hover { color:var(--ember); }
.entry {
  display:grid; grid-template-columns:10.5rem minmax(0,1fr); gap:clamp(1.25rem,4vw,3rem);
  padding-block:clamp(1.9rem,4vw,2.6rem); border-bottom:1px solid var(--hairline);
}
.on-linen .entry { border-bottom-color:rgba(33,30,26,.14); }
.entry-meta {
  display:flex; flex-direction:column; gap:.35rem; padding-top:.5rem;
  font-family:var(--mono); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
  color:var(--graphite); font-variant-numeric:tabular-nums;
}
.entry-meta .new { color:var(--ember); }
.entry h2, .entry h3 { margin:0; text-wrap:balance; color:var(--ink); }
.entry h2 { font-size:clamp(2rem,4.6vw,3.2rem); line-height:1.06; max-width:46rem; }
.entry h3 { font-size:clamp(1.45rem,3vw,2rem); line-height:1.15; max-width:44rem; }
.entry h2 a, .entry h3 a { color:inherit; text-decoration:none; transition:color .2s ease; }
.entry h2 a:hover, .entry h3 a:hover { color:var(--ember); }
.entry .dek {
  margin-top:.85rem; max-width:40rem; color:var(--graphite); font-style:italic;
  font-size:clamp(1.02rem,1.7vw,1.16rem); line-height:1.6;
}
.entry .excerpt { margin-top:1.3rem; max-width:40rem; color:var(--hairline-dark); line-height:1.75; }
.entry .more { margin-top:1.2rem; }
.follow { margin-top:2.6rem; color:var(--graphite); font-size:1rem; line-height:1.7; }
@media (max-width:700px) {
  .entry { grid-template-columns:1fr; gap:.8rem; }
  .entry-meta { flex-direction:row; flex-wrap:wrap; gap:.25rem 1rem; padding-top:0; }
}

/* ---------- the essay ----------
   The essay body is an <article>, not a <section>: motion.js fades a section in only once
   8% of it is on screen, which a long essay on a phone never reaches. */
.essay-body {
  display:block;
  padding-top:var(--sp-c); padding-bottom:clamp(4.5rem,9vw,8rem);
  padding-left:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-left));
  padding-right:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-right));
}
.prose { max-width:41rem; margin:0 auto; color:var(--hairline-dark); line-height:1.78; }
.prose p { max-width:none; }
.prose p + p { margin-top:1.1em; }
.prose h2 {
  margin:2.4em 0 .7em; color:var(--ink); text-wrap:balance;
  font-size:var(--fs-h2); line-height:var(--lh-h2);
}
.prose h2 + p { margin-top:0; }
.prose em { font-style:italic; }
/* section break: the small Edge Line that sits under headings on The Edge */
.section-break { margin:2.8rem 0; }
.section-break svg { display:block; width:170px; height:auto; overflow:visible; }
.section-break + p { margin-top:0 !important; }
.prose .endnote {
  margin-top:2.6rem; padding-top:1.3rem; border-top:1px solid var(--hairline);
  color:var(--graphite); font-size:.95em; line-height:1.7;
}
.sources { max-width:41rem; margin:3.2rem auto 0; padding-top:1.3rem; border-top:1px solid var(--hairline); }
.sources h2 {
  margin:0 0 1.1rem; font-family:var(--sans); font-size:.72rem; font-weight:600;
  letter-spacing:.2em; text-transform:uppercase; color:var(--graphite);
}
.sources p {
  max-width:none; padding-left:1.4rem; text-indent:-1.4rem; color:var(--graphite);
  font-size:.92rem; line-height:1.65; overflow-wrap:anywhere;
}
.sources p + p { margin-top:.7rem; }
.share {
  max-width:41rem; margin:3rem auto 0; padding-top:1.15rem; border-top:1px solid var(--hairline);
  display:flex; flex-wrap:wrap; align-items:center; gap:.8rem 1.6rem;
  font-family:var(--sans); font-size:.72rem; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
}
.share .label { color:var(--graphite); }
.share a, .share button {
  background:none; border:0; padding:0 0 .1em; cursor:pointer; font:inherit; letter-spacing:inherit; text-transform:inherit;
  color:var(--ink); text-decoration:none; border-bottom:1px solid var(--ember);
}
.share a:hover, .share button:hover { color:var(--ember); }
.share .copied { color:var(--ember); font-family:var(--mono); text-transform:none; letter-spacing:.04em; font-weight:400; }

/* ---------- from the book ---------- */
.book-grid {
  max-width:60rem; margin:0 auto; display:grid; grid-template-columns:auto minmax(0,1fr);
  gap:clamp(2rem,6vw,4.5rem); align-items:center;
}
.book-cover { width:clamp(8.5rem,16vw,11rem); }
.book-cover img { display:block; width:100%; height:auto; box-shadow:0 18px 40px rgba(0,0,0,.35); }
.book-band h2 { margin:.9rem 0 0; color:var(--bone); font-size:clamp(1.9rem,4vw,2.7rem); line-height:1.12; text-wrap:balance; }
.book-band .lede { margin-top:1rem; max-width:34rem; color:var(--voice); line-height:1.7; }
@media (max-width:640px) { .book-grid { grid-template-columns:1fr; } }

/* ---------- footer (as book.html) ---------- */
footer {
  color:var(--voice);
  padding:clamp(3.5rem,7vw,5.5rem) clamp(1.25rem,6vw,4rem) 2.5rem;
  padding-left:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-left));
  padding-right:max(clamp(1.25rem,6vw,4rem), env(safe-area-inset-right));
  padding-bottom:calc(2.5rem + env(safe-area-inset-bottom));
}
.foot-grid { max-width:72rem; margin:0 auto; display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:2.5rem; }
footer p { font-size:.9rem; line-height:1.7; margin-top:1rem; max-width:22rem; }
.foot-col h4 { font-family:var(--sans); font-weight:600; font-size:.7rem; letter-spacing:.2em; text-transform:uppercase; color:var(--muted-dark); margin-bottom:1.2rem; }
.foot-col a { display:block; font-family:var(--sans); font-size:.88rem; color:var(--voice); text-decoration:none; margin-bottom:.8rem; transition:color .2s ease; }
.foot-col a:hover { color:var(--bone); }
.foot-bottom { max-width:72rem; margin:3.5rem auto 0; padding-top:1.6rem; border-top:1px solid rgba(242,237,228,.12); font-family:var(--mono); font-size:.7rem; letter-spacing:.16em; }
@media (max-width:820px) { .foot-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:520px) {
  .foot-grid { grid-template-columns:1fr; }
  .btn-row { flex-direction:column; align-items:stretch; }
  .btn-row .btn { text-align:center; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
