/* [n]teresan reader: a page-turning edition of the daily PDF. brk.bz tokens, dark room, paper pages. */
:root {
  --bg: #0f0f0f; --bg2: #171717; --line: #2a2a2a; --text: #dedbd3; --dim: #aaa69f; --mute: #77736d;
  --paper: #fefbf5; --accent: #f04820; --ink: #0f0f0f;
  --mono: ui-monospace, "IBM Plex Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
:root[data-theme="light"] { --bg: #f7f3ee; --bg2: #e7e3de; --line: #d2cec9; --text: #312e2a; --dim: #6d6965; --mute: #aaa6a1; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }

.bar { position: fixed; inset: 0 0 auto 0; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); z-index: 5; }
.bar .mark { display: block; flex: none; line-height: 0; }
.bar .mark img { height: 19px; width: auto; display: block; }
:root[data-theme="light"] .bar .mark img { content: url(wordmark-light.png); }
h1.meta { margin: 0; }
.bar .meta { font: 500 11px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { font: 600 11px/1 var(--mono); letter-spacing: .06em; padding: 7px 10px; border-radius: 999px; color: var(--dim); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.icon { font: 500 11px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); padding: 8px 4px; text-decoration: none; white-space: nowrap; }
.icon:hover, .seg button:hover { color: var(--text); }

.stage { position: fixed; inset: 52px 0 calc(64px + env(safe-area-inset-bottom)) 0; display: flex; align-items: center; justify-content: center; padding: 14px 16px; }
#book { margin: 0 auto; }
.stf__parent { margin: 0 auto; }
.page { background: var(--paper); overflow: hidden; }
.page img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.loading { position: absolute; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }

.foot { position: fixed; inset: auto 0 0 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom) !important; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 0 16px; border-top: 1px solid var(--line); }
.foot .nav { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 18px; transition: border-color .18s var(--spring); }
.foot .nav:hover { border-color: var(--dim); }
.foot .mid { display: flex; flex-direction: column; gap: 7px; align-items: center; min-width: 0; }
.foot .count { font: 500 11px var(--mono); letter-spacing: .06em; color: var(--dim); }
.foot .count b { color: var(--text); font-weight: 600; }
.track { width: min(420px, 100%); height: 1px; background: var(--line); position: relative; }
.track i { position: absolute; inset: 0 auto 0 0; background: var(--accent); width: 0; transition: width .42s var(--spring); }
.tools { display: flex; gap: 6px; justify-content: center; }

/* zoom: the current page at full size, native pinch zoom on phones */
.zoom { position: fixed; inset: 0; background: var(--bg); z-index: 10; overflow: auto; display: none; -webkit-overflow-scrolling: touch; }
.zoom.on { display: block; }
.zoom img { display: block; width: min(100%, 1240px); margin: 52px auto 24px; background: var(--paper); }
.zoom .close { position: fixed; top: 8px; right: 12px; z-index: 11; padding: 10px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }

/* archive */
.arch { max-width: 1120px; margin: 0 auto; padding: 84px 16px 64px; }
.arch h1 { margin: 0 0 18px; line-height: 0; }
.arch h1 img { width: min(560px, 86vw); height: auto; }
.arch .lead { color: var(--dim); max-width: 560px; margin: 0 0 36px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 28px 20px; border-top: 1px solid var(--line); padding-top: 24px; }
.card { text-decoration: none; display: block; }
.card img { width: 100%; aspect-ratio: 210 / 297; object-fit: cover; display: block; background: var(--paper); transition: transform .42s var(--spring); }
.card:hover img { transform: translateY(-4px); }
.card .n { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-top: 12px; }
.card .t { font: 600 17px/1.25 var(--serif); margin-top: 4px; }
.card .d { font: 500 11px var(--mono); color: var(--mute); margin-top: 6px; }

@media (max-width: 560px) {
  .bar { gap: 10px; } .bar .meta { display: none; }
  .stage { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { .track i, .card img { transition: none; } }
