:root {
  --sans: "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Noto Serif", Georgia, serif;
  --ink: #111518;
  --muted: #6d6a62;
  --gold: #9d8b6c;
  --paper: #e9e7e1;
  --line: #d9d6ce;
  --bar: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  top: 0 !important;            /* Google Translate pushes body down */
  position: static !important;
}

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.logo img { display: block; height: 30px; width: auto; }
.books { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.books::-webkit-scrollbar { display: none; }
.books a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  font-size: 13px; padding: 7px 11px; border-radius: 6px;
}
.books a span { color: var(--gold); font-weight: 700; margin-right: 4px; }
.books a:hover { background: #f3f1ec; color: var(--ink); }
.books a.on { background: var(--ink); color: #fff; }
.tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pdf, .lang {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--ink); text-decoration: none; background: #fff;
}
.pdf:hover, .lang:hover { border-color: var(--gold); }
.pdf svg, .lang svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.lang select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  font: inherit; color: inherit; cursor: pointer; padding-right: 14px; max-width: 170px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 4px center, right 0 center; background-size: 4px 4px; background-repeat: no-repeat;
}
.lang select:focus { outline: none; }
.lang:focus-within { border-color: var(--ink); }

.mt-note {
  text-align: center; font-size: 12px; color: var(--muted);
  padding: 8px 16px; background: #f6f4ef; border-bottom: 1px solid var(--line);
}

/* ---------- pages ---------- */
.pages { max-width: 1240px; margin: 0 auto; padding: 28px 24px 8px; display: grid; gap: 24px; }
.page {
  position: relative; container-type: inline-size;
  aspect-ratio: 960 / 540; overflow: hidden;
  background: #fff; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 28px rgba(0,0,0,.08);
}
.page .bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.page .t { position: absolute; z-index: 1; font-kerning: none; }
.page .t.s, .page .t.r { width: max-content; }
.page .t.c { text-align: center; }
.page .t.r { text-align: right; }
.page .t p { margin: 0; overflow-wrap: break-word; }
.page .t.nw p { white-space: nowrap; }
.page .t .brand { text-transform: uppercase; }
html.translated-rtl .page .t:not(.c) { direction: rtl; text-align: right; }
html.translated-rtl .page .t.s { width: auto; }

.pager { display: flex; justify-content: space-between; padding: 8px 2px 0; }
.pager a { color: var(--ink); text-decoration: none; font-size: 14px; padding: 10px 0; }
.pager a:hover { color: var(--gold); }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 28px 16px 40px; letter-spacing: .04em; }

/* ---------- home ---------- */
.home { max-width: 1240px; margin: 0 auto; padding: 48px 24px 8px; }
.intro { max-width: 640px; margin-bottom: 36px; }
.kicker { text-transform: uppercase; letter-spacing: .22em; font-size: 11px; font-weight: 700; color: var(--gold); margin: 0 0 10px; }
.intro h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px; }
.card { display: block; text-decoration: none; color: inherit; }
.card .page { transition: transform .2s ease, box-shadow .2s ease; }
.card:hover .page { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 16px 36px rgba(0,0,0,.14); }
.card .meta { display: flex; align-items: baseline; gap: 10px; padding: 12px 2px 0; }
.card .num { color: var(--gold); font-weight: 700; font-size: 13px; }
.card .ttl { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.card .cnt { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- Google Translate chrome ---------- */
iframe.skiptranslate, .goog-te-banner-frame, .VIpgJd-ZVi9od-ORHb-OEVmcd,
#goog-gt-tt, .VIpgJd-yAWNEb-L7lbkb, .goog-te-balloon-frame, .goog-tooltip { display: none !important; }
.goog-text-highlight, .VIpgJd-yAWNEb-OiiCO { background: none !important; box-shadow: none !important; }
#google_translate_element { display: none; }
.gt-failed .mt-note { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .logo img { height: 24px; }
  .tools { margin-left: auto; }
  .books { order: 3; flex-basis: 100%; }
  .pdf span { display: none; }
  .lang select { max-width: 120px; }
  .pages { padding: 16px 16px 8px; gap: 14px; }
  .home { padding: 28px 16px 8px; }
  .grid { grid-template-columns: 1fr; gap: 22px; }
}
