/* ==========================================================================
   MOTION LAYER — "inside the camera" experience
   --------------------------------------------------------------------------
   Loaded after styles.css. Everything here is decorative and is switched off
   for visitors with "Reduce motion" enabled (see bottom of file).

   01. Aperture iris (page load + page-to-page transitions)
   02. Film grain + scroll meter + frame counter HUD
   03. Viewfinder HUD on heroes (corners, thirds, focus box, exposure readout)
   04. Hero slideshow (Ken Burns + shutter blink)
   05. Contact sheet / film strip (pinned horizontal scroll)
   06. Darkroom "develop" image reveal
   07. Split-word heading reveal
   08. Focus-bracket cursor + shutter click
   09. Tilt cards, magnetic buttons, EXIF tags
   10. Reduced motion
   ========================================================================== */

:root { --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }

/* 01. APERTURE IRIS ------------------------------------------------------- */
/* Six half-plane "blades", each rotated 60° apart and pushed outward by --r.
   Their union leaves a hexagonal opening that grows as --r grows; --tw twists
   the blades for a real iris feel. @property makes the variables animatable. */
@property --r  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --tw { syntax: "<angle>";  inherits: true; initial-value: 0deg; }

.iris { display: none; }
.js .iris {
  display: block; position: fixed; inset: 0; z-index: 3000; pointer-events: none; overflow: hidden;
  --r: 0px; --tw: -50deg;
  animation: irisOpen 1.25s cubic-bezier(.75, 0, .2, 1) .55s forwards;
}
.iris-blade {
  position: absolute; left: 50%; top: 50%;
  width: 400vmax; height: 200vmax; margin-left: -200vmax;
  transform-origin: 50% 0;
  transform: rotate(calc(var(--i) * 60deg + var(--tw))) translateY(var(--r));
  background: linear-gradient(180deg, #1b1a19 0%, #0c0b0b 6%, #0a0a0a 100%);
  box-shadow: inset 0 1px 0 rgba(197, 160, 89, .55), 0 -10px 40px rgba(0, 0, 0, .55);
}
.iris-label {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .6rem;
  color: #F3EEE6; z-index: 2; animation: irisLabel .5s ease .35s forwards;
}
.iris-label span { font-family: var(--font-serif); font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: .3em; }
.iris-label small { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .3em; color: #C5A059; text-transform: uppercase; }
@keyframes irisLabel { to { opacity: 0; transform: scale(.94); } }
@keyframes irisOpen {
  0%   { --r: 0px;    --tw: -50deg; visibility: visible; }
  99%  { visibility: visible; }
  100% { --r: 90vmax; --tw: 0deg;   visibility: hidden; }
}
/* Closing when navigating away */
.js .iris.is-closing { animation: irisClose .6s cubic-bezier(.7, 0, .3, 1) forwards; }
.js .iris.is-closing .iris-label { animation: none; opacity: 0; }
@keyframes irisClose {
  0%   { --r: 90vmax; --tw: 0deg;   visibility: visible; }
  100% { --r: 0px;    --tw: -50deg; visibility: visible; }
}
/* Headline rises once the aperture has opened */
.js .hero h1 .line > span { animation-delay: 1.15s; }
.js .hero h1 .line:nth-child(2) > span { animation-delay: 1.3s; }
.js .hero h1 .line:nth-child(3) > span { animation-delay: 1.45s; }

/* 02. GRAIN, SCROLL METER, FRAME COUNTER --------------------------------- */
.grain {
  position: fixed; inset: -100%; width: 300%; height: 300%; z-index: 2500; pointer-events: none;
  opacity: .055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(8) infinite;
}
:root[data-theme="light"] .grain { opacity: .09; mix-blend-mode: multiply; }
@keyframes grain {
  0% { transform: translate(0, 0); } 12% { transform: translate(-4%, 3%); } 25% { transform: translate(3%, -5%); }
  37% { transform: translate(-6%, -2%); } 50% { transform: translate(5%, 4%); } 62% { transform: translate(-2%, 6%); }
  75% { transform: translate(6%, -3%); } 87% { transform: translate(-5%, -6%); } 100% { transform: translate(0, 0); }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 150; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent));
  transform-origin: left; transform: scaleX(var(--p, 0));
}

