/* ============================================================
   SG HOME — Design tokens
   Palette inspirée des matières d'un intérieur habité : laiton
   patiné, plâtre sombre, bois brûlé. Fond toujours noir — la
   signature graphique (logo, cadres de "viseur 3D") est blanche.
   ============================================================ */
:root{
  --noir:        #0A0908;
  --noir-panel:  #131110;
  --noir-raised: #1B1815;
  --ivoire:      #EDE6D8;
  --pierre:      #cac1b1;
  --laiton:      #C6A15B;
  --laiton-vif:  #E7C583;
  --patine:      #55695B;
  --patine-vif:  #7C9A82;
  --ligne:       rgba(198,161,91,0.16);
  --ligne-vive:  rgba(198,161,91,0.5);

  --f-display: "Fraunces", "Times New Roman", serif;
  --f-body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --container: 1220px;
  --gutter: clamp(1.5rem, 5vw, 5.5rem);

  --dur: 0.9s;
  --ease: cubic-bezier(.19,1,.22,1);
  --ease-soft: cubic-bezier(.33,1,.68,1);
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; background: var(--noir); }
body{
  margin:0;
  background: var(--noir);
  color: var(--ivoire);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width: 100%; display:block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3{ font-family: var(--f-display); font-weight: 500; margin: 0 0 0.5em; color: var(--ivoire); letter-spacing: 0.005em; }
p{ margin: 0 0 1em; color: var(--pierre); }

::selection{ background: var(--laiton); color: var(--noir); }

:focus-visible{
  outline: 1.5px solid var(--laiton-vif);
  outline-offset: 4px;
}

/* ============================================================
   GRAIN — texture discrète sur tout le site (fond toujours noir)
   ============================================================ */
.grain{
  position: fixed; inset:0; z-index: 998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.eyebrow{
  display:block;
  font-family: var(--f-body);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--laiton);
  margin-bottom: 1.1em;
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header{
  position: fixed; top:0; left:0; right:0;
  z-index: 500;
  display:flex; align-items:center; justify-content:space-between;
  padding: 1.3rem var(--gutter);
  background: linear-gradient(to bottom, rgba(10,9,8,0.85), rgba(10,9,8,0));
  transition: background 0.4s ease, padding 0.4s ease, border-color .4s ease, backdrop-filter .4s ease;
  border-bottom: 1px solid transparent;
}
#site-header.scrolled{
  background: rgba(10,9,8,0.86);
  backdrop-filter: blur(14px);
  padding: 0.85rem var(--gutter);
  border-bottom: 1px solid var(--ligne);
}
.brand-mark img{ height: 30px; width: auto; }
#main-nav{ display:flex; gap: 2.6rem; }
#main-nav a{
  font-size: 0.73rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivoire);
  position: relative;
  padding-bottom: 4px;
  display:inline-block;
}
#main-nav a span{ position:relative; display:inline-block; }
#main-nav a::after{
  content:"";
  position:absolute; left:0; bottom:0;
  width:0; height:1px;
  background: var(--laiton);
  transition: width 0.4s var(--ease);
}
#main-nav a:hover::after{ width: 100%; }

#nav-toggle{
  display:none;
  flex-direction: column;
  justify-content:center;
  gap: 5px;
  width: 30px; height: 24px;
  background:none; border:none; cursor:pointer; padding:0;
  z-index: 600;
}
#nav-toggle span{
  display:block; height:1px; width:100%;
  background: var(--ivoire);
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
#nav-toggle.open span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
#nav-toggle.open span:nth-child(2){ opacity: 0; }
#nav-toggle.open span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   REVEAL ON SCROLL (sections sous le pli)
   ============================================================ */
.reveal{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.in{ opacity: 1; transform: translateY(0); }

/* ============================================================
   LOAD-IN — animation d'entrée du hero (au chargement, pas au scroll)
   ============================================================ */
.load-in{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft);
  transition-delay: calc(var(--d, 0) * 0.11s + 0.15s);
}
body.loaded .load-in{ opacity: 1; transform: translateY(0); }

.line-mask{
  display:block;
  overflow: hidden;
}
.line-inner{
  display:block;
  transform: translateY(110%);
  transition: transform 1.05s var(--ease-soft);
  transition-delay: calc(var(--d, 0) * 0.11s + 0.15s);
}
body.loaded .line-inner{ transform: translateY(0); }

/* ============================================================
   VIEWPORT FRAME — élément signature (coins de viseur, écho au
   travail en 3D / VR de la marque)
   ============================================================ */
