/* journal.css, the reading + hub design system for triday's journal.
   Extends the brand system from legal.css / triday.html:
   paper & ink, Mathem hand for display, Newsreader serif for body, one red accent, auto dark.
   Served root-relative as /journal.css so nested /journal/<slug>/ pages resolve it. */

@font-face {
  font-family: 'Mathem';
  src: url('/fonts/mathem.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #FAF9F4;
  --paper-2: #F4F2EA;      /* faint card / callout fill */
  --ink: #1C1B19;
  --soft: #46453F;          /* body text, a touch warmer than pure ink */
  --soft-2: #5C5A52;
  --faded: #908D83;
  --faded-2: #C0BDB3;
  --accent: #E5484D;
  --accent-soft: rgba(229,72,77,0.12);
  --rule: rgba(28,27,25,0.10);
  --rule-2: rgba(28,27,25,0.06);
  --select: rgba(229,72,77,0.16);
  --link-line: rgba(229,72,77,0.32);
  --shadow: rgba(28,27,25,0.07);
  --shadow-strong: rgba(28,27,25,0.16);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130F;
    --paper-2: #1B1A15;
    --ink: #ECEAE0;
    --soft: #C4C0B5;
    --soft-2: #ABA79C;
    --faded: #807C72;
    --faded-2: #4F4C44;
    --accent: #F06A6E;
    --accent-soft: rgba(240,106,110,0.16);
    --rule: rgba(236,234,224,0.13);
    --rule-2: rgba(236,234,224,0.07);
    --select: rgba(240,106,110,0.22);
    --link-line: rgba(240,106,110,0.42);
    --shadow: rgba(0,0,0,0.35);
    --shadow-strong: rgba(0,0,0,0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: oldstyle-nums;
}
a { color: inherit; }
::selection { background: var(--select); }

.hand { font-family: 'Mathem', 'Segoe Print', cursive; }
.wm { font-family: 'Mathem', cursive; line-height: 1; text-decoration: none; }
.dot { color: var(--accent); }

/* skip-to-content (a11y / SEO) */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper);
  font-family: 'Mathem', cursive; font-size: 18px; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* inline accent link (used in colophon, callouts) */
a.il { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--link-line); }
a.il:hover { border-bottom-color: var(--accent); }

/* ---- shell ---- */
.wrap { width: min(680px, 90vw); margin: 0 auto; }
.wrap-wide { width: min(1080px, 92vw); margin: 0 auto; }

.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 30px;
}
.topbar .wm { font-size: 30px; }
.topbar nav { display: flex; gap: 20px; font-family: 'Mathem', cursive; font-size: 21px; color: var(--faded); }
.topbar nav a { text-decoration: none; transition: color .2s ease; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); }

/* ---- breadcrumb ---- */
.crumbs {
  margin-top: 26px;
  font-family: 'Mathem', cursive;
  font-size: 18px;
  color: var(--faded);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
}
.crumbs a { text-decoration: none; transition: color .2s ease; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faded-2); }

/* =====================================================================
   ARTICLE
   ===================================================================== */
.article { padding-bottom: 40px; }

.article-head { padding-top: 30px; }
.kicker {
  font-family: 'Mathem', cursive;
  font-size: 20px;
  letter-spacing: .3px;
  color: var(--accent);
  margin: 0 0 14px;
  display: inline-flex; align-items: baseline; gap: 8px;
  text-decoration: none;
}
.kicker:hover { text-decoration: none; opacity: .8; }

