/* ============================================================
   ALEXIS BENOT — feuille de style
   Direction : élégant / mode, sobre (réf. romainfior.com),
   fond papier chaud discret, index à numérotation fine mono,
   accent organique/expérimental réservé à la page Expérimental.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --bg: #f2ede3;
  --bg-card: #e9e3d5;
  --fg: #17150f;
  --fg-dim: #726c5e;
  --line: rgba(23,21,15,0.12);
  --line-strong: rgba(23,21,15,0.3);
  --max: 1440px;
  --edge: clamp(20px, 4vw, 64px);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ background: var(--bg); scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Archivo', Arial, Helvetica, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

/* very quiet paper grain — static, barely-there */
body::after{
  content:"";
  position: fixed; inset:0; pointer-events:none; z-index: 999;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

h1,h2,h3,h4{
  font-family: 'Archivo', Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
button{ font-family: inherit; }

.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 var(--edge); }
.mono{ font-family: var(--mono); }

/* ---------------- Header / Nav ---------------- */
.site-header{
  position: fixed;
  top:0; left:0; right:0;
  z-index: 200;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 28px var(--edge);
}
.wordmark{
  font-family:'Archivo', sans-serif;
  font-weight: 500;
  font-size: clamp(14px, 1.4vw, 16px);
  letter-spacing: 0.01em;
}
.wordmark span{ color: var(--fg-dim); font-weight: 400; }
.wordmark img{ height: 40px; width:auto; vertical-align: -11px; margin-right: 9px; transition: opacity .2s; }

.site-nav{ display:flex; gap: clamp(22px,2.6vw,44px); align-items:center; }
.site-nav a{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
  transition: color .2s;
}
.site-nav a:hover, .site-nav a.active{ color: var(--fg); }

@media (max-width: 720px){
  .site-nav{ gap:16px; }
  .site-nav a{ font-size: 10.5px; }
}

/* ---------------- Footer ---------------- */
.site-footer{
  border-top:1px solid var(--line);
  padding: 36px var(--edge) 56px;
  margin-top: 100px;
  display:flex;
  flex-wrap:wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-dim);
}
.site-footer a{ color: var(--fg); border-bottom: 1px solid var(--line-strong); }

/* ---------------- Home — minimal ---------------- */
.hero{
  min-height: 92svh;
  display:flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 0 0;
  position: relative;
}
.hero-frame{
  padding: 120px var(--edge) 0;
}
.hero-eyebrow{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .02em;
}
.hero-visual{
  margin: 22px var(--edge) 0;
  aspect-ratio: 16/8.2;
  overflow: hidden;
  background: var(--bg-card);
}
.hero-visual img{ width:100%; height:100%; object-fit: cover; }