.viewport-frame{ position: relative; }
.viewport-frame::before, .viewport-frame::after{
  content:""; position:absolute; width: 20px; height: 20px;
  border-color: var(--laiton-vif); border-style: solid; border-width: 0;
  opacity: 0; transition: opacity .8s ease .1s, width .8s var(--ease), height .8s var(--ease);
  z-index: 3;
}
.viewport-frame::before{ top:-1px; left:-1px; border-top-width:1px; border-left-width:1px; }
.viewport-frame::after{ bottom:-1px; right:-1px; border-bottom-width:1px; border-right-width:1px; }
.viewport-frame.in::before, .viewport-frame.in::after,
body.loaded .viewport-frame.load-in::before, body.loaded .viewport-frame.load-in::after{ opacity: 1; }

/* ============================================================
   HERO
   ============================================================ */
#hero{
  min-height: 100svh;
  display:flex; flex-direction:column; justify-content:flex-end;
  padding: 2rem var(--gutter) 4rem;
  position: relative;
  overflow: hidden;
}
.hero-media{
  position:absolute; inset:0; z-index:0;
}
.hero-media img{
  width:100%; height:100%; object-fit: cover;
  filter: saturate(0.85) brightness(0.62);
  transform: scale(1.03);
}
.hero-media-overlay{
  position:absolute; inset:0;
  background:
    linear-gradient(to top, var(--noir) 4%, rgba(10,9,8,0.55) 42%, rgba(10,9,8,0.4) 65%, rgba(10,9,8,0.72) 100%),
    linear-gradient(115deg, rgba(10,9,8,0.55) 0%, rgba(10,9,8,0.15) 45%, rgba(10,9,8,0.55) 100%);
}
.hero-glow{
  position:absolute; z-index:3; pointer-events:none;
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  left: var(--gx, 50%); top: var(--gy, 30%);
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(198,161,91,0.16), transparent 68%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
@media (hover:hover){ .hero-glow{ opacity: 1; } }

.hero-top{
  position: relative; z-index: 2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: clamp(2rem, 6vw, 5rem);
}
.hero-content{ max-width: 760px; }
.hero-kicker{
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--laiton-vif);
  margin: 0 0 0.5em;
}
.hero-role{
  font-family: var(--f-body);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pierre);
  margin: 0 0 1.4em;
}
.hero-title{
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
.hero-sub{ font-size: 1.05rem; max-width: 44ch; margin-top: 1.2rem; }
.hero-cta{
  display:inline-flex; align-items:center; gap: 0.7em;
  margin-top: 2.2rem;
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ivoire);
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--ligne-vive);
  transition: color .3s ease, border-color .3s ease, gap .3s ease;
}
.hero-cta svg{ transform: rotate(-90deg); transition: transform .3s var(--ease); }
.hero-cta:hover{ color: var(--laiton-vif); border-color: var(--laiton-vif); gap: 1em; }

.hero-logo{
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.6rem;
  opacity: 0.92;
}
.hero-logo img{ width: 100%; height: auto; max-width: 500px; object-fit: contain; }

.hero-quote{
  position: relative; z-index: 2;
  margin-top: 4.5rem;
  max-width: 560px;
  padding: 2rem 2.2rem;
  background: rgba(19,17,16,0.72);
  backdrop-filter: blur(6px);
  border-left: 1px solid var(--ligne);
}
.hero-quote p{
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ivoire);
  line-height: 1.5;
}
.hero-quote cite{
  display:block; margin-top: 1rem;
  font-style: normal;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--laiton);
}

/* ============================================================
   APPROCHE — diptyque résidentiel / commercial
   ============================================================ */
.approche{
  padding: 6.5rem var(--gutter);
  background: var(--noir);
}
.approche-inner{
  max-width: var(--container);
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: stretch;
}
.approche-col{ max-width: 44ch; padding: 0.3rem 0; }
.approche-col:last-child{ margin-left: auto; }
.approche-col p{ font-size: 1.06rem; color: var(--ivoire); opacity: 0.78; }
.approche-divider{
  width: 1px;
  background: linear-gradient(var(--noir) 0%, var(--ligne-vive) 20%, var(--ligne-vive) 80%, var(--noir) 100%);
}

/* ============================================================
   SECTION HEAD (générique)
   ============================================================ */
.section-head{ max-width: 640px; margin: 0 auto 3.8rem; text-align:center; }
.section-head h2{ font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height:1.1; }
.section-sub{ font-size: 1rem; }

/* ============================================================
   SERVICES
   ============================================================ */
#services{ padding: 7.5rem var(--gutter); max-width: var(--container); margin: 0 auto; }
.services-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ligne);
  border: 1px solid var(--ligne);
}
.service-card{
  background: var(--noir);
  padding: 3.2rem 2.4rem;
  transition: background .4s ease;
}
.service-card:hover{ background: var(--noir-panel); }
.service-icon{
  color: var(--patine-vif);
  margin-bottom: 1.6rem;
  transition: color .4s ease, transform .4s var(--ease);
}
.service-card:hover .service-icon{ color: var(--laiton-vif); transform: translateY(-3px); }
.service-card h3{ font-size: 1.3rem; margin-bottom: 0.7em; }
.service-card p{ font-size: 0.94rem; margin: 0; }

