* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: #2A2620; font: 16px/1.5 'Work Sans', system-ui, sans-serif; }
h1, h2, .stamp b, .when b, figcaption, .card-name { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.page { position: relative; max-width: 560px; min-height: 100vh; margin: 0 auto; overflow: hidden; display: flex; flex-direction: column; }
.art svg { display: block; width: 100%; height: auto; }
.art-top { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.art-bottom { margin-top: auto; padding-top: 24px; }
.head, .visits, .visit, .foot, .cards { position: relative; padding-inline: 20px; }

.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 36px; }
.kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #5F574C; }
h1 { margin: 6px 0; font-size: clamp(40px, 12vw, 52px); line-height: 1; color: var(--accent); }
.sub { margin: 0; font-size: 14px; }
.stamp { flex-shrink: 0; width: 84px; height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 2px dashed #B23A2E; border-radius: 4px; background: var(--paper); color: #A3352A; transform: rotate(6deg); font-size: 10px; letter-spacing: .08em; text-align: center; }
.stamp b { font-size: 28px; line-height: 1; letter-spacing: 0; }

.visits { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 40px; padding-bottom: 22px; }
.visit-btn { min-height: 44px; padding: 0 16px; border: 2px dashed rgba(0, 0, 0, .35); border-radius: 4px; background: var(--paper); font-weight: 500; }
.visit-btn[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }

.polaroid { background: #fff; padding: 10px 10px 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); transform: rotate(-1deg); }
.slides { touch-action: pan-y; }
figure { margin: 0; }
.open { display: block; position: relative; width: 100%; padding: 0; border: 0; background: rgba(0, 0, 0, .08); cursor: zoom-in; }
.open img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
figcaption { padding-top: 10px; font-size: 17px; }
.count { margin: 0; font-size: 12px; color: #5F574C; text-align: right; }
.controls { display: flex; justify-content: center; gap: 12px; padding-top: 16px; }
.controls button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); background: var(--paper); display: grid; place-items: center; }
.controls .pause { border: 0; background: var(--accent); color: #fff; }
.controls .pause[aria-pressed="true"] { background: #5F574C; }

h2 { margin: 36px 0 14px; font-size: 26px; }
.story { margin: 0; font-size: 15px; line-height: 1.6; }
.empty { padding: 40px 0; text-align: center; color: #5F574C; }

.timeline { list-style: none; margin: 28px 0 0; padding: 0; }
.timeline li { display: flex; gap: 14px; }
.when { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: #5F574C; }
.when b { font-size: 26px; line-height: 1; color: var(--accent); }
.when::after { content: ''; flex-grow: 1; width: 1px; margin-top: 6px; background: rgba(0, 0, 0, .2); }
.what { padding-bottom: 24px; }
.what h3 { margin: 0; font-size: 16px; font-weight: 600; }
.what p { margin: 4px 0 0; font-size: 14px; }
.snap { display: block; width: 160px; height: 106px; margin-top: 8px; object-fit: cover; border: 6px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .14); }

.gallery-head { display: flex; justify-content: space-between; align-items: baseline; }
.gallery-head span { font-size: 13px; color: #5F574C; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: calc((min(100vw, 560px) - 52px) / 3); gap: 6px; padding-bottom: 24px; }
.tile { position: relative; padding: 0; border: 0; background: rgba(0, 0, 0, .08); }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.big { grid-column: span 2; grid-row: span 2; }
.tile.wide { grid-column: span 2; }
.play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.play::after { content: ''; position: absolute; left: 17px; top: 13px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #2A2620; }
.dur { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 3px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 11px; }
.broken { visibility: hidden; }

.foot { display: flex; justify-content: space-between; padding-block: 20px; border-top: 1px dashed rgba(0, 0, 0, .25); font-size: 13px; color: #5F574C; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

#viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111; color: #fff; }
#viewer::backdrop { background: #111; }
.stage { height: 100%; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.stage img, .stage video { max-width: 100%; max-height: 100%; }
.vmsg { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; }
.vclose, .vprev, .vnext { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; }
.vclose { top: 12px; right: 12px; }
.vprev { left: 8px; top: 50%; }
.vnext { right: 8px; top: 50%; }

.cards { list-style: none; margin: 32px 0; display: grid; gap: 16px; }
.card { display: grid; text-decoration: none; color: inherit; background: #fff; padding: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.card img, .nocover { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--accent); }
.card-name { padding-top: 8px; font-size: 24px; color: var(--accent); }
.card-sub { font-size: 13px; color: #5F574C; }
