:root {
  --gallery-bg: #f8f4ee;
  --gallery-surface: #fffaf4;
  --gallery-text: #171412;
  --gallery-muted: #746b62;
  --gallery-border: rgba(23,20,18,.13);
  --gallery-accent: #9f7f5c;
  --gallery-shadow: 0 28px 90px rgba(58,47,36,.12);
  --gallery-radius: 22px;
  --gallery-gap: 18px;
  --serif: "Cormorant Garamond", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--gallery-bg);
  color: var(--gallery-text);
  font-family: var(--sans);
  /* Cormorant's default numbers dip below the line and its 1 reads like an I. Use the even-height set. */
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 3px; }
.gallery-client { min-height: 100vh; background: var(--gallery-bg); }
.gallery-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(14px, 4vw, 42px);
  border-bottom: 1px solid var(--gallery-border);
  background: color-mix(in srgb, var(--gallery-bg) 86%, transparent);
  backdrop-filter: blur(18px);
}
.gallery-nav strong, .client-hero h1, .section-heading h2, .modal-card h2 { font-family: var(--serif); font-weight: 400; }
.gallery-nav div, .gallery-nav nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gallery-nav a, .gallery-nav button, .gallery-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gallery-border);
  border-radius: 999px;
  background: transparent;
  color: var(--gallery-text);
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.gallery-nav button[data-primary], .gallery-btn[data-primary] { background: var(--gallery-text); color: var(--gallery-bg); }
.client-hero {
  min-height: 92vh;
  display: grid;
  align-items: end;
  padding: clamp(24px, 6vw, 70px);
  background-size: cover;
  background-position: var(--cover-position, center);
  position: relative;
  isolation: isolate;
}
.client-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.58)), radial-gradient(circle at 20% 20%, rgba(255,255,255,.14), transparent 26rem);
}
.client-hero__copy { position: relative; z-index: 1; max-width: 920px; color: #fffaf2; }
/* Cover effect (falling petals/snow): over the photo, under the words. */
.client-hero .petal-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* "Watch the film" next to "View Gallery", and the full-screen player. */
.client-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.client-hero__film { gap: 8px; border-color: rgba(255,250,242,.7); background: rgba(0,0,0,.25); color: #fffaf2; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.client-hero__film span { font-size: 9px; }
body.film-open { overflow: hidden; }
.film-section { padding: clamp(32px, 6vw, 72px) clamp(18px, 5vw, 64px) 0; }
.film-card { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #111 center / cover no-repeat; cursor: pointer; }
.film-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.42)); transition: background .3s ease; }
.film-card:hover::before { background: linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.32)); }
.film-card__play { position: relative; display: grid; place-items: center; width: 74px; height: 74px; padding-left: 5px; border: 1px solid rgba(255,250,242,.8); border-radius: 50%; background: rgba(0,0,0,.28); color: #fffaf2; font-size: 22px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.film-card:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 4px; }
.film-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8,6,5,.92); }
.film-layer__box { width: min(1100px, 100%); display: grid; gap: 12px; }
.film-layer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fffaf2; }
.film-layer__bar strong { font-family: var(--serif); font-size: 20px; font-weight: 400; color: rgba(255,250,242,.85); }
/* Close: a thin, quiet × that does not pull the eye from the film. Still a
   44px tap target; brighter on hover/focus. Tapping outside or Esc also close. */
