/* ─── Fonts ──────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'NeueHaas';
  src: url('./global/font/NeueHaasDisplayRoman.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'NeueHaas';
  src: url('./global/font/NeueHaasDisplayLight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'NeueHaas';
  src: url('./global/font/NeueHaasDisplayMediu.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

::-webkit-scrollbar { display: none; }

html {
  font-family: 'NeueHaas', ui-sans-serif, system-ui, sans-serif;
  background-color: #fafafa;
  color: #000;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; }
img, video { display: block; max-width: unset; pointer-events: none; -webkit-user-drag: none; user-drag: none; }
ul { list-style: none; }

/* ─── Navigation Button ──────────────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  pointer-events: all;
  font-size: 0.65625rem;
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.btn span, .btn small {
  opacity: 0.3;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@media (hover: hover) {
  .btn:hover span,
  .btn:hover small { opacity: 1; }
}

.btn.active span,
.btn.active small { opacity: 1; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  padding: 4px;
  pointer-events: none;
  opacity: 0;
  backface-visibility: hidden;
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#nav nav {
  display: flex;
  width: 100%;
  max-width: 36.25rem;
}

#nav ul {
  display: flex;
  width: 100%;
  gap: 2px;
}

#nav li {
  display: flex;
  width: 25%;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  #nav li { width: 12.5rem; }
}

#nav li:first-child {
  width: 25%;
}

@media (min-width: 768px) {
  #nav li:first-child { width: 12.5rem; }
}

/* Site name — show "AR" on mobile, full name on desktop */
.nav-name-short { display: inline; }
.nav-name-full  { display: none; }

@media (min-width: 768px) {
  .nav-name-short { display: none; }
  .nav-name-full  { display: inline; }
}

/* ─── Background layers ──────────────────────────────────────────────────── */

.bg-solid {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #fafafa;
  pointer-events: none;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(45deg, #fafafa, #fafafa 1%, transparent 25%, transparent 75%, #fafafa);
  opacity: 0.75;
  pointer-events: none;
  display: none;
}

@media (min-width: 768px) {
  .bg-vignette { display: block; }
}

/* ─── Contact Overlay ────────────────────────────────────────────────────── */

#contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#contact-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
}

.contact-link {
  display: flex;
  padding: 10px 14px;
  font-size: 0.65625rem;
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.contact-link span {
  opacity: 0.3;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@media (hover: hover) {
  .contact-link:hover span { opacity: 1; }
}

#contact-legal {
  position: fixed;
  bottom: 11px;
  left: 14px;
  display: flex;
  gap: 12px;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 0.8125rem;
}

#contact-legal a { opacity: 0.3; }

#contact-blur {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#contact-blur.open { opacity: 1; }

@media (min-width: 768px) {
  #contact-blur {
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
  }
}

/* ─── Nav scroll hide ────────────────────────────────────────────────────── */

#nav.nav-hidden {
  opacity: 0;
}
#nav.nav-hidden .btn {
  pointer-events: none;
}

/* ─── Projects Grid ──────────────────────────────────────────────────────── */

#page-projects {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 3rem;
  padding-bottom: 12.5svh;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
  display: flex;
  flex-direction: column;
}

/* ─── Filter bar ─────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0 4px 20px;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
  padding: 2px 0;
  background: none;
  border: none;
  color: inherit;
}

.filter-btn.active,
.filter-btn:hover {
  opacity: 1;
}

.projects-grid .project-thumb {
  transition: opacity 0.4s cubic-bezier(0.215, 0.61, 0.355, 1), filter 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.projects-grid.has-filter .project-thumb:not(.match) {
  opacity: 0.08;
  filter: blur(3px);
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────── */

.projects-grid {
  display: grid;
  gap: 3px;
  padding: 0 4px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: start;
  margin-top: auto;
  margin-bottom: auto;
}

@media (min-width: 768px)  { .projects-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .projects-grid { grid-template-columns: repeat(14, minmax(0, 1fr)); } }

.project-thumb {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #e8e8e8;
}

.project-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

@media (hover: hover) {
  .project-thumb:hover img { transform: scale(1.03); }
}

#project-hover-info {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
}

#project-hover-info span {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

#project-hover-info span.visible {
  clip-path: inset(0 0% 0 0);
}

/* ─── Project Detail Overlay ─────────────────────────────────────────────── */

#project-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #fafafa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

#project-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#project-close {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 25;
  cursor: pointer;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#project-close.visible {
  opacity: 1;
  pointer-events: all;
}

#project-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 14px 14px 80px;
  gap: 40px;
}

