/* ========================================================================
   Onyxx.Scopes - Studio
   ----------------------------------------------------------------------
   Modern photographer site. Warm cream base, near-black ink, per-theme
   accents. 3D card hover, fluid Three.js slideshows, Lenis smooth scroll.
   Type: Bricolage Grotesque (display+body) + Newsreader Italic + IBM Plex Mono.
   ======================================================================== */

:root {
  --bg:        #F4F1EA;
  --bg-2:      #ECE7DC;
  --bg-3:      #DCD3BF;
  --ink:       #15110D;
  --ink-2:     #3D352C;
  --mute:      #7B6F5F;
  --mute-2:    #A99E89;
  --rule:      #D4CCBA;
  --accent:    #B5571E;        /* default terracotta - overridden per-theme */
  --accent-soft: #E5C9B0;

  --display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --condensed: 'Anton', 'Bebas Neue', Impact, sans-serif;
  --serif:   'Newsreader', Georgia, 'Times New Roman', serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --scripture-red: #E8261B;

  --container: min(1400px, 92vw);
  --container-narrow: min(960px, 88vw);
  --gutter: clamp(1rem, 2vw, 1.5rem);
}

/* Per-theme accent overrides */
body.theme-wedding-photography  { --accent: #A03A3A; --accent-soft: #E8C9C9; }
body.theme-until-all-have-heard { --accent: #C9A86A; --accent-soft: #F0E1C0; }
body.theme-corporate-photos     { --accent: #3F4853; --accent-soft: #C4CAD2; }

/* -- Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 240ms ease; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* -- Base ------------------------------------------------------------------ */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variation-settings: "wdth" 100;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }

/* Subtle paper grain (very faint, only at large viewports) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* -- Type ------------------------------------------------------------------ */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 500;
  margin: 0;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(3rem, 12vw, 11rem); font-weight: 400; font-variation-settings: "wdth" 95; }
h2 { font-size: clamp(2rem, 6vw, 5rem); font-weight: 500; }
h3 { font-size: clamp(1.4rem, 2.8vw, 2.2rem); font-weight: 500; }

p { margin: 0 0 1.2em; max-width: 64ch; }
em, i, .italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.eyebrow, .meta {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow { color: var(--accent); }

/* -- Header ---------------------------------------------------------------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: linear-gradient(to bottom, rgba(244, 241, 234, 0.92), rgba(244, 241, 234, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 320ms ease, border-color 320ms ease;
  border-bottom: 1px solid transparent;
}
header.site.scrolled {
  background: var(--bg);
  border-bottom-color: var(--rule);
  backdrop-filter: blur(8px);
}
.nav {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* No brand mark - links start from left */
  padding: 20px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-links { list-style: none; display: flex; gap: 32px; margin: 0; padding: 0; }
.nav-links a { color: var(--mute); padding: 4px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { color: var(--accent); }
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 14px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: 18px var(--gutter);
  }
  .nav-toggle {
    display: inline-flex; color: var(--ink);
    border: 1px solid var(--ink);
    padding: 6px 12px;
  }
}

/* -- Containers ------------------------------------------------------------ */
.container { width: var(--container); margin: 0 auto; }
.container-narrow { width: var(--container-narrow); margin: 0 auto; }
section { position: relative; z-index: 2; }

/* -- Home hero ------------------------------------------------------------- */
.home-hero {
  width: var(--container);
  margin: 0 auto;
  min-height: 92vh;
  display: grid;
  align-items: end;
  padding: clamp(120px, 14vh, 200px) 0 clamp(40px, 6vh, 72px);
  row-gap: 0;                              /* explicit children handle spacing */
}
.home-hero h1 {
  font-weight: 300;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 90;
  margin: 0 0 clamp(6px, 0.8vh, 12px);     /* tight gap to the meta line below */
  line-height: 0.92;
}
.home-hero h1 .dot { color: var(--scripture-red); }
.home-hero .meta { margin: 0; }
.home-hero .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  color: var(--ink-2);
  max-width: 56ch;
  margin: clamp(14px, 1.6vh, 22px) 0 0;
  line-height: 1.4;
}
.home-hero .stats {
  display: flex; gap: 36px; flex-wrap: wrap;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

/* -- Theme tiles (home) ---------------------------------------------------- */
.themes-grid {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 40px);
}
@media (min-width: 720px) {
  .themes-grid { grid-template-columns: repeat(3, 1fr); }
}

