/* Roark Enters — research site.
   Same ink-on-stone palette and type as the Witness Explorer (witness-explorer/src/styles.css). */

:root {
  --stone: #F2F3F0;
  --page: #FBFBF9;
  --ink: #1F2633;
  --ink-2: #4A5263;
  --ink-3: #5F6676;      /* darker than the explorer's #7D8494 so small text passes 4.5:1 on stone */
  --rule: #D9DBD5;
  --rule-2: #E7E8E3;
  --field: #A9ADB6;
  --carmine: #9E1B3B;
  --carmine-dark: #7A1430;
  --carmine-wash: #F5E3E7;

  --greek: "GFS Didot", "Gentium Book Plus", "Times New Roman", serif;
  --sans: "Alegreya Sans", "Gill Sans", "Segoe UI", sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--carmine); }
a:hover { color: var(--carmine-dark); }
:focus-visible { outline: 2px solid var(--carmine); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, .h2 { font-family: var(--greek); font-weight: 400; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3, .h3 { font-family: var(--sans); font-size: 1.25rem; font-weight: 500; margin: 0; line-height: 1.3; }
h2.h3 { font-family: var(--sans); font-size: 1.3rem; font-weight: 500; }
p { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.greek { font-family: var(--greek); }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
.small { font-size: .9rem; }
.center { text-align: center; }
.accent { color: var(--carmine); }
.lede { font-size: 1.18rem; line-height: 1.55; color: var(--ink-2); max-width: 40rem; }
.kicker { color: var(--ink-2); letter-spacing: .02em; }
.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--page); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 20px; border-radius: var(--radius);
  font-weight: 500; text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-sm { padding: 8px 18px; }
.btn-lg { min-height: 48px; padding: 10px 24px; font-size: 1.06rem; }
.btn-xl { min-height: 52px; padding: 12px 32px; font-size: 1.12rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--carmine); color: #fff; }
.btn-primary:hover { background: var(--carmine-dark); color: #fff; }
.btn-secondary { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-secondary:hover { background: var(--page); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--page); }
.btn-dark:hover { background: #10151F; color: var(--page); }
.btn-link { color: var(--carmine); padding-inline: 4px; }
.btn[disabled] { opacity: .65; cursor: progress; }

/* ---- masthead ---- */
.masthead { background: var(--page); border-bottom: 1px solid var(--rule); }
.masthead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; padding-top: 12px; padding-bottom: 10px; }
.wordmark { font-family: var(--greek); font-size: 1.6rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--carmine); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; }
.nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav a[aria-current="page"]:not(.btn) { color: var(--ink); border-bottom-color: var(--carmine); }

/* ---- shared blocks ---- */
.card { background: var(--page); border: 1px solid var(--rule); border-radius: var(--radius); }
.pad-lg { padding: 32px; }
.section { padding: 28px 0; display: flex; flex-direction: column; gap: 22px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.ruled { border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; padding: 28px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.grid-2 .card, .step { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tag { color: var(--carmine); }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ink-3); }
.band {
  background: var(--page); border: 1px solid var(--rule); border-top: 3px solid var(--carmine); border-radius: var(--radius);
  padding: 34px 40px; display: flex; flex-wrap: wrap; gap: 22px 32px; align-items: center; justify-content: space-between;
}
.band > div:first-child { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.follow-band { border-top: 1px solid var(--rule); margin-top: 24px; }
.slim { padding: 26px 40px; margin-bottom: 56px; }
.slim h2 { font-size: 1.6rem; }

/* ---- home ---- */
.hero { padding: 64px 0 48px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-text { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-text .actions { padding-top: 8px; }
.rating-card { flex: 1 1 340px; min-width: 0; padding: 22px 24px 20px; }
.ratings { margin: 6px 0 0; }
.rating-row { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: baseline; padding: 11px 8px; border-top: 1px solid var(--rule); }
.rating-row dt { font-family: var(--greek); font-size: 1.45rem; color: var(--ink-3); }
.rating-row dd { margin: 0; color: var(--ink-2); line-height: 1.4; }
.rating-row.is-focus { background: var(--carmine-wash); }
.rating-row.is-focus dt { color: var(--carmine); }
.rating-row.is-focus dd { color: var(--ink); font-weight: 500; }
.rating-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ink); color: var(--ink-2); font-size: .92rem; }
.rating-foot strong { color: var(--carmine); }
.grade-inline { font-family: var(--greek); color: var(--carmine); }
.status { padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 4px 32px; align-items: baseline; }
.status .accent { font-weight: 700; }
.home-section, .section { }
.update-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.update-card .more { margin-top: auto; padding-top: 4px; font-weight: 500; }
.about { padding: 48px 0; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.about img { flex: 0 0 200px; width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 1px solid var(--rule); }
.about > div { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.about p { font-size: 1.06rem; line-height: 1.6; max-width: 42rem; }
.support-cta { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ask-prompt { padding: 56px 0; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.ask-prompt > div { flex: 999 1 420px; display: flex; flex-direction: column; gap: 6px; }
.ask-prompt h2 { font-size: 1.75rem; }

/* ---- email sign-up ---- */
.follow-form { flex: 1 1 380px; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.follow-form input[type="email"] { flex: 1 1 220px; min-width: 0; }
.follow-form .form-status { flex-basis: 100%; min-height: 0; }
.follow-form .form-status:empty { display: none; }
.follow-form.is-done input, .follow-form.is-done button { display: none; }
.follow-inline { padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.follow-inline > div:first-child { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* ---- forms ---- */
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 8px 12px; font-size: 1rem;
  border: 1px solid var(--field); border-radius: var(--radius); background: var(--stone);
}
input:focus, select:focus, textarea:focus { background: #fff; }
textarea { resize: vertical; }
label { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--carmine); flex: 0 0 auto; }
.check label { font-weight: 400; color: var(--ink-2); }
.form-status { font-size: .98rem; }
.form-status.is-error, .form-error { color: var(--carmine); font-weight: 500; }

/* ---- research ---- */
.page-head { padding: 56px 0 20px; display: flex; flex-direction: column; gap: 14px; max-width: 48rem; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 22px; padding-top: 4px; }
.epigraph { color: var(--ink-2); }
.epigraph .greek { font-size: 1.12rem; color: var(--ink); }
.grid-2 p { font-size: 1.06rem; line-height: 1.6; }
.step { padding: 24px; }
.step-n { font-family: var(--greek); font-size: 1.9rem; color: var(--carmine); line-height: 1; }
.specialists { color: var(--ink-2); max-width: 52rem; }
.specialists strong { color: var(--ink); font-weight: 500; }
.byline a { color: inherit; }
.faq { padding: 4px 28px; }
.faq-item { padding: 20px 0; border-bottom: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 8px; max-width: 52rem; }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3 { margin: 0; font-size: 1.12rem; font-weight: 500; }
.faq-item p { margin: 0; line-height: 1.6; }
.milestones { list-style: none; margin: 0; padding: 0; }
.milestones li { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline; padding: 14px 24px; border-bottom: 1px solid var(--rule-2); }
.milestones li:last-child { border-bottom: 0; }
.ms-status { flex: 0 0 64px; font-size: .9rem; font-weight: 700; color: var(--ink-3); }
.ms-label { flex: 999 1 300px; font-size: 1.06rem; color: var(--ink-2); }
.ms-when { color: var(--ink-3); font-size: .9rem; }
.ms-now .ms-status { color: var(--carmine); }
.ms-now .ms-label { color: var(--ink); font-weight: 500; }
.ms-next .ms-status { font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: 0 20px; }
.filters button { background: none; border: 0; border-bottom: 2px solid transparent; min-height: 44px; padding: 6px 0; color: var(--ink-3); cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--carmine); }
.update-list article { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 20px 24px; border-bottom: 1px solid var(--rule-2); }
.update-list article:last-child { border-bottom: 0; }
.update-list .post-meta { flex: 0 0 140px; flex-direction: column; gap: 2px; }
.update-list article > div { flex: 999 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.update-list h3 a { color: var(--ink); text-decoration: none; }
.update-list h3 a:hover { color: var(--carmine); text-decoration: underline; }
.ask { padding: 28px 0 48px; display: flex; flex-wrap: wrap; gap: 32px; }
.ask-intro { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ask-form { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ask-form .btn { align-self: flex-start; }

/* ---- donate ---- */
.donate { padding: 56px 0; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.donate-why { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.facts { margin: 0; padding: 0 0 0 1.1rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.gift-form { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.gift-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gift-form legend { font-weight: 500; padding: 0; margin-bottom: 8px; }
.pills { display: grid; gap: 8px; }
.pills-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pills-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills label {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 1px solid var(--field); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 500;
}
.pills label:hover { border-color: var(--ink); }
.pills input:checked + label { background: var(--ink); border-color: var(--ink); color: var(--page); }
.pills input:focus-visible + label { outline: 2px solid var(--carmine); outline-offset: 2px; }
.money { display: flex; align-items: center; gap: 8px; }
.money span { font-size: 1.2rem; color: var(--ink-2); }
.js .other-amount[hidden] { display: none; }

/* ---- simple pages and posts ---- */
.narrow { max-width: 44rem; padding: 64px 0; display: flex; flex-direction: column; gap: 20px; }
.signoff { font-style: italic; color: var(--ink-2); }
.post { max-width: 44rem; padding: 56px 0 32px; display: flex; flex-direction: column; gap: 16px; }
.prose p { font-size: 1.12rem; line-height: 1.7; margin: 0 0 1rem; }
.prose h2 { margin-top: 1.2rem; }
.post-back { padding-top: 8px; }
.post + .band { margin-bottom: 56px; }

/* ---- footer ---- */
.footer { background: var(--page); border-top: 1px solid var(--rule); margin-top: 24px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: baseline; padding-top: 26px; padding-bottom: 26px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 36px 0 32px; gap: 28px; }
  .band, .slim { padding: 24px 20px; }
  .pad-lg { padding: 22px; }
  .hero .btn, .support-cta .btn { width: 100%; }
  .about { gap: 20px; padding: 32px 0; }
  .about img { flex-basis: 120px; width: 120px; height: 120px; }
  .update-list .post-meta { flex-basis: 100%; flex-direction: row; }
  .faq { padding: 4px 20px; }
}
