/* ============================================================
   MAXIME CORBY — Portfolio V3
   DA : Space Mono + Syne, dark #0e0e0e, accent gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg:       #0e0e0e;
  --surface:  #161616;
  --border:   #252525;
  --text:     #e8e8e8;
  --mi-muted: #b6b6b6;
  --muted:    #888;
  --accent:   #c8a96e;
  --accent-d: #7a6540;
  --fs:       'Lexend', sans-serif;
  --fm:       'Outfit', sans-serif;
  --nav-h:    64px;
  --max-w:    1100px;
  --ease:     cubic-bezier(.25,.46,.45,.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fm);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── NAV ───────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 48px; 
  padding: 0 40px;
  background: rgba(14,14,14,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-logo {
  font-family: var(--fs); font-weight: 800; font-size: 1.05rem;
  letter-spacing: .06em; text-transform: uppercase;
  transition: color .2s;
}
.nav-logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); position: relative; transition: color .2s; font-weight: 700;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transition: transform .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* ── PAGE WRAPPER ──────────────────────────────────── */
.page {
  padding-top: calc(var(--nav-h) + 60px);
  padding-bottom: 100px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* ── HERO ──────────────────────────────────────────── */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); margin-bottom: 56px; }
.hero-label {
  font-size: 1rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--fs); font-size: clamp(2.6rem,5.5vw,4.2rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin-bottom: 12px;
}
.hero-sub {
  font-size: 1.1rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 24px;
  font-family: var(--fm); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0e0e0e; }
.btn.primary:hover { background: transparent; color: var(--accent); }

.btn-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0e0e;
}
.btn-link:hover {
  background: transparent;
  color: var(--accent);
}

/* ── SECTION TITLE ─────────────────────────────────── */
.section-title {
  font-family: var(--fs); font-size: .85rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 14px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── PROJECT GRID ──────────────────────────────────── */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px;
}
.project-grid.two-col   { grid-template-columns: repeat(2, 1fr); }
.project-grid.three-col { grid-template-columns: repeat(3, 1fr); }

/* ── CARD ──────────────────────────────────────────── */
.card {
  display: block; background: var(--surface);
  position: relative; overflow: hidden; cursor: pointer;
}

/* Thumbnail */
.card-thumb {
  position: relative; aspect-ratio: 4/3; overflow: hidden; background: #111;
}
.card-thumb .img-still,
.card-thumb .img-gif {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), opacity .3s;
}
.card-thumb .img-gif   { opacity: 0; }
.card-thumb .img-still { opacity: 1; }
.card:hover .card-thumb .img-gif   { opacity: 1; }
.card:hover .card-thumb .img-still { opacity: 0; }
.card:hover .card-thumb .img-still,
.card:hover .card-thumb .img-gif   { transform: scale(1.02); }

/* Dark overlay on hover */
.card-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(14,14,14,.0); opacity: 0; transition: opacity .3s;
  z-index: 1;
}
.card:hover .card-thumb::after { opacity: 1; }

/* Overlay info — titre + meta visible au hover */
.card-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.card:hover .card-overlay { opacity: 1; transform: translateY(0); }
.card-overlay-title {
  font-family: var(--fs); font-size: 1.25rem; font-weight: 800;
  color: #fff; line-height: 1.15; margin-bottom: 4px;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.card-overlay-meta {
  font-size: .75rem; letter-spacing: .08em; color: rgba(255,255,255,.7);
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
}
.card-overlay-role {
  font-size: .72rem; letter-spacing: .06em; color: var(--accent);
  margin-top: 3px; text-shadow: 0 1px 6px rgba(0,0,0,.8);
}

/* Tech chips in overlay */
.card-overlay-techs {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.card-overlay-techs .chip {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: rgba(14,14,14,.75);
  border: 1px solid rgba(200,169,110,.4);
  font-size: .55rem; letter-spacing: .08em; color: var(--accent);
  backdrop-filter: blur(4px);
}
.chip svg { width: 10px; height: 10px; fill: currentColor; }

/* Placeholder */
.thumb-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; letter-spacing: .1em; color: var(--border);
}

