/* ============================================================
   Durel Zanfack — durelmanson.com
   Palette sombre, serif éditoriale, accent cuivré.
   ============================================================ */

:root {
  --bg: #060504;
  --bg-elevated: #0F0E0D;
  --bg-surface: #141210;
  --border: #1F1C19;
  --accent: #8B5A2B;
  --accent-light: #A67B5B;
  --accent-dark: #5C3A1E;
  --text: #E8E4DF;
  --text-secondary: #9A9590;
  --text-muted: #6C6560;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 78px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }
/* height:auto est indispensable : sans lui, l'attribut height du HTML
   l'emporte sur aspect-ratio et déforme l'image. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ---------- Apparitions au défilement ----------
   Armées uniquement quand JavaScript tourne (classe .js posée dans le head).
   Sans script, ou si l'utilisateur préfère moins d'animations, tout reste visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(4px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), filter .9s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; filter: none; }

.d1 { transition-delay: .08s; }
.d2 { transition-delay: .16s; }
.d3 { transition-delay: .24s; }
.d4 { transition-delay: .32s; }
.d5 { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   En-tête
   ============================================================ */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 1.5rem 0;
  border-bottom: 1px solid transparent;
  transition: background .4s ease, border-color .4s ease, padding .4s ease;
}
.site-header.is-scrolled {
  background: rgba(6, 5, 4, .88);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--border);
  padding: 1rem 0;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.wordmark {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.01em;
}

.site-header nav { display: flex; align-items: center; gap: 2.5rem; }
.site-header nav a {
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-secondary);
  position: relative; transition: color .3s ease;
}
.site-header nav a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a:hover::after { transform: scaleX(1); }

.nav-cta {
  border: 1px solid var(--border); padding: .6rem 1.2rem; border-radius: 2px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }
.nav-cta::after { display: none !important; }

/* Bouton menu — visible seulement en petit écran */
.menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 2px; width: 42px; height: 38px; cursor: pointer;
  padding: 0; place-items: center; gap: 5px;
}
.menu-btn span {
  display: block; width: 18px; height: 1px; background: var(--text);
  transition: transform .35s var(--ease-out), opacity .2s ease;
}
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .site-header nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(6, 5, 4, .97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden;
    transition: max-height .4s var(--ease-out);
  }
  .site-header nav.is-open { max-height: 340px; }
  .site-header nav a { padding: 1rem 2rem; border-top: 1px solid var(--border); }
  .site-header nav a::after { display: none; }
  .nav-cta { border: 0; border-top: 1px solid var(--border) !important; border-radius: 0; color: var(--accent) !important; }
}

/* ============================================================
   Accroche
   ============================================================ */

.hero {
  min-height: 100vh; display: grid; align-items: center;
  padding: 9rem 0 5rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -20%; right: -10%;
  width: 600px; height: 600px; pointer-events: none;
  background: radial-gradient(circle, rgba(139, 90, 43, .07) 0%, transparent 70%);
}

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: center; }

.portrait { position: relative; justify-self: center; max-width: 480px; width: 100%; }
/* Pas de aspect-ratio ni d'object-fit : la photo garde ses proportions
   d'origine (1104x736) et rien n'est rogné. Le cadre décalé se règle
   automatiquement sur elle. */
.portrait img {
  width: 100%; height: auto;
  border-radius: 2px; position: relative; z-index: 2;
  filter: grayscale(18%) contrast(1.04); transition: filter .6s ease;
}
.portrait:hover img { filter: none; }
.portrait::after {
  content: ''; position: absolute; inset: 20px -20px -20px 20px;
  border: 1px solid var(--accent-dark); border-radius: 2px; z-index: 1;
  opacity: .6; transition: inset .6s var(--ease-out), opacity .6s ease;
}
.portrait:hover::after { inset: 12px -12px -12px 12px; opacity: 1; }

.hero-text { position: relative; z-index: 2; }

.eyebrow {
  display: block; margin-bottom: 1.5rem;
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .2em; color: var(--accent);
}

.hero h1 {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
  line-height: 1.06; letter-spacing: -.02em;
}
.hero h1 .accent { color: var(--accent); font-style: italic; font-weight: 400; }