.theme-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-2);
  perspective: 1200px;
  cursor: pointer;
}
.theme-tile .tile-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 480ms cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: transform;
}
.theme-tile:hover .tile-inner { transform: scale(1.02); }

/* Cycling slideshow inside each theme tile (replaces single still image) */
.tile-slides {
  position: relative;
  width: 100%; height: 100%;
}
.tile-slides img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  /* No filter - preserve original color/saturation */
  transition: opacity 1500ms cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 1200ms cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: opacity, transform;
}
.tile-slides img.active { opacity: 1; }
.theme-tile:hover .tile-slides img.active {
  transform: scale(1.06);
}
.theme-tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(21, 17, 13, 0.78) 0%, rgba(21, 17, 13, 0.18) 50%, rgba(21, 17, 13, 0) 80%);
  pointer-events: none;
  z-index: 2;
}
.theme-tile .tile-meta {
  position: absolute; left: 24px; right: 24px; bottom: 24px;
  z-index: 3;
  color: var(--bg);
  display: grid; gap: 8px;
}
.theme-tile .tile-meta .kicker {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bg-3);
}
.theme-tile .tile-meta .name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1;
}
.theme-tile .tile-meta .cta {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bg-3);
  margin-top: 6px;
}
.theme-tile .tile-meta .cta::after { content: "  ->"; }

/* -- Theme page (scripture + sidebar + slideshow) -------------------------- */
.theme-page-bg {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.theme-page-bg::before,
.theme-page-bg::after {
  content: "";
  position: absolute;
}
/* Wedding: warm rose + candlelight */
body.theme-wedding-photography .theme-page-bg::before {
  inset: -10%;
  background: radial-gradient(ellipse at 70% 30%, rgba(180, 70, 70, 0.12) 0%, transparent 55%),
              radial-gradient(ellipse at 20% 80%, rgba(220, 180, 140, 0.18) 0%, transparent 55%);
  filter: blur(40px);
  animation: bgFloat 28s ease-in-out infinite alternate;
}
/* Ministry: gold light rays */
body.theme-until-all-have-heard .theme-page-bg::before {
  inset: -10%;
  background: radial-gradient(ellipse at 50% -10%, rgba(220, 180, 100, 0.28) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 110%, rgba(200, 160, 80, 0.10) 0%, transparent 50%);
  filter: blur(36px);
  animation: bgFloat 32s ease-in-out infinite alternate;
}
body.theme-until-all-have-heard .theme-page-bg::after {
  inset: 0;
  background: linear-gradient(105deg,
    transparent 0%, transparent 35%,
    rgba(220, 190, 120, 0.06) 45%,
    rgba(220, 190, 120, 0.02) 55%,
    transparent 65%, transparent 100%);
  background-size: 200% 100%;
  animation: rays 24s linear infinite;
}
/* Corporate: clean cool gradient */
body.theme-corporate-photos .theme-page-bg::before {
  inset: -10%;
  background: radial-gradient(ellipse at 30% 40%, rgba(80, 100, 130, 0.10) 0%, transparent 55%),
              linear-gradient(180deg, transparent 0%, rgba(60, 70, 85, 0.04) 100%);
  filter: blur(30px);
  animation: bgFloat 36s ease-in-out infinite alternate;
}

@keyframes bgFloat {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2vw, -2vh, 0) scale(1.04); }
  100% { transform: translate3d(-1vw, 1vh, 0) scale(1.02); }
}
@keyframes rays {
  0%   { background-position: -50% 0; }
  100% { background-position: 250% 0; }
}

/* Theme hero - the JOHN 3:16 treatment from the reference screenshot.
   BIG red ultra-condensed reference, mono caps body, theme name below.
   Background "card" sit on the cream paper - no rounded corners by default. */
