@font-face { font-family: Geist; src: url(fonts/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Gelasio; src: url(fonts/gelasio-italic.woff2) format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  --bg: #fff;
  --ink: #000;
  --ink-muted: rgba(0, 0, 0, .8);
  --on-image: #fff;
  --on-image-2: rgba(255, 255, 255, .8);
  --on-image-off: rgba(255, 255, 255, .5);
  --pad: 16px;
  --gap: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-roll: cubic-bezier(0.22, 1, 0.36, 1);
  --ui: Geist, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: Gelasio, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/20px var(--ui); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a, button { color: inherit; font: inherit; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
[hidden] { display: none !important; }
p, h2 { margin: 0; font-weight: inherit; font-size: inherit; }

/* roll hover: two stacked labels in a 20px mask */
.roll { display: inline-block; height: 20px; overflow: hidden; position: relative; vertical-align: top; }
.roll::before, .roll::after { content: attr(data-label); display: block; height: 20px; transition: transform .3s var(--ease-roll); }
.roll::after { opacity: .8; }
.roll:hover::before, .roll:hover::after, .roll:focus-visible::before, .roll:focus-visible::after { transform: translateY(-20px); }
.roll .dot { position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- intro ---- */
.intro { position: fixed; inset: 0; z-index: 100; background: #fff; color: #000; display: none; place-items: center; }
.intro.on { display: grid; }
.intro-text { text-align: center; }
.mask { display: block; overflow: hidden; }
.mask > span { display: block; transform: translateY(110%); animation: rise .9s var(--ease-out) forwards; }
.mask:nth-child(2) > span { animation-delay: .12s; }
.mask:nth-child(3) > span { animation-delay: .24s; color: var(--ink-muted); }
@keyframes rise { to { transform: none; } }
.intro.out { opacity: 0; transition: opacity .7s ease; pointer-events: none; }

/* ---- hero ---- */
.hero { position: relative; width: 100%; height: 100vh; height: 100svh; overflow: hidden; background: #111; color: var(--on-image); }
.hero-slides, .slide { position: absolute; inset: 0; }
.slide { overflow: hidden; z-index: 1; }
.slide.current { z-index: 3; }
.slide.incoming { z-index: 4; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; background-size: cover; background-position: center; }
.hero::before, .hero::after { content: ''; position: absolute; left: 0; right: 0; height: 160px; z-index: 5; pointer-events: none; }
.hero::before { top: 0; background: linear-gradient(rgba(0, 0, 0, .08), transparent); }
.hero::after { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .08)); }
.hero-ui { position: absolute; inset: var(--pad); z-index: 6; pointer-events: none; }
.hero-ui > *, .hero-ui a, .hero-ui button { pointer-events: auto; }
.hero-name { position: absolute; top: 0; left: 0; max-width: calc(50% - 24px); }
.hero-nav { position: absolute; top: 0; left: 50%; display: flex; flex-direction: column; gap: 4px; margin-left: -14px; }
.hero-nav a { align-self: flex-start; padding-left: 14px; }
.hero-info { position: absolute; top: 0; right: 0; }
.hero-counter { position: absolute; left: 0; bottom: 0; display: flex; gap: 24px; }
.hero-counter button { color: var(--on-image-off); transition: color .3s; }
.hero-counter button[aria-current='true'] { color: var(--on-image); }
.hero-caption { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0; }
.hero-title { font: italic 400 20px/24px var(--serif); min-height: 0; }
.hero-title:empty { display: none; }
.hero-scroll { position: absolute; right: 0; bottom: 0; }

/* ---- density toggle ---- */
.density { display: flex; justify-content: center; gap: 24px; padding: 24px var(--pad) 0; }
.density button[aria-pressed='true'] { text-decoration: underline; text-underline-offset: 4px; }

/* ---- grid ---- */
.grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: var(--gap); padding: var(--pad) var(--pad) 160px; overflow: hidden; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.tile { display: block; width: 100%; position: relative; background-size: cover; background-position: center; cursor: pointer; opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.tile.in { opacity: 1; transform: none; }
.tile img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .5s ease; }
.tile img.loaded { opacity: 1; }
.tile:focus-visible { outline-offset: 2px; }

/* ---- footer ---- */
.footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: var(--pad); }
.footer-ig { justify-self: end; }
.footer .roll { justify-self: center; }

/* ---- lightbox ---- */
.lb { position: fixed; inset: 0; z-index: 90; background: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s ease; }
.lb.open { opacity: 1; }
.lb-stage { position: absolute; inset: 56px 16px 56px; display: flex; overflow: hidden; touch-action: pan-y; }
.lb-img { margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background-size: cover; background-position: center; cursor: zoom-in; opacity: 1; transition: opacity .35s ease; user-select: none; -webkit-user-drag: none; }
.lb-img.swap { opacity: 0; }
.lb-stage.actual { overflow: auto; touch-action: auto; }
.lb-stage.actual .lb-img { max-width: none; max-height: none; cursor: zoom-out; flex: none; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px; z-index: 2; }
.lb-status { position: absolute; left: 50%; transform: translateX(-50%); color: rgba(0, 0, 0, .55); }
.lb-bar { position: absolute; top: 0; left: 0; height: 2px; width: 100%; background: #000; transform-origin: left; transform: scaleX(0); opacity: 0; z-index: 3; }
.lb-bar.loading { opacity: 1; animation: bar 2.2s var(--ease-out) forwards; }
@keyframes bar { to { transform: scaleX(.92); } }
.lb-bar.done { opacity: 0; transform: scaleX(1); transition: transform .2s, opacity .5s .2s; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 56px; height: 56px; z-index: 2; opacity: .6; transition: opacity .2s; }
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 0; } .lb-next { right: 0; }
.lb-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; text-align: center; font: italic 400 20px/24px var(--serif); }
.lb-title:empty { display: none; }

/* ---- info ---- */
.info { position: fixed; inset: 0; z-index: 95; background: #fff; opacity: 0; transition: opacity .3s ease; overflow: auto; }
.info.open { opacity: 1; }
.info-inner { padding: var(--pad); max-width: 560px; margin: 0 auto; padding-top: 72px; display: grid; gap: 20px; }
.info-inner > button { position: fixed; top: 16px; right: 16px; }
.info-inner h2 { font: italic 400 20px/24px var(--serif); }
.info-inner p { color: var(--ink-muted); white-space: pre-line; }
.info-inner .info-tag { font: italic 400 20px/24px var(--serif); color: var(--ink); }
.info-inner a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 767px) { .lb-nav { display: none; } .lb-stage { inset: 56px 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .2s !important; }
  .tile { transform: none; }
  .roll::before, .roll::after { transition: none; }
}