.lead {
  margin-top: 2rem; max-width: 42ch;
  font-size: 1.15rem; line-height: 1.7; color: var(--text-secondary);
}

.hero-actions { margin-top: 3rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 2rem; border-radius: 2px; border: 1px solid transparent;
  font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  cursor: pointer; transition: background .35s ease, color .35s ease,
    border-color .35s ease, transform .35s var(--ease-out), box-shadow .35s ease;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover {
  background: var(--accent-light); transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(139, 90, 43, .35);
}
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-facts { margin-top: 4rem; display: flex; gap: 3rem; flex-wrap: wrap; list-style: none; }
.hero-facts li { font-size: .85rem; color: var(--text-secondary); }
.hero-facts strong {
  display: block; margin-bottom: .25rem;
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 400;
  color: var(--text); line-height: 1.2;
}

@media (max-width: 860px) {
  .hero { padding: 7.5rem 0 4rem; min-height: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .portrait { max-width: 380px; }
  .lead { margin-inline: auto; }
  .hero-actions, .hero-facts { justify-content: center; }
  .hero-facts { gap: 2rem; }
}

/* ============================================================
   Sections
   ============================================================ */

section[id] { scroll-margin-top: var(--header-h); }
.band { background: var(--bg-elevated); }

#faire, #projets, #competences, #parcours, #contact { padding: 9rem 0; }

.section-label {
  display: block; margin-bottom: 1rem;
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .2em; color: var(--accent);
}

.section-title {
  position: relative; display: inline-block; margin-bottom: 1.75rem;
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  line-height: 1.1; letter-spacing: -.02em;
}
.section-title::after {
  content: ''; position: absolute; bottom: -.5rem; left: 0;
  width: 60px; height: 1px; background: var(--accent); opacity: .5;
}

.section-intro {
  max-width: 55ch; margin-bottom: 5rem;
  font-size: 1.08rem; line-height: 1.75; color: var(--text-secondary);
}

/* ============================================================
   Services
   ============================================================ */

.services-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; }

.card {
  position: relative; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 2px;
  padding: 3rem;
  transition: border-color .4s ease, transform .5s var(--ease-out), box-shadow .5s ease;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-dark));
  opacity: 0; transition: opacity .4s ease;
}
.card:hover {
  border-color: var(--accent-dark); transform: translateY(-6px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}
.card:hover::before { opacity: 1; }

.card:nth-child(1) { grid-column: 1 / 8; }
.card:nth-child(2) { grid-column: 8 / 13; margin-top: 4rem; }
.card:nth-child(3) { grid-column: 3 / 11; margin-top: 2rem; }

.card h3 {
  margin-bottom: 1.25rem;
  font-family: var(--font-serif); font-size: 1.6rem; font-weight: 400; line-height: 1.3;
}
.card p { color: var(--text-secondary); font-size: .95rem; line-height: 1.75; }
.card-tech {
  margin-top: 2.5rem;
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent) !important;
}

@media (max-width: 860px) {
  .services-grid { gap: 1.5rem; }
  .card { padding: 2.25rem 1.75rem; }
  .card:nth-child(1), .card:nth-child(2), .card:nth-child(3) { grid-column: 1 / -1; margin-top: 0; }
}

/* ============================================================
   Projets
   ============================================================ */

.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
  align-items: center; padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: none; padding-bottom: 0; }
/* Une réalisation sur deux inverse l'image et le texte. */
.project:nth-of-type(even) .project-visual { order: 2; }

.project-visual {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--bg-surface) 0%, #1C1A18 100%);
  border: 1px solid var(--border); border-radius: 2px;
}
/* Sans capture, on réserve un cadre 16/10 pour garder la mise en page stable. */
.project-visual:not(:has(img)) { aspect-ratio: 16 / 10; }
/* Avec une capture, c'est elle qui donne ses proportions au cadre :
   rien n'est rogné, quelle que soit la forme de l'image. */
.project-visual:has(img) { aspect-ratio: auto; }

.project-visual::after {
  content: attr(data-placeholder);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-muted);
}
.project-visual img { width: 100%; height: auto; display: block; }
.project-visual:has(img)::after { display: none; }

.project-content { position: relative; }