.article-head h1 {
  font-family: 'Mathem', cursive;
  font-weight: 600;
  font-size: clamp(40px, 7.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.5px;
  margin: 0 0 18px;
  text-wrap: balance;
}
.dek {
  font-size: clamp(21px, 3.3vw, 25px);
  line-height: 1.5;
  color: var(--soft-2);
  font-style: italic;
  margin: 0 0 26px;
  max-width: 36ch;
  text-wrap: pretty;
}
.byline {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  font-family: 'Mathem', cursive;
  font-size: 18px;
  color: var(--faded);
}
.byline .who { color: var(--soft-2); }
.byline .sep { color: var(--faded-2); }

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

/* table of contents (in-article) */
.toc {
  margin: 30px 0 6px;
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
}
.toc-title { font-family: 'Mathem', cursive; font-size: 19px; color: var(--faded); margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { font-size: 17px; line-height: 1.75; color: var(--soft); }
.toc a { text-decoration: none; transition: color .2s ease; }
.toc a:hover { color: var(--accent); }

/* ---- body prose ---- */
.prose { margin-top: 8px; }
.prose > * { max-width: 100%; }
.prose p {
  margin: 0 0 22px;
  color: var(--soft);
}
.prose p.lede { font-size: 22px; color: var(--ink); }
.prose .dropcap::first-letter {
  font-family: 'Mathem', cursive;
  float: left;
  font-size: 78px;
  line-height: 0.72;
  padding: 8px 12px 0 0;
  color: var(--accent);
}

.prose h2 {
  font-family: 'Mathem', cursive;
  font-weight: 600;
  font-size: clamp(29px, 4.8vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.3px;
  margin: 52px 0 6px;
  scroll-margin-top: 24px;
}
.prose h3 {
  font-family: 'Mathem', cursive;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  margin: 36px 0 4px;
  color: var(--ink);
  scroll-margin-top: 24px;
}
.prose h2 + p, .prose h3 + p { margin-top: 10px; }

.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--link-line);
  transition: border-color .2s ease, color .2s ease;
}
.prose a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.prose ul, .prose ol { margin: 0 0 22px; padding-left: 26px; }
.prose li { margin: 9px 0; color: var(--soft); }
.prose li::marker { color: var(--faded); }
.prose ul.tight li, .prose ol.tight li { margin: 4px 0; }

/* blockquote, quiet, ruled */
.prose blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--soft-2);
  font-style: italic;
}
.prose blockquote p { margin: 0 0 8px; }
.prose blockquote cite { display: block; font-style: normal; font-family: 'Mathem', cursive; font-size: 17px; color: var(--faded); margin-top: 6px; }

/* pullquote, the hand, the brand's voice spoken aloud */
.pullquote {
  font-family: 'Mathem', cursive;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.2px;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
  margin: 44px auto;
  max-width: 22ch;
}
.pullquote .dot { color: var(--accent); }

/* figure / image */
.prose figure { margin: 34px 0; }
.prose figure img, .prose img { display: block; width: 100%; height: auto; border-radius: 12px; }
.prose figcaption { font-family: 'Mathem', cursive; font-size: 17px; color: var(--faded); text-align: center; margin-top: 10px; }

/* callout / aside, a quiet card */
.callout {
  margin: 30px 0;
  padding: 20px 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
}
.callout .callout-label { font-family: 'Mathem', cursive; font-size: 18px; color: var(--accent); margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
.callout.quiet { background: transparent; border-left: 2px solid var(--rule); border-radius: 0; padding: 6px 0 6px 22px; }

/* the practice box, a do-this-tonight prompt */
.practice {
  margin: 34px 0;
  padding: 24px 26px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background:
    linear-gradient(var(--paper) 0 0) padding-box;
  position: relative;
}
.practice::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: var(--accent); border-radius: 3px;
}
.practice .practice-label {
  font-family: 'Mathem', cursive; font-size: 19px; color: var(--accent); margin-bottom: 8px;
}
.practice p:last-child { margin-bottom: 0; }

/* in-text citation markers + notes list */
.prose sup.ref { font-size: .62em; line-height: 0; vertical-align: super; }
.prose sup.ref a { border-bottom: none; color: var(--accent); padding: 0 1px; }
.notes {
  margin: 48px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}
.notes-title { font-family: 'Mathem', cursive; font-size: 21px; color: var(--faded); margin-bottom: 12px; }
.notes ol { margin: 0; padding-left: 22px; }
.notes li { font-size: 16px; line-height: 1.6; color: var(--soft-2); margin: 10px 0; }
.notes li a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--link-line); word-break: break-word; }
.notes li a:hover { border-bottom-color: var(--accent); }

/* FAQ (carries FAQPage schema) */
.faq { margin: 48px 0 0; }
.faq h2 { font-family: 'Mathem', cursive; font-weight: 600; font-size: clamp(29px,4.8vw,36px); margin: 0 0 10px; }
.faq details {
  border-top: 1px solid var(--rule);
  padding: 16px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  font-family: 'Mathem', cursive;
  font-size: 23px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 26px; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 2px; color: var(--soft); }

