:root {
  --bg: #FBFFE3;
  --text: #111111;
  --muted: #8a8a8a;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  background: transparent;
  transition: background 0.4s ease;
}

.site-header.scrolled {
  background: var(--bg);
}

.logo {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Index projets (fixe) ---------- */
.project-index {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.project-index a {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  white-space: nowrap;
}

.project-index a:hover,
.project-index a.active { color: var(--text); }

@media (max-width: 600px) {
  .project-index { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 40px 48px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('image/Untitled-3.png');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  filter: saturate(0.4) sepia(1) hue-rotate(60deg) brightness(1.3);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 1;
  pointer-events: none;
}

.hero-name,
.hero-sub {
  position: relative;
  z-index: 2;
}

.hero-name {
  width: 100%;
  height: auto;
  overflow: visible;
  visibility: hidden;
}

.name-stroke {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  clip-path: inset(0 100% 0 0);
}

.name-fill {
  fill: var(--text);
  opacity: 0;
}

@keyframes drawHeroName {
  to { clip-path: inset(0 0% 0 0); }
}

@keyframes fillHeroName {
  to { opacity: 1; }
}

.hero-sub {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
  overflow: hidden;
  height: 1.5em;
}

.hero-sub-text {
  display: inline-block;
  animation: none;
}

@keyframes slideUp {
  0%   { transform: translateY(100%); opacity: 0; }
  15%  { transform: translateY(0);    opacity: 1; }
  85%  { transform: translateY(0);    opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

.hero-sub-text.animating {
  animation: slideUp 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 600px) {
  .hero { padding: 0 20px 40px; }
}

/* ---------- Projets (liste) ---------- */
.projects {
  padding: 0 40px 20vh;
  border-top: 1px solid var(--text);
}

.project-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: baseline;
  gap: 0 24px;
  padding: 22px 0;
}

.project-num {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.project-title {
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.project-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Bloc projet (titre + vidéo) ---------- */
.project-block {
  border-bottom: 1px solid var(--text);
}

.project-row {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.project-video {
  padding: 20px 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.project-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

/* État visible */
.project-block.in-view .project-row {
  opacity: 1;
  transform: translateY(0);
}

.project-block.in-view .project-video video:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.project-block.in-view .project-video video:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.3s;  }
.project-block.in-view .project-video video:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
  .project-row-inner,
  .project-video video { transition: none; transform: none; opacity: 1; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 80px 40px;
  border-top: 1px solid var(--text);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .site-header, .projects, .site-footer { padding-left: 20px; padding-right: 20px; }
  .project-title { font-size: 1.6rem; }
  .project-meta { display: none; }
  .preview { display: none; }
  .site-footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .preview { transition: none; }
}