.project-num {
  position: absolute; top: -3.25rem; left: -1rem; z-index: 0;
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(5rem, 9vw, 7.5rem); line-height: 1;
  color: var(--bg-surface); pointer-events: none; user-select: none;
}
.band .project-num { color: #17150F; }

.project-content > * { position: relative; z-index: 1; }

.project-kind {
  margin-bottom: .85rem;
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent);
}
.project h3 {
  margin-bottom: 1.5rem;
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.2;
}

.project-problem {
  margin-bottom: 1.5rem; padding: 1.4rem 1.5rem;
  background: rgba(139, 90, 43, .05); border-left: 2px solid var(--accent);
  color: var(--text) !important;
}
.project-problem .label {
  display: block; margin-bottom: .4rem;
  font-size: .68rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent);
}

.project-content p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.75; }
.project-content strong { color: var(--text); font-weight: 500; }
.project-content em { color: var(--text); font-style: italic; }

.stack {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  line-height: 1.9; color: var(--text-muted) !important;
}

.project-links { margin: 1.25rem 0 0 !important; }
.soon { font-size: .8rem; font-style: italic; color: var(--text-muted); }

.demo-link {
  display: inline-block; padding: .7rem 1.5rem; border-radius: 2px;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
  transition: background .35s ease, color .35s ease, transform .35s var(--ease-out);
}
.demo-link:hover { background: var(--accent); color: var(--bg); transform: translateY(-2px); }
.demo-note {
  display: block; margin-top: .7rem;
  font-size: .75rem; font-style: italic; color: var(--text-muted);
}

@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; gap: 2.25rem; padding: 4rem 0; }
  .project:nth-of-type(even) .project-visual { order: 0; }
  .project-num { top: -2.25rem; left: -.25rem; }
}

/* ============================================================
   Compétences
   ============================================================ */

.skills { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--border); }

.skill-group {
  padding: 3rem;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  transition: background .4s ease;
}
.skill-group:nth-child(even) { border-right: none; }
.skill-group:hover { background: rgba(139, 90, 43, .025); }

.skill-group h3 {
  margin-bottom: 1rem;
  font-size: .72rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent);
}
.skill-group p {
  font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.6;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .skills { grid-template-columns: 1fr; }
  .skill-group { padding: 2.25rem 1.5rem; border-right: none; }
}

/* ============================================================
   Parcours
   ============================================================ */

.timeline { list-style: none; position: relative; padding-left: 3rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: .6rem; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline li { position: relative; padding-bottom: 4rem; }
.timeline li:last-child { padding-bottom: 0; }

.dot {
  position: absolute; left: -3rem; top: .45rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 0 4px rgba(139, 90, 43, .12);
  transform: translateX(-4px);
}

.when {
  display: block; margin-bottom: .5rem;
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent);
}
.timeline h3 {
  margin-bottom: .75rem;
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 400; line-height: 1.3;
}
.timeline p { max-width: 60ch; color: var(--text-secondary); line-height: 1.75; }

@media (max-width: 860px) {
  .timeline { padding-left: 2rem; }
  .dot { left: -2rem; }
}

/* ============================================================
   Contact
   ============================================================ */

#contact {
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 50%, var(--bg) 100%);
}
#contact .section-title { display: inline-block; }
#contact .section-title::after { left: 50%; transform: translateX(-50%); }
#contact .section-intro { margin-inline: auto; margin-bottom: 0; }
.contact-actions { margin-top: 3.5rem; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   Pied de page
   ============================================================ */

.site-footer { padding: 4rem 0; border-top: 1px solid var(--border); text-align: center; }
.footer-inner {
  display: flex; flex-direction: column; gap: .75rem;
  font-size: .85rem; color: var(--text-muted);
}
.footer-inner a { color: var(--text-secondary); transition: color .3s ease; }
.footer-inner a:hover { color: var(--accent); }

/* ============================================================
   Accessibilité
   ============================================================ */

.skip { position: absolute; left: -9999px; }
.skip:focus {
  position: fixed; top: 1rem; left: 1rem; z-index: 9999;
  padding: .75rem 1.25rem; border-radius: 2px;
  background: var(--accent); color: var(--bg); font-weight: 500;
}
