/* Calculating Space — shared stylesheet
   Tokens and landing-page rules are carried over unchanged from the
   original inline <style>; additions are marked NEW. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-faint: #8a8a8a;
  --paper: #fafaf7;
  --rule: #d8d4c8;
  --accent: #6b4226;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 4rem 1.75rem 3rem;
  flex: 1;
  width: 100%;
}

/* MARK (fixed-point glyph) ---------------------------------- */
.mark {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 2.5rem;
  color: var(--ink);
}

/* MASTHEAD -------------------------------------------------- */
.masthead { margin-bottom: 3.5rem; }

.wordmark {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.descriptor {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  font-weight: 400;
}

/* APHORISM -------------------------------------------------- */
.aphorism {
  font-family: var(--serif);          /* was var(--italic), undefined */
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

/* PROSE ----------------------------------------------------- */
.prose {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 3rem;
}
.prose p + p { margin-top: 1.1rem; }
.prose em { font-style: italic; color: var(--ink); }

/* RULE ------------------------------------------------------ */
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
  width: 4rem;
}

/* SECTION LABELS -------------------------------------------- */
.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

/* LISTS (notes, essays) ------------------------------------- */
.recent ul { list-style: none; }

.recent li {
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}
.recent li:last-child { border-bottom: none; }

.recent a {
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: color 0.15s ease;
}
.recent a:hover { color: var(--accent); }

.recent .post-title {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.15rem;
}

.recent .post-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* NEW: an essay entry carries no monospace — the serif byline
   is the visible mark of the other voice */
.recent .post-meta.serif {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

/* TALKS ----------------------------------------------------- */
.talks ul { list-style: none; }
.talks li {
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}
.talks li:last-child { border-bottom: none; }

.talks .talk-title {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.2rem;
  color: var(--ink);
}
.talks .talk-thesis {
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.talks .talk-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.talks .talk-meta a {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s ease, border-color 0.2s ease;
}
.talks .talk-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* NOTE (long-form, Nik) ------------------------------------- */
.note { margin-top: 0.5rem; }
.note-header { margin-bottom: 1.75rem; }

.note-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.note-sub {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.note-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.note-body p + p { margin-top: 1.15rem; }
.note-body em { font-style: italic; color: var(--ink); }
.note-body .lead { color: var(--ink); }

.note-body a,
.essay-body a,
.related a,
.back a,
.intro a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s ease, border-color 0.2s ease;
}
.note-body a:hover,
.essay-body a:hover,
.related a:hover,
.back a:hover,
.intro a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.note-body .note-coda {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-faint);
  margin-top: 1.75rem;
}

.note-dateline {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 2rem;
}

/* CONTACT --------------------------------------------------- */
.contact { margin-top: 0.5rem; }
.contact a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.contact a:hover { border-bottom-color: var(--accent); }

/* FOOTER ---------------------------------------------------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 1.75rem;
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer a {
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer a:hover { color: var(--ink); }

/* NEW: TOP BAR on inner pages ------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 3.5rem;
}
.topbar a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
}
.topbar a:hover { color: var(--accent); }
.topbar .mark { width: 1.15rem; height: 1.15rem; margin: 0; }

/* NEW: index-page intro ------------------------------------- */
.index-title {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.intro {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 2.5rem;
}

/* NEW: ESSAY (Placido) — serif only, no monospace ----------- */
.essay-header { margin-bottom: 2.25rem; }

.essay-title {
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* the struck word stays fully legible: both readings are meant */
s {
  text-decoration-line: line-through;
  text-decoration-thickness: 0.07em;
  text-decoration-color: currentColor;
}

.byline {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.essay-body {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink-soft);
}
.essay-body p + p { margin-top: 1.15rem; }
.essay-body em { font-style: italic; color: var(--ink); }
.essay-body .lead { color: var(--ink); }

.essay-date {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-faint);
  margin-top: 2rem;
}

.sources {
  margin-top: 2.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.sources summary {
  cursor: pointer;
  font-style: italic;
  color: var(--ink-soft);
  width: max-content;
}
.sources summary:hover { color: var(--accent); }
.sources ol { margin: 0.9rem 0 0 1.1rem; }
.sources li + li { margin-top: 0.35rem; }

.related {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px dotted var(--rule);
  font-size: 0.95rem;
  color: var(--ink-faint);
}

.back {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

/* NEW: accessibility ---------------------------------------- */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* RESPONSIVE ------------------------------------------------ */
@media (max-width: 540px) {
  html { font-size: 16px; }
  .page { padding: 2.5rem 1.25rem 2rem; }
  .aphorism { font-size: 1.3rem; }
  .wordmark { font-size: 1.35rem; }
  .note-title { font-size: 1.3rem; }
  .essay-title { font-size: 1.65rem; }
  .index-title { font-size: 1.35rem; }
}

/* PAGE LOAD — landing page only; reading pages appear at once */
.home { animation: fade-in 0.5s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home { animation: none; }
  * { transition: none !important; }
}
