/* ============================================================
   ALIBKS DARKROOM - photos.alibks.dev
   Portal-specific layer on top of the shared neo-brutalist system
   (alibks.dev/assets/neobrutal.css).

   The contact sheet: prints taped to a cobalt wall, pulled off in a stepped
   lightbox with cut-paper exposure notes.
   ============================================================ */

.hero {
  text-align: center;
  padding-top: 72px;
}

.hero .kicker {
  justify-content: center;
}

.hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 12px;
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 128px);
  line-height: 0.92;
  font-weight: 400;
  text-transform: uppercase;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--cyan);
}

.hero-sub {
  margin-left: auto;
  margin-right: auto;
}

.status-row {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status i {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  border: 2px solid var(--ink);
  animation: lamp-blink 1.4s steps(1) infinite;
}

.status.developed i {
  background: var(--crimson);
  animation: none;
}

/* ---------- the wall ---------- */

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 60px;
  border-bottom: 5px solid var(--cyan);
  padding-bottom: 10px;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 52px);
  text-transform: uppercase;
  line-height: 1;
}
.sheet-title::before {
  content: "/ ";
  color: var(--crimson);
}

/* Generous row gap: prints hang at randomized offsets and their tape overhangs
   the paper by 12px, so a tight grid has neighbours colliding. */
.sheet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 30px;
  margin-top: 52px;
}

/* ============================================================
   3D BOOK STAGE
   ============================================================ */

.book-wrap {
  margin-top: 44px;
}

.book-stage {
  position: relative;
  width: 100%;
  /* The renderer sizes its own canvas; this just reserves height so the page does
     not jump when WebGL mounts. */
  min-height: 320px;
  border: 4px solid var(--ink);
  background:
    radial-gradient(rgba(0, 210, 255, 0.08) 1.5px, transparent 2px) 0 0 / 22px 22px,
    var(--cobalt-2);
  clip-path: polygon(10px 0, 100% 6px, calc(100% - 7px) 100%, 0 calc(100% - 10px));
  overflow: hidden;
  /* A grabbable surface that owns wheel-as-page-turn only while centered. */
  touch-action: pan-y;
}

.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.book-page {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(220, 238, 251, 0.75);
  min-width: 12ch;
  text-align: center;
}

.book-hint {
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  opacity: 0.7;
}

/* ============================================================
   FILM-REEL FALLBACK

   A vertical filmstrip: taped polaroids down a sprocketed reel, scroll-snapped.
   The strips are the sprocket edges; the frames sit between them.
   ============================================================ */

.reel {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  gap: 0;
  margin-top: 48px;
  align-items: stretch;
}

/* Empty state reuses .reel as a plain frame grid, no sprockets. */
.reel.reel-empty {
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 22px;
}

.reel-strip {
  background:
    repeating-linear-gradient(
      to bottom,
      var(--ink) 0 14px,
      transparent 14px 20px,
      var(--ink) 20px 34px,
      var(--cobalt) 34px 48px
    );
  /* Sprocket holes punched down the middle of each ink strip. */
  position: relative;
}
.reel-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 20px,
    var(--cobalt) 20px 30px,
    transparent 30px 48px
  );
  -webkit-mask: radial-gradient(circle at center, #000 3px, transparent 3.5px) center / 100% 48px;
  mask: radial-gradient(circle at center, #000 3px, transparent 3.5px) center / 100% 48px;
}

.reel-frames {
  display: flex;
  flex-direction: column;
  gap: 46px;
  padding: 46px 24px;
  background: var(--cobalt-3);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
}

.reel-cell {
  display: flex;
  justify-content: center;
}
.reel-cell .polaroid {
  width: min(340px, 78%);
}

.empty-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 3px solid rgba(0, 210, 255, 0.45);
  background: rgba(0, 210, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(6px 0, 100% 4px, calc(100% - 4px) 100%, 0 calc(100% - 6px));
}

.empty-frame .cross {
  font-family: var(--font-mono);
  font-size: 30px;
  color: rgba(0, 210, 255, 0.4);
  transform: skewX(-10deg);
}

.empty-frame .num,
.empty-frame .label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 210, 255, 0.55);
}
.empty-frame .num {
  top: 10px;
  left: 12px;
}
.empty-frame .label {
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ---------- note / cta ---------- */

.note-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 64px;
}

.note-grid p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.35;
  opacity: 0.9;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(5, 11, 20, 0.95);
  overflow-y: auto;
}

.lightbox.open {
  display: block;
}

.lb-inner {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 24px 40px;
}

.lb-stage {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.lb-stage .polaroid {
  max-width: 460px;
  cursor: zoom-out;
  --pola-tilt: 0deg;
  --pola-hang: 0px;
}

.lb-stage .polaroid-caption {
  font-size: 26px;
}

/* The panel wipes in from the left on stepped frames, matching the curtain. */
.lb-panel {
  min-width: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--cycle) steps(3, jump-none) 120ms;
}

.lightbox.panel-in .lb-panel {
  clip-path: inset(0 0 0 0);
}

.lb-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 44px);
  text-transform: uppercase;
  line-height: 0.95;
  margin: 12px 0 16px;
  word-break: break-word;
}

.lb-meta {
  border-top: 4px solid var(--cyan);
}

.lb-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 2px solid rgba(0, 210, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lb-row .k {
  opacity: 0.55;
}
.lb-row .v {
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 5;
}

.lb-nav {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .sheet {
    grid-template-columns: repeat(2, 1fr);
  }
  .reel.reel-empty {
    grid-template-columns: repeat(2, 1fr);
  }
  .lb-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 76px;
  }
  .lb-panel {
    clip-path: none;
    transition: none;
  }
}

@media (max-width: 767px) {
  .sheet {
    gap: 40px 16px;
  }
  /* Thinner sprocket strips on a phone, and the frames breathe less. */
  .reel {
    grid-template-columns: 16px minmax(0, 1fr) 16px;
  }
  .reel-frames {
    gap: 34px;
    padding: 34px 12px;
  }
  .reel-cell .polaroid {
    width: min(300px, 92%);
  }
  .note-grid {
    grid-template-columns: 1fr;
  }
  .lb-close {
    top: 12px;
    right: 12px;
  }
  .lb-inner {
    padding: 68px 14px 32px;
  }
  .lb-stage .polaroid-caption {
    font-size: 20px;
  }
}
