:root {
  color-scheme: light;
  --paper: #f4f2ed;
  --ink: #1b1b19;
  --muted: #75736d;
  --line: rgba(27, 27, 25, 0.13);
  --card: #e8e5de;
  --focus: #285e4b;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.page {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: clamp(38px, 6vw, 88px) clamp(18px, 4vw, 64px) 80px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(30px, 4vw, 52px);
}

.page-heading h1 {
  max-width: 900px;
  margin: 0;
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.eyebrow, .album-count {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(26px, 3vw, 48px) clamp(14px, 2vw, 28px);
}

.album-card { min-width: 0; }

.album-link {
  display: block;
  text-decoration: none;
}

.album-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin: 0 0 15px;
  background: var(--card);
  border-radius: 5px;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms cubic-bezier(.2, .7, .2, 1), filter 320ms ease;
}

.album-link:hover .album-cover img { transform: scale(1.018); filter: brightness(.96); }

.album-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.album-title {
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  font-weight: 550;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: clamp(5px, .6vw, 10px);
}

.media-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--card);
  cursor: zoom-in;
}

.media-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.media-tile:hover img { transform: scale(1.025); filter: brightness(.92); }

.play-mark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 50%;
  background: rgba(10,10,10,.5);
  color: white;
  font-size: 13px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.loading, .empty-state, .error-state {
  display: grid;
  min-height: 46vh;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b0b;
  color: #fff;
}

.lightbox::backdrop { background: #0b0b0b; }

.lightbox[open] {
  display: grid;
  grid-template-columns: clamp(48px, 7vw, 92px) minmax(0, 1fr) clamp(48px, 7vw, 92px);
  grid-template-rows: 70px minmax(0, 1fr);
}

.viewer-toolbar {
  z-index: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(12px, 2vw, 28px);
}

.viewer-actions { display: flex; align-items: center; gap: 8px; }

.viewer-button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.9);
  cursor: pointer;
}

.viewer-button:disabled { cursor: default; opacity: .18; }

.close-button {
  width: 48px;
  height: 48px;
  padding: 0 0 5px;
  font-size: 37px;
  font-weight: 200;
  line-height: 1;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
}

.nav-button {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  font-size: clamp(44px, 5vw, 74px);
  font-weight: 200;
}

.previous-button { grid-column: 1; grid-row: 2; }
.next-button { grid-column: 3; grid-row: 2; }

.media-stage {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  margin: 0 0 20px;
  place-items: center;
}

.media-stage img,
.media-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-stage [hidden] { display: none; }

.item-position {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.72);
  font-size: 12px;
  backdrop-filter: blur(8px);
}

@media (max-width: 640px) {
  .site-header { min-height: 58px; }
  .page { padding-top: 34px; }
  .page-heading { display: block; }
  .album-count { margin-top: 15px; }
  .album-grid { grid-template-columns: 1fr 1fr; gap: 28px 10px; }
  .album-cover { margin-bottom: 11px; }
  .album-meta { display: block; }
  .album-title { font-size: 15px; }
  .item-count { display: block; margin-top: 3px; }
  .media-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .lightbox[open] { grid-template-columns: 50px minmax(0, 1fr) 50px; grid-template-rows: 62px minmax(0, 1fr); }
  .viewer-toolbar { padding: 6px 7px; }
  .text-button { min-height: 38px; padding: 0 10px; }
  .media-stage { grid-column: 1 / -1; margin-bottom: 54px; }
  .nav-button { z-index: 2; grid-row: 2; width: 50px; height: 68px; align-self: center; border-radius: 4px; background: rgba(0,0,0,.28); }
  .previous-button { grid-column: 1; }
  .next-button { grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

