:root {
  --paper: #f7f3ec;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6b645c;
  --line: #e2dbd0;
  --gold: #b08a3e;
  --jlb: #7a3b33;
  --alr: #4c6b3f;
  --hlr: #1a1a1a;
  --plr: #34557a;
  --accent: #7a3b33;
  --ok: #2f6b3a;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161412; --card: #201d1a; --ink: #f1ece4; --muted: #b3aa9e; --line: #36312b;
    --hlr: #c9c4bc; --accent: #d08a7e;
  }
}
:root[data-theme="dark"] {
  --paper: #161412; --card: #201d1a; --ink: #f1ece4; --muted: #b3aa9e; --line: #36312b;
  --hlr: #c9c4bc; --accent: #d08a7e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { font: 700 15px/1 var(--serif); letter-spacing: .08em; border: 1.5px solid currentColor; padding: 9px 8px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.brand-text strong { font: 700 15px/1.1 var(--serif); letter-spacing: .32em; }
.brand-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-nav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 15px; }
.header-nav a { text-decoration: none; }
.header-nav a:hover { color: var(--accent); }
@media (max-width: 640px) { .header-nav a { display: none; } .brand-text small { max-width: 52vw; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 10px 18px; font: 600 15px/1 var(--sans); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; padding: 13px 18px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* banner */
.banner { background: var(--ink); color: var(--paper); text-align: center; padding: 10px 16px; font-size: 15px; }
.banner.ok { background: var(--ok); }
.banner button { margin-left: 10px; background: none; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; }

/* hero */
.hero { padding: 56px 0 36px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: 12.5px; font-weight: 700; color: var(--gold); margin: 0 0 10px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
.lede { font-size: 19px; color: var(--muted); max-width: 40ch; margin: 16px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.journal-key { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.journal-key li { display: grid; grid-template-columns: 14px 42px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.journal-key em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.journal-key em.free { color: var(--ok); font-weight: 700; }
.swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--c); }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }

/* library */
.library { padding: 36px 0 56px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: 600 14px/1 var(--sans); cursor: pointer; }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
select, .search input { font: 15px var(--sans); color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.search { position: relative; display: flex; align-items: center; }
.search span { position: absolute; left: 13px; color: var(--muted); }
.search input { padding-left: 32px; width: min(260px, 70vw); }
.count { color: var(--muted); font-size: 14px; margin: 16px 0 8px; }
.group-title { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--jc, var(--ink)); }
.group-title h3 { font-size: 22px; }
.group-title span { color: var(--muted); font-size: 14px; }
.grid { display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 8px 24px rgb(0 0 0 / .08); transform: translateY(-2px); }
.cover { position: relative; aspect-ratio: 612 / 792; background: var(--jc); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 8px; left: 8px; font: 700 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; background: rgb(255 255 255 / .92); color: #1d1b19; }
.badge.free { background: #e6f2e7; color: var(--ok); }
.badge.soon { background: #fff4dc; color: #7a5a12; }
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body .meta { font-size: 13px; color: var(--muted); }
.card-body .title { font: 700 16px/1.25 var(--serif); }
.card-body .ed { font-size: 12.5px; color: var(--gold); font-weight: 600; }
.card-body .btn { margin-top: auto; padding: 8px 12px; font-size: 14px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* subscribe */
.subscribe { padding: 56px 0; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sub-lede { color: var(--muted); max-width: 60ch; margin: 12px 0 28px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 20px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 24px; background: var(--paper); display: flex; flex-direction: column; gap: 12px; }
.plan-best { border-color: var(--gold); }
.ribbon { position: absolute; top: -12px; right: 18px; margin: 0; background: var(--gold); color: #fff; font: 700 12px/1 var(--sans); padding: 6px 10px; border-radius: 999px; }
.plan h3 { font-size: 22px; }
.price { margin: 0; color: var(--muted); }
.price span { font: 700 36px/1 var(--serif); color: var(--ink); }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); max-width: 70ch; margin-top: 22px; }
.about-content { margin-top: 28px; padding: 18px 20px; border-left: 3px solid var(--gold); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; max-width: 80ch; }
.about-content h3 { font-size: 17px; margin-bottom: 6px; }
.about-content p { margin: 0; font-size: 15px; color: var(--muted); }

/* footer */
.site-footer { padding: 40px 0 56px; font-size: 14.5px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 28px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font: 700 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }
.issn th { text-align: left; padding: 2px 12px 2px 0; color: var(--ink); }
.issn td { padding: 2px 0; }

/* log out button */
[hidden], .btn[hidden] { display: none !important; }
@media (max-width: 640px) {
  .header-nav { gap: 8px; }
  .header-nav .btn { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 480px) {
  .brand-text { display: none; }
}
