/* Homepage — 35mm filmstrip, landscape 3:2 frames */

.home-film {
  --peek: clamp(38px, 12%, 100px);
  --frame-w: calc(100% - var(--peek) * 2);
  --frame-gap: 0px;
  --frame-step: var(--frame-w);
  --stage-w: min(960px, 96vw);
  --roll-u: 10px;
  --film-ink: var(--ink);
  --film-edge: var(--ink);
  --film-divider: var(--ink);
  --film-frame-gap: 14px;

  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.page-home .home-film {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.home-film-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.home-film-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  opacity: 0.5;
  padding: 1rem;
  z-index: 4;
}

.home-film-loading[hidden] {
  display: none;
}

.home-film-stage {
  max-width: var(--stage-w);
  margin: 0 auto;
  padding: 0 clamp(0.5rem, 2vw, 1rem);
  width: 100%;
  flex-shrink: 0;
}

.home-film-assembly {
  width: 100%;
}

/* ---- film gate ---- */
.home-film-viewport {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 0.85rem 0;
  background: var(--paper);
}

.home-film-roll {
  font-size: var(--roll-u);
  background: var(--film-ink);
  border-top: 3px solid var(--film-edge);
  border-bottom: 3px solid var(--film-edge);
  overflow: hidden;
}

.home-film-track {
  display: flex;
  flex-direction: column;
  width: max-content;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.home-film-track.is-scrubbing {
  will-change: transform;
}

.home-film-edge {
  background: var(--film-ink);
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.home-film-edge--top {
  padding-bottom: 0.1em;
}

.home-film-edge--bottom {
  padding-top: 0.1em;
}

.home-film-sprocket {
  position: relative;
  height: 1.45em;
  background: var(--film-ink);
}

.home-film-sprocket--top {
  border-bottom: 2px solid var(--film-edge);
}

.home-film-sprocket--bottom {
  border-top: 2px solid var(--film-edge);
}

.home-film-sprocket-hole {
  position: absolute;
  background: var(--paper);
  border: 0.14em solid var(--film-edge);
  border-radius: 0.18em;
  box-shadow: inset 0 0 0.25em rgba(10, 8, 6, 0.25);
}

.home-film-sprocket--top .home-film-sprocket-hole {
  top: 0.12em;
  transform: translate(-50%, 0);
}

.home-film-sprocket--bottom .home-film-sprocket-hole {
  bottom: 0.12em;
  top: auto;
  transform: translate(-50%, 0);
}

.home-film-strip {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex: 0 0 auto;
}

.home-film-frame {
  flex: 0 0 var(--frame-w);
  width: var(--frame-w);
  background: var(--film-ink);
  position: relative;
  contain: layout style paint;
  transform: translateZ(0);
}

.home-film-frame + .home-film-frame::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--film-frame-gap);
  background: var(--film-divider);
  z-index: 1;
  pointer-events: none;
}

.home-film-frame.is-cover {
  z-index: 2;
}

.home-film-frame--loop-clone .home-film-cover-link {
  pointer-events: none;
}

/* 35mm — landscape 3:2 */
.home-film-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--film-ink);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 3px var(--film-ink);
}

.home-film-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.home-film-cover-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.85rem 0.75rem 1.25rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 40%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.home-film-frame.is-cover.is-active .home-film-cover-link {
  opacity: 1;
  pointer-events: auto;
}

.home-film-cover-title {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 3.6vw, 1.85rem);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.home-film-cover-link:hover .home-film-cover-title,
.home-film-cover-link:focus-visible .home-film-cover-title {
  text-decoration-color: var(--flash);
}

.home-film-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.05rem;
}

.home-film-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.15rem;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 2.65rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  cursor: url('../assets/cursor-hover.png') 12 12, pointer;
  transform: scaleX(0.93);
  transform-origin: center;
  transition: color 0.12s ease, opacity 0.12s ease;
}

.home-film-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.home-film-nav:not(:disabled):hover,
.home-film-nav:not(:disabled):focus-visible {
  color: var(--flash);
  outline: none;
}

@media (max-width: 560px) {
  .page-home .site-nav {
    padding-bottom: 0.65rem;
  }
}
