*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Design tokens — spacing (8px scale), type, color, elevation */
:root {
  --font-sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-muted: rgba(255, 255, 255, 0.55);
  --color-accent: #c4a574;
  --color-surface: rgba(255, 255, 255, 0.06);
  --color-surface-elevated: rgba(255, 255, 255, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.2, 0.85, 0.35, 1);
  --duration-fast: 160ms;
  --duration-normal: 240ms;
  --outline-dark: rgba(0, 0, 0, 0.22);
  /* Shared by `.gallery-bar__brand` and `.page-center-title` so pill heights stay aligned. */
  --gallery-pill-pad-block: 0.5rem;
  --gallery-pill-pad-inline: 1.1rem;
  --gallery-pill-inner-min-height: 40px;
  /* Matches `.gallery-flow-track` marquee timing (updated from JS when flow starts). */
  --view-gallery-burst-spin-duration: 40s;
}

html,
body {
  min-height: 100%;
  /* `clip` can interact badly with nested scroll/overflow in some WebKit builds. */
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Helps anchor / in-page navigation respect the fixed header in Safari. */
  scroll-padding-top: calc(128px + env(safe-area-inset-top, 0px) + 1.25rem);
  /* Avoid default white canvas showing as a 1px hairline under fixed layers / transforms. */
  background-color: #F0F0F0;
}

html:has(body.page-contact) {
  background-color: #0b0f1a;
}

html:has(body.page-profile) {
  background-color: #070a10;
}

@media (min-width: 769px) {
  html::before,
  html::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1in;
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
  }

  html::before {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.5) 38%,
      rgba(0, 0, 0, 0.22) 68%,
      rgba(0, 0, 0, 0) 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 46%,
      rgba(0, 0, 0, 0.28) 76%,
      rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 46%,
      rgba(0, 0, 0, 0.28) 76%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  html::after {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.5) 38%,
      rgba(0, 0, 0, 0.22) 68%,
      rgba(0, 0, 0, 0) 100%
    );
    -webkit-mask-image: linear-gradient(
      to left,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 46%,
      rgba(0, 0, 0, 0.28) 76%,
      rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
      to left,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 46%,
      rgba(0, 0, 0, 0.28) 76%,
      rgba(0, 0, 0, 0) 100%
    );
  }
}

/* Focus rings — calm, high-end affordance */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: var(--font-sans);
  line-height: 1.5;
  letter-spacing: 0.01em;
  background: #F0F0F0;
  background-repeat: no-repeat;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  /* Avoid `filter: blur()` here — it’s expensive during scroll and caused visible hitch. */
  transition:
    opacity 360ms cubic-bezier(0.22, 0.8, 0.3, 1),
    transform 400ms cubic-bezier(0.2, 0.9, 0.25, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Shorter travel + slightly snappier timing for large blocks (flow, grid, contact). */
.reveal-on-scroll.reveal-on-scroll--soft {
  transform: translateY(12px);
  transition:
    opacity 300ms cubic-bezier(0.22, 0.8, 0.35, 1),
    transform 340ms cubic-bezier(0.2, 0.9, 0.28, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.reveal-on-scroll.reveal-on-scroll--soft.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Home bio + contact: no scroll entrance animations. */
body.page-home .home-bio-image,
body.page-home .home-flow-heading,
body.page-home .home-bio-row .home-bio-heading,
body.page-home .home-bio-row .home-intro,
body.page-home .home-start-btn,
body.page-home .onepage-section--contact .contact__heading,
body.page-home .onepage-section--contact .contact__intro,
body.page-home .onepage-section--contact .contact__form,
body.page-home .onepage-section--contact .contact__social,
body.page-home .onepage-section--contact .contact__card {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

/* Full gallery should never fade/slide on scroll. */
body.page-full-gallery .reveal-on-scroll,
body.page-full-gallery .portfolio-date-group,
body.page-full-gallery .portfolio-row,
body.page-full-gallery .full-gallery-row {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .gallery-bar__menu-content {
    transition: none;
  }

  .gallery-bar__brand {
    transition: none;
  }
}

/* Use system default cursor everywhere; pointer only on obvious interactive elements */
a,
button,
input,
textarea,
.gallery-bar__menu-trigger,
.gallery-bar__menu-link,
.gallery-bar__title,
.gallery-flow-arrow,
.media-item,
.lightbox__close,
.lightbox__arrow,
.profile__cta-btn,
.profile__cta-link,
.contact__submit,
.contact__instagram {
  cursor: pointer;
}

/* Contact text fields should show I-beam cursor. */
.contact__input,
.contact__textarea {
  cursor: text;
}

body.page-contact {
  overflow: auto;
}

html:has(body.page-full-gallery) {
  background-color: #141414;
  scroll-behavior: auto;
}

body.page-full-gallery {
  background-color: #141414;
}

/* Fixed layer (not background-attachment: fixed) — avoids scroll jitter in Safari. */
.home-page-bg,
.full-gallery-page-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  bottom: auto;
  height: 100vh;
  height: 100svh;
  height: var(--stable-viewport-height, 100svh);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.home-page-bg {
  background-color: #050505;
}

.full-gallery-page-bg {
  background-color: #141414;
}

.home-page-bg img,
.full-gallery-page-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.page-full-gallery::after {
  display: none;
  background-image: none;
}

/* Home + full gallery: site title is plain white type (no pill). */
body.page-home .page-center-title,
body.page-home a.page-center-title,
body.page-full-gallery .page-center-title,
body.page-full-gallery a.page-center-title {
  padding: 0;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.96);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}

body.page-home a.page-center-title:hover,
body.page-full-gallery a.page-center-title:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  opacity: 0.85;
}

/* Home + full gallery: black menu pill, white type (matches gallery page). */
body.page-home .gallery-bar__brand,
body.page-full-gallery .gallery-bar__brand {
  background: rgba(0, 0, 0, 0.88);
}

body.page-home .gallery-bar__brand.gallery-bar__brand--open,
body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open {
  background: rgba(0, 0, 0, 0.96);
}

body.page-home .gallery-bar__title,
body.page-home .gallery-bar__menu-link,
body.page-home .gallery-bar__menu-link:visited,
body.page-home .gallery-bar__menu-link:hover,
body.page-home .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__title,
body.page-home .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link,
body.page-home .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link:visited,
body.page-full-gallery .gallery-bar__title,
body.page-full-gallery .gallery-bar__menu-link,
body.page-full-gallery .gallery-bar__menu-link:visited,
body.page-full-gallery .gallery-bar__menu-link:hover,
body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__title,
body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link,
body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link:visited {
  color: rgba(255, 255, 255, 0.96);
}

body.page-home .gallery-bar__menu-icon span,
body.page-home .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-icon span,
body.page-full-gallery .gallery-bar__menu-icon span,
body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-icon span {
  background: rgba(255, 255, 255, 0.92);
}

/* Home flow arrows: match black menu pill + white icons. */
body.page-home .gallery-flow-arrow {
  background: rgba(0, 0, 0, 0.88);
  color: rgba(255, 255, 255, 0.96);
}

body.page-home .gallery-flow-arrow:hover {
  background: rgba(0, 0, 0, 0.96);
  color: rgba(255, 255, 255, 0.96);
}

body.page-contact::after {
  background-image: none;
}

body.page-profile::after {
  background-image: none;
}

/* Profile page background video */
.profile-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #070a10; /* fallback under video */
}

.profile-bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(10%) contrast(1.03) brightness(0.9);
}

/* Contact crossfading background (two-layer swap; never black).
   Default `absolute` so in-page contact (e.g. `index.html`) scrolls with the section.
   Standalone `contact.html` pins it to the viewport via `body.page-contact .contact-bg`. */
.contact-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #0b0f1a; /* fallback under images */
}

body.page-contact > .contact-bg {
  position: fixed;
}

.contact-bg__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: scroll;
  opacity: 0;
  transition: opacity 1600ms ease;
  will-change: opacity;
}

.contact-bg__layer--static {
  opacity: 1;
  transition: none;
  will-change: auto;
  background-image: none !important;
}

.contact-bg__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  content-visibility: visible;
}

/* Frosted gradient blur on left/right outskirts */
.contact-bg::before,
.contact-bg::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(28vw, 420px);
  pointer-events: none;
  z-index: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.contact-bg::before {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0)
  );
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}

.contact-bg::after {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0)
  );
  -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}

.contact-bg__layer.is-visible {
  opacity: 1;
}

.contact-bg__layer.is-fading-in {
  opacity: 1;
}