/* Card body (always visible) */
.card-body { padding: 18px 20px 22px; border-top: 1px solid var(--border); }
.card-idx  { font-size: .65rem; letter-spacing: .16em; color: rgba(200,169,110,.3); margin-bottom: 7px; }
.card-title {
  font-family: var(--fs); font-size: 1.35rem; font-weight: 700;
  line-height: 1.2; margin-bottom: 7px; transition: color .2s;
}
.card:hover .card-title { color: var(--accent); }
.card-meta  { font-size: .95rem; letter-spacing: .06em; color: var(--muted); line-height: 1.6; margin-bottom: 4px; }
.card-role  { font-size: .9rem; letter-spacing: .05em; color: var(--accent-d); }

/* Tech badges in card body */
.card-tech-row {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px;
}
.card-tech-row .tech-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border: 1px solid var(--border);
  font-size: .75rem; letter-spacing: .07em; color: var(--muted);
  transition: border-color .2s, color .2s;
}
.card-tech-row .tech-badge svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.card:hover .card-tech-row .tech-badge { border-color: rgba(200,169,110,.3); color: var(--accent); }

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-d);
  padding: 4px 14px;
  margin-bottom: 16px;
}

/* ── PROJECT PAGE ──────────────────────────────────── */
.proj-header {
  padding-bottom: 52px; border-bottom: 1px solid var(--border); margin-bottom: 60px;
}
.proj-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 36px; transition: color .2s, gap .2s;
}
.proj-back:hover { color: var(--accent); gap: 12px; }

.proj-meta-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.proj-year { font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.proj-badge {
  font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--accent); color: #0e0e0e; padding: 2px 10px;
}
.proj-header h1 {
  font-family: var(--fs); font-size: clamp(2.4rem,5.5vw,4rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.0; margin-bottom: 14px;
}
.proj-tagline {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 24px;
}
.proj-specs {
  display: flex; gap: 28px; flex-wrap: wrap;
  font-size: .9rem; letter-spacing: .08em; color: var(--muted);
}
.proj-specs strong { color: var(--text); }

/* Context */
.proj-ctx {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 52px; padding-bottom: 60px;
  border-bottom: 1px solid var(--border); margin-bottom: 72px;
}
.proj-ctx h3 {
  font-family: var(--fs);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 12px;
}
.proj-ctx p { font-size: .9rem; color: var(--muted); line-height: 1.9; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.tech-tag {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); padding: 7px 16px;
  transition: border-color .2s, color .2s;
}
.tech-tag svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.tech-tag:hover { border-color: var(--accent); color: var(--accent); }

/* Section */
.proj-section { margin-bottom: 72px; padding-bottom: 72px; border-bottom: 1px solid var(--border); }
.proj-section.last-section { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.proj-section-inner {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 56px; align-items: start;
}
.proj-section-label { position: sticky; top: calc(var(--nav-h) + 20px); }
.proj-section-label .s-num {
  font-size: .52rem; letter-spacing: .18em; color: rgba(200,169,110,.25);
  display: block; margin-bottom: 8px;
}
.proj-section-label h2 {
  font-family: var(--fs); font-size: 1.45rem; font-weight: 800; line-height: 1.15;
}
.proj-section-content p {
  font-size: 1rem; color: var(--mi-muted); line-height: 1.65;
  margin-bottom: 28px; max-width: 640px;
}

/* Image layouts */
.proj-imgs { margin-top: 4px; }
.imgs-1 .proj-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface); display: block; }
.imgs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.imgs-2 .proj-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface); display: block; }
.imgs-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.imgs-3 .proj-img:first-child { grid-column: 1/-1; width: 100%; aspect-ratio: 16/7; object-fit: cover; background: var(--surface); display: block; }
.imgs-3 .proj-img:not(:first-child) { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface); display: block; }
.img-ph {
  width: 100%; aspect-ratio: 16/9; background: var(--surface);
  border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; letter-spacing: .1em; color: var(--border);
}

