/* ============================================================
   ARCHIVE — a curatorial photo gallery
   ============================================================ */

:root {
  --bg: #0a0908;
  --bg-soft: #14110f;
  --fg: #f2efe7;
  --fg-muted: rgba(242, 239, 231, 0.45);
  --fg-dim: rgba(242, 239, 231, 0.2);
  --hairline: rgba(242, 239, 231, 0.12);
  --accent: #c84b31;
  --display: 'Fraunces', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --easing: cubic-bezier(0.65, 0.05, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-variation-settings: 'opsz' 24, 'SOFT' 50;
  font-weight: 350;
  line-height: 1.4;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none) { body { cursor: auto; } .cursor { display: none; } }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: none; }

/* ============================================================
   Film grain overlay
   ============================================================ */
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 200;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grainShift 8s steps(8) infinite;
}
@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -5%); }
  20%  { transform: translate(-10%, 5%); }
  30%  { transform: translate(5%, -10%); }
  40%  { transform: translate(-5%, 15%); }
  50%  { transform: translate(-10%, 5%); }
  60%  { transform: translate(15%, 0); }
  70%  { transform: translate(0, 10%); }
  80%  { transform: translate(-15%, 0); }
  90%  { transform: translate(10%, 5%); }
}

/* ============================================================
   Custom cursor
   ============================================================ */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fg);
  pointer-events: none;
  z-index: 300;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--easing), height 0.3s var(--easing), background 0.3s var(--easing);
}
.cursor.is-hover {
  width: 64px; height: 64px;
  background: transparent;
  border: 1px solid var(--fg);
}
.cursor-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--fg);
}
.cursor.is-hover .cursor-label { opacity: 1; }

/* ============================================================
   Top status bar
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 2rem;
  z-index: 100;
  mix-blend-mode: difference;
  color: var(--fg);
}
.topbar__brand {
  display: flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.brand-mark {
  font-size: 1rem;
  display: inline-block;
  animation: spin 12s linear infinite;
  transform-origin: center;
}
@keyframes spin { to { transform: rotate(360deg); } }

.topbar__meta {
  display: flex; gap: 2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.meta-line { display: inline-flex; align-items: center; gap: 0.5rem; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); }
.dot--rec { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (max-width: 720px) {
  .topbar { padding: 1rem; }
  .topbar__meta { gap: 0.75rem; font-size: 0.6rem; }
  .topbar__meta .meta-line:nth-child(3) { display: none; }
}

/* ============================================================
   INDEX VIEW
   ============================================================ */
.index { padding-top: 6rem; }

.hero {
  padding: 4rem 2rem 6rem;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}
.hero__eyebrow {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 4rem;
}
.hero__title {
  font-size: clamp(3.5rem, 13vw, 12rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: rise 1s var(--easing) forwards;
}
.hero__title .word:nth-child(1) { animation-delay: 0.1s; }
.hero__title .word:nth-child(2) { animation-delay: 0.2s; }
.hero__title .word:nth-child(3) { animation-delay: 0.3s; }
.hero__title .word:nth-child(4) { animation-delay: 0.4s; }
.hero__title .word:nth-child(5) { animation-delay: 0.5s; }
.hero__title .italic {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.hero__sub {
  font-style: italic;
  font-size: 1.1rem;
  max-width: 38ch;
  color: var(--fg-muted);
  margin-top: 3rem;
  margin-left: auto;
  opacity: 0;
  animation: rise 1s var(--easing) 0.8s forwards;
}

/* Album list */
.album-list {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--hairline);
}
.album-list__head {
  display: grid;
  grid-template-columns: 60px 1fr 100px 200px 40px;
  gap: 2rem;
  padding: 1rem 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--hairline);
}
.album-list__head .label { text-transform: uppercase; }
.album-list__head .label:last-child { display: none; }

.album-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 200px 40px;
  gap: 2rem;
  align-items: baseline;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline);
  position: relative;
  transition: padding 0.5s var(--easing);
  cursor: none;
}
.album-row:hover { padding-left: 2rem; padding-right: 2rem; }
.album-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--bg-soft) 50%, transparent);
  opacity: 0;
  transition: opacity 0.5s var(--easing);
  z-index: -1;
}
.album-row:hover::before { opacity: 1; }

