/* The Ben Franklin Journal — "The Almanack" landing page.
   Philosophy-first: the idea leads, commerce recedes. Flat letterpress, no
   shadows or gradients, generous whitespace, quiet text-link actions. */

/* Self-hosted (SIL OFL, latin subset) so the page makes no third-party requests. */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/eb-garamond.woff2) format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/eb-garamond-italic.woff2) format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english.woff2) format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english-italic.woff2) format("woff2"); }

:root {
  --bg: #F3E7CB;
  --paper: #FBF4DF;
  --ink: #2C1810;
  --ink-2: #3A2616;
  --gold: #9C7A2E;
  --gold-deep: #6F520F;
  --slate: #4A3C24;
  --crimson: #7C1F1F;
  --border: #D8C7A2;
  --hair: #E5D6B4;
  --font-head: "IM Fell English", Georgia, serif;
  --font-body: "EB Garamond", Georgia, serif;
  --measure: 660px;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: #2a2014;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 28px; }

a { color: var(--ink-2); text-decoration: none; }

/* Quiet link: a single gold hairline underline, for secondary actions. */
.quiet, .lib-link, .welcome-actions a {
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
  color: var(--ink);
  transition: border-color 160ms ease, color 160ms ease;
}
.quiet:hover, .lib-link:hover, .welcome-actions a:hover {
  border-color: var(--ink);
}

/* Primary CTA: a filled wax-seal button — the one loud action on the page. */
.cta {
  display: inline-block; font-family: var(--font-head); font-size: 18px;
  letter-spacing: 0.5px; padding: 11px 30px; border-radius: 3px;
  background: var(--crimson); color: var(--paper); border: 1px solid var(--crimson);
  transition: background 160ms ease, transform 160ms ease;
}
.cta:hover { background: #621818; border-color: #621818; transform: translateY(-1px); }

:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 400; color: var(--ink); }

.orn { text-align: center; color: var(--gold); letter-spacing: 7px; font-size: 16px; margin: 2.5rem 0; }
.rule { width: 46px; height: 0; border-top: 1px solid var(--gold); margin: 2rem auto; }

/* ── Masthead ────────────────────────────────────────────────── */
.masthead { text-align: center; padding: 2.4rem 0 0.6rem; }
.masthead .name {
  font-family: var(--font-head); font-size: 17px; letter-spacing: 4px;
  text-transform: uppercase; color: var(--ink);
}
.dateline {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 6px 0; margin: 0.8rem 0 0; font-size: 13px; letter-spacing: 1px;
  color: var(--slate);
}
.soon-flag { color: var(--crimson); font-weight: 400; letter-spacing: 1.5px; }

/* ── Junto referral welcome (hidden until ?ref=junto) ─────────── */
.welcome {
  margin: 1.6rem 0 0; padding: 1.1rem 1.3rem;
  background: var(--paper); border: 1px solid var(--border);
  border-left: 3px solid var(--crimson); border-radius: 0;
}
.welcome h2 { font-size: 18px; margin: 0 0 0.4rem; color: var(--ink); }
.welcome p { margin: 0 0 0.6rem; font-size: 17px; color: var(--ink-2); }
.welcome-actions { font-size: 15px; }
[hidden] { display: none !important; }

/* ── The Hook ────────────────────────────────────────────────── */
.hook { text-align: center; padding: 2.8rem 0 1rem; }
.hook h1 {
  font-size: 34px; line-height: 1.22; margin: 0 auto 0.7rem; max-width: 13em;
}
.hook .sub {
  font-style: italic; color: var(--ink-2); font-size: 19px;
  max-width: 26em; margin: 0 auto 1.1rem;
}
.hero-soon { font-family: var(--font-head); font-size: 15px; color: var(--slate); letter-spacing: 1px; margin: 0; }
/* ── The Essay ───────────────────────────────────────────────── */
.essay { max-width: var(--measure); margin: 1rem auto 0; }
.essay p { text-align: left; }
.essay .lead::first-letter {
  font-family: var(--font-head); float: left; font-size: 58px; line-height: 46px;
  padding: 6px 10px 0 0; color: var(--ink);
}

/* The ledger — one week of the grid, shown rather than described. */
.ledger { margin: 1.8rem auto; max-width: 30em; }
.ledger table {
  width: 100%; border-collapse: collapse; background: var(--paper);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  font-size: 15px; line-height: 1.3;
}
.ledger caption {
  caption-side: bottom; font-style: italic; font-size: 15px; color: var(--ink-2);
  padding-top: 0.7rem; line-height: 1.5;
}
.ledger thead th { font-family: var(--font-head); font-weight: 400; color: var(--slate); padding: 7px 0 5px; border-bottom: 1px solid var(--ink); }
.ledger thead th:first-child { text-align: left; padding-left: 10px; }
.ledger tbody th { font-family: var(--font-head); font-weight: 400; text-align: left; color: var(--ink); padding: 3px 10px; white-space: nowrap; }
.ledger abbr { text-decoration: none; }
.ledger td { text-align: center; color: var(--ink); width: 11%; border-left: 1px solid var(--hair); font-size: 22px; line-height: 1; letter-spacing: 1px; }
.ledger tbody tr + tr > * { border-top: 1px solid var(--hair); }
.ledger tr.focus th { color: var(--crimson); }
.ledger tr.focus > * { background: var(--bg); }

/* ── The Method ──────────────────────────────────────────────── */
.method { max-width: var(--measure); margin: 0 auto; }
.method h2 { font-size: 22px; text-align: center; margin: 0 0 0.7rem; }
.method p { margin: 0 0 0.9rem; }
.method p:last-child { margin-bottom: 0; }

/* ── The Vow / Privacy Covenant ──────────────────────────────── */
.vow { max-width: var(--measure); margin: 0 auto; text-align: center; }
.vow h2 { font-size: 22px; margin: 0 0 0.3rem; }
.vow .sub { font-style: italic; color: var(--ink-2); margin: 0 auto 1.2rem; max-width: 28em; }
.matrix { text-align: left; border-top: 1px solid var(--border); margin: 0 0 1.4rem; }
.matrix .m {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 16px;
}
.matrix .them { color: var(--ink-2); }
.matrix .us { color: var(--ink); }
.matrix .lbl { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.vow-acq { padding: 1.2rem 0 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vow-acq .price { font-size: 14px; color: var(--slate); margin-top: 9px; }

/* ── The Library / From the Press ────────────────────────────── */
.library { max-width: var(--measure); margin: 0 auto; }
.library h2 { font-size: 20px; text-align: center; margin: 0 0 0.2rem; }
.library .sub { text-align: center; font-style: italic; color: var(--slate); font-size: 15px; margin: 0 0 1.2rem; }
.item { padding: 0.95rem 0; border-top: 1px solid var(--hair); }
.item:first-of-type { border-top: none; }
.item .t { font-family: var(--font-head); font-size: 18px; font-weight: 400; color: var(--ink); margin: 0; }
.item .gift { font-style: italic; color: var(--gold-deep); font-size: 14px; margin-left: 8px; }
.item .d { font-size: 16px; color: var(--ink-2); margin: 1px 0 4px; }
.item .d + .d { margin-top: 0.6rem; }
.item .p { font-size: 14px; color: var(--slate); }
.item .note { font-size: 13px; color: var(--slate); margin: 3px 0 0; }
.item .prep { font-style: italic; color: var(--slate); }
.item.featured { background: var(--paper); border-left: 3px solid var(--gold); padding-left: 14px; }

/* The Attic Ledger, sold per virtue */
.parts { list-style: none; margin: 0.7rem 0 0.5rem; padding: 0; }
.parts li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px solid var(--hair);
}
.parts li:last-child { border-bottom: none; }
.pt-n { font-family: var(--font-head); font-size: 13px; color: var(--slate); min-width: 62px; }
.pt-name { font-size: 15px; color: var(--ink); flex: 1; }
.item .bundle { margin-top: 0.8rem; font-size: 15px; }

/* Page-2 intro + the newspaper "Continued on Page N" cross-references */
.press-intro { text-align: center; max-width: var(--measure); margin: 1.6rem auto 0; }
.press-intro h1 { font-size: 30px; margin: 0 0 0.5rem; }
.press-intro .sub { font-style: italic; color: var(--ink-2); font-size: 17px; max-width: 30em; margin: 0 auto; }
.continued { text-align: center; font-family: var(--font-head); font-size: 16px; margin: 1rem 0 0; }

/* ── Page 3 — the guide. Every section shares one frame class. ── */
.gsec { max-width: var(--measure); margin: 0 auto; }
.gsec h2 { font-size: 22px; text-align: center; margin: 0 0 0.4rem; }
.gsec > .sub {
  text-align: center; font-style: italic; color: var(--ink-2);
  font-size: 16px; max-width: 34em; margin: 0 auto 1.3rem;
}
.toc { text-align: center; font-family: var(--font-head); font-size: 15px; color: var(--slate); margin: 1.1rem 0 0; }
.toc a { color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: 1px; transition: border-color 160ms ease; }
.toc a:hover { border-color: var(--ink); }
.pullquote {
  text-align: center; font-style: italic; font-size: 20px; line-height: 1.6;
  color: var(--ink); max-width: 26em; margin: 1.6rem auto;
  padding: 0.9rem 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
}
.weeklog { list-style: none; margin: 1rem 0; padding: 0; }
.weeklog li { padding: 0.7rem 0; border-bottom: 1px solid var(--hair); }
.weeklog li:last-child { border-bottom: none; }
.wl-day { font-family: var(--font-head); font-size: 15px; color: var(--gold-deep); display: block; margin-bottom: 2px; }
.weeklog p { margin: 0; font-size: 17px; }
.faq h3 { font-family: var(--font-head); font-size: 18px; font-weight: 400; color: var(--ink); margin: 1.4rem 0 0.4rem; }
.faq p { margin: 0 0 0.6rem; }

.virtue { padding: 1rem 0; border-top: 1px solid var(--hair); }
.virtue:first-of-type { border-top: none; }
.vt { font-family: var(--font-head); font-size: 19px; font-weight: 400; color: var(--ink); display: flex; align-items: baseline; gap: 10px; margin: 0; }
.vt-n { color: var(--gold-deep); font-size: 15px; min-width: 2.4em; }
.vt-precept { font-style: italic; color: var(--ink-2); font-size: 16px; margin: 5px 0 7px; }
.vt-mod { margin: 0 0 7px; }
.vt-aph { font-size: 14px; color: var(--slate); margin: 0; }

/* The daily routine */
.routine { list-style: none; margin: 0.6rem auto; padding: 0; max-width: 28em; }
.routine li { display: flex; gap: 16px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.routine li:last-child { border-bottom: none; }
.rt-time { font-family: var(--font-head); font-size: 15px; color: var(--gold-deep); min-width: 4em; text-align: right; }
.rt-label { font-size: 16px; color: var(--ink); }
.routine-note { font-size: 14px; color: var(--slate); font-style: italic; text-align: center; margin: 0.9rem auto 0; max-width: 30em; }

/* ── Colophon — the dark "broadside" coming-soon panel ───────── */
.colophon {
  text-align: center; max-width: var(--measure); margin: 0 auto; border-radius: 5px;
  background: var(--ink); color: var(--paper); padding: 2.6rem 1.6rem 2.8rem;
}
.colophon .fh { font-family: var(--font-head); font-size: 23px; color: var(--paper); margin: 0 0 0.8rem; }
.colophon .offer { font-size: 15px; color: var(--border); margin: 0 0 1.4rem; }
.badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 0 1.3rem; }
.badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  font-size: 13px; border-radius: 4px;
}
/* Coming-soon badge sitting on the dark panel: light outline, crimson chip. */
.badge.soon { background: transparent; border-color: rgba(251, 244, 223, 0.45); color: var(--paper); cursor: default; }
.badge.soon .small { color: var(--border); }
.badge.soon .big { color: var(--paper); }
.badge .soon-tag {
  font-family: var(--font-head); font-size: 11px; letter-spacing: 0.04em;
  color: var(--paper); background: var(--crimson); padding: 3px 7px; border-radius: 3px;
}
.badge .small { display: block; font-size: 11px; color: var(--slate); }
.badge .big { display: block; font-family: var(--font-head); font-size: 15px; line-height: 1.1; }
.microcopy { font-size: 14px; color: var(--border); max-width: 30em; margin: 0 auto 1.4rem; line-height: 1.6; }
.colophon-more { font-size: 15px; margin: 0 0 1.4rem; }
.colophon-more a { color: var(--paper); border-bottom: 1px solid var(--gold); padding-bottom: 2px; transition: border-color 160ms ease; }
.colophon-more a:hover { border-color: var(--paper); }
.press { font-style: italic; color: var(--hair); font-size: 14px; line-height: 1.7; opacity: 0.75; }
.footer-flourish { color: var(--gold); font-size: 22px; line-height: 1; margin-bottom: 8px; }

/* ── Coming-soon strip + page navigation (Pages 2 & 3 endings) ─ */
.soon-strip {
  max-width: var(--measure); margin: 0 auto; text-align: center;
  font-size: 15px; color: var(--ink-2); line-height: 1.7;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}
.pagenav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px;
  font-family: var(--font-head); font-size: 15px; margin: 1.8rem auto 0;
}
.pagenav .here { color: var(--slate); }
.pagenav a { color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: 1px; transition: border-color 160ms ease; }
.pagenav a:hover { border-color: var(--ink); }