/* Video layouts */
video.proj-img { object-fit: cover; }

/* YouTube embed */
.yt-wrap {
  margin-bottom: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--border);
}

.yt-wrap h3 {
  font-family: var(--fs);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
}
.yt-frame {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  overflow: hidden;
}
.yt-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Related */
.related { margin-top: 80px; padding-top: 36px; border-top: 1px solid var(--border); }

/* ── ABOUT PAGE ────────────────────────────────────── */
.about-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 72px; align-items: start; padding-top: 24px;
}
.about-left { position: sticky; top: calc(var(--nav-h) + 24px); }
.portrait-wrap {
  aspect-ratio: 1/1; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 22px;
}
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; }
.portrait-ph {
  width: 100%; aspect-ratio: 1/1;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; letter-spacing: .1em; color: var(--border); margin-bottom: 22px;
}
.about-name { font-family: var(--fs); font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.about-role { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.about-contacts { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.about-contacts a { font-size: .95rem; color: var(--muted); transition: color .2s; }
.about-contacts a:hover { color: var(--accent); }

.about-right h3 {
  font-family: var(--fs); font-size: .82rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px; margin-top: 44px;
}
.about-right h3:first-child { margin-top: 0; }
.about-right p { font-size: 1rem; color: var(--mi-muted); line-height: 1.6; margin-bottom: 14px; max-width: 560px; }

/* Canva embed */
.canva-wrap {
  margin-top: 44px; padding-top: 44px; border-top: 1px solid var(--border);
}
.canva-wrap h3 {
  font-family: var(--fs); font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px; margin-top: 0;
}
.canva-frame {
  position: relative; width: 100%; aspect-ratio: 3/4; max-height: 700px;
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden;
}
.canva-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.canva-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--muted); font-size: .72rem; letter-spacing: .08em;
}
.canva-fallback a { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: opacity .2s; }
.canva-fallback a:hover { opacity: .7; }

/* ── FOOTER ────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 26px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; letter-spacing: .1em; color: var(--muted);
}
.footer-links { display: flex; gap: 28px; }
.footer-links a { transition: color .2s; }
.footer-links a:hover { color: var(--accent); }

/* ── BACK TO TOP ───────────────────────────────────── */
.back-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 40px; height: 40px; border: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: .72rem; color: var(--muted); cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, border-color .2s, color .2s; z-index: 90;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { border-color: var(--accent); color: var(--accent); }

/* ── REVEAL ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.rd1 { transition-delay: .08s; }
.rd2 { transition-delay: .16s; }
.rd3 { transition-delay: .24s; }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .project-grid.two-col, .project-grid.three-col { grid-template-columns: repeat(2, 1fr); }
  .proj-section-inner { grid-template-columns: 1fr; gap: 20px; }
  .proj-section-label { position: static; }
  .proj-ctx { grid-template-columns: 1fr; gap: 32px; }
  .about-layout { grid-template-columns: 1fr; }
  .about-left { position: static; display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
  .portrait-wrap, .portrait-ph { max-width: 200px; }
}
@media (max-width: 850px) {
  .related .project-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  nav { padding: 0 20px; }
  .nav-links { gap: 18px; }
  .page { padding-left: 20px; padding-right: 20px; }
  .project-grid, .project-grid.two-col, .project-grid.three-col { grid-template-columns: 1fr; }
  footer { padding: 22px 20px; flex-direction: column; gap: 14px; text-align: center; }
  .imgs-2, .imgs-3 { grid-template-columns: 1fr; }
  .imgs-3 .proj-img:first-child { grid-column: auto; aspect-ratio: 16/10; }
}