.home-index{
  border-top: 1px solid var(--line);
  padding: var(--edge);
}
.home-index-row{
  display:grid;
  grid-template-columns: 60px 1fr 2fr;
  gap: 20px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.home-index-row:first-child{ border-top: 1px solid var(--line); }
.home-index-num{ font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.home-index-title{ font-size: clamp(22px, 3vw, 34px); font-weight: 500; }
.home-index-desc{ font-size: 14px; color: var(--fg-dim); max-width: 46ch; }
.home-index-row{ transition: opacity .2s; }
.home-index-row:hover .home-index-title{ text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 700px){
  .home-index-row{ grid-template-columns: 40px 1fr; }
  .home-index-desc{ grid-column: 2 / -1; }
}

/* ---------------- Section generic ---------------- */
.section{ padding: 90px var(--edge) 40px; }
.page-head{
  padding: 140px var(--edge) 44px;
  border-bottom: 1px solid var(--line);
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.page-head .eyebrow{
  font-family: var(--mono);
  font-size: 12px; color: var(--fg-dim); margin-bottom: 14px;
}
.page-head h1{ font-size: clamp(32px, 5.6vw, 64px); font-weight: 500; }

/* ---------------- Filters (Projets) ---------------- */
.filters{
  display:flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 24px var(--edge) 0;
  font-family: var(--mono);
}
.filter-btn{
  border: 0;
  background: transparent;
  color: var(--fg-dim);
  padding: 4px 0;
  font-size: 12.5px;
  letter-spacing: .02em;
  cursor:pointer;
  border-bottom: 1px solid transparent;
}
.filter-btn.active, .filter-btn:hover{ color: var(--fg); border-color: var(--fg); }

/* ---------------- Project grid ---------------- */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 40px var(--edge) 90px;
}
@media (max-width: 980px){ .grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 620px){ .grid{ grid-template-columns: 1fr;} }

.card{
  background: var(--bg-card);
  position:relative;
  aspect-ratio: 4/3;
  overflow:hidden;
  cursor:pointer;
}
.card img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
  transform: scale(1.0);
  transition: transform .8s cubic-bezier(.16,1,.3,1);
}
.card:hover img{ transform: scale(1.04); }
.card-fig{
  position:absolute; top:16px; left:16px; z-index:2;
  font-family: var(--mono);
  font-size: 11px;
  color: #f2ede3;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.card-overlay{
  position:absolute; left:0; right:0; bottom:0; z-index:2;
  background: linear-gradient(180deg, rgba(23,21,15,0) 60%, rgba(23,21,15,.65) 100%);
  padding: 16px;
  color: #f2ede3;
  opacity: 0;
  transition: opacity .3s;
}
.card:hover .card-overlay{ opacity: 1; }
.card-title{
  font-family:'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height:1.25;
}
.card-credit{
  margin-top:4px;
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: .8;
}
.card-play{ display:none; }

/* ---------------- Lightbox ---------------- */
.lightbox{
  position:fixed; inset:0;
  background: rgba(23,21,15,.92);
  z-index: 500;
  display:none;
  align-items:center;
  justify-content:center;
  padding: var(--edge);
}
.lightbox.open{ display:flex; }
.lightbox-inner{
  width:100%; max-width: 1100px;
  aspect-ratio: 16/9;
  position:relative;
  background:#000;
}
.lightbox-inner iframe{ width:100%; height:100%; border:0; }
.lightbox-close{
  position:absolute; top:-42px; right:0;
  font-family: var(--mono);
  font-size: 12px;
  color: #f2ede3;
  cursor:pointer;
  border-bottom: 1px solid rgba(242,237,227,.5);
  padding-bottom: 2px;
}

/* ---------------- Bio ---------------- */
.bio-layout{
  display:grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: clamp(30px, 6vw, 100px);
  padding: 0 var(--edge) 100px;
}
@media (max-width: 860px){ .bio-layout{ grid-template-columns: 1fr; } }
.bio-copy p{
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--fg);
  margin: 0 0 24px;
  max-width: 60ch;
  font-weight: 400;
}
.bio-copy p:first-child{
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.3;
}
.bio-side{
  border-left: 1px solid var(--line);
  padding-left: clamp(20px, 3vw, 40px);
}
.bio-side dl{ margin:0; }
.bio-side dt{
  font-family: var(--mono);
  font-size: 11.5px; color: var(--fg-dim);
  margin-top: 24px;
}
.bio-side dt:first-child{ margin-top:0; }
.bio-side dd{ margin: 6px 0 0; font-size: 16px; }
.bio-side a{ border-bottom: 1px solid var(--line-strong); }

/* ---------------- Labo — disposition organique (collage) ---------------- */
.exp-intro{ padding: 0 var(--edge) 50px; max-width: 68ch; }
.exp-intro p{ font-size: clamp(15px,1.6vw,19px); color: var(--fg-dim); }

.labo-collage{
  column-count: 4;
  column-gap: clamp(12px, 1.6vw, 18px);
  padding: 10px var(--edge) 110px;
}
@media (max-width: 1100px){ .labo-collage{ column-count: 3; } }
@media (max-width: 780px){ .labo-collage{ column-count: 2; } }
@media (max-width: 480px){ .labo-collage{ column-count: 1; } }

.labo-item{
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: block;
  margin: 0 0 clamp(12px, 1.6vw, 18px);
  position: relative;
  transition: transform .3s cubic-bezier(.19,1,.22,1);
  will-change: transform;
}
.labo-item:hover{ transform: scale(1.02); z-index: 3; }
.labo-item video, .labo-item img{
  width: 100%;
  display: block;
  background: var(--bg-card);
}
.labo-item:nth-child(5n+1){ margin-top: 0; }
.labo-item:nth-child(5n+2){ margin-top: 26px; }
.labo-item:nth-child(5n+3){ margin-top: 8px; }
.labo-item:nth-child(5n+4){ margin-top: 40px; }
.labo-item:nth-child(5n+5){ margin-top: 14px; }

/* ---------------- Easter egg — Lab runner (press "6") ---------------- */
.rex-stage{
  position: fixed;
  left:0; right:0;
  height: 190px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 250;
  display:none;
  overflow:hidden;
  cursor: pointer;
}
.rex-stage.active{ display:block; }
.rex-stage canvas{ display:block; width:100%; height:100%; }

.labo-tag{
  position:absolute; top:12px; left:12px; z-index:2;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #f2ede3;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