.contact-bg__layer.is-fading-out {
  opacity: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("../images/site/home-hero-backdrop.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Gallery page: restrained gradient (primary site shell) */
body:not(.page-contact):not(.page-profile):not(.page-home):not(.page-full-gallery) {
  background: #F0F0F0;
  background-attachment: scroll;
}

body:not(.page-contact):not(.page-profile):not(.page-home):not(.page-full-gallery)::after {
  /* Disable the blurred photo layer on gallery page */
  background-image: none;
  filter: none;
}

/* Home one-page: film-grain texture shell (full gallery keeps its own photo bg). */
html:has(body.page-home) {
  background-color: #050505;
}

body.page-home {
  background: transparent;
  background-attachment: scroll;
}

body.page-home::after {
  background-image: none;
}

/* Removed overlay helper */

/* Removed frosted helper */

/* Top bar — minimal glass strip */
.gallery-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  height: calc(128px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: transparent;
  isolation: isolate;
  /* Let scroll/wheel pass through empty header area; menu stays clickable on child. */
  pointer-events: none;
}

/* Full-width frosted strip removed: it forced a huge backdrop-filter compositing region
   on every scroll frame on desktop. Glass lives on `.gallery-bar__brand` only (same as mobile). */
.gallery-bar::before {
  display: none;
}

/* Gallery page: subtle hint in top-right for keyboard control */
.gallery-key-hint {
  position: fixed;
  top: 55px;
  left: 76px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(0, 0, 0, 0.56);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}

.gallery-key-hint__icon {
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.62);
  background: rgba(255, 255, 255, 0.22);
}

.gallery-key-hint__text {
  opacity: 1;
  color: rgba(0, 0, 0, 0.56);
}

/* Wrapper keeps the pill top-anchored so open/close doesn't jump */
.gallery-bar__anchor {
  align-self: flex-start;
  margin-top: calc((128px - 52px) / 2 - 12px);
  margin-right: 2.4rem;
  pointer-events: auto;
}

/* Top-left Instagram + email — vertically aligned with `.gallery-bar__anchor` / menu pill. */
.header-social {
  position: absolute;
  top: calc((128px + env(safe-area-inset-top, 0px)) / 2 - 12px);
  left: calc(max(3.5rem, env(safe-area-inset-left, 0px)) + 1in + 0.5rem);
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  pointer-events: auto;
}

.header-social.header-social--scroll-hidden {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.header-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  color: #000000;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.header-social__link svg {
  display: block;
  width: 26px;
  height: 26px;
  stroke-width: 2.35;
}

.header-social__link:hover {
  opacity: 0.72;
}

body.page-full-gallery .header-social__link {
  color: rgba(255, 255, 255, 0.96);
}

body.page-home .header-social__link {
  color: rgba(255, 255, 255, 0.96);
}

body.page-home .header-social__link:hover {
  opacity: 0.85;
}

/* Viewport-fixed; chrome + type match `.gallery-bar__brand` / menu links. */
.page-center-title {
  position: fixed;
  top: calc((128px + env(safe-area-inset-top, 0px)) / 2 - 12px);
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: min(68vw, 44rem);
  z-index: 12;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--gallery-pill-pad-block) var(--gallery-pill-pad-inline);
  min-height: calc(var(--gallery-pill-inner-min-height) + 2 * var(--gallery-pill-pad-block));
  border-radius: 50px;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000000;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background 420ms var(--ease-out),
    box-shadow 420ms var(--ease-out),
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out);
}

.page-center-title.page-center-title--hidden {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 8px));
  pointer-events: none;
}

a.page-center-title {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: #000000;
}

a.page-center-title:hover {
  color: #000000;
  background: rgba(250, 248, 245, 0.96);
  opacity: 0.92;
}

/* Top bar: combined GALLERY + hamburger */
.gallery-bar__brand {
  --gallery-menu-ease: cubic-bezier(0.33, 0, 0.2, 1);
  --gallery-menu-dur: 0.36s;
  position: relative;
  display: flex;
  /* Always column: row (title + trigger) then menu panel. Avoids row↔column reflow on open/close (main source of jank). */
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: fit-content;
  max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 1rem);
  /* Same padding + inner band as `.page-center-title` (see :root pill tokens). */
  padding: var(--gallery-pill-pad-block) var(--gallery-pill-pad-inline);
  border-radius: 50px;
  /* Frosted pill only (small compositing region — scrolls stay smooth on desktop). */
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: translateZ(0);
  transition:
    background var(--gallery-menu-dur) var(--gallery-menu-ease),
    box-shadow var(--gallery-menu-dur) var(--gallery-menu-ease),
    border-radius var(--gallery-menu-dur) var(--gallery-menu-ease),
    gap var(--gallery-menu-dur) var(--gallery-menu-ease),
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out);
}

.gallery-bar__brand.gallery-bar__brand--scroll-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) translateZ(0);
}

.gallery-bar__brand.gallery-bar__brand--open.gallery-bar__brand--scroll-hidden {
  opacity: 1;
  pointer-events: auto;
  transform: translateZ(0);
}

/* When menu is open, show white pill backing around heading + menu */
.gallery-bar__brand.gallery-bar__brand--open {
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  /* Same vertical rhythm as between menu links */
  gap: var(--space-3);
}

.gallery-bar__brand:not(.gallery-bar__brand--open) .gallery-bar__menu-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  /* Snap after JS finishes collapse (see gallery-menu.js); avoids fighting the panel transition. */
  transition: none;
}

.gallery-bar__brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  width: 100%;
  min-width: 0;
  min-height: var(--gallery-pill-inner-min-height);
  box-sizing: border-box;
}

.gallery-bar__title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000000;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Keep section label on one line in the pill (avoid overflow-wrap: anywhere splitting words). */
  white-space: nowrap;
  overflow-wrap: normal;
  flex-shrink: 0;
  min-width: min-content;
  display: flex;
  align-items: center;
  min-height: var(--gallery-pill-inner-min-height);
}

.gallery-bar__menu-trigger {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.gallery-bar__menu-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  min-height: 0;
  width: 100%;
  transition:
    grid-template-rows var(--gallery-menu-dur) var(--gallery-menu-ease),
    opacity var(--gallery-menu-dur) var(--gallery-menu-ease);
}

.gallery-bar__brand--open .gallery-bar__menu-content {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

/* Closing: reverse the open transition while bar stays column-layout (see gallery-menu.js). */
.gallery-bar__brand--open .gallery-bar__menu-content.gallery-bar__menu-content--collapse {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.gallery-bar__menu-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.gallery-bar__brand--open .gallery-bar__menu-content.gallery-bar__menu-content--collapse .gallery-bar__menu-inner {
  gap: 0;
}

.gallery-bar__menu-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  font-family: var(--font-sans);
  color: #000000;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform-origin: left center;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
  overflow-wrap: anywhere;
}

.gallery-bar__menu-link:visited {
  color: #000000;
}

.gallery-bar__menu-link:hover {
  color: #000000;
  text-decoration: none;
  transform: translateX(2px);
  opacity: 0.85;
}

/* Contact page: keep heading + links identical */
body.page-contact .gallery-bar__title,
body.page-contact .gallery-bar__menu-link,
body.page-contact .gallery-bar__menu-link:visited {
  color: #000000;
}

/* When the pill menu is open, shift heading and links to black for contrast */
.gallery-bar__brand.gallery-bar__brand--open .gallery-bar__title,
.gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link,
.gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-link:visited {
  color: #000000;
}

/* Removed menu glow helper */

.gallery-bar__brand-row,
.gallery-bar__menu-content {
  position: relative;
  z-index: 1;
}

/* GALLERY as link on contact page */
.gallery-bar__title--link {
  text-decoration: none;
  color: inherit;
}
.gallery-bar__title--link:hover {
  color: #000;
}

.gallery-bar__menu-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.gallery-bar__menu-icon span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: rgba(0, 0, 0, 0.88);
  border-radius: 999px;
  transition: background var(--duration-fast) var(--ease-out);
}

/* When menu pill is open, match heading/menu text (black) */
.gallery-bar__brand.gallery-bar__brand--open .gallery-bar__menu-icon span {
  background: #000000;
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2.4rem 0;
  padding-top: calc(128px + env(safe-area-inset-top, 0px) + 2.4rem);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: max(2.4rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page.page--onepage {
  display: block;
  padding-top: calc(128px + env(safe-area-inset-top, 0px) + 1rem);
  padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
}

.onepage-section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  /* Align scroll targets / hash jumps with the fixed nav (see also .gallery-bar height). */
  scroll-margin-top: calc(128px + env(safe-area-inset-top, 0px) + 1.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.onepage-section--home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-4);
  padding-top: 0;
  height: auto;
  min-height: 0;
  /* Prevent scroll anchoring from snapping to top when flow rows reflow above the bio. */
  overflow-anchor: none;
}

.onepage-section--gallery {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--space-4);
  margin-top: -4vh;
  padding-top: 10vh;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.06) 38%,
    rgba(0, 0, 0, 0.05) 76%,
    rgba(0, 0, 0, 0) 100%
  );
}

body.page-full-gallery .onepage-section--gallery {
  background: transparent;
}

.onepage-section__heading {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto var(--space-4);
  padding: 0 var(--space-5);
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4.2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.72);
  text-align: center;
  /* Anchor targets (#gallery-section-heading) — align with fixed nav, not section padding. */
  scroll-margin-top: calc(128px + env(safe-area-inset-top, 0px) + 1.25rem);
  overflow-wrap: anywhere;
}

body.page-full-gallery .onepage-section__heading {
  font-weight: 800;
  letter-spacing: 0.16em;
}

.onepage-section--contact {
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
  padding-top: 0;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  background: transparent;
  /* One document scroll — no viewport-locked panel or nested overflow. */
  overflow: visible;
  overscroll-behavior: none;
  isolation: isolate;
  align-items: stretch;
  justify-content: flex-start;
  min-height: auto;
}

/* Soft transparency gradient so contact background fades in from the top. */
.onepage-section--contact::before {
  content: "";
  position: absolute;
  top: clamp(-96px, -16vh, -44px);
  left: 0;
  right: 0;
  height: clamp(220px, 34vh, 420px);
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    rgba(236, 230, 220, 0.72) 0%,
    rgba(236, 230, 220, 0.5) 22%,
    rgba(236, 230, 220, 0.24) 52%,
    rgba(236, 230, 220, 0.08) 74%,
    rgba(238, 232, 223, 0) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.78) 48%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.78) 48%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Tiny neutral wash exactly at the section seam. */
.onepage-section--contact::after {
  content: "";
  position: absolute;
  top: clamp(-10px, -1.5vh, -4px);
  left: 0;
  right: 0;
  height: clamp(18px, 4vh, 40px);
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    rgba(236, 230, 220, 0.4) 0%,
    rgba(236, 230, 220, 0) 100%
  );
  filter: blur(4px);
}

.page--onepage .onepage-section--contact .contact-bg {
  /* Scroll with the section — negative inset caused bg to drift vs the form on wheel/touch. */
  position: absolute !important;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translateZ(0);
  content-visibility: visible;
}