/* ============================================================
   GALERIE
   ============================================================ */
#galerie{ padding: 7.5rem var(--gutter) 8rem; max-width: 1440px; margin: 0 auto; }
.gallery-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  width: 80%;
  margin: 0 auto;
}
.gallery-item{
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--noir-panel);
  cursor: pointer;
}
.gallery-item img{
  width:100%; height:100%; object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.8s var(--ease), filter 0.8s ease;
  filter: saturate(0.9) brightness(0.9);
}
/* Apparition subtile et chic au scroll, en cascade légère */
.gallery-reveal{
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--gi, 0) * 90ms);
}
.gallery-reveal.in{
  opacity: 1;
  transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce){
  .gallery-reveal{ transition: none; opacity: 1; transform: none; }
}
.gallery-item::before, .gallery-item::after{
  content:""; position:absolute; width: 16px; height:16px;
  border-color: var(--laiton-vif); border-style: solid; border-width:0;
  opacity:0; transition: opacity .35s ease; z-index:2;
}
.gallery-item::before{ top:10px; left:10px; border-top-width:1px; border-left-width:1px; }
.gallery-item::after{ bottom:10px; right:10px; border-bottom-width:1px; border-right-width:1px; }
.gallery-overlay{
  position:absolute; inset:0; z-index:1;
  display:flex; align-items:flex-end;
  padding: 1rem 1.1rem;
  background: linear-gradient(to top, rgba(10,9,8,0.75), transparent 55%);
  opacity: 0;
  transition: opacity .4s ease;
}
.gallery-overlay span{
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ivoire);
  display:flex; align-items:center; gap: 0.6em;
}
.gallery-overlay span::before{ content:""; width: 14px; height:1px; background: var(--laiton-vif); }
.gallery-item:hover::before, .gallery-item:hover::after, .gallery-item:hover .gallery-overlay{ opacity: 1; }
.gallery-item:hover img{ transform: scale(1.07); filter: saturate(1) brightness(1); }

/* ============================================================
   A PROPOS
   ============================================================ */
