/* =====================================================================
   Landing — the split between still and moving
   ===================================================================== */

.page-landing { height: 100svh; overflow: hidden; }
.page-landing::after { z-index: 400; } /* keep grain under the nav */

.nav-clock { opacity: 0.8; }
@media (max-width: 700px) { .nav-clock { display: none; } }

.split {
  display: flex;
  height: 100svh;
}

.half {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(var(--nav-h) + 12px) var(--gutter) clamp(24px, 4vh, 48px);
  transition: flex-grow 1.1s var(--ease);
}
.half-photo { background: var(--paper); color: var(--ink); }
.half-film { background: var(--night); color: var(--bone); }

.split.is-photo .half-photo,
.split.is-film .half-film { flex-grow: 1.75; }

.half-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 0;
}

/* ---------- labels ---------- */
.half-label {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 2;
}
.half-film .half-label { justify-items: end; text-align: right; }

.numeral { opacity: 0.6; }
.half-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 15.5cqi, 168px);
  line-height: 0.86;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.half-sub { opacity: 0.65; }
.half-enter {
  display: inline-flex;
  gap: 8px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s, transform 0.6s var(--ease-out);
}
.split.is-photo .half-photo .half-enter,
.split.is-film .half-film .half-enter { opacity: 1; transform: none; transition-delay: 0.35s; }

/* when one side is open, the other recedes */
.half > * { transition: opacity 0.8s var(--ease); }
.split.is-photo .half-film > *,
.split.is-film .half-photo > * { opacity: 0.35; }

/* ---------- the seam ---------- */
.seam {
  position: relative;
  width: 0;
  z-index: 20;
  pointer-events: none;
}
.seam-badge {
  position: absolute;
  top: 50%;
  left: 0;
  width: 116px;
  height: 116px;
  margin: -58px 0 0 -58px;
  mix-blend-mode: difference;
  fill: #fff;
  overflow: visible;
}
.seam-badge text {
  font-family: var(--mono);
  font-size: 8.6px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- I. viewfinder ---------- */
.viewfinder {
  position: relative;
  width: min(84cqi, calc((100svh - 300px) * 1.5), 820px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ink);
  --exp: 1;
}
.vf-exposure { position: absolute; inset: 0; filter: brightness(var(--exp)); transition: filter 0.25s linear; }
.vf-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px) saturate(0.7);
  transform: scale(1.06);
  transition: filter 0.6s var(--ease), transform 1.4s var(--ease-out);
}
.viewfinder.is-hunting .vf-img { animation: focus-hunt 0.75s var(--ease) forwards; }
.viewfinder.is-focused .vf-img { filter: none; transform: scale(1); }

@keyframes focus-hunt {
  0%   { filter: blur(10px) saturate(0.7); }
  35%  { filter: blur(2px) saturate(0.9); }
  60%  { filter: blur(6px) saturate(0.9); }
  100% { filter: blur(0) saturate(1); }
}

/* rule-of-thirds grid */
.vf-thirds {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255,255,255,0.28) calc(33.33% - 0.5px) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px) calc(66.66% - 0.5px), rgba(255,255,255,0.28) calc(66.66% - 0.5px) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255,255,255,0.28) calc(33.33% - 0.5px) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px) calc(66.66% - 0.5px), rgba(255,255,255,0.28) calc(66.66% - 0.5px) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px));
  opacity: 0;
  transition: opacity 0.6s;
}
.viewfinder.is-live .vf-thirds { opacity: 1; }