/* Frame matches hero photo (DSC_0166-2.webp ≈ 3:2); --contact-bg-aspect set in JS when image loads. */
.page--onepage .onepage-section--contact {
  --contact-card-max-width: min(520px, calc(100% - 2rem));
  --contact-card-offset-y: 0px;
  --contact-section-min-height: auto;
  width: 100%;
  aspect-ratio: var(--contact-bg-aspect, 3 / 2);
  min-height: var(--contact-section-min-height);
  margin-top: clamp(1rem, 2.5vh, 1.75rem);
  padding: clamp(0.65rem, 1.8vw, 1.1rem);
  padding-bottom: max(clamp(0.65rem, 1.8vw, 1.1rem), env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

.page--onepage .onepage-section--home + .onepage-section--contact,
.page--onepage .onepage-section--gallery + .onepage-section--contact {
  margin-top: clamp(1rem, 2.5vh, 1.75rem);
  padding-top: clamp(0.65rem, 1.8vw, 1.1rem);
}

.page--onepage .onepage-section--contact::before,
.page--onepage .onepage-section--contact::after {
  display: none;
}

.page--onepage .onepage-section--contact .contact {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--contact-card-max-width);
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transform: translateY(var(--contact-card-offset-y));
}

.page--onepage .onepage-section--contact .contact__card {
  max-height: 100%;
  overflow: auto;
}

.gallery {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  overflow: visible;
  /* Move both rows up by 0.5in from previous placement */
  transform: translateY(calc(40px - 0.5in));
}

.home-bio-image {
  width: min(62rem, calc(100% - 3rem));
  /* Keep natural aspect ratio: the HTML height attribute must not fix the height. */
  height: auto;
  margin: var(--space-3) auto var(--space-2);
  display: block;
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.home-bio-row {
  width: 100%;
  max-width: min(92rem, 100%);
  margin: var(--space-3) auto var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: calc(var(--radius-md) + 2px);
  background: #000000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.home-bio-row .home-bio-image {
  width: 100%;
  margin: 0 0 var(--space-3);
}

.home-bio-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

.home-bio-row .home-bio-copy {
  align-items: center;
  text-align: center;
  width: 100%;
}

.home-bio-heading {
  margin: 0;
  width: 100%;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.98);
  text-align: center;
  text-wrap: balance;
}

/* Mobile-only title above the home flow row. */
.home-flow-heading {
  display: none;
}

.home-bio-row .home-intro {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(238, 238, 238, 0.92);
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  box-shadow: none;
  text-align: center;
  text-wrap: balance;
  line-height: 1.62;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
}

.home-bio-row .home-start-btn--pov {
  position: relative;
  z-index: 1;
  overflow: visible;
  isolation: isolate;
  --view-gallery-burst-clip: polygon(
    50% 0%,
    54.019% 9.197%,
    59.755% 0.961%,
    61.902% 10.765%,
    69.134% 3.806%,
    69.327% 13.841%,
    77.779% 8.427%,
    76.01% 18.307%,
    85.355% 14.645%,
    81.693% 23.99%,
    91.573% 22.221%,
    86.159% 30.673%,
    96.194% 30.866%,
    89.235% 38.098%,
    99.039% 40.245%,
    90.803% 45.981%,
    100% 50%,
    90.803% 54.019%,
    99.039% 59.755%,
    89.235% 61.902%,
    96.194% 69.134%,
    86.159% 69.327%,
    91.573% 77.779%,
    81.693% 76.01%,
    85.355% 85.355%,
    76.01% 81.693%,
    77.779% 91.573%,
    69.327% 86.159%,
    69.134% 96.194%,
    61.902% 89.235%,
    59.755% 99.039%,
    54.019% 90.803%,
    50% 100%,
    45.981% 90.803%,
    40.245% 99.039%,
    38.098% 89.235%,
    30.866% 96.194%,
    30.673% 86.159%,
    22.221% 91.573%,
    23.99% 81.693%,
    14.645% 85.355%,
    18.307% 76.01%,
    8.427% 77.779%,
    13.841% 69.327%,
    3.806% 69.134%,
    10.765% 61.902%,
    0.961% 59.755%,
    9.197% 54.019%,
    0% 50%,
    9.197% 45.981%,
    0.961% 40.245%,
    10.765% 38.098%,
    3.806% 30.866%,
    13.841% 30.673%,
    8.427% 22.221%,
    18.307% 23.99%,
    14.645% 14.645%,
    23.99% 18.307%,
    22.221% 8.427%,
    30.673% 13.841%,
    30.866% 3.806%,
    38.098% 10.765%,
    40.245% 0.961%,
    45.981% 9.197%
  );
  text-transform: none;
  letter-spacing: 0.06em;
  font-weight: 700;
  gap: 0.35em;
  border-radius: 50px;
  padding: var(--gallery-pill-pad-block) calc(var(--gallery-pill-pad-inline) * 1.45);
  min-height: calc(var(--gallery-pill-inner-min-height) + 2 * var(--gallery-pill-pad-block));
  border: none;
  background: #dfe6e6;
  color: #1a1a1a;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.home-bio-row .home-start-btn--pov .home-start-btn__label,
.home-bio-row .home-start-btn--pov .home-start-btn__arrow {
  position: relative;
  z-index: 1;
}

.home-bio-row .home-start-btn--pov .home-start-btn__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
}

.home-bio-row .home-start-btn--pov .home-start-btn__arrow-rest {
  opacity: 1;
  transition: opacity 0.12s ease;
}

.home-bio-row .home-start-btn--pov .home-start-btn__arrow-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
}

.home-bio-row .home-start-btn--pov::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 108%;
  aspect-ratio: 1;
  background: #fcd844;
  clip-path: var(--view-gallery-burst-clip);
  opacity: 0;
  translate: -50% -50%;
  scale: 0.5;
  rotate: 0deg;
  transform-origin: center center;
  pointer-events: none;
  backface-visibility: hidden;
  contain: layout style paint;
}

.home-bio-row .home-start-btn--pov:hover {
  background: #cfd6d6;
  color: #1a1a1a;
  border-color: transparent;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  body.page-home .onepage-section--home:has(.home-start-btn--pov:hover) {
    position: relative;
    z-index: 8;
  }

  @keyframes home-view-gallery-burst-spin {
    to {
      rotate: 360deg;
    }
  }

  body.page-home .home-bio-row .home-start-btn--pov::before {
    animation: home-view-gallery-burst-spin
      calc(var(--view-gallery-burst-spin-duration, 40s) / 2)
      linear
      infinite;
    animation-play-state: paused;
  }

  body.page-home .home-bio-row .home-start-btn--pov.is-burst-ready::before,
  body.page-home .home-bio-row .home-start-btn--pov.is-hover-prewarming::before {
    will-change: transform, opacity;
  }

  body.page-home .home-bio-row .home-start-btn--pov.is-hover-prewarming::before {
    animation-play-state: running;
    opacity: 0.001;
    scale: 1;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover {
    z-index: 2;
    background: transparent !important;
    color: #1a1a1a !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: scale(1) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    --view-gallery-pill-out-duration: 0.16s;
    --view-gallery-star-delay: 0.16s;
    --view-gallery-star-pop-duration: 0.3s;
    transition:
      color var(--view-gallery-pill-out-duration) ease,
      background var(--view-gallery-pill-out-duration) ease,
      border-color var(--view-gallery-pill-out-duration) ease,
      box-shadow var(--view-gallery-pill-out-duration) ease !important;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover .home-start-btn__label,
  body.page-home .home-bio-row .home-start-btn--pov:hover .home-start-btn__arrow {
    font-weight: 900;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover .home-start-btn__label {
    font-style: italic;
    text-transform: uppercase;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover .home-start-btn__arrow-rest {
    opacity: 0;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover .home-start-btn__arrow-pop {
    opacity: 1;
    transition: opacity 0.12s ease var(--view-gallery-star-delay, 0.16s);
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover::before {
    opacity: 1;
    scale: 1;
    animation-play-state: running;
    transition:
      opacity var(--view-gallery-star-pop-duration, 0.3s)
        cubic-bezier(0.22, 1.12, 0.36, 1) var(--view-gallery-star-delay, 0.16s),
      scale var(--view-gallery-star-pop-duration, 0.3s)
        cubic-bezier(0.22, 1.12, 0.36, 1) var(--view-gallery-star-delay, 0.16s);
  }

  body.page-home .home-bio-row .home-start-btn--pov:not(:hover)::before {
    animation-play-state: paused;
    opacity: 0;
    scale: 0.5;
    rotate: 0deg;
    transition:
      opacity 0.24s ease,
      scale 0.24s ease;
  }
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  body.page-home .home-bio-row .home-start-btn--pov:hover::before {
    animation: none;
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }

  body.page-home .home-bio-row .home-start-btn--pov:hover {
    transform: none !important;
  }
}

.home-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.72em 2.15em;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: clamp(1.02rem, 1.6vw, 1.24rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.home-start-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.26);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.full-gallery-heading {
  width: 100%;
  max-width: min(83.2rem, 80%);
  margin: 0 auto var(--space-5);
  padding: 0 max(0.85rem, env(safe-area-inset-left, 0px))
    0 max(0.85rem, env(safe-area-inset-right, 0px));
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.96);
  text-wrap: balance;
  box-sizing: border-box;
}

/* Force bio card/text theme regardless of downstream generic `.home-intro` rules. */
.onepage-section--home .home-bio-row {
  background: #000000 !important;
}

.onepage-section--home .home-bio-row .home-bio-heading {
  color: rgba(255, 255, 255, 0.98) !important;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif !important;
  font-weight: 700 !important;
  text-align: center !important;
}

.onepage-section--home .home-bio-row .home-intro {
  color: rgba(238, 238, 238, 0.92) !important;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif !important;
  font-weight: 400 !important;
  text-align: center !important;
}

@media (min-width: 1024px) {
  .home-bio-row {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr);
    gap: var(--space-4);
    align-items: center;
  }

  .home-bio-row .home-bio-image {
    margin: 0;
    height: 100%;
    min-height: 17rem;
  }

  .home-bio-row .home-intro {
    text-align: center;
    font-size: clamp(1.05rem, 1.35vw, 1.28rem);
    line-height: 1.62;
    max-width: min(58ch, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  .home-bio-copy {
    justify-self: stretch;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    gap: clamp(1rem, 1.8vw, 1.7rem);
    text-align: center;
    width: 100%;
  }

  .home-start-btn {
    min-height: 64px;
    padding: 0.82em 2.7em;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
    letter-spacing: 0.18em;
  }
}

.home-intro {
  max-width: min(62rem, calc(100% - 3rem));
  margin: var(--space-3) auto var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.55vw, 1.12rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: rgba(0, 0, 0, 0.76);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.66));
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: calc(var(--radius-md) + 2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  overflow-wrap: anywhere;
}

.gallery-flow-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 68px;
  height: 68px;
  border-radius: var(--radius-pill);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  z-index: 24;
  padding: 0;
  user-select: none;
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.gallery-flow-arrow:hover {
  background: #ffffff;
  opacity: 1;
}

.gallery-flow-arrow span {
  display: flex;
  width: 48%;
  height: 48%;
  align-items: center;
  justify-content: center;
}

.gallery-flow-arrow svg {
  width: 100%;
  height: 100%;
}

.gallery-flow-arrow--left {
  left: calc(18px + 0.3in);
}

.gallery-flow-arrow--right {
  right: calc(18px + 0.3in);
}

.gallery-flow-arrow--right svg {
  transform: translateX(1px);
}

.gallery-flow-arrow--left svg {
  transform: translateX(-1px);
}

.gallery-flow-arrow:active {
  transform: translateY(-50%) scale(0.97);
}

.page--onepage .gallery-flow-arrow {
  position: absolute;
}

/* Match onepage.js getFlowItemWidth() so tiles are the right width before JS runs. */
@media (max-width: 420px) {
  :root {
    --flow-item-width: 200px;
  }
}

@media (min-width: 421px) and (max-width: 768px) {
  :root {
    --flow-item-width: 248px;
  }
}

.gallery-row {
  position: relative;
  height: clamp(17.13rem, 38.7vh, 25.42rem);
  height: clamp(17.13rem, 38.7svh, 25.42rem);
  overflow: hidden;
  contain: none;
  transform: translateZ(0);
  content-visibility: visible;
}

@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .gallery-row {
    /* paint containment makes Instagram WebKit discard decoded tiles on scroll. */
    contain: none;
  }

  .page-home .gallery,
  .page-home .gallery-flow-track {
    content-visibility: visible;
  }

  /* Marquee already animates on the compositor; drop will-change during touch scroll. */
  .gallery-flow-track.flow-marquee-active {
    will-change: auto;
  }

  /* Only the first tiles per row stay GPU-promoted; the rest use normal compositing. */
  .gallery-row .gallery-flow-track .media-item--priority-render {
    will-change: auto;
    transform: scale(var(--scale, 1));
  }

  .gallery-row .media-item--priority-render img,
  .gallery-row .media-item--priority-render video {
    will-change: auto;
    transform: none;
  }

  body.page-home #row-bottom {
    display: none !important;
  }
}

@keyframes flow-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-1 * var(--flow-segment-width, 0px)), 0, 0);
  }
}

