:root {
  --paper: #f6efe3;
  --paper-2: #efe5d4;
  --card: #fbf7f0;
  --ink: #2b241e;
  --ink-2: #5a4e43;
  --ink-3: #8a7c6e;
  --rule: #ddd0bc;
  --accent: #a8461f;
  --accent-2: #c77a3a;
  --green: #4f6b3a;
  --red: #9b3b2e;
  --amber: #a7741f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .08);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --display: 'Fraunces', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1916; --paper-2: #24201b; --card: #29241f; --ink: #efe6d8; --ink-2: #c9bba8; --ink-3: #998a78;
    --rule: #3d352d; --accent: #e08a5a; --accent-2: #d9a066; --green: #9cba7f; --red: #e08a7a; --amber: #e0b562;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --paper: #1d1916; --paper-2: #24201b; --card: #29241f; --ink: #efe6d8; --ink-2: #c9bba8; --ink-3: #998a78;
  --rule: #3d352d; --accent: #e08a5a; --accent-2: #d9a066; --green: #9cba7f; --red: #e08a7a; --amber: #e0b562;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 17px; } }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand .mark { position: relative; width: 47px; height: 32px; flex: none; }
.brand .mark i { position: absolute; inset: 0; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.brand .mark .l { background: var(--ink); -webkit-mask-image: url(img/logo-letters.png); mask-image: url(img/logo-letters.png); }
.brand .mark .a { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-mask-image: url(img/logo-arrow.png); mask-image: url(img/logo-arrow.png); transition: transform .3s ease; }
.brand .mark.big { width: 70px; height: 48px; opacity: .85; }
.sig { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.brand:hover .mark .a { transform: translate(1px, -1px); }
.top nav { display: flex; gap: 22px; align-items: center; font-size: 16px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--accent); }
.theme { background: none; border: 1px solid var(--rule); color: var(--ink-2); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
@media (max-width: 600px) { .top nav a.hide-s { display: none; } }

/* hero */
.hero { position: relative; padding: 56px 0 40px; border-bottom: 1px solid var(--rule); }
.kicker { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 6vw, 68px); line-height: 1.05; margin: 14px 0 20px; letter-spacing: -.015em; max-width: 15ch; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero p.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 52ch; margin: 0 0 30px; }
.chart { position: absolute; right: 0; top: 40px; width: 38%; max-width: 440px; opacity: .9; pointer-events: none; }
.chart path.line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3.2s ease-out .3s forwards; }
.chart path.area { fill: url(#g); opacity: 0; animation: fade 1.6s ease-out 2.2s forwards; }
.chart circle { fill: var(--accent); opacity: 0; animation: fade .6s ease-out 3.3s forwards; }
.chart line.hi { stroke: var(--ink-3); stroke-dasharray: 3 5; stroke-width: 1; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (max-width: 860px) { .chart { position: static; width: 100%; max-width: 520px; margin: 0 0 18px; } }
@media (prefers-reduced-motion: reduce) { .chart path.line, .chart path.area, .chart circle { animation: none; stroke-dashoffset: 0; opacity: 1; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 8px; border-top: 1px solid var(--rule); }
.stat { padding: 18px 16px 4px 0; }
.stat b { display: block; font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--ink-3); font-size: 15px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* sections */
section { padding: 56px 0; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 8px; letter-spacing: -.01em; }
.sub { color: var(--ink-2); max-width: 62ch; margin: 0 0 28px; }

/* ledger of beliefs */
.ledger { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 1.15fr 1fr 150px; gap: 18px; padding: 15px 22px; border-top: 1px solid var(--rule); align-items: baseline; }
.row:first-child { border-top: 0; }
.row.head { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-2); padding-top: 11px; padding-bottom: 11px; }
.row .belief { font-style: italic; }
.row .finding { color: var(--ink-2); font-size: 16.5px; }
a.row { text-decoration: none; color: inherit; transition: background .15s; }
a.row:hover { background: var(--paper-2); }
a.row:hover .belief { color: var(--accent); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: 4px; } .row.head { display: none; } }

.tag { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; line-height: 1.5; }
.tag.no { color: var(--red); }
.tag.small { color: var(--amber); }
.tag.yes { color: var(--green); }
.tag.gone { color: var(--ink-3); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.filters button { font-family: var(--serif); font-size: 16px; background: transparent; border: 1px solid var(--rule); color: var(--ink-2); padding: 6px 15px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* paper cards */
.papers { display: grid; gap: 22px; }
.paper { display: grid; grid-template-columns: 150px 1fr; gap: 28px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.paper:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60,40,20,.08), 0 14px 32px rgba(60,40,20,.12); }
.paper.hidden { display: none; }
.thumb { display: block; width: 150px; aspect-ratio: 414 / 585; border-radius: 4px; overflow: hidden; border: 1px solid var(--rule); background: #fff; box-shadow: 3px 3px 0 var(--paper-2), 3px 3px 0 1px var(--rule); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
:root[data-theme="dark"] .thumb img { filter: brightness(.88) sepia(.15); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb img { filter: brightness(.88) sepia(.15); } }
.meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.meta .no-pill { color: var(--accent); font-weight: 500; }
.paper h3 { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.2; margin: 8px 0 2px; letter-spacing: -.005em; }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--accent); }
.paper .subtitle { color: var(--ink-2); font-style: italic; margin: 0 0 14px; font-size: 17px; }
.qa { display: grid; grid-template-columns: 116px 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 17px; }
.qa dt { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 4px; }
.qa dd { margin: 0; }
.figure { font-family: var(--display); font-size: 19px; color: var(--accent); font-weight: 600; }
details { border-top: 1px dashed var(--rule); padding-top: 10px; margin-top: 4px; }
summary { cursor: pointer; color: var(--ink-2); font-size: 16px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '+'; font-family: var(--mono); color: var(--accent); width: 14px; }
details[open] summary::before { content: '−'; }
details p { font-size: 16.5px; color: var(--ink-2); margin: 10px 0 4px; text-align: justify; hyphens: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 16px; padding: 8px 16px; border-radius: 8px; text-decoration: none; border: 1px solid var(--accent); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--paper); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.btn svg { width: 16px; height: 16px; }
pre.bib { display: none; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
pre.bib.show { display: block; }
@media (max-width: 680px) {
  .paper { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .thumb { width: 110px; }
  .qa { grid-template-columns: 1fr; gap: 0 0; }
  .qa dd { margin-bottom: 8px; }
}

/* method */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.principle { border-top: 2px solid var(--accent); padding-top: 14px; }
.principle h4 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.principle p { margin: 0; color: var(--ink-2); font-size: 16.5px; }
@media (max-width: 820px) { .method { grid-template-columns: 1fr; } }

.quote { font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; font-style: italic; font-weight: 400; max-width: 34ch; margin: 0 auto; text-align: center; color: var(--ink); }
.quote small { display: block; font-family: var(--serif); font-style: normal; font-size: 16px; color: var(--ink-3); margin-top: 14px; }
.band { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

footer { padding: 40px 0 56px; color: var(--ink-3); font-size: 15px; }
footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; border-top: 1px solid var(--rule); padding-top: 22px; }
footer p { margin: 0 0 6px; max-width: 70ch; }
.guide-link { margin: 30px 0 0; font-size: 17px; }
@media (max-width: 430px) { .top nav { gap: 14px; font-size: 15px; } .brand { font-size: 18px; gap: 8px; } .brand .mark { width: 40px; height: 27px; } }