.album-row__num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}
.album-row__title {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 350;
  font-variation-settings: 'opsz' 72;
  letter-spacing: -0.02em;
  font-style: italic;
  line-height: 1;
  transition: color 0.4s, transform 0.4s var(--easing);
}
.album-row:hover .album-row__title {
  color: var(--accent);
  transform: translateX(0.3rem);
}
.album-row__count, .album-row__loc {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.album-row__arrow {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-align: right;
  transition: transform 0.4s var(--easing);
}
.album-row:hover .album-row__arrow { transform: translate(0.3rem, -0.3rem); color: var(--accent); }

@media (max-width: 720px) {
  .album-list__head { grid-template-columns: 30px 1fr 60px; }
  .album-list__head .label:nth-child(4) { display: none; }
  .album-row { grid-template-columns: 30px 1fr 60px; padding: 1.25rem 0; }
  .album-row__loc, .album-row__arrow { display: none; }
  .album-row:hover { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* Hover preview */
.hover-preview {
  position: fixed;
  width: 280px; height: 360px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s var(--easing);
  transform: translate(-50%, -50%) rotate(-3deg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}
.hover-preview.is-active { opacity: 1; }
.hover-preview img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.05) saturate(0.85); }

/* Empty state */
.empty {
  padding: 6rem 0;
  text-align: center;
  color: var(--fg-muted);
  font-style: italic;
}
.empty p { margin-bottom: 0.5rem; }
.empty .hint { font-family: var(--mono); font-size: 0.75rem; font-style: normal; }
.empty code { background: var(--bg-soft); padding: 0.2rem 0.5rem; border: 1px solid var(--hairline); }

/* Manifesto */
.manifesto {
  padding: 10rem 2rem 8rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.manifesto__line {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  line-height: 1.3;
  font-variation-settings: 'opsz' 72;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}
.manifesto__line.italic { font-style: italic; color: var(--fg); }

/* ============================================================
   ALBUM VIEW
   ============================================================ */
.album { padding-top: 6rem; }

.album__head {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  position: relative;
}
.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4rem;
  transition: color 0.3s;
}
.back-link:hover { color: var(--accent); }

.album__title-wrap { display: grid; gap: 1.5rem; }

.album__num {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.album__title {
  font-size: clamp(2.5rem, 10vw, 9rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  animation: rise 1s var(--easing) 0.1s backwards;
}
.album__sub {
  display: flex; gap: 2rem; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.album__desc {
  max-width: 50ch;
  font-style: italic;
  color: var(--fg-muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-top: 1rem;
}

/* Asymmetric grid */
.grid {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
}

.tile {
  position: relative;
  grid-column: span 3;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: none;
}
.tile.span-2 { grid-column: span 2; }
.tile.tall  { grid-column: span 2; grid-row: span 2; }
.tile.wide  { grid-column: span 4; }
.tile.offset { grid-column: 2 / span 3; }

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--easing), filter 0.6s;
  filter: contrast(1.02) saturate(0.95);
}
.tile:hover img { transform: scale(1.04); filter: contrast(1.05) saturate(1.05); }

.tile__idx {
  position: absolute;
  top: 1rem; left: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg);
  background: rgba(10, 9, 8, 0.5);
  padding: 0.3rem 0.5rem;
  backdrop-filter: blur(8px);
  z-index: 2;
}

.tile__cap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(10,9,8,0.85));
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s var(--easing), transform 0.4s var(--easing);
}
.tile:hover .tile__cap { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1rem; }
  .tile, .tile.span-2, .tile.tall, .tile.wide, .tile.offset {
    grid-column: span 1; grid-row: auto;
  }
  .tile.wide { grid-column: span 2; }
}

/* Album nav */
.album-nav {
  max-width: 1600px;
  margin: 6rem auto 0;
  padding: 4rem 2rem;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.album-nav__link {
  display: grid; gap: 0.5rem;
  transition: transform 0.4s var(--easing);
}
.album-nav__link:hover { transform: translateX(-0.5rem); }
.album-nav__link--right { text-align: right; }
.album-nav__link--right:hover { transform: translateX(0.5rem); }
.album-nav__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
}
.album-nav__title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: 'opsz' 72;
}
.album-nav__link:hover .album-nav__title { color: var(--accent); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 9, 8, 0.98);
  z-index: 500;
  display: grid;
  grid-template-columns: 1fr 320px;
  opacity: 0;
  transition: opacity 0.4s var(--easing);
}
.lightbox:not([hidden]) { opacity: 1; }
.lightbox[hidden] { display: none; }

.lightbox__close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px;
  font-size: 1.5rem;
  z-index: 10;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.lightbox__close:hover { color: var(--accent); }

.lightbox__stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 4rem;
  overflow: hidden;
}
.lightbox__img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 100px rgba(0,0,0,0.8);
  animation: lbFade 0.5s var(--easing);
}
@keyframes lbFade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox__nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 1.5rem;
  width: 60px; height: 60px;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.lightbox__nav:hover { color: var(--accent); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

.lightbox__panel {
  padding: 6rem 2rem 2rem;
  border-left: 1px solid var(--hairline);
  background: var(--bg);
  overflow-y: auto;
}
.lb-counter {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}
.lb-counter__sep { color: var(--fg-dim); margin: 0 0.5rem; }
#lbTotal { color: var(--fg-muted); }
.lb-album {
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 300;
  font-variation-settings: 'opsz' 72;
  margin-bottom: 3rem;
  line-height: 1.1;
}
.lb-exif {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2rem;
}
.lb-exif dt {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  align-self: center;
}
.lb-exif dd { color: var(--fg); }
.lb-actions a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.3s;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.5rem;
  display: inline-block;
}
.lb-actions a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lightbox__panel { border-left: 0; border-top: 1px solid var(--hairline); padding: 1.5rem; max-height: 35vh; }
  .lightbox__stage { padding: 5rem 1rem 1rem; }
  .lb-album { font-size: 1.2rem; margin-bottom: 1rem; }
  .lb-exif { font-size: 0.65rem; padding-bottom: 1rem; margin-bottom: 1rem; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 4rem 2rem 2rem;
  display: flex; justify-content: center; gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.footer__sep { color: var(--accent); }
