/* ---------------------------------------------------------------- */
/* Design tokens — shared lineage with haveyoumethash.in: serif       */
/* headlines, monospace labels, warm paper surface                    */
/* ---------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --surface: #faf6ec;
  --surface-2: #f2ecdc;
  --ink: #15130f;
  --muted: #6b6355;
  --border: #e7e0cf;
  --accent: #c1720f;
  --accent-ink: #ffffff;
  --teal: #0c776d;
  --maroon: #93105a;
  --red: #a3231f;
  --blue: #035a6d;
  --violet: #5b4b8a;
  --shadow: 0 1px 2px rgba(21, 19, 15, 0.05), 0 12px 32px rgba(21, 19, 15, 0.07);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #1c1a13;
    --surface-2: #221f17;
    --ink: #f3efe3;
    --muted: #a89d87;
    --border: #332e21;
    --accent: #e2983c;
    --accent-ink: #17130a;
    --teal: #3fab9d;
    --maroon: #dd5a9c;
    --red: #e07570;
    --blue: #57aecb;
    --violet: #a597d8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

/* Domain cover gradients — duotone, keyed by subject area */
.cover-ancient        { background: linear-gradient(135deg, #7a0e48, #c1720f); }
.cover-epistemology    { background: linear-gradient(135deg, #04485a, #0c776d); }
.cover-logic           { background: linear-gradient(135deg, #1b1a3a, #5b4b8a); }
.cover-mind            { background: linear-gradient(135deg, #0a5f57, #3fab9d); }
.cover-metaphysics     { background: linear-gradient(135deg, #3a1a4a, #93105a); }
.cover-science         { background: linear-gradient(135deg, #04314a, #035a6d); }
.cover-ethics          { background: linear-gradient(135deg, #7a2e0e, #c1720f); }
.cover-political       { background: linear-gradient(135deg, #4a1414, #a3231f); }
.cover-aesthetics      { background: linear-gradient(135deg, #5b1a3a, #dd5a9c); }
.cover-religion        { background: linear-gradient(135deg, #241a4a, #5b4b8a); }
.cover-modern          { background: linear-gradient(135deg, #0c3a2e, #0c776d); }
.cover-19c             { background: linear-gradient(135deg, #4a0e2e, #93105a); }
.cover-phenomenology   { background: linear-gradient(135deg, #0a2a4a, #035a6d); }
.cover-analytic        { background: linear-gradient(135deg, #1a1a1a, #6b6355); }
.cover-nonwestern      { background: linear-gradient(135deg, #4a2e04, #c1720f); }

/* ---------------------------------------------------------------- */
/* Base                                                               */
/* ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

img { max-width: 100%; display: block; }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.tag::before { content: "\25CF"; font-size: 0.55rem; color: currentColor; }
.tag-maroon { color: var(--maroon); }
.tag-blue { color: var(--blue); }
.tag-teal { color: var(--teal); }
.tag-accent { color: var(--accent); }
.tag-violet { color: var(--violet); }
.tag-red { color: var(--red); }

/* ---------------------------------------------------------------- */
/* Masthead                                                           */
/* ---------------------------------------------------------------- */
.masthead { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
.masthead-inner { max-width: 1180px; margin: 0 auto; padding: 1.15rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { font-family: var(--serif); font-weight: 700; font-style: italic; font-size: 1.3rem; color: var(--accent); letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; opacity: 0.75; }
.masthead-nav { display: flex; gap: 0; align-items: center; }
.masthead-nav a { font-family: var(--mono); color: var(--ink); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 0.7rem; }
.masthead-nav a:first-child { padding-left: 0; }
.masthead-nav a:not(:first-child)::before { content: "/"; color: var(--border); margin-right: 0.7rem; }
.masthead-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- */
/* Homepage: hero                                                     */
/* ---------------------------------------------------------------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

.hero { width: 100vw; margin-left: calc(50% - 50vw); padding: 4.5rem max(1.5rem, calc(50vw - 590px + 1.5rem)) 4rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 680px; }
.hero h1 { font-size: 3rem; font-weight: 700; }
.hero-tagline { font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--accent); margin: 0 0 1.5rem; }
.hero-lede { color: var(--ink); margin: 0 0 1.25rem; max-width: 560px; }
.hero-cta { font-family: var(--mono); font-size: 0.92rem; font-weight: 500; letter-spacing: 0.02em; border-bottom: 1px solid currentColor; padding-bottom: 0.1rem; }
.hero-cta:hover { text-decoration: none; opacity: 0.75; }

.progress-strip { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 2.25rem; padding-top: 2rem; border-top: 1px solid var(--border); max-width: 680px; }
.progress-stat .num { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--ink); line-height: 1; }
.progress-stat .label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 0.35rem; }

/* ---------------------------------------------------------------- */
/* Homepage: essay card grid                                          */
/* ---------------------------------------------------------------- */
.section-head { padding: 3.5rem 0 2.25rem; max-width: 640px; }
.section-head h2 { font-size: 2.1rem; }
.section-head p { color: var(--muted); margin: 0.5rem 0 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2.5rem 2rem; padding-bottom: 4rem; }
.card { color: inherit; }
.card-link { color: inherit; display: block; }
.card-link:hover { text-decoration: none; }
.card-link:hover h3 { color: var(--accent); }
.card-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; display: flex; align-items: flex-end; padding: 1rem; }
.card-cover .cover-domain { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.85); }
.card-body { padding: 1.1rem 0 0; }
.card-body .tag { margin-bottom: 0.75rem; }
.card-body h3 { font-size: 1.32rem; line-height: 1.28; margin: 0 0 0.6rem; transition: color 0.15s ease; }
.card-excerpt { font-family: var(--sans); color: var(--muted); font-size: 0.96rem; margin: 0 0 0.75rem; }
.card-meta { font-family: var(--mono); color: var(--muted); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }

.empty-state { border: 1px dashed var(--border); border-radius: 4px; padding: 2.5rem; text-align: center; color: var(--muted); font-family: var(--serif); font-size: 1.1rem; max-width: 560px; }

/* ---------------------------------------------------------------- */
/* Homepage: epilogue + social                                        */
/* ---------------------------------------------------------------- */
.epilogue { width: 100vw; margin-left: calc(50% - 50vw); padding: 4.5rem max(1.5rem, calc(50vw - 590px + 1.5rem)); background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.epilogue .eyebrow { text-align: center; }
.epilogue-card { max-width: 680px; margin: 0 auto; }
.epilogue-card p { font-family: var(--serif); font-size: 1.2rem; line-height: 1.7; margin: 0 0 1.25rem; color: var(--ink); }
.epilogue-card p:last-child { margin-bottom: 0; }

.social { padding: 4.5rem 0 5rem; text-align: center; }
.social .eyebrow { text-align: center; }
.social > p { color: var(--muted); }
.social-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; padding: 0; margin: 1.5rem 0 0; }
.social-links a { display: inline-block; padding: 0.55rem 1.15rem; border: 1px solid var(--border); border-radius: 999px; font-family: var(--mono); color: var(--ink); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.social-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- */
/* Site footer                                                        */
/* ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.25rem 1.5rem; text-align: center; font-family: var(--mono); color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.site-footer a { color: var(--muted); font-weight: 500; }
.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- */
/* Article page                                                       */
/* ---------------------------------------------------------------- */
.essay-hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); margin-bottom: 2.5rem; padding: 4rem max(1.5rem, calc(50vw - 590px + 1.5rem)); overflow: hidden; display: flex; align-items: flex-end; min-height: 360px; background-position: center; }
.essay-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 8, 4, 0.78), rgba(10, 8, 4, 0.25) 55%, rgba(10, 8, 4, 0) 90%); }
.essay-hero-content { position: relative; max-width: 760px; }
.essay-hero-content .tag { margin-bottom: 1rem; color: #fff; }
.essay-hero-content .tag::before { color: #fff; }
.essay-hero-content h1 { color: #fff; font-size: 2.6rem; line-height: 1.12; margin: 0; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), 0 1px 4px rgba(0, 0, 0, 0.9); }

.essay-meta { display: flex; align-items: center; gap: 0.6rem; font-family: var(--mono); color: var(--muted); font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; padding: 0 0.25rem 1.5rem; max-width: 720px; margin: 0 auto; border-bottom: 1px solid var(--border); margin-bottom: 2rem; padding-bottom: 1.5rem; }
.essay-meta .dot { opacity: 0.5; }

.essay-body { max-width: 720px; margin: 0 auto; padding: 0.5rem 0.25rem 2rem; font-family: var(--serif); font-size: 1.18rem; line-height: 1.75; }
.essay-body p { margin: 0 0 1.4rem; }

.read-together { max-width: 720px; margin: 0 auto 2.5rem; padding: 1.5rem 1.5rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; font-family: var(--sans); }
.read-together .eyebrow { margin-bottom: 0.9rem; }
.read-together ol { margin: 0; padding-left: 1.2rem; }
.read-together li { margin-bottom: 0.6rem; font-size: 0.98rem; }
.read-together a { font-weight: 500; }
.read-together li:last-child { margin-bottom: 0; }

.essay-footer { max-width: 720px; margin: 0 auto; padding: 2.5rem 0.25rem 4.5rem; border-top: 1px solid var(--border); font-family: var(--sans); }
.essay-footer p { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.back-home { font-family: var(--mono); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------------------------------------------------------------- */
/* Path page                                                          */
/* ---------------------------------------------------------------- */
.path-intro { padding: 3rem 0 1rem; max-width: 680px; }
.path-intro p { color: var(--muted); }

.cluster-list { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem 0 4rem; }
.cluster-card { border: 1px solid var(--border); border-radius: 6px; padding: 1.75rem 1.85rem; background: var(--bg); }
.cluster-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.cluster-num { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }
.cluster-card h3 { font-size: 1.4rem; margin: 0.15rem 0 0.6rem; }
.cluster-blurb { color: var(--muted); font-size: 0.98rem; margin: 0 0 1.1rem; max-width: 640px; }
.cluster-status { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.cluster-status.written { color: var(--teal); border-color: var(--teal); }
.cluster-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cluster-entries li a { display: inline-block; font-family: var(--mono); font-size: 0.82rem; padding: 0.4rem 0.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--ink); }
.cluster-entries li a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cluster-essay-link { display: inline-block; margin-top: 1.1rem; font-family: var(--mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; border-bottom: 1px solid currentColor; }

.domain-roadmap { padding: 1rem 0 5rem; }
.domain-roadmap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.domain-tile { border: 1px solid var(--border); border-radius: 6px; padding: 1.1rem 1.25rem; }
.domain-tile .dname { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; margin-bottom: 0.3rem; }
.domain-tile .dcount { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------------- */
/* Entries index page                                                 */
/* ---------------------------------------------------------------- */
.entries-toolbar { position: sticky; top: 61px; z-index: 9; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1.25rem 0; margin-bottom: 1rem; }
.entries-search { width: 100%; max-width: 420px; padding: 0.65rem 0.9rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 0.95rem; }
.entries-search:focus { outline: none; border-color: var(--accent); }
.entries-stats { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 0.75rem; letter-spacing: 0.02em; }
.entries-jump { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.9rem; }
.entries-jump a { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); padding: 0.2rem 0.4rem; }
.entries-jump a:hover { color: var(--accent); text-decoration: none; }

.entries-list { padding-bottom: 5rem; }
.letter-group { margin-top: 2rem; }
.letter-group h2 { font-family: var(--mono); font-size: 1rem; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.75rem; letter-spacing: 0.04em; }
.entry-row { display: flex; align-items: baseline; gap: 0.65rem; padding: 0.4rem 0; font-size: 0.98rem; }
.entry-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; margin-top: 0.15rem; cursor: pointer; }
.entry-row a { color: var(--ink); }
.entry-row a:hover { color: var(--accent); }
.entry-row.is-read a { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); }
.entry-row.hidden { display: none; }

/* ---------------------------------------------------------------- */
/* Responsive                                                          */
/* ---------------------------------------------------------------- */
@media (max-width: 760px) {
  .masthead-nav { gap: 0; }
  .masthead-nav a { padding: 0 0.5rem; }
  .masthead-nav a:not(:first-child)::before { margin-right: 0.5rem; }
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero h1 { font-size: 2.1rem; }
  .card-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .epilogue { padding: 3rem 1.5rem; }
  .essay-hero { padding: 2.5rem 1.25rem; min-height: 240px; margin-bottom: 1.5rem; }
  .essay-hero-content h1 { font-size: 1.7rem; }
  .essay-body { font-size: 1.08rem; }
  .cluster-card { padding: 1.35rem 1.4rem; }
  .progress-strip { gap: 1.5rem; }
}
