/* =========================================================
   Portfolio photo — Thibaut Loubère
   ========================================================= */

:root {
  --color-bg: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #6B6B6B;
  --color-accent: #1A1A1A;
  --color-border: #E8E8E8;
  --color-overlay: rgba(0, 0, 0, 0.4);

  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --header-height: 72px;
  --grid-gap: 3px;
}

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

html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* ---------- Loader diaphragme ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 400ms ease;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader__name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
}

.loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader__iris {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-text);
  position: relative;
  animation: iris-spin 4s linear infinite;
}

.loader__hole {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-bg);
  animation: iris-open 1.6s ease-in-out infinite;
}

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

@keyframes iris-open {
  0%, 100% {
    clip-path: polygon(50% 49%, 51% 50%, 50% 51%, 49% 50%, 50% 49%, 51% 50%);
  }
  40%, 60% {
    clip-path: polygon(50% 15%, 80% 32%, 80% 68%, 50% 85%, 20% 68%, 20% 32%);
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  max-width: 1800px;
  margin: 0 auto;
}

.site-header__name {
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav__item {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 4px 0;
  position: relative;
  transition: color 200ms ease;
}

.site-nav__item:hover { color: var(--color-text); }

.site-nav__item.is-active {
  color: var(--color-text);
}

.site-nav__item.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--color-text);
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  padding: var(--grid-gap);
  transition: opacity 250ms ease;
}

.grid.is-fading { opacity: 0; }

.grid__empty {
  grid-column: 1 / -1;
  padding: 80px 20px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: #f3f3f3;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.tile.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease, transform 300ms ease;
}

.tile__img.is-loaded {
  opacity: 1;
}

.tile:hover .tile__img { transform: scale(1.03); }

.tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-overlay);
  color: #fff;
  opacity: 0;
  transition: opacity 300ms ease;
  padding: 12px;
  text-align: center;
}

.tile:hover .tile__overlay { opacity: 1; }

.tile__name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.tile__exif {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.pin {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
  transform: translateY(-1px);
}

/* ---------- About ---------- */

.about {
  padding: 80px 24px;
  text-align: center;
}

.about p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text-secondary);
}


/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 24px 64px;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.site-footer__mail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: border-color 200ms ease;
}

.site-footer__mail:hover { border-color: var(--color-text); }

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  gap: 14px;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.lightbox__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #fff;
}

.lightbox__name .pin {
  width: 14px;
  height: 14px;
}

.lightbox__exif {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #fff;
  opacity: 0.75;
  text-align: center;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 40px;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 200ms ease;
}

.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  width: 44px;
  height: 44px;
  opacity: 0.6;
  transition: opacity 200ms ease;
}
.lightbox__close:hover { opacity: 1; }

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

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .grid { grid-template-columns: 1fr; }

  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
  }

  .site-nav {
    gap: 20px;
    flex-wrap: wrap;
  }

  .site-nav__item {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .lightbox__nav { width: 44px; height: 44px; font-size: 32px; }
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
}