/* ---- in-content app CTA ---- */
.appcta {
  margin: 46px 0;
  padding: 30px 30px 32px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  text-align: center;
  background: var(--paper-2);
}
.appcta .mark { font-family: 'Mathem', cursive; font-size: 44px; line-height: 1; margin-bottom: 10px; }
.appcta p { font-family: 'Mathem', cursive; font-size: 23px; line-height: 1.4; color: var(--soft-2); margin: 0 auto 20px; max-width: 26ch; }
.appcta .appstore {
  display: inline-flex; border-radius: 12px;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s cubic-bezier(.2,.8,.2,1);
}
.appcta .appstore:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 26px -10px var(--shadow-strong); }
.appcta .appstore:active { transform: translateY(-1px) scale(.997); transition-duration: .09s; }
.badge-bg { fill: var(--ink); }
.badge-fg { fill: var(--paper); }
@media (prefers-color-scheme: dark) { .badge-bg { fill: var(--ink); } .badge-fg { fill: var(--paper); } }

/* ---- end matter: author colophon, related, pager ---- */
.colophon {
  margin: 50px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
  display: flex; gap: 16px; align-items: flex-start;
}
.colophon .seal {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2); border: 1px solid var(--rule);
  font-family: 'Mathem', cursive; font-size: 26px;
}
.colophon .seal .dot { color: var(--accent); }
.colophon .who { font-family: 'Mathem', cursive; font-size: 19px; color: var(--ink); }
.colophon p { font-size: 16px; line-height: 1.6; color: var(--soft-2); margin: 4px 0 0; }

.related { margin: 50px 0 0; }
.related-title { font-family: 'Mathem', cursive; font-size: 22px; color: var(--faded); margin-bottom: 12px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { border-top: 1px solid var(--rule); }
.related li:last-child { border-bottom: 1px solid var(--rule); }
.related a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 15px 0; text-decoration: none; transition: color .2s ease;
}
.related a:hover .r-title { color: var(--accent); }
.related .r-title { font-family: 'Mathem', cursive; font-size: 22px; color: var(--ink); }
.related .r-kicker { font-family: 'Mathem', cursive; font-size: 16px; color: var(--faded); white-space: nowrap; }

/* =====================================================================
   COMPARISON TABLE (comparison / alternative pages)
   ===================================================================== */
