:root {
  --brand: #3B3399;
  --bg: #F8F2EC;
  --card: #FFFFFF;
  --ink: #3B2A24;
  --muted: #8A8A99;
  --soft: #ECE4DA;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17130F; --card: #241E1A; --ink: #F6EDE6; --muted: #A8A3B3; --soft: #2E2722; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Heebo, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
main { max-width: 1100px; margin: 0 auto; padding: 0 12px calc(32px + env(safe-area-inset-bottom)); }

header.top { text-align: center; padding: 34px 16px 18px; }
.logo { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; background: var(--brand); color: #fff;
        display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 28px; overflow: hidden;
        box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.biz { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
h1 { font-family: 'Suez One', serif; font-weight: 400; font-size: clamp(26px, 6vw, 40px); margin: 10px 0 4px; }
.date { color: var(--muted); font-size: 15px; }
.until { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--muted); background: var(--soft); padding: 4px 12px; border-radius: 99px; }

.tabs { display: flex; gap: 4px; background: var(--soft); border-radius: 99px; padding: 4px; max-width: 420px; margin: 8px auto 14px; position: sticky; top: 8px; z-index: 2; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--ink); font: 600 15px Heebo, sans-serif; padding: 10px 0; border-radius: 99px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.tile { aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--soft); cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile:active img { transform: scale(.97); }
.grid.pages .tile { aspect-ratio: 2 / 3; }
.skeleton { animation: pulse 1.2s ease-in-out infinite; }
.skeleton-header { height: 190px; }
@keyframes pulse { 50% { opacity: .5; } }

.download { display: block; width: 100%; max-width: 420px; margin: 18px auto 6px; border: 0; border-radius: 99px; background: var(--brand); color: #fff;
            font: 700 17px Heebo, sans-serif; padding: 15px; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.download:disabled { opacity: .7; }

footer { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; padding: 22px 12px 8px; }
footer .line { color: var(--ink); }
footer .made { font-size: 11px; opacity: .7; }
footer a { color: var(--brand); text-decoration: none; }

.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 10; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer .bar { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; color: #fff; }
.viewer .bar button, .viewer .bar a { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 99px; padding: 9px 16px; font: 600 15px Heebo, sans-serif; text-decoration: none; cursor: pointer; }
.viewer .stage { flex: 1; display: flex; align-items: center; justify-content: center; touch-action: pan-y; overflow: hidden; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.viewer .prev { right: 12px; } .viewer .next { left: 12px; }

.gone { max-width: 420px; margin: 18vh auto 0; text-align: center; background: var(--card); border-radius: 24px; padding: 40px 24px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.gone h1 { font-size: 26px; }
.gone p { color: var(--muted); line-height: 1.6; }