/* framing corners */
.vf-corners i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgba(255, 255, 255, 0.9);
}
.vf-corners i:nth-child(1) { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.vf-corners i:nth-child(2) { top: 12px; right: 12px; border-width: 1px 1px 0 0; }
.vf-corners i:nth-child(3) { bottom: 12px; left: 12px; border-width: 0 0 1px 1px; }
.vf-corners i:nth-child(4) { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

/* focus point */
.vf-focus {
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 32px;
  margin: -16px 0 0 -22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  will-change: transform;
}
.vf-focus::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 4px; height: 4px;
  margin: -2px 0 0 -2px;
  background: currentColor;
  color: rgba(255, 255, 255, 0.85);
}
.viewfinder.is-focused .vf-focus { border-color: var(--stamp); animation: af-confirm 0.36s steps(1) 2; }
.viewfinder.is-focused .vf-focus::after { color: var(--stamp); }
@keyframes af-confirm { 50% { opacity: 0; } }

/* date stamp, like a 90s point-and-shoot */
.vf-stamp {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(12px, 2.2cqi, 18px);
  letter-spacing: 0.12em;
  color: var(--stamp);
  text-shadow: 0 0 6px rgba(255, 120, 40, 0.85), 0 0 1px #ffd2a8;
  opacity: 0.92;
}

/* readout strip under the frame */
.vf-readout {
  width: min(84cqi, calc((100svh - 300px) * 1.5), 820px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  color: var(--ink);
  white-space: nowrap;
}
.vf-readout .af { padding: 1px 5px; border: 1px solid currentColor; transition: color 0.2s, background-color 0.2s; }
.viewfinder.is-focused ~ .vf-readout .af { background: var(--ink); color: var(--paper); }
.meter { position: relative; padding-bottom: 6px; }
.meter-scale { letter-spacing: 0.02em; }
.meter-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--accent);
  transition: left 0.2s linear;
}
@container (max-width: 520px) {
  .vf-readout .meter, .vf-readout > span:last-child { display: none; }
}

/* ---------- II. projector screen ---------- */
.screen {
  display: flex;
  width: min(92cqi, calc((100svh - 300px) * 2.6), 940px);
  background: #1f1b17;
  transition: box-shadow 1s;
}
.screen-frame {
  position: relative;
  flex: 1;
  aspect-ratio: 2.39 / 1;
  overflow: hidden;
  background: #000;
}
.screen-media { position: absolute; inset: -2%; }
.screen-media img,
.screen-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.55) contrast(1.1);
  transition: filter 0.9s var(--ease);
}

.sprockets {
  width: clamp(14px, 3cqi, 24px);
  flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='22'%3E%3Crect x='6' y='5' width='12' height='12' rx='2.5' fill='%230d0d0c'/%3E%3C/svg%3E");
  background-size: 100% auto;
  background-repeat: repeat-y;
}

.screen-hud {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent 28%, transparent 72%, rgba(0,0,0,0.5));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: clamp(8px, 1.6cqi, 16px);
  font-size: clamp(9px, 1.3cqi, 11px);
  color: rgba(233, 228, 218, 0.8);
  pointer-events: none;
}
.screen-hud > :nth-child(2n) { text-align: right; }
.screen-hud > :nth-child(n+3) { align-self: end; }
.screen-hud .tc { font-variant-numeric: tabular-nums; }
.screen-hud .status { transition: color 0.3s; }

.screen.is-running { box-shadow: 0 0 120px 10px rgba(255, 214, 160, 0.09); }
.screen.is-running .screen-media { animation: gate-weave 0.18s steps(2) infinite; }
.screen.is-running .screen-media img,
.screen.is-running .screen-media video { filter: none; animation: flicker 0.14s infinite; }
.screen.is-running .sprockets { animation: sprocket-run 0.24s linear infinite; }
.screen.is-running .status { color: var(--accent); }

@keyframes gate-weave {
  0% { transform: translate(0, 0); }
  50% { transform: translate(0.4px, -0.6px); }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.93; }
}
@keyframes sprocket-run {
  from { background-position: 0 0; }
  to { background-position: 0 -22px; }
}

/* ---------- small screens: stack top / bottom ---------- */
@media (max-width: 760px) {
  .split { flex-direction: column; }
  .half { padding: calc(var(--nav-h) + 4px) var(--gutter) 20px; grid-template-rows: 1fr auto; }
  .half-film { padding-top: 24px; }
  .half-stage { gap: 8px; }
  .viewfinder { width: min(100%, calc((50svh - 170px) * 1.5)); }
  .screen { width: min(100%, calc((50svh - 190px) * 2.6)); }
  .half-film { padding-top: 56px; }
  .half-title { font-size: clamp(44px, 14cqi, 72px); }
  .half-label { gap: 2px; }
  .half-enter, .vf-readout { display: none; }
  .split.is-photo .half-photo, .split.is-film .half-film { flex-grow: 1; }
  .split.is-photo .half-film > *, .split.is-film .half-photo > * { opacity: 1; }
  .seam { width: auto; height: 0; }
  .seam-badge { left: auto; right: calc(var(--gutter) + 6px); top: 0; width: 84px; height: 84px; margin: -42px 0 0 0; }
}