/* ── Site footer ─────────────────────────────────────────────── */
.site-footer { text-align: center; padding: 1.6rem 28px 2.4rem; }
.site-footer p { margin: 0; font-size: 13px; letter-spacing: 0.5px; color: var(--slate); }
.site-footer p + p { margin-top: 6px; }
.site-footer a { color: var(--slate); border-bottom: 1px solid var(--gold); padding-bottom: 1px; }
.site-footer a:hover { color: var(--ink); border-color: var(--ink); }

/* ── Ben's nod after a download (app.js wireBen) ─────────────── */
.ben {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translateX(-50%); animation: ben-rise 3.2s ease-out both;
}
.ben-face {
  width: 140px; height: 140px; border-radius: 50%; overflow: hidden; background: var(--paper);
  border: 3px solid var(--gold); box-shadow: 0 6px 18px rgba(44, 24, 16, 0.25);
  animation: ben-tilt 3.2s ease-in-out both;
}
/* The art has a white ground; multiply lets the parchment show through it. */
.ben-face img { display: block; width: 100%; height: 100%; mix-blend-mode: multiply; }
.ben-says {
  background: var(--paper); color: var(--ink); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 14px; font-size: 16px; text-align: center; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.18);
}
.ben-says span { display: block; font-size: 12px; color: var(--slate); }
@keyframes ben-rise {
  0%   { opacity: 0; transform: translate(-50%, 140px) scale(0.6); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  82%  { opacity: 1; transform: translate(-50%, -16px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}
@keyframes ben-tilt { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .hook h1 { font-size: 28px; }
  .dateline { justify-content: center; }
  .matrix .m { grid-template-columns: 1fr; gap: 4px; }
  .ledger table { font-size: 14px; }
  .ledger tbody th, .ledger thead th:first-child { padding-left: 6px; }
}

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .welcome { display: none; }
  a { color: #000; border-bottom: none; }
  .orn, .rule, .footer-flourish { color: #000; }
  .colophon { background: #fff; color: #000; }
  .colophon .fh, .colophon .offer, .microcopy, .press, .badge.soon .small, .badge.soon .big { color: #000; }
  .cta { background: #fff; color: #000; border-color: #000; }
}

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