.gallery-flow-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
  width: max-content;
  gap: 10px;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Compositor-driven loop — keeps moving smoothly during Safari scroll. */
.gallery-flow-track.flow-marquee-active {
  animation: flow-marquee var(--flow-marquee-duration, 40s) linear infinite;
  animation-direction: var(--flow-marquee-direction, normal);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-flow-track.flow-marquee-active {
    animation: none !important;
    will-change: auto;
  }
}

.gallery-row .gallery-flow-track .media-item {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
  transform: scale(var(--scale));
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}

/* Top-of-page flow tiles (first 3 per row): keep decoded + composited in Instagram WebKit. */
.gallery-row .media-item--priority-render,
body.page-full-gallery .portfolio-grid .media-item--priority-render {
  will-change: transform;
  transform: translateZ(0) scale(var(--scale, 1));
  backface-visibility: hidden;
}

.gallery-row .media-item--priority-render img,
.gallery-row .media-item--priority-render video,
body.page-full-gallery .portfolio-grid .media-item--priority-render img,
body.page-full-gallery .portfolio-grid .media-item--priority-render video,
.priority-render-img,
.contact-bg__image {
  will-change: transform;
  transform: translateZ(0);
  image-rendering: -webkit-optimize-contrast;
  content-visibility: visible;
}

/* Block interaction until hero media is pinned, decoded, and painted. */
html.site-boot-locked {
  overflow: hidden;
}

html.site-boot-locked body {
  pointer-events: none;
  touch-action: none;
  overflow: hidden;
}

.site-boot-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #050505;
  pointer-events: auto;
}

/* Simple spinner so the boot wait reads as loading rather than a dead screen. */
.site-boot-gate::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.75);
  animation: site-boot-spin 0.9s linear infinite;
}

body.page-full-gallery .site-boot-gate {
  background: #f0f0f0;
}

body.page-full-gallery .site-boot-gate::after {
  border-color: rgba(0, 0, 0, 0.14);
  border-top-color: rgba(0, 0, 0, 0.55);
}

@keyframes site-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-boot-gate::after {
    animation: none;
    display: none;
  }
}

.site-boot-gate[hidden] {
  display: none !important;
}

#image-memory-keeper {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 1;
  pointer-events: none;
  z-index: -1;
}

#image-memory-keeper img {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 1;
}

.media-item {
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--flow-item-width, 288px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  /* Clip inner media so the visible image/video always shares
     the same rounded corners as the card itself. */
  overflow: hidden;
  border: 1px solid var(--outline-dark);
  /* Let the page gradient show through between items */
  background: transparent;
  --x: 0px;
  --scale: 1;
  transform: translate3d(var(--x), 0, 0) scale(var(--scale));
  transform-origin: center center;
  transition:
    opacity 220ms ease-out,
    transform 280ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

/* Used only while tiles are being instantly repositioned off-screen for
   the infinite loop. Disables transform animation so they don't
   "slingshot" visibly across the viewport, without affecting the
   pop-up animation when they are on-screen. */
.media-item--teleport {
  transition: opacity 220ms ease-out;
}

.media-item--gif {
  background: #000;
}

.media-item img,
.media-item video {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0%);
}

.media-item video {
  pointer-events: none;
}

/* Moving gallery: keep dark backing behind videos */
.gallery-row .media-item video {
  background: #000;
}

.gallery-row .media-item:hover {
  border-radius: 0;
  border-width: 10px;
  border-color: #000000;
  outline: 12px solid #000000;
  outline-offset: -6px;
  box-shadow: none !important;
  animation: blocky-border-slap 180ms cubic-bezier(0.2, 1.2, 0.3, 1);
}

.media-item--hovered {
  --scale: 1.25;
  z-index: 5;
}

.media-item--hovered img,
.media-item--hovered video {
  /* Keep the same visual aspect ratio as in the flow. */
  object-fit: cover;
  filter: grayscale(0%);
}

.media-item--hovered {
  border-radius: 0;
  border-width: 10px;
  border-color: #000000;
  outline: 12px solid #000000;
  outline-offset: -6px;
  box-shadow: none !important;
  animation: blocky-border-slap 180ms cubic-bezier(0.2, 1.2, 0.3, 1);
}

.media-item--neighbor {
  --scale: 1.12;
  z-index: 4;
}

@keyframes blocky-border-slap {
  0% {
    border-width: 1px;
    outline-width: 0;
  }
  70% {
    border-width: 14px;
    outline-width: 16px;
  }
  100% {
    border-width: 10px;
    outline-width: 12px;
  }
}

/* Mobile / touch: no cursor-hover image effects (flow + gallery grid). */
@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .gallery-row .gallery-flow-track .media-item,
  .gallery-row .gallery-flow-track .media-item:hover,
  .gallery-row .media-item--hovered,
  .gallery-row .media-item--neighbor {
    --scale: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
    animation: none !important;
    border-width: 1px !important;
    border-color: var(--outline-dark) !important;
    border-radius: var(--radius-md) !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
  }

  .gallery-row .gallery-flow-track .media-item--priority-render {
    transform: scale(1) !important;
    will-change: auto !important;
  }

  .gallery-row .media-item:hover img,
  .gallery-row .media-item:hover video,
  .gallery-row .media-item--hovered img,
  .gallery-row .media-item--hovered video {
    filter: grayscale(0%);
    object-fit: cover;
  }

  .portfolio-grid .media-item,
  .portfolio-grid .media-item:hover,
  .portfolio-grid .media-item--hovered {
    transform: none !important;
    transition: none !important;
    animation: none !important;
    border-width: 1px !important;
    border-color: var(--outline-dark) !important;
    border-radius: var(--radius-md) !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
  }

  .portfolio-grid .media-item:hover img,
  .portfolio-grid .media-item:hover video,
  .portfolio-grid .media-item--hovered img,
  .portfolio-grid .media-item--hovered video {
    filter: grayscale(0%);
  }
}