.frame-hud {
  position: fixed; left: var(--gutter); bottom: 1.6rem; z-index: 80; display: none;
  align-items: center; gap: .9rem; pointer-events: none;
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-muted); mix-blend-mode: difference; color: #cfc6b8;
  transition: opacity .6s var(--ease);
}
.frame-hud .dot { width: 7px; height: 7px; border-radius: 50%; background: #e0574a; animation: blink 1.6s steps(2) infinite; }
.frame-hud b { font-weight: 500; color: #F3EEE6; }
.frame-hud .lbl { display: inline-block; min-width: 14ch; transition: opacity .3s, transform .3s; }
.frame-hud .lbl.swap { opacity: 0; transform: translateY(6px); }
.frame-hud.is-hidden { opacity: 0; }
@keyframes blink { 50% { opacity: .15; } }
@media (min-width: 1080px) { .frame-hud { display: flex; } }

/* 03. VIEWFINDER HUD ------------------------------------------------------ */
.vf {
  position: absolute; z-index: 1; pointer-events: none;
  inset: calc(var(--header-h) + 14px) var(--gutter) 22px;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; color: rgba(243, 238, 230, .82);
  opacity: 0; animation: vfIn 1s var(--ease) 1.5s forwards;
}
@keyframes vfIn { to { opacity: 1; } }
.vf-corner { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(243, 238, 230, .75); }
.vf-corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.vf-corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.vf-corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.vf-corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.vf-thirds {
  position: absolute; inset: 0; opacity: .14;
  background:
    linear-gradient(90deg, transparent calc(33.33% - .5px), #fff calc(33.33% - .5px), #fff calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), #fff calc(66.66% - .5px), #fff calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(180deg, transparent calc(33.33% - .5px), #fff calc(33.33% - .5px), #fff calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), #fff calc(66.66% - .5px), #fff calc(66.66% + .5px), transparent calc(66.66% + .5px));
}
.vf-top, .vf-bottom { position: absolute; left: 40px; right: 40px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.vf-top { top: 6px; }
.vf-bottom { bottom: 4px; }
.vf-group { display: flex; align-items: center; gap: 1.4rem; }
.vf-rec { display: inline-flex; align-items: center; gap: .5rem; }
.vf-rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e0574a; animation: blink 1.6s steps(2) infinite; }
.vf-val { display: inline-block; min-width: 3.5ch; transition: color .3s; }
.vf-val.tick { color: #e5c98f; }
.vf-batt { display: inline-flex; gap: 2px; align-items: center; }
.vf-batt i { width: 4px; height: 9px; background: currentColor; }
.vf-batt i:last-child { opacity: .3; }
.vf-meter { position: relative; display: inline-flex; align-items: flex-end; gap: 5px; height: 14px; padding: 0 2px; }
.vf-meter i { width: 1px; height: 5px; background: currentColor; opacity: .7; }
.vf-meter i:nth-child(4) { height: 10px; opacity: 1; }
.vf-needle { position: absolute; bottom: -5px; left: 50%; width: 0; height: 0; border: 4px solid transparent; border-bottom-color: #e5c98f; transform: translateX(calc(var(--ev, 0) * 6px - 50%)); transition: transform .4s var(--ease); }

/* Focus box (follows the pointer, "hunts", then locks) */
.vf-focus {
  position: absolute; left: 0; top: 0; width: 84px; height: 64px; margin: -32px 0 0 -42px;
  will-change: transform; transition: width .3s var(--ease), height .3s var(--ease);
}
.vf-focus i { position: absolute; width: 12px; height: 12px; border: 0 solid rgba(243, 238, 230, .9); transition: border-color .25s, transform .35s var(--ease); }
.vf-focus i:nth-child(1) { top: 0; left: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.vf-focus i:nth-child(2) { top: 0; right: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.vf-focus i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.vf-focus i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.vf-focus.is-hunting i:nth-child(1) { transform: translate(-6px, -6px); }
.vf-focus.is-hunting i:nth-child(2) { transform: translate(6px, -6px); }
.vf-focus.is-hunting i:nth-child(3) { transform: translate(-6px, 6px); }
.vf-focus.is-hunting i:nth-child(4) { transform: translate(6px, 6px); }
.vf-focus.is-locked i { border-color: #e5c98f; }
.vf-focus.is-locked { animation: lockPulse .45s var(--ease); }
@keyframes lockPulse { 0% { scale: 1.12; } 50% { scale: .94; } 100% { scale: 1; } }
.vf-focus-label { position: absolute; left: 100%; top: -2px; margin-left: 8px; font-size: .55rem; letter-spacing: .2em; color: #e5c98f; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.vf-focus.is-locked .vf-focus-label { opacity: 1; }

/* Lite version for inner-page heroes */
.vf--lite .vf-thirds, .vf--lite .vf-focus { display: none; }

/* Shutter blink (mirror slap) + flash */
.shutter {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; background: #000; opacity: 0;
}
.shutter.is-firing { animation: shutterBlink .28s steps(1) forwards; }
@keyframes shutterBlink { 0% { opacity: 1; } 40% { opacity: .0; background: #fff; } 45% { opacity: .18; background: #fff; } 100% { opacity: 0; } }

@media (max-width: 699px) {
  .vf { inset: calc(var(--header-h) + 6px) 12px 12px; font-size: .56rem; }
  .vf-top, .vf-bottom { left: 32px; right: 32px; }
  .vf-hide-sm { display: none !important; }
  .vf-thirds { opacity: .07; }
}

/* 04. HERO SLIDESHOW ------------------------------------------------------ */
.hero-media .hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.12); animation: none;
  transition: opacity 1.4s var(--ease);
}
.hero-media .hero-slide.is-active { opacity: 1; animation: kenBurns 9s linear forwards; }
.hero-media .hero-slide.is-leaving { opacity: 0; }
@keyframes kenBurns { from { transform: scale(1.12) translate3d(0, 0, 0); } to { transform: scale(1.02) translate3d(-1.5%, -1%, 0); } }
.hero-slides-nav {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 3;
  display: none; flex-direction: column; gap: .8rem;
}
.hero-slides-nav button {
  position: relative; width: 44px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .15em; color: rgba(243, 238, 230, .5); text-align: right;
  transition: color .3s;
}
.hero-slides-nav button::after { content: ""; position: absolute; right: 0; bottom: 6px; width: 18px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.hero-slides-nav button[aria-current="true"] { color: #e5c98f; }
.hero-slides-nav button[aria-current="true"]::after { width: 36px; }
@media (min-width: 1080px) { .hero-slides-nav { display: flex; } .scroll-cue { display: none; } }

/* 05. CONTACT SHEET / FILM STRIP ----------------------------------------- */
.contact-sheet { position: relative; background: var(--bg); }
.cs-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(2rem, 5vh, 3.5rem); }
.cs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; }
.cs-head p { max-width: 30rem; margin: 0; }
.filmstrip {
  position: relative; display: inline-flex; flex-direction: column; gap: 0;
  background: #0b0a09; padding: 0 3vw; will-change: transform;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
  transform: translateX(var(--fx, 0px)) rotate(-1.2deg);
}
.film-edge {
  height: 44px; position: relative; display: flex;
  /* sprocket holes: one 12px-tall row of rounded-ish rectangles */
  background-image: repeating-linear-gradient(90deg, transparent 0 10px, rgba(243, 238, 230, .85) 10px 24px, transparent 24px 34px);
  background-size: 34px 12px; background-repeat: repeat-x;
}
.film-edge.top { background-position: 0 7px; }
.film-edge.bottom { background-position: 0 calc(100% - 7px); }
.film-edge span { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .3em; color: #d9a54a; white-space: nowrap; opacity: .85; line-height: 1; }
.film-edge.top span { align-self: flex-end; margin-bottom: 5px; }
.film-edge.bottom span { align-self: flex-start; margin-top: 5px; }
.film-frames { display: flex; gap: 14px; padding: 4px 0; }
.film-frame { position: relative; margin: 0; width: clamp(240px, 28vw, 420px); aspect-ratio: 3 / 2; background: #1a1918; overflow: visible; }
.film-frame img { width: 100%; height: 100%; object-fit: cover; transition: filter .6s var(--ease), transform .8s var(--ease); }
.filmstrip:hover .film-frame img { filter: brightness(.55) saturate(.6); }
.filmstrip .film-frame:hover img { filter: none; transform: scale(1.04); }
.film-frame figcaption {
  position: absolute; left: 8px; bottom: 6px; z-index: 2; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em; color: #e5c98f; text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.film-frame .select-mark { position: absolute; inset: -14% -8%; width: 116%; height: 128%; pointer-events: none; overflow: visible; }
.film-frame .select-mark path { fill: none; stroke: #e0412f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 1.6s cubic-bezier(.6, .1, .3, 1); }
.film-frame.is-marked .select-mark path { stroke-dashoffset: 0; }
.film-frame .select-tag {
  position: absolute; right: -6px; top: -36px; transform: rotate(6deg);
  font-family: var(--font-serif); font-style: italic; font-size: 1.4rem; color: #e0412f; opacity: 0; transition: opacity .6s 1.1s;
}
.film-frame.is-marked .select-tag { opacity: 1; }
.cs-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.cs-bar { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.cs-bar::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--cp, 0)); }

/* 06. DARKROOM DEVELOP ---------------------------------------------------- */
.develop img {
  filter: grayscale(1) sepia(.4) brightness(1.55) contrast(.5) blur(5px);
  transition: filter 2.4s cubic-bezier(.3, .6, .2, 1), transform 1.4s var(--ease), opacity 1s var(--ease);
}
.develop.developed img { filter: grayscale(0) sepia(0) brightness(1) contrast(1) blur(0); }
/* a faint red "safelight" glow while developing */
.develop { position: relative; }
.develop::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(180, 40, 30, .28), transparent 70%);
  opacity: 1; transition: opacity 2s var(--ease) .4s;
}
.develop.developed::before { opacity: 0; }
.service-card.develop::before { z-index: 0; }

/* 07. SPLIT-WORD HEADINGS ------------------------------------------------- */
.js .split-ready[data-reveal] { opacity: 1; transform: none; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .12em 0; margin: 0 -.06em -.12em 0; }
.w > span { display: inline-block; transform: translateY(108%) rotate(5deg); transform-origin: 0 100%; transition: transform 1.15s cubic-bezier(.2, .7, .1, 1); transition-delay: calc(var(--wi, 0) * 55ms); }
.is-visible .w > span { transform: none; }

/* 08. FOCUS-BRACKET CURSOR ----------------------------------------------- */
.cursor-ring, .cursor-ring.is-hover, .cursor-ring.is-view {
  border: 0; border-radius: 0; mix-blend-mode: difference;
  --c: rgba(243, 238, 230, .95); --l: 9px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px var(--l) no-repeat;
}
.cursor-ring.is-hover { --l: 12px; }
.cursor-ring.is-view { --l: 16px; width: 110px; height: 80px; margin: -40px 0 0 -55px; }
.cursor-ring span { font-family: var(--font-mono); font-size: .55rem; letter-spacing: .25em; color: #F3EEE6; }
.cursor-ring.is-view span { opacity: 1; }
.cursor-ring.is-shoot { animation: shoot .35s var(--ease); }
@keyframes shoot { 0% { scale: 1; } 30% { scale: .7; } 100% { scale: 1; } }
.cursor-flash {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none; background: #fff; opacity: 0;
}
.cursor-flash.is-on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .22; } 100% { opacity: 0; } }

/* 09. TILT, MAGNETIC, EXIF ------------------------------------------------ */
.service-cards { perspective: 1200px; }
.service-card { transform-style: preserve-3d; transition: transform .7s var(--ease); }
.service-card .glare {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 240, 210, .28), transparent 45%);
  mix-blend-mode: soft-light;
}
.service-card:hover .glare { opacity: 1; }
.service-card .glass { transform: translateZ(40px); }

.btn, .icon-btn { transition: color .45s var(--ease), border-color .45s var(--ease), transform .5s cubic-bezier(.2, .9, .3, 1.3), opacity .3s; }

.exif {
  display: block; margin-top: .45rem; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; color: #e5c98f;
  text-transform: none !important; opacity: 1 !important;
}

/* 10. REDUCED MOTION ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .js .iris, .grain, .vf-focus, .shutter, .hero-slides-nav { display: none !important; }
  .vf { opacity: 1; animation: none; }
  .develop img, .develop.developed img { filter: none; }
  .develop::before { display: none; }
  .w > span { transform: none; }
  .cs-sticky { position: static; height: auto; padding: var(--section) 0; }
  .filmstrip-wrap { overflow-x: auto; }
  .filmstrip { transform: none; }
  .film-frame .select-mark path { stroke-dashoffset: 0; }
  .film-frame .select-tag { opacity: 1; }
}