#apropos{ padding: 7.5rem var(--gutter); max-width: var(--container); margin: 0 auto; }
.apropos-grid{
  display:grid;
  grid-template-columns: 0.8fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.apropos-portrait{
  aspect-ratio: 3/4;
  overflow:hidden;
  background: var(--noir-panel);
}
.apropos-portrait img{
  width:100%; height:100%; object-fit: cover;
  filter: grayscale(0.7) brightness(0.92);
  transition: filter 1s ease, transform 1s var(--ease);
}
.apropos-portrait:hover img{ filter: grayscale(0) brightness(1); transform: scale(1.03); }
.apropos-text{ position: relative; }
.apropos-quote-mark{
  position:absolute; top:-3.2rem; left:-0.3rem;
  font-family: var(--f-display);
  font-size: 7rem;
  color: var(--ligne-vive);
  line-height:1;
  pointer-events:none;
  user-select:none;
}
.apropos-text h2{ font-size: clamp(1.9rem, 3.2vw, 2.5rem); }
.apropos-text p{ font-size: 1rem; max-width: 58ch; }
.apropos-cta{ color: var(--laiton-vif); font-style: italic; font-family: var(--f-display); font-size: 1.05rem; margin-top: 1.6em; }

/* ============================================================
   CONTACT
   ============================================================ */
#contact{
  padding: 8.5rem var(--gutter);
  text-align:center;
  background: var(--noir-panel);
  border-top: 1px solid var(--ligne);
  position: relative;
  overflow: hidden;
}
#contact::before{
  content:"";
  position:absolute; left:50%; bottom:-30%;
  width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(198,161,91,0.08), transparent 65%);
  pointer-events:none;
}
.contact-inner{ max-width: 620px; margin: 0 auto; position:relative; }
.contact-inner .eyebrow{ display:inline-block; }
.contact-inner h2{ font-size: clamp(2rem, 4vw, 3rem); line-height:1.08; }
.contact-email{
  position: relative;
  display:inline-block;
  margin-top: 1.8rem;
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--laiton-vif);
  padding-bottom: 6px;
}
.contact-email::after{
  content:"";
  position:absolute; left:0; bottom:0; height:1px; width:100%;
  background: var(--ligne-vive);
}
.contact-email::before{
  content:"";
  position:absolute; left:0; bottom:0; height:1px; width:0;
  background: var(--ivoire);
  transition: width .4s var(--ease);
}
.contact-email:hover{ color: var(--ivoire); }
.contact-email:hover::before{ width: 100%; }
.contact-social{
  margin-top: 2.6rem;
  display:flex; justify-content:center; gap: 2.2rem;
  flex-wrap: wrap;
}
.contact-social a{
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pierre);
  transition: color .3s ease;
}
.contact-social a:hover{ color: var(--laiton); }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer{
  padding: 3.4rem var(--gutter) 2.6rem;
  display:flex; flex-direction:column; align-items:center; gap: 1.1rem;
  background: var(--noir);
  position: relative;
}
.footer-logo img{ height: 120px; width:auto; opacity: 0.8; }
#site-footer p{ font-size: 0.72rem; letter-spacing: 0.06em; color: var(--pierre); margin:0; }
.footer-top{
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  border: 1px solid var(--ligne);
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  color: var(--pierre);
  transition: border-color .3s ease, color .3s ease, transform .3s ease;
}
.footer-top:hover{ border-color: var(--laiton); color: var(--laiton-vif); transform: translateY(-53%); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox{
  position: fixed; inset:0; z-index: 900;
  background: rgba(6,5,4,0.97);
  display:flex; align-items:center; justify-content:center;
  opacity:0; visibility:hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
.lightbox.open{ opacity:1; visibility:visible; }
.lightbox img{
  max-width: 88vw; max-height: 84vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  touch-action: pan-y;
  transition: opacity .28s ease, transform .28s ease;
  will-change: opacity, transform;
}
.lightbox img.is-switching{
  opacity: 0;
  transform: scale(0.985);
}
@media (prefers-reduced-motion: reduce){
  .lightbox img{ transition: none; }
}
.lightbox button{
  position:absolute;
  background: none; border: 1px solid var(--ligne);
  color: var(--ivoire);
  cursor:pointer;
  font-size: 1.4rem;
  line-height: 1;
  width: 46px; height: 46px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  transition: border-color .3s ease, color .3s ease;
}
.lightbox button:hover{ border-color: var(--laiton); color: var(--laiton); }
#lightbox-close{ top: 2rem; right: 2rem; }
#lightbox-prev{ left: 2rem; top:50%; transform: translateY(-50%); }
#lightbox-next{ right: 2rem; top:50%; transform: translateY(-50%); }
.lightbox-counter{
  position:absolute; left:2rem; bottom:2rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pierre);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px){
  .apropos-grid{ grid-template-columns: 1fr; }
  .apropos-portrait{ max-width: 340px; margin: 0 auto; }
  .apropos-quote-mark{ display:none; }
  .services-grid{ grid-template-columns: 1fr; }
  .gallery-grid{ width: 88%; gap: 1rem; }
  .approche-inner{ grid-template-columns: 1fr; }
  .approche-divider{ width: 100%; height: 1px; background: linear-gradient(90deg, var(--noir) 0%, var(--ligne-vive) 20%, var(--ligne-vive) 80%, var(--noir) 100%); }
  .approche-col:last-child{ margin-left: 0; }
  .hero-title{ font-size: clamp(2.4rem, 7vw, 3.6rem); }
}

@media (max-width: 720px){
  #main-nav{
    position: fixed; top:0; right:0; height:100svh; width: min(78vw, 320px);
    background: var(--noir-panel);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 3rem;
    transform: translateX(100%);
    transition: transform .45s var(--ease);
    border-left: 1px solid var(--ligne);
  }
  #main-nav.open{ transform: translateX(0); }
  #main-nav a{ font-size: 0.95rem; }
  #nav-toggle{ display:flex; }

  #hero{ padding-top: 7rem; align-items: stretch; }
  .hero-top{
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.6rem;
  }
  .hero-logo{ flex-basis: auto; width: min(78vw, 340px); margin: 0 auto; align-self: center; padding-bottom: 0; }
  .hero-quote{ padding: 1.5rem 1.5rem; margin-top: 3rem; }

  .gallery-grid{ width: 94%; gap: 0.6rem; }
  .lightbox button{ width: 40px; height:40px; font-size: 1.2rem; }
  #lightbox-prev{ left: 0.6rem; }
  #lightbox-next{ right: 0.6rem; }
  #lightbox-close{ top: 1rem; right: 1rem; }
  .lightbox-counter{ left: 1rem; bottom: 1rem; }

  .footer-top{ position: static; transform:none; margin-top: 0.4rem; }
  #site-footer{ gap: 0.8rem; }
}

@media (max-width: 480px){
  .gallery-grid{ width: 96%; gap: 0.5rem; }
  .approche{ padding: 4.5rem var(--gutter); }
  #services, #apropos, #galerie{ padding-top: 5rem; padding-bottom: 5rem; }
  #contact{ padding: 5.5rem var(--gutter); }
}