/* Classic portfolio gallery (justified rows) */
.portfolio {
  width: 100%;
  max-width: min(92rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

.portfolio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 auto var(--space-2);
  padding: 0 var(--space-5);
  max-width: 72rem;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.portfolio-filter {
  border: 1px solid var(--outline-dark);
  background: rgba(255, 255, 255, 0.65);
  color: rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-pill);
  padding: 0.55em 1.1em;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.portfolio-filter:hover {
  color: rgba(0, 0, 0, 0.85);
  border-color: rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.92);
}

.portfolio-filter.is-active {
  background: rgba(250, 248, 245, 0.96);
  border-color: transparent;
  color: #141414;
  box-shadow: var(--shadow-sm);
}

.portfolio-meta {
  flex-basis: 100%;
  text-align: center;
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  user-select: none;
  overflow-wrap: anywhere;
}

.portfolio-grid {
  padding: 0 var(--space-5) 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  width: 100%;
  max-width: min(92rem, 100%);
  margin: 0 auto;
  box-sizing: border-box;
}

.portfolio-date-group {
  width: 100%;
  max-width: min(92rem, 100%);
  margin: 0 auto var(--space-6);
}

body.page-full-gallery .portfolio-grid {
  max-width: min(83.2rem, 80%);
  padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
}

body.page-full-gallery .portfolio-grid .media-item img,
body.page-full-gallery .portfolio-grid .media-item video {
  object-fit: contain !important;
  object-position: center;
  width: 100% !important;
  height: 100% !important;
}

body.page-full-gallery .portfolio-grid .media-item--hovered img,
body.page-full-gallery .portfolio-grid .media-item--hovered video,
body.page-full-gallery .portfolio-grid .media-item--neighbor img,
body.page-full-gallery .portfolio-grid .media-item--neighbor video {
  object-fit: contain !important;
}

body.page-full-gallery .portfolio-date-group {
  width: 100%;
  max-width: 100%;
  padding: var(--space-3);
  --portfolio-date-pad-x: var(--space-3);
  --portfolio-date-pad-bottom: var(--space-3);
  scroll-margin-top: calc(128px + env(safe-area-inset-top, 0px) + 1.25rem);
  border: none;
  border-radius: 14px;
  background: #000000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

body.page-full-gallery .portfolio-date-rows,
body.page-full-gallery .portfolio-date-grid {
  gap: calc(var(--portfolio-section-gap, 16px) * 0.8);
}

body.page-full-gallery .portfolio-date-extra-inner > .portfolio-date-grid + .portfolio-date-grid,
body.page-full-gallery .portfolio-date-rows > .portfolio-date-grid + .portfolio-date-grid {
  margin-top: calc(var(--portfolio-section-gap, 16px) * 0.8);
}

@media (max-width: 768px) {
  body.page-full-gallery .onepage-section--gallery,
  body.page-full-gallery .onepage-section--gallery .portfolio {
    width: 100%;
    max-width: 100%;
  }

  body.page-full-gallery .portfolio-grid {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body.page-full-gallery .portfolio-date-group {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--portfolio-section-gap, 8px);
    padding-right: var(--portfolio-section-gap, 8px);
    --portfolio-date-pad-x: var(--portfolio-section-gap, 8px);
    scroll-margin-top: calc(104px + env(safe-area-inset-top, 0px) + 1.25rem);
    border-radius: 0;
    box-sizing: border-box;
  }

  body.page-full-gallery .portfolio-date-header {
    padding-left: 0;
    padding-right: 0;
  }

  body.page-full-gallery .portfolio-date-rows,
  body.page-full-gallery .portfolio-date-grid {
    width: 100%;
  }
}

/* Desktop full gallery: slanted folder index in the left gutter (does not shift the grid). */
body.page-full-gallery .full-gallery-folder-nav {
  display: none;
}

@media (min-width: 769px) {
  body.page-full-gallery .full-gallery-folder-nav:not([hidden]) {
    display: block;
    position: fixed;
    top: calc(128px + env(safe-area-inset-top, 0px) + 1.35rem);
    left: max(1.65rem, calc(env(safe-area-inset-left, 0px) + 1.35rem));
    z-index: 6;
    width: var(--full-gallery-nav-max-width, 8rem);
    max-width: var(--full-gallery-nav-max-width, 8rem);
    max-height: calc(100vh - 128px - env(safe-area-inset-top, 0px) - 2.5rem);
    max-height: calc(100dvh - 128px - env(safe-area-inset-top, 0px) - 2.5rem);
    overflow: visible;
    pointer-events: none;
  }

  body.page-full-gallery .full-gallery-folder-nav__list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: auto;
    overflow: visible;
  }

  body.page-full-gallery .full-gallery-folder-nav__item {
    overflow: visible;
    width: 100%;
  }

  body.page-full-gallery .full-gallery-folder-nav__link {
    display: block;
    position: relative;
    padding: 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-sans);
    font-size: clamp(0.78rem, 0.95vw, 0.94rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: left;
    rotate: 22deg;
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: left center;
    transition:
      transform 0.24s cubic-bezier(0.22, 1.18, 0.36, 1),
      color 0.2s ease;
    box-shadow: none;
    overflow-wrap: anywhere;
  }

  body.page-full-gallery .full-gallery-folder-nav__link:hover,
  body.page-full-gallery .full-gallery-folder-nav__link:focus-visible {
    transform: translate3d(0.85rem, -0.12rem, 0) scale(1.18);
    color: rgba(255, 255, 255, 1);
    z-index: 2;
    outline: none;
  }
}

@media (min-width: 769px) and (prefers-reduced-motion: reduce) {
  body.page-full-gallery .full-gallery-folder-nav__link {
    transition: color 0.2s ease;
  }

  body.page-full-gallery .full-gallery-folder-nav__link:hover,
  body.page-full-gallery .full-gallery-folder-nav__link:focus-visible {
    transform: translate3d(0.5rem, 0, 0) scale(1.1);
  }
}

/* Full gallery: remove filter buttons + works count + section buttons */
body.page-full-gallery .portfolio-controls,
body.page-full-gallery .portfolio-toggle,
body.page-full-gallery .portfolio-toggle__button {
  display: none !important;
}

.portfolio-date-group--collapsed,
.portfolio-date-group--expanded {
  padding-bottom: 0;
}

.portfolio-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: var(--space-3);
  flex-shrink: 0;
}

.portfolio-date-heading {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 238, 238, 0.96);
  margin: 0;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.portfolio-date-collapse {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  width: auto;
  min-height: 2.35rem;
  padding: 0.42rem 0.9rem 0.42rem 1rem;
  border: none;
  border-radius: 999px;
  background: #e8e8e8;
  color: #000000;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.portfolio-date-group--expanded .portfolio-date-collapse {
  display: inline-flex;
}

.portfolio-date-collapse:hover {
  background: #dcdcdc;
  color: #000000;
}

.portfolio-date-collapse__label {
  line-height: 1;
  white-space: nowrap;
}

.portfolio-date-collapse__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  line-height: 0;
}

.portfolio-date-collapse__icon svg {
  display: block;
  width: 1em;
  height: 1em;
  transform: rotate(180deg);
}

@media (min-width: 769px) {
  body.page-full-gallery .portfolio-date-collapse {
    font-size: clamp(0.72rem, 1.1vw, 0.95rem);
    padding: 0.5rem 1rem 0.5rem 1.1rem;
    gap: 0.5rem;
  }
}

.portfolio-date-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-sizing: border-box;
  min-height: 3.35rem;
  width: calc(100% + 2 * var(--portfolio-date-pad-x, var(--space-3)));
  margin-top: var(--space-3);
  margin-inline: calc(-1 * var(--portfolio-date-pad-x, var(--space-3)));
  margin-bottom: 0;
  padding: 1.05rem 1rem;
  border: none;
  border-radius: 0 0 13px 13px;
  background: #000000;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.portfolio-date-toggle:hover {
  background: #000000;
  color: #ffffff;
}

.portfolio-date-toggle__label {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  line-height: 1;
}

.portfolio-date-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  line-height: 1;
}

.portfolio-date-toggle__icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

body.page-full-gallery .portfolio-date-extra,
body.page-full-gallery .portfolio-date-extra-inner,
body.page-full-gallery .portfolio-date-extra-inner .media-item,
body.page-full-gallery .portfolio-date-extra-inner .media-item img,
body.page-full-gallery .portfolio-date-extra-inner .media-item video,
body.page-full-gallery .portfolio-date-toggle,
body.page-full-gallery .portfolio-date-toggle__icon svg {
  transition: none !important;
  animation: none !important;
}

body.page-full-gallery .portfolio-date-toggle--expanded .portfolio-date-toggle__icon svg {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  body.page-full-gallery .portfolio-date-toggle {
    border-radius: 0;
    min-height: 3.65rem;
  }
}

/* Full gallery: equal vertical + horizontal gap between rows. */
.portfolio-date-rows {
  display: flex;
  flex-direction: column;
  gap: var(--portfolio-section-gap, 16px);
  width: 100%;
}

.portfolio-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--portfolio-section-gap, 16px);
  width: 100%;
  align-items: stretch;
}

.portfolio-date-grid--stacked {
  grid-template-columns: minmax(0, 1fr);
}

.portfolio-date-preview-grid + .portfolio-date-preview-grid {
  margin-top: var(--portfolio-section-gap, 16px);
}

/* Full gallery: instant folder expand/collapse — no grid-row reveal. */
.portfolio-date-extra {
  display: none;
  overflow-anchor: none;
}

.portfolio-date-extra.portfolio-date-extra--open {
  display: block;
}

.portfolio-date-extra-inner {
  display: block;
}

.portfolio-date-extra-inner > .portfolio-date-grid + .portfolio-date-grid,
.portfolio-date-rows > .portfolio-date-grid + .portfolio-date-grid {
  margin-top: var(--portfolio-section-gap, 16px);
}

.portfolio-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

.portfolio-row--short {
  justify-content: center;
}

.portfolio-grid .media-item {
  /* Override the flow-gallery absolute positioning. */
  position: relative !important;
  top: auto !important;
  flex: 0 0 auto;
  transform: none !important;

  /* Dimensions set in JS (justified rows, natural aspect). */
  border: 1px solid var(--outline-dark);
  background: rgba(245, 242, 237, 0.9);
  padding: 0;
  outline: none;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.portfolio-grid .media-item img,
.portfolio-grid .media-item video {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0%);
}

body.page-full-gallery .portfolio-grid .full-gallery-tile {
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

body.page-full-gallery .portfolio-grid .full-gallery-tile--fullwidth {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 100%;
}

body.page-full-gallery .portfolio-grid .full-gallery-tile--orphan-portrait {
  width: min(50%, 26rem);
  max-width: 100%;
}

body.page-full-gallery .portfolio-grid .full-gallery-tile--fullwidth img,
body.page-full-gallery .portfolio-grid .full-gallery-tile--fullwidth video {
  height: auto !important;
  flex: none;
  margin-inline: auto;
}

body.page-full-gallery .portfolio-grid .full-gallery-tile img,
body.page-full-gallery .portfolio-grid .full-gallery-tile video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: contain !important;
  object-position: center;
  border-radius: var(--radius-md);
  display: block;
}