.theme-hero {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(120px, 16vh, 200px) 0 clamp(28px, 4vh, 56px);
  text-align: center;
  position: relative;
}
.theme-hero .corner-mark {
  position: absolute;
  top: clamp(120px, 16vh, 200px);
  left: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.theme-hero .verse-ref {
  font-family: var(--condensed);
  font-weight: 400;
  font-size: clamp(4.5rem, 17vw, 14rem);
  line-height: 0.85;
  letter-spacing: -0.01em;
  color: var(--scripture-red);
  text-transform: uppercase;
  margin: clamp(36px, 5vh, 64px) auto 0;
  /* Visually narrow the type a bit since Anton is slightly wider than Flexible H1000 */
  transform: scaleX(0.94);
  transform-origin: center center;
  display: block;
}
.theme-hero .verse-body {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: 60ch;
  margin: clamp(28px, 4vh, 48px) auto 0;
  text-align: center;             /* explicit centering - was inheriting */
  padding: 0 clamp(8px, 2vw, 24px);
}
.theme-hero .theme-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(0.78rem, 1.05vw, 1rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: clamp(28px, 4vh, 44px);
}
.theme-hero .kicker {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.theme-hero .next-arrow {
  position: absolute;
  right: 0;
  bottom: clamp(28px, 4vh, 56px);
  width: 44px; height: 44px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 240ms ease, color 240ms ease;
}
.theme-hero .next-arrow:hover { background: var(--ink); color: var(--bg); }

/* For non-scripture theme pages (Corporate), the verse-ref slot becomes the
   theme name in ink instead of red. */
.theme-hero .verse-ref.no-scripture {
  color: var(--ink);
  font-size: clamp(3rem, 12vw, 10rem);
}

/* Theme body: sidebar + slideshow */
.theme-body {
  width: var(--container);
  margin: 0 auto;
  padding: 24px 0 96px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 900px) {
  .theme-body {
    grid-template-columns: 320px 1fr;
    gap: 64px;
    align-items: start;
  }
}
@media (min-width: 1200px) {
  .theme-body { grid-template-columns: 360px 1fr; }
}

/* Sub-project sidebar */
.subproj-list {
  display: flex; flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.subproj-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: padding-left 240ms ease, color 240ms ease;
}
.subproj-row:hover {
  padding-left: 12px;
  color: var(--accent);
}
.subproj-row .num { color: var(--mute); font-size: 0.68rem; letter-spacing: 0.18em; }
.subproj-row .name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--ink);
}
.subproj-row:hover .name { color: var(--accent); }
.subproj-row .count { color: var(--mute); font-size: 0.66rem; }
.subproj-row.active .name { color: var(--accent); }
.subproj-row.active .num,
.subproj-row.active .count { color: var(--accent); }

/* Slideshow canvas - WebGL randomized */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  overflow: hidden;
}
@media (min-width: 900px) {
  .slideshow { aspect-ratio: 5 / 6; }
}
.slideshow canvas {
  width: 100%; height: 100%;
  display: block;
}
/* Fallback img stack (used pre-WebGL or when JS off) */
.slideshow .fallback {
  position: absolute; inset: 0;
}
.slideshow .fallback img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 1400ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.slideshow .fallback img.active { opacity: 1; }
.slideshow.webgl-on .fallback { display: none; }

/* Slideshow controls / status */
.slideshow-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.slideshow-meta .label { color: var(--ink); }
.slideshow-meta .progress { color: var(--accent); }

