:root {
  --bg: #050506;
  --fg: #f2f2ef;
  --dim: rgba(242, 242, 239, 0.55);
  --accent: #2f52e0;      /* royal blue */
  --accent-soft: #8aa2ff; /* lighter shade for text links on dark bg */
  --overlay-bg: rgba(8, 8, 9, 0.985);
  --mono: "Space Mono", "Heebo", monospace;
  --header-h: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Present for search engines / screen readers, invisible on screen */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Heebo", system-ui, sans-serif;
  overflow: hidden;
}

/* ---------- WebGL scene ---------- */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#scene canvas {
  display: block;
  touch-action: none; /* let drag-to-look work on touch screens */
}
#scene.tile-hover { cursor: pointer; }

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.6) 100%);
}

/* Subtle blur on the edges of the sphere view */
#edge-blur {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 52%, black 90%);
  mask-image: radial-gradient(ellipse at center, transparent 52%, black 90%);
}

/* Dissolve that hides the end of the zoom-through, where the low-res
   tile would otherwise be seen scaling up at full screen */
#zoom-fade {
  position: fixed;
  inset: 0;
  z-index: 15; /* above the canvas, below the gallery overlay */
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#zoom-fade.show { opacity: 1; }

#intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 1.1s ease;
}
#intro.done { opacity: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: var(--header-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.logo {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link,
.lang-btn,
.btn-talk {
  font-family: inherit;
  font-size: 15px;
  border: none;
  background: none;
  color: var(--fg);
  cursor: pointer;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

/* Same energy as the Let's Talk pill: invert to a solid white pill */
.nav-link:hover {
  background: var(--fg);
  color: #0a0a0c;
  transform: scale(1.05);
}

.lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  min-width: 46px;
  font-weight: 600;
}
.lang-btn:hover { border-color: var(--fg); }

.btn-talk {
  background: #f2f2ef;
  color: #0a0a0c;
  font-weight: 800;
}
.btn-talk:hover { transform: scale(1.05); }

/* Small mono studio line under the top edge, phantom.land style */
.site-tag {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 31;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(242, 242, 239, 0.7);
  pointer-events: none;
}
@media (max-width: 980px) {
  .site-tag { display: none; }
}

/* ---------- Caption + hint ---------- */
.caption {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom));
  inset-inline: 0;
  z-index: 5;
  text-align: center;
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
.caption.show {
  opacity: 1;
  transform: translateY(0);
}

.hint {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  inset-inline: 0;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--overlay-bg);
  transform: translateY(100%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  padding: var(--header-h) 28px 48px;
  visibility: hidden;
}
.overlay.open {
  transform: none;
  visibility: visible;
}

/* Fade variant: used by the gallery so the zoom-through-the-image
   transition crossfades instead of sliding */
.overlay.fade {
  transform: none;
  opacity: 0;
  transition: opacity 0.38s ease, visibility 0.38s;
}
.overlay.fade.open {
  opacity: 1;
}

.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 24px;
}
.overlay-head h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.close {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none;
  color: var(--fg);
  font-size: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease, color 0.25s ease;
}
.close:hover {
  background: var(--fg);
  color: #101010;
}

/* Gallery grids */
.photo-grid {
  column-count: 3;
  column-gap: 16px;
}
.photo-grid img {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  display: block;
  background: #2e2e33;
  cursor: zoom-in;
}

.photo-grid video {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  display: block;
  background: #2e2e33;
}

/* Cascade reveal: the opening screenful rises in as one choreographed
   sequence (see revealInSequence in main.js); later items dissolve in as
   they load. A soft shimmer covers any file still arriving. */