.ctable-wrap { margin: 32px 0; }
.ctable-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 14px; }
table.ctable {
  border-collapse: collapse; width: 100%; min-width: 560px;
  font-family: 'Newsreader', Georgia, serif; font-size: 17px;
}
table.ctable th, table.ctable td {
  padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--rule);
  vertical-align: middle; white-space: nowrap;
}
table.ctable thead th {
  font-family: 'Mathem', cursive; font-weight: 600; font-size: 18px; color: var(--ink);
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
table.ctable tbody th {
  font-weight: 600; color: var(--ink); white-space: normal; min-width: 130px;
}
table.ctable td { color: var(--soft); }
table.ctable tbody tr:last-child th, table.ctable tbody tr:last-child td { border-bottom: none; }
/* the triday row, quietly highlighted */
table.ctable tr.is-triday th, table.ctable tr.is-triday td {
  background: var(--accent-soft); color: var(--ink);
}
table.ctable tr.is-triday th { font-family: 'Mathem', cursive; font-size: 21px; }
table.ctable tr.is-triday th .dot { color: var(--accent); }
/* yes / no cell marks */
.cmark { font-weight: 600; }
.cmark.no { color: var(--accent); }       /* a "no" (e.g. no subscription) is GOOD for triday's columns; styled as the accent */
.cmark.yes { color: var(--soft-2); }
.ctable .good { color: var(--accent); font-weight: 600; }  /* highlight a winning value */
.ctable-note { font-family: 'Mathem', cursive; font-size: 16px; color: var(--faded); margin-top: 10px; text-align: right; }
.ctable caption { caption-side: top; text-align: left; font-family: 'Mathem', cursive; font-size: 19px; color: var(--faded); padding-bottom: 10px; }

/* the honest "where X is better" block */
.fairness {
  margin: 38px 0; padding: 22px 26px; border: 1px solid var(--rule); border-left: 3px solid var(--soft-2);
  border-radius: 12px; background: var(--paper-2);
}
.fairness .fairness-label { font-family: 'Mathem', cursive; font-size: 19px; color: var(--soft-2); margin-bottom: 8px; }
.fairness p:last-child { margin-bottom: 0; }
.fairness strong { color: var(--ink); }

@media (max-width: 560px) {
  table.ctable { font-size: 15px; }
  table.ctable th, table.ctable td { padding: 11px 12px; }
}

/* =====================================================================
   HUB / INDEX
   ===================================================================== */
.hub-head { padding-top: 44px; text-align: center; }
.hub-head h1 {
  font-family: 'Mathem', cursive; font-weight: 600;
  font-size: clamp(52px, 11vw, 92px); line-height: 0.95; letter-spacing: -0.5px; margin: 0;
}
.hub-head .dek {
  font-style: italic; color: var(--soft-2);
  font-size: clamp(21px, 3.4vw, 26px); margin: 16px auto 0; max-width: 30ch; text-align: center;
}

.pillarnav {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 30px auto 0;
}
.pillarnav a {
  font-family: 'Mathem', cursive; font-size: 18px; color: var(--soft-2);
  text-decoration: none; padding: 7px 15px; border: 1px solid var(--rule); border-radius: 999px;
  transition: color .2s ease, border-color .2s ease, background .2s ease; white-space: nowrap;
}
.pillarnav a:hover { color: var(--ink); border-color: var(--faded); }
.pillarnav a.on { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.feature {
  margin: 46px 0 10px; padding: 32px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.feature .kicker { margin-bottom: 12px; }
.feature h2 { font-family: 'Mathem', cursive; font-weight: 600; font-size: clamp(34px,6vw,50px); line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.4px; }
.feature p { font-size: 21px; color: var(--soft-2); margin: 0 0 18px; max-width: 52ch; }
.feature a.more { font-family: 'Mathem', cursive; font-size: 20px; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--link-line); }
.feature a.more:hover { border-bottom-color: var(--accent); }

.pillar-section { margin-top: 50px; }
.pillar-section > h2 {
  font-family: 'Mathem', cursive; font-weight: 600; font-size: 30px; margin: 0 0 4px;
  display: flex; align-items: baseline; gap: 12px;
}
.pillar-section > h2 .num { color: var(--accent); }
.pillar-section > .pillar-dek { color: var(--soft-2); margin: 0 0 18px; max-width: 60ch; }

.cards { display: grid; gap: 2px; }
.card {
  display: grid; gap: 5px; padding: 20px 0; border-top: 1px solid var(--rule);
  text-decoration: none; transition: opacity .2s ease;
}
.card:last-child { border-bottom: 1px solid var(--rule); }
.card .c-kicker { font-family: 'Mathem', cursive; font-size: 16px; color: var(--accent); }
.card .c-title { font-family: 'Mathem', cursive; font-size: clamp(23px,3.6vw,28px); line-height: 1.12; color: var(--ink); transition: color .2s ease; }
.card .c-dek { font-size: 18px; color: var(--soft-2); line-height: 1.55; max-width: 60ch; }
.card .c-meta { font-family: 'Mathem', cursive; font-size: 15px; color: var(--faded); }
.card:hover .c-title { color: var(--accent); }

/* grid variant for hub cards on wide layouts */
@media (min-width: 760px) {
  .cards.grid { grid-template-columns: 1fr 1fr; gap: 0 40px; }
}

/* ---- footer (shared) ---- */
.foot {
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  padding: 28px 0 56px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; justify-content: space-between;
}
.foot .wm { font-size: 28px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; font-family: 'Mathem', cursive; font-size: 20px; color: var(--faded); }
.foot nav a { text-decoration: none; transition: color .2s ease; white-space: nowrap; }
.foot nav a:hover { color: var(--ink); }
.foot .copy { font-family: 'Mathem', cursive; font-size: 17px; color: var(--faded-2); width: 100%; }

/* reading progress + back-to-top niceties */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .appcta .appstore { transition: none; }
}

@media (max-width: 560px) {
  body { font-size: 19px; }
  .topbar nav { gap: 14px; font-size: 19px; }
}
