/* ------------------------------------------------------------------
   réelirréel – site styles
   ------------------------------------------------------------------ */

:root {
  --color-primary: #000000;
  --color-secondary: #54595f;
  --color-text: #7a7a7a;
  --color-accent: #d9d9d9;
  --color-bg: #ffffff;
  --color-panel: #f0f0f0;
  --color-panel-backdrop: rgba(223, 223, 223, 0.8);
  --color-lightbox: rgba(8, 8, 8, 0.95);
  --color-lightbox-ui: rgba(237, 237, 237, 0.9);

  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --page-pad: 10px;
  --gallery-pad: 51px;
  --gallery-gap: clamp(24px, 4.2vw, 72px);
  --gallery-cols: 4;
  --blur: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-text); }

:focus-visible { outline: 1px solid var(--color-secondary); outline-offset: 4px; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */

.site-header {
  position: relative;
  padding: var(--page-pad);
  text-align: center;
}

.site-logo {
  display: inline-block;
  line-height: 0;
}

.site-logo img {
  width: 100px;
  height: auto;
  transition: filter 0.3s;
}

.site-logo:hover img {
  filter: brightness(191%) blur(2.8px);
}

.site-nav { display: contents; }

.nav-link {
  position: fixed;
  top: 0;
  z-index: 45; /* above the sheet backdrop so About / Contact can switch sheets */
  padding: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-primary);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0);
  transition: color 0.3s, background-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible { color: var(--color-secondary); }

.nav-link--about { left: 0; }
.nav-link--contact { right: 0; }

/* once the page has scrolled, a soft frosted pill keeps the links legible over images */
body.is-scrolled .nav-link {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.03);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}

body.is-scrolled .nav-link--about { transform: translate(8px, 8px); }
body.is-scrolled .nav-link--contact { transform: translate(-8px, 8px); }

.nav-link[aria-expanded="true"] { color: var(--color-secondary); }

/* ------------------------------------------------------------------
   Gallery grid
   ------------------------------------------------------------------ */

.gallery {
  padding: var(--gallery-pad);
  margin: 0 var(--page-pad) var(--page-pad);
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols), minmax(0, 1fr));
  gap: var(--gallery-gap);
}

.noscript { grid-column: 1 / -1; text-align: center; }

.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 1px;
  background-color: #eee;
  background-size: cover;
  background-position: center;
  -webkit-tap-highlight-color: transparent;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--blur));
  transform: scale(1.04); /* hide blurred edges */
  opacity: 0;
  transition: filter 0.4s ease-in-out, opacity 0.5s ease, transform 0.4s ease-in-out;
  will-change: filter;
}

.tile img.is-loaded { opacity: 1; }

.tile:hover img,
.tile:focus-visible img,
.tile.is-revealed img {
  filter: blur(0);
  transform: scale(1);
}

/* Touch devices never get a hover: reveal tiles as they enter the viewport. */
@media (hover: none) {
  .tile img { filter: blur(0); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tile img { filter: blur(0); transform: none; transition: opacity 0.3s; }
}

/* ------------------------------------------------------------------
   Bottom sheet (About / Contact)
   ------------------------------------------------------------------ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 20, 20, 0.28);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.sheet-backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(100%, 920px);
  max-height: min(82vh, 82dvh);
  display: flex;
  flex-direction: column;
  background: var(--color-panel);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.14);
  transform: translate3d(-50%, 100%, 0);
  transition: transform 0.55s var(--ease);
  touch-action: none;
  will-change: transform;
}

.sheet.is-open { transform: translate3d(-50%, 0, 0); }
.sheet.is-dragging { transition: none; }

/* grab handle */
.sheet-handle {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  cursor: grab;
}

.sheet-handle::before {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
}

.sheet-inner {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 48px 48px;
  touch-action: pan-y;
}

.sheet-title {
  margin: 0 0 18px;
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: -1.3px;
  color: var(--color-primary);
}

.sheet-columns {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
}

.sheet-columns > * { flex: 1 1 0; min-width: 0; }

.sheet-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
}

.sheet-text p { margin: 0 0 1em; }
.sheet-text p:last-child { margin-bottom: 0; }
.sheet-text a { color: var(--color-text); text-decoration: underline; text-underline-offset: 2px; }
.sheet-text a:hover { color: var(--color-primary); }

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 34px;
  text-align: center;
  color: var(--color-primary);
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
}

.sheet-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

/* text settles in line by line once the sheet is up */
.sheet .sheet-inner > *,
.sheet .sheet-columns > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.7s var(--ease);
}

.sheet.is-open .sheet-inner > *,
.sheet.is-open .sheet-columns > * {
  opacity: 1;
  transform: none;
}

