:root {
  --bg: #121212; --bar: rgb(18 18 18 / 82%); --ink: #f4f1ea; --muted: #8f8b84; --line: rgb(255 255 255 / 9%);
  --accent: #e3684f; --serif: "Iowan Old Style", "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.bar {
  position: sticky; top: 0; z-index: 10; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 16px; background: var(--bar); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
.brand { font-family: var(--serif); font-size: 22px; letter-spacing: -.3px; }
.brand span { color: var(--accent); }
.title { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .2px; padding-left: 16px; border-left: 1px solid var(--line); line-height: 20px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.counter { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 10px; }
.counter .of, #total { color: var(--muted); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); transition: background .15s; }
.icon-button:hover { background: rgb(255 255 255 / 8%); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease-out; }

main { max-width: 920px; margin: 0 auto; padding: 32px 24px 8px; display: grid; gap: 24px; }
figure { margin: 0; border-radius: 4px; overflow: hidden; background: #1b1b1b; box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgb(0 0 0 / 80%); }
img { display: block; width: 100%; height: auto; }

.end { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 40px 20px calc(56px + env(safe-area-inset-bottom)); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--ink); color: var(--bg); transition: opacity .15s; }
.pill:hover { opacity: .88; }
.pill.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); }

@media (max-width: 640px) {
  .bar { gap: 10px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .title { display: none; }
  main { padding: 0; gap: 6px; }
  figure { border-radius: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .progress i { transition: none; } }