.film-layer__close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: rgba(255,250,242,.55); cursor: pointer; transition: color .2s ease, background .2s ease; }
.film-layer__close:hover, .film-layer__close:focus-visible { color: #fffaf2; background: rgba(255,250,242,.08); }
.film-layer__close:focus-visible { outline: 1px solid rgba(255,250,242,.6); outline-offset: 2px; }
.film-layer__frame { position: relative; aspect-ratio: 16 / 9; max-height: calc(100vh - 110px); background: #000; border-radius: 10px; overflow: hidden; }
.film-layer__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--gallery-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.client-hero h1 { margin: 0; font-size: clamp(54px, 10vw, 136px); line-height: .9; }
.client-hero p { max-width: 660px; color: rgba(255,250,242,.78); line-height: 1.75; }
.gallery-intro, .gallery-section, .profile-card, .not-found, .password-screen {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}
.gallery-intro { display: grid; gap: 18px; padding: clamp(58px, 10vw, 120px) 0; }
.gallery-intro h2 { max-width: 880px; margin: 0; font-family: var(--serif); font-size: clamp(40px, 7vw, 92px); font-weight: 400; line-height: .98; }
.gallery-intro p, .section-heading p, .profile-card p { color: var(--gallery-muted); line-height: 1.75; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.section-nav a { border: 1px solid var(--gallery-border); border-radius: 999px; padding: 9px 12px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gallery-section { padding: clamp(34px, 7vw, 84px) 0; }
.section-heading { display: grid; gap: 10px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(42px, 7vw, 84px); line-height: .96; }
.photo-layout { display: grid; gap: var(--gallery-gap); }
.layout-editorial { grid-template-columns: repeat(6, 1fr); }
.layout-editorial .photo-tile { grid-column: span 3; }
.layout-editorial .photo-tile:nth-child(4n+1) { grid-column: span 4; }
.layout-editorial .photo-tile:nth-child(4n+2) { grid-column: span 2; }
.layout-masonry { columns: 3 260px; column-gap: var(--gallery-gap); display: block; }
.layout-masonry .photo-tile { break-inside: avoid; margin-bottom: var(--gallery-gap); }
.layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Filmstrip: every photo has the same height; the width follows its shape (wide or tall). */
.layout-filmstrip { --strip-height: min(58.5vw, 465px); display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.layout-filmstrip .photo-tile { flex: 0 0 calc(var(--strip-height) * 4 / 3); scroll-snap-align: start; }
.layout-filmstrip .photo-tile[data-orientation="portrait"] { flex-basis: calc(var(--strip-height) * 3 / 4); }
.photo-tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius);
  background: var(--gallery-surface);
  box-shadow: var(--gallery-shadow);
}
.photo-tile button.image-button { width: 100%; display: block; border: 0; padding: 0; background: transparent; }
.photo-tile img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: color-mix(in srgb, var(--gallery-text) 8%, transparent); }
.photo-tile[data-orientation="portrait"] img { aspect-ratio: 3 / 4; }
.photo-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 7px;
}
.photo-tools button { min-width: 38px; min-height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(0,0,0,.42); color: white; }
.photo-caption { padding: 12px 14px; color: var(--gallery-muted); line-height: 1.55; }
.profile-card { margin-top: 50px; margin-bottom: 70px; padding: clamp(24px, 5vw, 44px); border: 1px solid var(--gallery-border); border-radius: var(--gallery-radius); background: var(--gallery-surface); box-shadow: var(--gallery-shadow); }
.footer { padding: 32px 14px 50px; text-align: center; color: var(--gallery-muted); }
.profile-card .profile-note { font-family: var(--serif); font-style: italic; font-size: 1.15em; color: var(--gallery-text, inherit); }
.footer-brand { display: grid; justify-items: center; gap: 10px; }
.footer-brand small, .footer-brand span { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.footer-brand strong { font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: .04em; color: var(--gallery-text, currentColor); }
.password-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.password-screen--link { padding: 24px 16px; background: radial-gradient(circle at 30% 20%, #e9d8bd, #d7c4ab 48%, #ad957d); }
.password-screen--link .gallery-btn { width: 100%; }
.password-card, .modal-card {
  width: min(480px, 100%);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius);
  background: var(--gallery-surface);
  box-shadow: var(--gallery-shadow);
}
.password-card h1 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(42px, 9vw, 76px); font-weight: 400; line-height: .95; }
.password-card form, .modal-card form { display: grid; gap: 12px; }
.password-card input, .modal-card input {
  min-height: 46px;
  border: 1px solid var(--gallery-border);
  border-radius: 999px;
  padding: 0 15px;
  background: transparent;
  color: var(--gallery-text);
}
.error { color: #a33; font-weight: 700; }
.password-card .error:empty { display: none; }
/* Gallery link password: Show/Hide inside the box, Open Gallery right below. */
.password-field { position: relative; }
.password-card .password-field input { width: 100%; padding-right: 74px; font-size: 16px; }
.password-field__toggle { position: absolute; top: 50%; right: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--gallery-muted, #6f645b); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transform: translateY(-50%); cursor: pointer; }
.password-field__toggle:focus-visible { outline: 1px solid var(--gallery-text); outline-offset: 2px; }
.password-screen--link .remember-phone { justify-self: center; font-size: 14px; }
@media (max-width: 640px) {
  /* Less height above the box, so the box and Open Gallery fit above the keyboard. */
  .password-screen--link { place-items: start center; padding-top: 32px; }
  .password-screen--link .password-card h1 { font-size: clamp(38px, 11vw, 52px); }
}
.modal-backdrop, .lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
}
.modal-backdrop[data-open="true"], .lightbox[data-open="true"] { display: grid; }
.modal-card { background: var(--gallery-bg); }
.lightbox { z-index: 40; background: rgba(0,0,0,.92); color: #fffaf2; }
.lightbox__frame { width: min(1180px, 100%); display: grid; gap: 12px; }
.lightbox img { width: 100%; max-height: 74vh; object-fit: contain; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lightbox__bar div { display: flex; flex-wrap: wrap; gap: 8px; }
.lightbox button { border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.08); color: #fffaf2; padding: 10px 13px; }
.favorite-count { margin-left: .5em; color: var(--gallery-accent); }
.photo-tools button[aria-pressed="true"] { background: rgba(255,250,242,.94); color: #a8433a; }
.favorites-card { max-height: calc(100dvh - 36px); display: grid; gap: 14px; overflow-y: auto; padding: 22px; }
.favorites-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.favorites-head h2 { margin: 0; font-size: clamp(28px, 7vw, 40px); line-height: 1; }
.favorites-close { flex: none; width: 40px; height: 40px; border: 1px solid var(--gallery-border); border-radius: 999px; background: transparent; color: var(--gallery-text); font-size: 20px; line-height: 1; }
.favorites-summary, .favorites-help { margin: 0; color: var(--gallery-muted); font-size: 14px; line-height: 1.6; }
.favorites-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.favorites-grid:empty { display: none; }
.favorite-thumb { position: relative; margin: 0; overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--gallery-text) 8%, transparent); }
.favorite-thumb img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }
.favorite-thumb button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; }
.favorites-send { display: grid; gap: 12px; }
.favorites-send[hidden] { display: none; }
.favorites-note { display: grid; gap: 6px; color: var(--gallery-muted); font-size: 13px; }
.favorites-note textarea { width: 100%; border: 1px solid var(--gallery-border); border-radius: 14px; padding: 12px 14px; background: transparent; color: var(--gallery-text); font: inherit; font-size: 16px; resize: vertical; }
.favorites-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.favorites-actions .gallery-btn { min-height: 46px; }
.modal-card .share-link { width: 100%; font-size: 16px; text-overflow: ellipsis; }
.modal-card .favorites-note input { width: 100%; font-size: 16px; }
.modal-status { margin: 0; color: var(--gallery-text); font-size: 14px; line-height: 1.6; }
.modal-status:empty { display: none; }
.gallery-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  width: max-content;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--gallery-text);
  color: var(--gallery-bg);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.gallery-toast[data-open="true"] { opacity: 1; transform: translate(-50%, 0); }
.not-found { min-height: 80vh; display: grid; place-items: center; text-align: center; }
body[data-theme="cinema"] .photo-tile { box-shadow: none; }
body[data-theme="cinema"] .client-hero::before { background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.12), rgba(0,0,0,.64)); }
body[data-theme="lumen"] .client-hero::before { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(42,35,29,.45)); }
@media (max-width: 760px) {
  .gallery-nav { flex-direction: column; gap: 8px; padding-block: 10px; }
  .gallery-nav div { flex-wrap: nowrap; justify-content: space-between; gap: 12px; }
  .gallery-nav strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gallery-nav div .eyebrow { flex: none; margin: 0; }
  .gallery-nav nav { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .gallery-nav a, .gallery-nav button { flex: 1 1 auto; min-height: 34px; padding-inline: 8px; font-size: 8px; white-space: nowrap; }
  .client-hero { min-height: 82vh; padding: 22px; }
  .layout-editorial, .layout-grid { grid-template-columns: 1fr; }
  .layout-editorial .photo-tile, .layout-editorial .photo-tile:nth-child(4n+1), .layout-editorial .photo-tile:nth-child(4n+2) { grid-column: auto; }
  .layout-filmstrip { --strip-height: 64.5vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Owner preview: a quiet note at the very top, only on gallery-client.html?owner=… */
.owner-preview-bar { margin: 0; padding: 9px 16px; background: #1c1612; color: #f3ece2; font-size: 12px; letter-spacing: .02em; line-height: 1.5; text-align: center; }