@media (min-width: 768px) {
  #project-inner {
    flex-direction: row;
    align-items: flex-start;
    padding: 14px 32px 80px;
    gap: 60px;
  }
}

#project-info {
  flex-shrink: 0;
  width: 100%;
  max-width: 17rem;
}

@media (min-width: 768px) {
  #project-info {
    position: sticky;
    top: 3rem;
  }
}

#project-meta {
  display: flex;
  gap: 8px;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  opacity: 0.35;
  margin-bottom: 10px;
}

#project-title {
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 1.25;
  font-weight: 400;
  margin-bottom: 16px;
}

#project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
}

.project-tag {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
  padding: 2px 0;
}

.project-tag:not(:last-child)::after {
  content: ' ·';
  opacity: 0.5;
  margin-left: 4px;
}

#project-desc {
  font-size: 0.65625rem;
  letter-spacing: 0.01em;
  line-height: 1.7;
  opacity: 0.65;
  text-transform: none;
  font-weight: 400;
  white-space: pre-line;
}

#project-price-btn {
  display: none;
  margin-top: 28px;
  padding: 10px 0;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-transform: uppercase;
  cursor: pointer;
}

#project-price-btn span {
  opacity: 0.3;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@media (hover: hover) {
  #project-price-btn:hover span { opacity: 1; }
}

#project-visuals {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#project-visuals img,
#project-visuals video {
  height: 100vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ─── Research Page ──────────────────────────────────────────────────────── */

#page-research {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 3rem;
  padding-bottom: 12.5svh;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.research-description {
  padding: 0 14px 40px;
  max-width: 27rem;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 1.7;
  text-transform: none;
  opacity: 0.7;
}

.research-grid {
  columns: 2;
  column-gap: 4.5rem;
  padding: 0 4.5rem;
}

@media (min-width: 640px)  { .research-grid { columns: 3; } }
@media (min-width: 768px)  { .research-grid { columns: 5; } }
@media (min-width: 1024px) { .research-grid { columns: 7; } }
@media (min-width: 1280px) { .research-grid { columns: 7; } }

.research-item {
  break-inside: avoid;
  margin-bottom: 4.5rem;
  cursor: zoom-in;
  position: relative;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.research-item img,
.research-item video {
  width: 100%;
  height: auto;
  display: block;
}

/* Quand une image est sélectionnée */
.research-grid.has-selected .research-item {
  opacity: 0.05;
  pointer-events: none;
}

.research-grid.has-selected .research-item.selected {
  opacity: 1;
  pointer-events: all;
  cursor: zoom-out;
}

/* Image agrandie — fixed overlay centré */
.research-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  cursor: zoom-out;
}

.research-zoom-overlay img,
.research-zoom-overlay video {
  max-width: 80vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.research-empty {
  padding: 0 14px;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  opacity: 0.3;
}

/* ─── About Page ────────────────────────────────────────────────────────── */

#page-about {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 3rem;
  padding-bottom: 12.5svh;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.about-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 27rem;
}

.about-description {
  padding: 0 14px 20px;
  font-size: 0.65625rem;
  letter-spacing: 0.01em;
  line-height: 1.7;
  text-transform: none;
  opacity: 0.8;
}

.about-block {
  display: flex;
  padding: 0 14px;
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 1.25;
  margin-bottom: 20px;
}

.about-block-label {
  opacity: 0.3;
  flex-shrink: 0;
  width: 80px;
}

.about-block-items {
  display: flex;
  flex-direction: column;
}

.about-block-items span,
.about-block-items a {
  line-height: 1.4;
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  .about-block-items a:hover { opacity: 0.45; }
}

#about-photo {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 260px;
  height: 340px;
  z-index: 3;
  opacity: 1;
  pointer-events: none;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ─── Lightbox (research) ────────────────────────────────────────────────── */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: zoom-out;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ─── Legal Page ─────────────────────────────────────────────────────────── */

#page-legal {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 3rem;
  padding-bottom: 12.5svh;
}

.legal-content {
  max-width: 36rem;
  padding: 20px 14px 60px;
}

.legal-content h1 {
  font-size: 0.65625rem;
  letter-spacing: 0.015em;
  line-height: 1.25;
  margin-bottom: 40px;
  opacity: 1;
}

.legal-content h2 {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
  margin-bottom: 8px;
  margin-top: 28px;
}

.legal-section:first-child h2 {
  margin-top: 0;
}

.legal-content p {
  font-size: 0.65625rem;
  letter-spacing: 0.01em;
  line-height: 1.75;
  text-transform: none;
  opacity: 0.7;
}