/* -- Subproject (full gallery) page --------------------------------------- */
.subproj-hero {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(140px, 16vh, 200px) 0 clamp(28px, 4vh, 48px);
  border-bottom: 1px solid var(--rule);
}
.subproj-hero .breadcrumb {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.subproj-hero .breadcrumb a:hover { color: var(--accent); }
.subproj-hero h1 {
  font-weight: 400;
  margin-top: 14px;
  font-size: clamp(2.6rem, 7vw, 6rem);
  letter-spacing: -0.03em;
}
.subproj-hero .meta-row {
  margin-top: 24px;
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Frames - cinematic stack */
.frames {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vh, 80px);
  padding: clamp(48px, 8vh, 96px) 0;
}
.frame {
  position: relative;
  background: var(--bg-2);
}
.frame img {
  width: 100%; height: auto; display: block;
  /* If the figure provides --master-w, cap the displayed image width to the
     master's native dimensions. Prevents browser upscaling - images render
     pixel-perfect, never blown up beyond their actual resolution. */
  max-width: var(--master-w, 100%);
  margin-left: auto; margin-right: auto;
}
.frame.full {
  /* Full-bleed up to the master's intrinsic width. On displays wider than the
     master, the image stays at master width (no upscale) and centers itself. */
  width: min(100vw, var(--master-w, 100vw));
  margin-left: max(calc(50% - 50vw), calc((100% - min(100vw, var(--master-w, 100vw))) / 2));
}
@supports not (width: min(100vw, 100px)) {
  /* Fallback for browsers without min() - just use 100vw and let max-width on img cap */
  .frame.full { width: 100vw; margin-left: calc(50% - 50vw); }
}
.frame.wide { width: 100%; }
.frame.narrow {
  width: min(78%, var(--master-w, 78%));
  margin-left: auto; margin-right: auto;
}
.frame-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  width: 100%;
}
@media (max-width: 720px) {
  .frame.full { width: 100%; margin-left: 0; }
  .frame.narrow { width: 100%; }
  .frame-pair { grid-template-columns: 1fr; gap: 40px; }
}

/* Subproject nav (prev / next within theme) */
.subproj-nav {
  width: var(--container);
  margin: 32px auto 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.subproj-nav a:hover { color: var(--accent); }
.subproj-nav .right { text-align: right; }

/* -- About / Contact ------------------------------------------------------- */
.page-head {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(140px, 16vh, 200px) 0 clamp(36px, 5vh, 56px);
  border-bottom: 1px solid var(--rule);
}
.about-grid, .contact-grid {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding: clamp(48px, 7vh, 80px) 0;
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1fr 1.6fr; gap: 64px; align-items: start; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
}
.about-portrait {
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  overflow: hidden;
}
.about-portrait img {
  width: 100%; height: 100%; object-fit: cover;
}
.about-body { font-size: 17px; line-height: 1.7; max-width: 60ch; }
.about-body p { color: var(--ink-2); }
.about-body p:first-of-type { color: var(--ink); font-size: 18px; }
.about-body .lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 28px;
  max-width: 28ch;
}