.sheet.is-open .sheet-title                 { transition-delay: 0.18s; }
.sheet.is-open .sheet-columns               { opacity: 1; transform: none; transition: none; }
.sheet.is-open .sheet-columns > :nth-child(1) { transition-delay: 0.26s; }
.sheet.is-open .sheet-columns > :nth-child(2) { transition-delay: 0.34s; }
.sheet.is-open .sheet-inner > .sheet-text    { transition-delay: 0.42s; }
.sheet.is-open .sheet-inner > .sheet-text + .sheet-text { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop,
  .sheet .sheet-inner > *, .sheet .sheet-columns > * { transition-duration: 0.01s; transition-delay: 0s; }
}

/* ------------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------------ */

.lightbox {
  --lb-top: 48px;
  --lb-bottom: 64px;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  color: var(--color-lightbox-ui);
  opacity: 0;
  transition: opacity 0.25s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox.is-open { opacity: 1; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-lightbox);
}

.lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 1px;
  transition: opacity 0.3s;
}

.lightbox-tools { display: flex; gap: 2px; }

.lightbox-btn,
.lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-lightbox-ui);
  opacity: 0.75;
  transition: opacity 0.2s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-btn { width: 36px; height: 36px; border-radius: 50%; }
.lightbox-btn svg { width: 18px; height: 18px; }
.lightbox-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); opacity: 1; }

.lightbox-btn:hover,
.lightbox-nav:hover,
.lightbox-btn:focus-visible,
.lightbox-nav:focus-visible { opacity: 1; }

.lightbox svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 64px;
  height: 120px;
  margin-top: -60px;
}

.lightbox-nav svg { width: 28px; height: 28px; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }
.lightbox-nav:disabled { opacity: 0.15; cursor: default; }

.lightbox-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--lb-top) 0 var(--lb-bottom);
  will-change: transform;
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  cursor: zoom-in;
}

.slide img.is-zoomable-out { cursor: zoom-out; }

.slide-frame {
  --ratio: 1;
  --natural-w: 10000px;
  position: relative;
  display: flex;
  aspect-ratio: var(--ratio);
  /* as large as the viewport allows, never beyond the image's native width */
  width: min(100%, calc((100vh - var(--lb-top) - var(--lb-bottom)) * var(--ratio)), var(--natural-w));
  width: min(100%, calc((100dvh - var(--lb-top) - var(--lb-bottom)) * var(--ratio)), var(--natural-w));
  max-height: 100%;
}

/* the thumbnail shown instantly while the full-size image loads */
.slide-frame .slide-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.slide-frame.is-ready .slide-preview { opacity: 0; }

.slide-frame .slide-full { opacity: 0; transition: opacity 0.4s ease; }
.slide-frame.is-ready .slide-full { opacity: 1; }

.slide-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}

.slide-frame.is-ready .slide-spinner { display: none; }

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

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 10px;
  padding: 12px 72px 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.3px;
  transition: opacity 0.3s;
}

.lightbox-caption-studio { font-weight: 600; }
.lightbox-caption-title { font-style: italic; }
.lightbox-caption-place::before { content: "— "; }
.lightbox-caption-title:empty,
.lightbox-caption-place:empty { display: none; }

.lightbox.is-zoomed .lightbox-caption,
.lightbox.is-zoomed .lightbox-nav { opacity: 0; pointer-events: none; }

.lightbox.is-idle .lightbox-topbar,
.lightbox.is-idle .lightbox-caption,
.lightbox.is-idle .lightbox-nav { opacity: 0; }

.lightbox.is-dragging .slide { transition: none !important; }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 1280px) {
  :root { --gallery-cols: 3; --gallery-gap: clamp(24px, 5vw, 64px); }
}

@media (max-width: 1024px) {
  :root { --gallery-cols: 2; --gallery-gap: clamp(24px, 6vw, 64px); }
}

@media (max-width: 767px) {
  :root { --gallery-pad: 27px; --gallery-gap: 27px; }

  .nav-link {
    font-size: 10px;
    letter-spacing: 1.4px;
    padding: 10px 12px;
  }

  .sheet { max-height: min(88vh, 88dvh); border-radius: 12px 12px 0 0; }
  .sheet-inner { padding: 4px 20px 40px; }
  .sheet-columns { flex-direction: column; gap: 1em; }
  .sheet-text { font-size: 14px; }
  .sheet-close { top: 8px; right: 8px; }

  .lightbox { --lb-top: 44px; }
  .lightbox-nav { width: 44px; }
  .lightbox-caption { padding: 10px 16px 14px; font-size: 11px; flex-direction: column; gap: 0; }
}

@media (max-width: 480px) {
  :root { --gallery-cols: 1; --gallery-pad: 20px; --gallery-gap: 32px; }
}