.photo-grid img,
.photo-grid video,
.video-grid video,
.photo-grid .embed,
.video-grid .embed {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  object-fit: cover;
  background: linear-gradient(110deg, #131316 30%, #1e1e23 45%, #131316 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer {
  to { background-position-x: -200%; }
}
.photo-grid img.loaded,
.photo-grid video.loaded,
.video-grid video.loaded,
.photo-grid .embed.loaded,
.video-grid .embed.loaded {
  opacity: 1;
  transform: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
  align-items: start; /* every clip keeps its own height */
}
.video-grid video {
  width: 100%;
  /* fallback only — main.js sets each clip's real ratio inline */
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #2e2e33;
}
/* Footage is never cropped, whatever the frame it sits in */
.photo-grid video,
.video-grid video {
  object-fit: contain;
}

/* Named sections inside a gallery (Weddings, Commercials…) */
.section-title {
  margin: 40px 0 16px;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.sectioned > .section-title:first-child { margin-top: 0; }

/* Videos hosted on YouTube/Vimeo */
.embed {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #101013;
  aspect-ratio: 16 / 9; /* overridden inline per clip */
}
.photo-grid .embed { margin-bottom: 16px; display: block; }
.embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* About */
.about-wrap {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  max-width: 1100px;
}
.about-photo {
  width: min(340px, 38vw);
  border-radius: 10px;
  flex-shrink: 0;
}
.about-text p {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 300;
  line-height: 1.75;
  max-width: 60ch;
  margin: 0 0 1.2em;
}

/* Contact */
.contact-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
}
.contact-sub {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 300;
  color: var(--dim);
  margin: 0;
  max-width: 40ch;
}
.contact-mail {
  font-size: clamp(20px, 3.2vw, 36px);
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
  direction: ltr; /* email stays LTR in Hebrew too */
}
/* Hover colour is picked in the admin page (--mail-hover) */
.contact-mail:hover {
  color: var(--mail-hover, var(--accent-soft));
  border-color: var(--mail-hover, var(--accent-soft));
}

.contact-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.25s ease, border-color 0.25s ease,
    color 0.25s ease, transform 0.15s ease;
}
.contact-btn svg { width: 20px; height: 20px; }
.contact-btn.wa svg { color: #25d366; }
.contact-btn.ig svg { color: #e1306c; }
.contact-btn:hover { transform: scale(1.04); }
.contact-btn.wa:hover {
  background: #25d366;
  border-color: #25d366;
  color: #06130a;
}
.contact-btn.wa:hover svg { color: #06130a; }
.contact-btn.ig:hover {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  border-color: transparent;
  color: #fff;
}
.contact-btn.ig:hover svg { color: #fff; }

.contact-rows {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}
.contact-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.contact-label { color: var(--dim); }
.contact-row a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  direction: ltr;
}
.contact-row a:hover { color: var(--accent-soft); }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(24, 24, 27, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  cursor: zoom-out;
}
#lightbox.open {
  opacity: 1;
  visibility: visible;
}
#lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#lightbox img.loaded { opacity: 1; transform: none; }
/* Directional slide when stepping through the gallery with the arrows */
#lightbox img.nav-left:not(.loaded) {
  transform: translateX(-36px) scale(0.985);
  transition: none;
}
#lightbox img.nav-right:not(.loaded) {
  transform: translateX(36px) scale(0.985);
  transition: none;
}

/* The clicked grid photo expanding into the lightbox (see flipFrom in
   main.js): a fixed-position copy that animates from the thumbnail's
   rectangle to the lightbox position, then fades away. */
.lightbox-flip {
  position: fixed;
  z-index: 52;
  border-radius: 6px;
  object-fit: cover;
  transform-origin: top left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  will-change: transform;
  pointer-events: none;
}
.lightbox-flip.fade { opacity: 0; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 10, 12, 0.45);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease;
}
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-nav.prev { left: 22px; }
.lightbox-nav.next { right: 22px; }
.lightbox-nav:hover {
  background: var(--fg);
  color: #101010;
}
@media (max-width: 600px) {
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-nav.prev { left: 10px; }
  .lightbox-nav.next { right: 10px; }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  inset-inline-end: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none;
  color: var(--fg);
  font-size: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-close:hover {
  background: var(--fg);
  color: #101010;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .photo-grid { column-count: 2; }
  .about-wrap { flex-direction: column; }
  .about-photo { width: min(340px, 70vw); }
}

@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .logo { font-size: 15px; letter-spacing: 0.12em; }
  .nav-link, .lang-btn, .btn-talk { font-size: 13px; padding: 7px 10px; }
  .photo-grid { column-count: 1; }
  .overlay { padding: var(--header-h) 16px calc(32px + env(safe-area-inset-bottom)); }
  .caption { bottom: calc(56px + env(safe-area-inset-bottom)); }
}