.contact-form label {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mute);
  margin: 22px 0 6px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font: inherit;
  font-family: var(--display);
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--rule);
  padding: 8px 0;
  outline: none;
  transition: border-color 240ms ease;
}
.contact-form input:focus,
.contact-form textarea:focus { border-bottom-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button[type=submit] {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 14px 28px;
  transition: all 240ms ease;
}
.contact-form button[type=submit]:hover {
  background: var(--ink); color: var(--bg);
}

/* -- Footer ---------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--rule);
  padding: 40px 0 32px;
  margin-top: 64px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.foot-grid {
  width: var(--container);
  margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
@media (min-width: 720px) {
  .foot-grid { grid-template-columns: 1fr auto auto auto auto; align-items: center; }
}
footer.site a:hover { color: var(--ink); }
footer.site a.credit:hover { color: var(--accent); }

/* -- Custom cursor (additive ring; native cursor visible) ----------------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  opacity: 0;
  transition: width 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              height 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              margin 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              background 280ms ease,
              border-color 280ms ease,
              opacity 320ms ease;
  will-change: transform, width, height;
}
.cursor.visible { opacity: 1; }
.cursor.hover {
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  background: var(--ink);
  border-color: var(--ink);
}
.cursor.image-hover {
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-color: var(--bg);
  background: transparent;
}
@media (hover: none), (pointer: coarse) {
  .cursor { display: none !important; }
}

/* -- Lazy load + reveal ---------------------------------------------------- */
img.lazy {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1100ms cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 1100ms cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: opacity, transform;
}
img.lazy.loaded { opacity: 1; transform: none; }

/* -- Page transitions ------------------------------------------------------ */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
body { animation: pageIn 540ms cubic-bezier(0.2, 0.6, 0.2, 1) both; }
body.exit {
  opacity: 0;
  transition: opacity 320ms cubic-bezier(0.2, 0.6, 0.2, 1);
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  body.exit { transition: none; }
  img.lazy { transition: none; transform: none; }
  .cursor { display: none; }
  .theme-tile img,
  .theme-tile:hover img,
  .theme-tile:hover .tile-inner { transition: none; transform: none; }
  body::before { display: none; }
}

/* ========================================================================
   Cinematic intro (home page only, first session visit)
   ----------------------------------------------------------------------
   `html.cine-pending` is set by an inline head-script BEFORE first paint,
   only when on / and sessionStorage flag is unset and motion isn't reduced.
   That hides the H1 + cine-hidden elements before any flash, so the
   typewriter starts cleanly. JS removes the html.cine-pending class once
   it begins typing.
   ======================================================================== */
html.cine-pending h1[data-typewriter] {
  opacity: 0;
}
.cine-hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
html.cine-pending .cine-hidden {
  /* Same as default - reaffirm in case JS hasn't loaded yet */
  opacity: 0;
  transform: translateY(16px);
}
.cine-revealing {
  pointer-events: auto;
}
/* Safety net: if JS fails entirely, fade the H1 in after 4s anyway */
html.cine-pending h1[data-typewriter] {
  animation: cineSafety 1.2s 4s forwards;
}
@keyframes cineSafety { to { opacity: 1; } }

/* Typewriter caret */
.typewriter-caret {
  display: inline-block;
  width: 0.06em;
  height: 0.85em;
  background: var(--accent);
  margin-left: 0.04em;
  vertical-align: -0.05em;
  animation: caretBlink 580ms steps(2, start) infinite;
}
@keyframes caretBlink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .cine-hidden { opacity: 1; transform: none; pointer-events: auto; }
  .typewriter-caret { display: none; }
}

/* ========================================================================
   .display-h1 - Anton red ultra-condensed treatment for ALL major page
   headings (Gallery, About, Contact, sub-projects, Privacy). Same font
   family + color used on the scripture verse references.
   ======================================================================== */
.display-h1 {
  margin-top: 14px;
  font-family: var(--condensed);
  font-weight: 400;
  font-size: clamp(3rem, 12vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.01em;
  color: var(--scripture-red);
  text-transform: uppercase;
  transform: scaleX(0.94);
  transform-origin: left center;
}
.display-h1.center {
  transform-origin: center center;
  text-align: center;
}

/* Gallery page head ------------------------------------------------------- */
.gallery-head {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(140px, 16vh, 200px) 0 clamp(28px, 4vh, 48px);
  border-bottom: 1px solid var(--rule);
}
.gallery-head .lede {
  margin-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.4vw, 1.4rem);
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.45;
}

/* Sub-project hero - reuse display-h1 sizing override -------------------- */
.subproj-hero h1.display-h1 { margin-top: 14px; }
.subproj-hero .breadcrumb { margin-bottom: 0; }

/* ========================================================================
   Pagination for sub-project galleries (Corporate)
   ======================================================================== */
.frames[data-paginated] .frame,
.frames[data-paginated] .frame-pair { display: none; }
.frames[data-paginated] .frame.in-page,
.frames[data-paginated] .frame-pair.in-page { display: block; }
.frames[data-paginated] .frame-pair.in-page { display: grid; }

.pagination {
  width: var(--container);
  margin: 0 auto;
  padding: 24px 0 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.pagination .page-info { color: var(--ink); }
.pagination button {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 12px 20px;
  background: transparent;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.pagination button:hover:not(:disabled) {
  background: var(--ink); color: var(--bg);
}
.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--rule);
  color: var(--mute);
}
.pagination .page-dots { display: flex; gap: 8px; }
.pagination .page-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 200ms ease;
}
.pagination .page-dot.active { background: var(--accent); }