body.page-full-gallery .portfolio-grid [data-gallery-folder-preview] img,
body.page-full-gallery .portfolio-grid [data-gallery-folder-preview] video {
  content-visibility: visible;
}

.portfolio-grid .media-item[data-kind="video"] {
  background: rgba(245, 242, 237, 0.95);
}

.portfolio-grid .media-item[data-kind="video"] video {
  background: transparent;
}

.portfolio-grid .media-item:hover {
  transform: translateY(-4px) scale(1.01) !important;
  z-index: 2;
  border-radius: 0;
  border-width: 10px;
  border-color: #000000;
  outline: 12px solid #000000;
  outline-offset: -6px;
  box-shadow: none !important;
  animation: blocky-border-slap 180ms cubic-bezier(0.2, 1.2, 0.3, 1);
}

/* Full gallery: no hover animations on images/tiles (all breakpoints). */
body.page-full-gallery .portfolio-grid .media-item,
body.page-full-gallery .portfolio-grid .media-item:hover,
body.page-full-gallery .portfolio-grid .media-item--hovered,
body.page-full-gallery .portfolio-grid .media-item--neighbor,
body.page-full-gallery .portfolio-grid .full-gallery-tile,
body.page-full-gallery .portfolio-grid .full-gallery-tile:hover {
  --scale: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  border-radius: var(--radius-md) !important;
  border-width: 1px !important;
  border-color: var(--outline-dark) !important;
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  z-index: auto !important;
}

body.page-full-gallery .portfolio-grid .media-item:hover img,
body.page-full-gallery .portfolio-grid .media-item:hover video,
body.page-full-gallery .portfolio-grid .media-item--hovered img,
body.page-full-gallery .portfolio-grid .media-item--hovered video {
  filter: grayscale(0%);
}

.portfolio-grid .media-item:hover img,
.portfolio-grid .media-item:hover video {
  filter: grayscale(0%);
}

.is-hidden {
  display: none !important;
}

.is-collapsed-hidden {
  display: none !important;
}

.portfolio-toggle {
  display: flex;
  justify-content: center;
  margin: 0.35rem auto var(--space-4);
  padding: 0 var(--space-5);
}

.page--onepage .portfolio-toggle {
  margin-top: 0.5rem;
  margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

.portfolio-toggle__button {
  border: 1px solid var(--outline-dark);
  background: rgba(255, 255, 255, 0.94);
  color: rgba(0, 0, 0, 0.92);
  border-radius: var(--radius-pill);
  padding: 1.1em 2.5em;
  min-height: 48px;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.portfolio-toggle__button:hover {
  background: #ffffff;
  color: #000;
  border-color: rgba(0, 0, 0, 0.36);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-toggle__button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

/* Morph animation layer from grid image to lightbox */
.morph-layer {
  position: fixed;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  pointer-events: none;
}

.morph-layer img,
.morph-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Emoji cursor 📷 / 📸 */
.cursor-emoji {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  font-size: 38px;
  line-height: 1;
  user-select: none;
  filter: brightness(1.05) saturate(0.92);
  opacity: 0.92;
}

@media (hover: none), (pointer: coarse) {
  .cursor-emoji {
    display: none !important;
  }
}

/* Contact page */
.page--contact {
  padding-top: calc(128px + env(safe-area-inset-top, 0px) + 3rem);
  padding-bottom: max(3rem, env(safe-area-inset-bottom, 0px));
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Profile page */
body.page-profile {
  overflow: auto;
}

.page--profile {
  padding-top: calc(128px + env(safe-area-inset-top, 0px) + 1.8rem);
  padding-bottom: max(3.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.profile {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.profile__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.profile__card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  overflow: hidden;
}

.profile__card--hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 420px;
}

.profile__hero-media {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.profile__hero-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(20%) contrast(1.02);
  transform: scale(1.02);
  opacity: 1;
  transition: opacity 420ms ease-out;
  border-radius: inherit;
}

.profile__hero-img--overlay {
  display: none;
}

.profile__hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 200, 150, 0.22), transparent 55%),
    linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.65;
  pointer-events: none;
}

.profile__hero-copy {
  padding: 2.1rem 2.1rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.95rem;
}

.profile__kicker {
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(249, 250, 251, 0.85);
}

.profile__headline {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  color: #f9fafb;
}

.profile__bio {
  color: rgba(249, 250, 251, 0.82);
  font-weight: 600;
  line-height: 1.55;
  max-width: 46ch;
}

.profile__cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.35rem;
}

.profile__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75em 1.25em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f9fafb;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.profile__cta-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

.profile__cta-btn--ghost {
  background: rgba(0, 0, 0, 0.12);
}

.profile__cta-link {
  color: rgba(249, 250, 251, 0.85);
  text-decoration: none;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.profile__cta-link:hover {
  color: #fff;
  text-decoration: underline;
}

.profile__card--duo {
  padding: 1.35rem 1.35rem 1.45rem;
}

.profile__duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.profile__tile {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.profile__tile img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  filter: grayscale(20%) contrast(1.02);
}

.profile__meta {
  display: grid;
  gap: 0.35rem;
}

.profile__section-title {
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 650;
  color: #f9fafb;
}

.profile__section-copy {
  color: rgba(249, 250, 251, 0.82);
  font-weight: 600;
  line-height: 1.55;
  max-width: 68ch;
}

.profile__card--motion {
  padding: 1.35rem 1.35rem 1.55rem;
}

.profile__motion-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile__motion-tile {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
}

.profile__video {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  filter: grayscale(15%) contrast(1.05);
}

.profile__card--feature {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  min-height: 340px;
}

.profile__feature-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(20%) contrast(1.02);
}

.profile__feature-copy {
  padding: 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .profile__card--hero {
    grid-template-columns: 1fr;
  }
  .profile__hero-img {
    max-height: 360px;
  }
  .profile__card--feature {
    grid-template-columns: 1fr;
  }
  .profile__feature-media img {
    max-height: 320px;
  }
}

@media (max-width: 720px) {
  .profile {
    padding: 0 max(1.1rem, env(safe-area-inset-left, 0px)) 0
      max(1.1rem, env(safe-area-inset-right, 0px));
  }
  .profile__hero-copy {
    padding: 1.6rem 1.4rem 1.7rem;
  }
  .profile__duo,
  .profile__motion-row {
    grid-template-columns: 1fr;
  }
  .profile__tile img {
    height: 280px;
  }
  .profile__video {
    height: 260px;
  }
}

.contact {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contact__card {
  /* Dark frosted glass: keeps text contrast WCAG-safe over any slideshow photo. */
  background: rgba(12, 12, 14, 0.62);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-6) var(--space-5);
  color: #f5f5f5;
}

.contact__heading {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
  color: #ffffff;
  scroll-margin-top: calc(128px + env(safe-area-inset-top, 0px) + 1.25rem);
  overflow-wrap: anywhere;
}

.contact__intro {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--space-5);
  overflow-wrap: anywhere;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.contact__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.75rem;
}

.contact__label:first-of-type {
  margin-top: 0;
}

.contact__input,
.contact__textarea {
  width: 100%;
  padding: 0.75em 1em;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.contact__input::placeholder {
  color: rgba(0, 0, 0, 0.62);
}

.contact__input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.25);
}

.contact__textarea {
  resize: vertical;
  min-height: 90px;
  color: #0a0a0a;
  border-color: rgba(0, 0, 0, 0.18);
}

.contact__textarea::placeholder {
  color: rgba(0, 0, 0, 0.62);
}

.contact__textarea:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.25);
}

.contact__submit {
  margin-top: var(--space-3);
  padding: 0.85em 1.75em;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #141414;
  background: #e3f2e3;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-pill);
  transition:
    background var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.contact__submit:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.contact__submit:active {
  transform: scale(0.98);
}

.contact__social {
  display: flex;
  justify-content: center;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.contact__instagram {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.9rem;
  transition:
    background var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out);
}

.contact__instagram:hover {
  color: #000;
  background: #fff;
  box-shadow: var(--shadow-sm);
  opacity: 1;
}

.contact__instagram-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

@media (min-width: 769px) and (max-width: 1100px), (min-width: 769px) and (max-height: 920px) {
  .page--onepage .onepage-section--contact {
    aspect-ratio: auto;
    min-height: var(--contact-section-min-height, clamp(520px, 78vh, 760px));
    --contact-card-max-width: min(680px, calc(100% - 2.5rem));
    --contact-card-offset-y: 0px;
    padding: clamp(1rem, 2.5vh, 1.75rem) clamp(1rem, 2.5vw, 1.5rem);
  }

  .page--onepage .onepage-section--contact .contact {
    transform: none;
    max-height: none;
    height: auto;
  }

  .page--onepage .onepage-section--contact .contact__card {
    max-height: none;
    width: 100%;
  }

  .page--onepage .onepage-section--contact .contact__textarea {
    min-height: clamp(7rem, 22vh, 10rem);
  }
}

@media (min-width: 1101px) and (min-height: 921px) {
  .page--onepage .onepage-section--contact {
    --contact-card-max-width: min(720px, 56vw);
    --contact-card-offset-y: -4in;
  }
}

@media (min-width: 769px) {
  .page--onepage .onepage-section--contact .contact__card {
    padding: 2.5rem 2.5rem 1.75rem;
  }

  .page--onepage .onepage-section--contact .contact__heading {
    font-size: 1.5rem;
  }

  .page--onepage .onepage-section--contact .contact__intro {
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
  }

  .page--onepage .onepage-section--contact .contact__form {
    gap: 0.65rem;
    margin-bottom: 2.5rem;
  }

  .page--onepage .onepage-section--contact .contact__label {
    font-size: 0.9rem;
    margin-top: 0.9rem;
  }

  .page--onepage .onepage-section--contact .contact__input,
  .page--onepage .onepage-section--contact .contact__textarea {
    font-size: 1.05rem;
    padding: 0.85em 1.15em;
  }

  .page--onepage .onepage-section--contact .contact__textarea {
    min-height: 135px;
  }

  .page--onepage .onepage-section--contact .contact__submit {
    font-size: 0.9rem;
    padding: 1em 2.15em;
  }
}

@media (max-width: 768px) {
  :root {
    --gallery-pill-inner-min-height: 44px;
  }

  .gallery-bar {
    height: calc(104px + env(safe-area-inset-top, 0px));
  }

  .gallery-bar__anchor {
    margin-top: calc((104px - 52px) / 2);
    margin-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .gallery-bar__title,
  .gallery-bar__menu-link {
    font-size: clamp(1rem, 4.2vw, 1.45rem);
    letter-spacing: 0.1em;
  }

  .gallery-bar__menu-trigger {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .gallery-bar__menu-link {
    min-height: 40px;
  }

  /* Tighter vertical rhythm for stacked nav links on small screens */
  .gallery-bar__brand.gallery-bar__brand--open {
    gap: var(--space-1);
    background: rgba(250, 248, 245, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  body.page-home .gallery-bar__brand.gallery-bar__brand--open,
  body.page-full-gallery .gallery-bar__brand.gallery-bar__brand--open {
    background: rgba(0, 0, 0, 0.96);
  }

  .gallery-bar__menu-inner {
    gap: var(--space-1);
  }

  .page-center-title {
    display: none;
  }

  .header-social {
    top: calc((104px + env(safe-area-inset-top, 0px)) / 2);
    left: max(1.15rem, env(safe-area-inset-left, 0px));
    gap: 0.55rem;
  }

  .header-social__link {
    width: 44px;
    height: 44px;
  }

  .header-social__link svg {
    width: 24px;
    height: 24px;
  }

  .gallery-key-hint {
    display: none;
  }

  .page {
    padding: 0.8rem max(0.75rem, env(safe-area-inset-left, 0px))
      max(1rem, env(safe-area-inset-bottom, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px));
    padding-top: calc(104px + env(safe-area-inset-top, 0px) + 0.6rem);
  }

  .page.page--onepage {
    padding-top: calc(104px + env(safe-area-inset-top, 0px) + 0.75rem);
    padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    padding-left: 0;
    padding-right: 0;
  }

  /* Title band is in document flow; main top padding would double-clear the header. */
  body.page-home .page.page--onepage {
    padding-top: 0;
  }

  html {
    scroll-padding-top: calc(104px + env(safe-area-inset-top, 0px) + 1.25rem);
    /* Avoid smooth programmatic corrections feeling like a delayed jump on touch scroll. */
    scroll-behavior: auto;
  }

  body.page-home .gallery {
    overflow-anchor: none;
  }

  .onepage-section__heading,
  .contact__heading {
    scroll-margin-top: calc(104px + env(safe-area-inset-top, 0px) + 1.25rem);
  }

  .onepage-section {
    scroll-margin-top: calc(104px + env(safe-area-inset-top, 0px) + 1.25rem);
    min-height: 0;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

  /* Mobile: disable entrance animation for bio text + gallery heading. */
  .home-bio-row .home-intro.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .onepage-section--gallery .onepage-section__heading.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Justified grid: skip entrance motion on small screens (scroll perf). */
  .page--onepage #gallery-grid.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .home-bio-image.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Also disable if classes/timing differ while observer is attaching. */
  .home-bio-row .home-intro,
  .onepage-section--gallery .onepage-section__heading {
    transition: none !important;
    animation: none !important;
  }

  .onepage-section--gallery {
    margin-top: 0;
    padding-top: 3vh;
    background: transparent;
  }

  .onepage-section--contact {
    margin-top: clamp(0.5rem, 1.5vh, 1rem);
    padding-top: 0;
  }

  .page--onepage .onepage-section--home + .onepage-section--contact,
  .page--onepage .onepage-section--home + .onepage-section--contact,
  .page--onepage .onepage-section--gallery + .onepage-section--contact {
    margin-top: clamp(0.75rem, 2vh, 1.25rem);
    padding-top: 0;
  }

  .page--onepage .portfolio-toggle {
    margin-bottom: clamp(0.85rem, 2vh, 1.25rem);
  }

  .page--onepage .onepage-section--contact {
    aspect-ratio: auto;
    min-height: 0;
    padding: 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  }

  /* Mobile one-page contact: no photo layers; gradient scrims off. */
  .page--onepage .onepage-section--contact .contact-bg {
    display: none;
  }

  .page--onepage .onepage-section--contact::before,
  .page--onepage .onepage-section--contact::after {
    display: none;
  }

  /* Mobile standalone contact page: hide crossfade background. */
  body.page-contact .contact-bg {
    display: none;
  }

  /* One-page contact: avoid a nested flex/scroll chain (textarea filling the viewport)
     so wheel/touch scrolling stays on the document, not “inside” the contact block. */
  .page--onepage .onepage-section--contact {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  }

  .page--onepage .onepage-section--contact .contact {
    flex: 0 0 auto;
    display: block;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
  }


  .page--onepage .onepage-section--contact .contact__heading,
  .page--onepage .onepage-section--contact .contact__intro,
  .page--onepage .onepage-section--contact .contact__label,
  body.page-contact .page--contact .contact__heading,
  body.page-contact .page--contact .contact__intro,
  body.page-contact .page--contact .contact__label {
    color: #fff;
    /* Soft shadow keeps WCAG contrast when the photo backdrop has light patches. */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  }

  .page--onepage .onepage-section--contact .contact__form {
    flex: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .page--onepage .onepage-section--contact .contact__textarea {
    flex: none;
    min-height: clamp(11rem, 36vh, 16rem);
    resize: vertical;
    align-self: stretch;
  }

  .page--onepage .onepage-section--contact .contact__submit {
    margin-top: var(--space-2);
  }

  .page--onepage .onepage-section--contact .contact__social {
    margin-top: 0;
    padding-top: var(--space-3);
  }

  /* Instagram link: always visible on mobile (no scroll-reveal pop-in). */
  .page--onepage .onepage-section--contact .contact__social.reveal-on-scroll,
  body.page-contact .page--contact .contact__social.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Standalone contact page: same full-height message field on small screens. */
  body.page-contact .page--contact {
    min-height: 100dvh;
    min-height: 100lvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  body.page-contact .page--contact .contact {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 max(1rem, env(safe-area-inset-left, 0px)) 0 max(1rem, env(safe-area-inset-right, 0px));
  }


  body.page-contact .page--contact .contact__heading,
  body.page-contact .page--contact .contact__intro {
    flex-shrink: 0;
  }

  body.page-contact .page--contact .contact__form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  body.page-contact .page--contact .contact__form > .contact__label,
  body.page-contact .page--contact .contact__form > .contact__input {
    flex-shrink: 0;
  }

  body.page-contact .page--contact .contact__textarea {
    flex: 1 1 0;
    min-height: 8.25rem;
    resize: none;
    align-self: stretch;
  }

  body.page-contact .page--contact .contact__submit {
    flex-shrink: 0;
    margin-top: var(--space-2);
  }

  body.page-contact .page--contact .contact__social {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: var(--space-3);
  }

  .page--contact {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .page.page--contact {
    padding-top: calc(104px + env(safe-area-inset-top, 0px) + 2rem);
  }

  .contact {
    padding: 0;
  }

  .contact__card {
    padding: 1rem 0.9rem;
  }

  .contact__submit {
    min-height: 48px;
    width: 100%;
    max-width: 100%;
  }

  .portfolio-controls {
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0 max(0.75rem, env(safe-area-inset-left, 0px)) 0
      max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .portfolio-filters {
    justify-content: center;
  }

  .portfolio-filter {
    min-height: 44px;
    padding: 0.55em 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .portfolio-meta {
    font-size: 0.78rem;
  }

  .portfolio-grid {
    padding: 0 max(0.75rem, env(safe-area-inset-left, 0px))
      0
      max(0.75rem, env(safe-area-inset-right, 0px));
    gap: 0.45rem;
  }

  body.page-full-gallery .portfolio-grid {
    padding-left: 0;
    padding-right: 0;
  }

  .portfolio-toggle {
    margin-top: 0.35rem;
    margin-bottom: clamp(0.85rem, 2vh, 1.25rem);
    padding: 0 max(0.75rem, env(safe-area-inset-left, 0px))
      0 max(0.75rem, env(safe-area-inset-right, 0px));
  }

  body.page-home .onepage-section--home {
    --home-flow-heading-font: clamp(
      0.55rem,
      calc(
        (
            100vw - max(0.75rem, env(safe-area-inset-left, 0px)) -
              max(0.75rem, env(safe-area-inset-right, 0px))
          ) / 21
      ),
      1.25rem
    );
    --home-flow-header-offset: calc(104px + env(safe-area-inset-top, 0px) + 0.75rem);
    --home-flow-block-gap: calc(0.75rem + var(--space-3));
    gap: 0;
    padding-top: 0;
  }

  body.page-home .gallery {
    gap: 0.65rem;
    transform: none;
    margin-top: var(--home-flow-block-gap);
    margin-bottom: var(--home-flow-block-gap);
  }

  body.page-home .home-flow-heading {
    --home-flow-pill-bleed: 4rem;
    --home-flow-header-offset: calc(104px + env(safe-area-inset-top, 0px) + 0.75rem);
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
    width: calc(100vw + var(--home-flow-pill-bleed));
    max-width: none;
    margin-inline: calc(50% - 50vw - (var(--home-flow-pill-bleed) / 2));
    margin-top: 0;
    padding-top: var(--home-flow-header-offset);
    padding-inline: 1.15em;
    padding-bottom: calc(0.55em + 0.2in);
    font-family: var(--font-sans);
    font-size: var(--home-flow-heading-font, clamp(
      0.55rem,
      calc(
        (
            100vw - max(0.75rem, env(safe-area-inset-left, 0px)) -
              max(0.75rem, env(safe-area-inset-right, 0px))
          ) / 21
      ),
      1.25rem
    ));
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    text-wrap: nowrap;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-top: none;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .home-intro {
    max-width: min(44rem, calc(100% - 1.25rem));
    margin: var(--space-2) auto var(--space-2);
    padding: var(--space-3) max(0.85rem, env(safe-area-inset-left, 0px))
      var(--space-3) max(0.85rem, env(safe-area-inset-right, 0px));
    font-size: clamp(0.9rem, 3.2vw, 1rem);
    line-height: 1.45;
  }

  body.page-home .home-bio-row {
    width: auto;
    margin-top: 0;
    margin-left: max(0.9rem, env(safe-area-inset-left, 0px));
    margin-right: max(0.9rem, env(safe-area-inset-right, 0px));
    padding: 1.35rem max(1.15rem, env(safe-area-inset-left, 0px))
      1.35rem max(1.15rem, env(safe-area-inset-right, 0px));
  }

  .home-bio-copy {
    align-items: stretch;
    gap: var(--space-3);
    padding-inline: 0.25rem;
  }

  .home-bio-heading {
    padding: 0.35rem 0.5rem 0.15rem;
  }

  .home-bio-row .home-bio-copy {
    align-items: center;
    text-align: center;
  }

  .home-bio-row .home-intro {
    width: 100%;
    max-width: none;
    font-size: clamp(0.94rem, 3.15vw, 1.04rem);
    line-height: 1.58;
  }

  .home-start-btn {
    width: 100%;
    min-height: 52px;
    font-size: clamp(0.94rem, 3.8vw, 1.06rem);
  }

  .home-bio-row .home-start-btn.home-start-btn--pov {
    text-transform: none;
    letter-spacing: 0.05em;
    min-height: calc(var(--gallery-pill-inner-min-height) + 2 * var(--gallery-pill-pad-block));
  }

  .full-gallery-heading {
    max-width: 100%;
    margin-bottom: var(--space-4);
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    font-size: clamp(1.85rem, 9vw, 2.75rem);
    letter-spacing: -0.015em;
  }

  /* 2:3 portrait tiles: height tracks JS/CSS --flow-item-width. */
  .gallery-row {
    height: calc(var(--flow-item-width, 200px) * 1.5);
  }

  /* Flow tiles stay tappable on mobile; hover effects disabled in shared touch query above. */
  .gallery-row .media-item {
    pointer-events: auto;
    touch-action: manipulation;
  }

  .gallery-flow-arrow {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    transform: none;
  }

  /* Mobile: hide home flow arrows; keep lightbox arrows unaffected. */
  .page--onepage .gallery .gallery-flow-arrow {
    display: none;
  }

  .gallery-flow-arrow--left {
    left: max(10px, env(safe-area-inset-left, 0px));
  }

  .gallery-flow-arrow--right {
    right: max(10px, env(safe-area-inset-right, 0px));
  }

  .gallery-flow-arrow:active {
    transform: scale(0.96);
  }
}

@media (max-width: 414px) {
  .header-social {
    left: max(0.9rem, env(safe-area-inset-left, 0px));
  }

  .gallery-bar__anchor {
    margin-right: max(0.6rem, env(safe-area-inset-right, 0px));
  }

  .gallery-bar__brand {
    padding: 0.35em 0.7em 0.35em;
    max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 0.5rem);
  }

  .gallery-bar__title,
  .gallery-bar__menu-link {
    font-size: clamp(0.86rem, 4.2vw, 0.98rem);
    letter-spacing: 0.08em;
  }
  .onepage-section--gallery {
    margin-top: 0;
    padding-top: 2vh;
  }

  .onepage-section--contact {
    margin-top: clamp(0.5rem, 1.5vh, 1rem);
    padding-top: 0;
  }

  .page--onepage .onepage-section--home + .onepage-section--contact,
  .page--onepage .onepage-section--gallery + .onepage-section--contact {
    margin-top: clamp(0.75rem, 2vh, 1.25rem);
  }

  .onepage-section__heading {
    padding: 0 var(--space-4);
    font-size: clamp(1.28rem, 8vw, 1.85rem);
    letter-spacing: 0.1em;
  }

  .portfolio-controls {
    gap: 0.4rem;
    padding-left: max(0.6rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.6rem, env(safe-area-inset-right, 0px));
  }

  .portfolio-filter {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    padding: 0.5em 0.95em;
  }

  .portfolio-grid {
    gap: 0.4rem;
  }

  .portfolio-toggle {
    margin-top: 0.35rem;
    margin-bottom: clamp(0.85rem, 2vh, 1.25rem);
  }

  .portfolio-row {
    gap: 10px;
  }

  .portfolio-toggle__button {
    font-size: clamp(0.82rem, 3.4vw, 0.95rem);
    letter-spacing: 0.1em;
    padding: 0.95em 1.85em;
    min-height: 46px;
  }

  .home-intro {
    margin: var(--space-1) auto var(--space-2);
    border-radius: var(--radius-md);
  }

  .home-bio-row {
    margin-left: max(0.95rem, env(safe-area-inset-left, 0px));
    margin-right: max(0.95rem, env(safe-area-inset-right, 0px));
    padding: 1.25rem max(1rem, env(safe-area-inset-left, 0px))
      1.25rem max(1rem, env(safe-area-inset-right, 0px));
  }

  .home-bio-heading {
    padding: 0.3rem 0.4rem 0.1rem;
  }

  .home-start-btn {
    min-height: 48px;
    font-size: clamp(0.9rem, 4vw, 1rem);
    letter-spacing: 0.12em;
  }

  .home-bio-row .home-start-btn.home-start-btn--pov {
    text-transform: none;
    letter-spacing: 0.045em;
    min-height: calc(var(--gallery-pill-inner-min-height) + 2 * var(--gallery-pill-pad-block));
  }

  .contact {
    max-width: 100%;
    padding: 0 max(0.75rem, env(safe-area-inset-left, 0px))
      0 max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .contact__card {
    padding: 1.15rem 0.95rem;
  }

  .contact__heading {
    font-size: 1.03rem;
    letter-spacing: 0.09em;
  }

  .contact__intro {
    font-size: 0.88rem;
  }

  .contact__textarea {
    width: calc(100% - 1.5rem);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .page--onepage .onepage-section--contact .contact__textarea {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    flex: none;
    min-height: clamp(11rem, 36vh, 16rem);
    resize: vertical;
  }

  body.page-contact .page--contact .contact__textarea {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    flex: 1 1 0;
    min-height: 8.25rem;
  }

  .page--onepage .onepage-section--contact .contact__card {
    padding-left: max(0.95rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.95rem, env(safe-area-inset-right, 0px));
    padding-top: 1.15rem;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  }

  body.page-contact .page--contact .contact__card {
    padding-left: max(0.95rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.95rem, env(safe-area-inset-right, 0px));
    padding-top: 1.15rem;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  }

  .contact__instagram {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.7rem;
  }
}

@media (max-width: 360px) {
  .gallery-bar__brand {
    padding: 0.3em 0.55em 0.3em;
  }

  .gallery-bar__title,
  .gallery-bar__menu-link {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
  }

  .gallery-bar__menu-content {
    max-width: min(72vw, 14rem);
  }

  .home-intro {
    padding: 0.85rem 0.75rem;
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .portfolio-filter {
    font-size: 0.65rem;
    padding: 0.48em 0.78em;
  }

  .portfolio-meta {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .contact__instagram {
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.42rem 0.6rem;
  }
}

/* Lightbox full-screen view */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  /* Disable browser double-tap-to-zoom inside the lightbox so quick taps on the
     nav arrows advance images instead of zooming the page. */
  touch-action: manipulation;
}

.lightbox[data-state="open"] {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: min(95vw, 1200px);
  max-height: 90vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, #12141a 0%, #0a0b0e 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.lightbox__media {
  position: relative;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.lightbox__image,
.lightbox__video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.lightbox__image[data-active="true"],
.lightbox__video[data-active="true"] {
  display: block;
}

/* Controls are anchored to the image content box (which is sized to the photo),
   so the arrows are always perfectly centered on the image vertically and sit
   just inside its left/right edges — on every aspect ratio and screen size. */
.lightbox__close {
  position: absolute;
  top: clamp(10px, 1.4vw, 18px);
  right: clamp(10px, 1.4vw, 18px);
  transform: none;
  width: clamp(44px, 3.4vw, 56px);
  height: clamp(44px, 3.4vw, 56px);
  border-radius: var(--radius-pill);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1;
  font-weight: 300;
  color: #000000;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  z-index: 3;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.lightbox__close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox__close:hover {
  color: #000000;
  background: #ffffff;
  transform: scale(1.05);
}

.lightbox__close:active {
  transform: scale(0.94);
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(46px, 3.8vw, 60px);
  height: clamp(46px, 3.8vw, 60px);
  border-radius: var(--radius-pill);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #000000;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  z-index: 3;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.lightbox__arrow--prev {
  left: clamp(10px, 1.4vw, 20px);
}

.lightbox__arrow--next {
  right: clamp(10px, 1.4vw, 20px);
}

.lightbox__arrow:hover {
  background: #ffffff;
}

.lightbox__arrow:hover {
  transform: translateY(-50%) scale(1.05);
}

.lightbox__arrow:active {
  transform: translateY(-50%) scale(0.94);
}

/* Chevron glyph is symmetric and centered within the button (no offsets). */
.lightbox__arrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox__arrow-icon svg {
  width: 46%;
  height: 46%;
  flex-shrink: 0;
  display: block;
}

/* Phones: slightly smaller controls, snug to the image edges */
@media (max-width: 768px) {
  .lightbox {
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }

  .lightbox__content {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 0.65rem;
  }

  .lightbox__image,
  .lightbox__video {
    max-height: min(82dvh, 100%);
  }

  .lightbox__close {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }

  .lightbox__arrow {
    width: 42px;
    height: 42px;
  }
}

/* Landscape phones: a touch more image height */
@media (max-width: 900px) and (orientation: landscape) {
  .lightbox__image,
  .lightbox__video {
    max-height: min(90dvh, 100%);
  }
}
