@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

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

:root{
  --gold:#C9A84C;
  /* --dark maps to a warm light value so color:var(--dark) stays readable
     on the dark background — the cta button gets an inverted override below */
  --dark:#f0ede8;
  --off:#f0ede8;
  --muted:rgba(240,237,232,0.48);
  --border:rgba(201,168,76,0.13);
  --border2:rgba(201,168,76,0.32);
}

html{scroll-behavior:smooth}

body{
  background:#0a0a0a;
  color:var(--off);
  font-family:'Inter',sans-serif;
  overflow-x:hidden;
}

::selection{background:var(--gold);color:#0a0a0a}

/* ─── AMBIENT LAYERS ────────────────────────────────────────────── */
/* Fixed full-viewport particle canvas (background.js), sits above the
   body color but below every piece of real content (.page). */
#fluid-bg{position:fixed;inset:0;width:100vw;height:100vh;z-index:0;pointer-events:none}

/* Fine film-grain texture — cheap way to kill the flat "generated" look */
body::before{
  content:'';
  position:fixed;inset:0;
  z-index:1;
  pointer-events:none;
  opacity:.035;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* All real page content lives above the ambient canvas + grain */
.page{position:relative;z-index:1}

/* Scroll progress hairline */
#scroll-progress{position:fixed;top:0;left:0;height:2px;width:0%;background:var(--gold);z-index:200;transition:width .12s linear;box-shadow:0 0 8px rgba(201,168,76,.5)}

/* ─── NAVIGATION ────────────────────────────────────────────────── */
nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:1.7rem 4rem;
  border-bottom:.5px solid var(--border);
  position:sticky;
  top:0;
  background:rgba(10,10,10,.88);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  z-index:100;
  transition:padding .35s ease,border-color .35s ease;
}
nav.scrolled{padding:1rem 4rem;border-color:rgba(201,168,76,.2)}

.nav-logo{
  font-family:'Cormorant Garamond',serif;
  font-size:1.05rem;
  font-weight:600;
  letter-spacing:.16em;
  color:var(--off);
  text-decoration:none;
  transition:color .25s;
}
.nav-logo:hover{color:var(--gold)}

.nav-links{display:flex;gap:2.4rem;list-style:none}
.nav-links a{
  font-size:.7rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted);
  text-decoration:none;
  position:relative;
  padding-bottom:3px;
  transition:color .25s;
}
.nav-links a::after{
  content:'';
  position:absolute;
  bottom:0;left:0;
  width:0;height:.5px;
  background:var(--gold);
  transition:width .3s ease;
}
.nav-links a:hover{color:var(--off)}
.nav-links a:hover::after{width:100%}

/* ─── FADE-IN ───────────────────────────────────────────────────── */
.fade-in{
  opacity:0;
  transform:translateY(24px);
  transition:opacity .8s cubic-bezier(.25,.46,.45,.94),transform .8s cubic-bezier(.25,.46,.45,.94);
}
.fade-in.visible{opacity:1;transform:translateY(0)}

/* ─── DIVIDERS & SECTION HEAD ───────────────────────────────────── */
hr.div{border:none;border-top:.5px solid var(--border);margin:0 4rem}

body{counter-reset:sec}
.sec-head{
  display:flex;align-items:center;gap:1.2rem;
  padding:2.8rem 4rem 2rem;
  counter-increment:sec;
}
.sec-head::before{
  content:'0' counter(sec);
  font-family:'Cormorant Garamond',serif;font-style:italic;font-weight:300;
  font-size:1rem;color:var(--muted);flex-shrink:0;
}
.sec-label{
  font-size:.63rem;letter-spacing:.28em;text-transform:uppercase;
  color:var(--gold);white-space:nowrap;font-weight:500;
}
.sec-line{flex:1;height:.5px;background:var(--border);position:relative;overflow:hidden}
.sec-line::after{
  content:'';position:absolute;inset:0;width:0;background:var(--gold);
  transition:width 1s cubic-bezier(.16,1,.3,1);
}
.sec-head.visible .sec-line::after{width:100%}

/* ─── LAYOUT UTILITIES ──────────────────────────────────────────── */
.content-section{padding:3.5rem 4rem}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:start}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.4rem}
.grid-asymm{display:grid;grid-template-columns:1.3fr 1fr;gap:3rem;align-items:start}

/* ─── TYPOGRAPHY ────────────────────────────────────────────────── */
h2.section-title{
  font-family:'Playfair Display','Cormorant Garamond',serif;
  font-size:2.2rem;font-weight:400;
  margin-bottom:1.3rem;line-height:1.18;
  color:var(--off);
  position:relative;display:inline-block;
}
h2.section-title::after{
  content:'';position:absolute;left:1px;bottom:-.4rem;
  width:34px;height:1.5px;background:var(--gold);
  transform-origin:left;transform:scaleX(0);
  transition:transform .7s cubic-bezier(.16,1,.3,1);
}
.fade-in.visible h2.section-title::after{transform:scaleX(1)}
p.body-text{
  font-size:.95rem;font-weight:300;
  color:var(--muted);line-height:1.95;margin-bottom:.9rem;
}

/* ─── CTA BUTTON — inverted for dark theme ──────────────────────── */
/* inline style uses background:var(--dark) + color:var(--off)
   with --dark now being light, we flip the text to dark on hover */
.cta-p{color:#0a0a0a !important}
.cta-p:hover{color:var(--off) !important}

/* ─── IMAGES ────────────────────────────────────────────────────── */
.ibox{border-radius:2px;overflow:hidden;transition:transform .5s cubic-bezier(.16,1,.3,1),box-shadow .5s cubic-bezier(.16,1,.3,1)}
.ibox img{width:100%;display:block;object-fit:contain;max-height:420px;transition:transform .6s cubic-bezier(.16,1,.3,1)}
.ibox-dark{border-radius:2px;overflow:hidden;background:#0f0f0f;padding:1.5rem;transition:transform .5s cubic-bezier(.16,1,.3,1),box-shadow .5s}
.ibox-dark img{width:100%;display:block;object-fit:contain;max-height:220px}

/* Generic hover-lift for project-page image tiles (classes declared per-page) */
.vbox,.social-card,.mockup-box,.gbox,.sbox{transition:transform .5s cubic-bezier(.16,1,.3,1),box-shadow .5s cubic-bezier(.16,1,.3,1)}

@media(hover:hover){
  .ibox:hover,.ibox-dark:hover,.vbox:hover,.social-card:hover,.mockup-box:hover,.gbox:hover,.sbox:hover{
    transform:translateY(-6px);
    box-shadow:0 28px 52px -26px rgba(0,0,0,.6);
  }
  .ibox:hover img{transform:scale(1.03)}
}

/* Break the perfectly aligned grid — small hand-placed offset on alternating tiles */
@media(min-width:769px){
  .finales-grid .ibox:nth-child(2),
  .grid-3 .ibox:nth-child(2),
  .vgrid .vbox:nth-child(2),
  .img-grid-2 .ibox:nth-child(2),
  .img-grid-3 .ibox:nth-child(2){transform:translateY(-16px)}
  .finales-grid .ibox:nth-child(2):hover,
  .grid-3 .ibox:nth-child(2):hover,
  .vgrid .vbox:nth-child(2):hover,
  .img-grid-2 .ibox:nth-child(2):hover,
  .img-grid-3 .ibox:nth-child(2):hover{transform:translateY(-22px)}
}

/* Subtle, slow Ken Burns drift on every project-page hero image — kills the static, stock-template stillness */
[class*="-hero-bg"]{animation:kenburns 24s ease-in-out infinite alternate}
@keyframes kenburns{0%{transform:scale(1)}100%{transform:scale(1.07)}}
@media(prefers-reduced-motion:reduce){[class*="-hero-bg"]{animation:none}}

/* ─── CHIPS ─────────────────────────────────────────────────────── */
.chip-row{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.2rem}
.chip{
  font-size:.68rem;letter-spacing:.07em;
  padding:.3rem .8rem;
  border:.5px solid var(--border2);
  color:var(--muted);
  border-radius:2px;
  transition:border-color .25s,color .25s,transform .25s,background .25s;
}
.chip:hover{border-color:var(--gold);color:var(--gold);transform:translateY(-2px);background:rgba(201,168,76,.08)}

/* ─── STATS ──────────────────────────────────────────────────────── */
.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.stat-block{
  padding:1.5rem;
  border:.5px solid var(--border);
  border-radius:2px;
  transition:border-color .35s;
}
.stat-block:hover{border-color:var(--border2)}
.stat-n{
  font-family:'Playfair Display','Cormorant Garamond',serif;
  font-size:2.3rem;font-weight:400;
  color:var(--gold);line-height:1;margin-bottom:.3rem;
}
.stat-l{
  font-size:.63rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--muted);
}

/* ─── CAROUSEL ───────────────────────────────────────────────────── */
.carousel{position:relative;overflow:hidden;border-radius:2px}
.carousel-track{display:flex;transition:transform .6s cubic-bezier(.77,0,.18,1)}
.carousel-track img{width:100%;flex-shrink:0;object-fit:contain;max-height:400px}
.carousel-btn{
  position:absolute;top:50%;transform:translateY(-50%);
  background:rgba(10,10,10,.72);
  color:var(--off);
  border:.5px solid var(--border2);
  width:38px;height:38px;
  font-size:1rem;
  display:flex;align-items:center;justify-content:center;
  transition:background .25s,border-color .25s,color .25s;
  border-radius:2px;
}
.carousel-btn:hover{background:var(--gold);border-color:var(--gold);color:#0a0a0a}
.carousel-btn.prev{left:.8rem}
.carousel-btn.next{right:.8rem}
.carousel-dots{display:flex;justify-content:center;gap:.5rem;padding:.8rem 0}
.carousel-dot{
  width:4px;height:4px;
  border-radius:50%;
  background:var(--border2);
  transition:background .25s,transform .25s;
  cursor:pointer;
}
.carousel-dot.active{background:var(--gold);transform:scale(1.5)}

/* ─── PROJECT HERO ──────────────────────────────────────────────── */
.proj-hero{
  min-height:50vh;
  display:flex;align-items:flex-end;
  padding:3.5rem 4rem;
  position:relative;overflow:hidden;
}
.proj-hero-bg{
  position:absolute;inset:0;
  background-size:cover;background-position:center;
  filter:brightness(.22);
}
.proj-hero-content{position:relative;z-index:1;max-width:680px}

.proj-tag{
  font-size:.63rem;letter-spacing:.26em;text-transform:uppercase;
  color:var(--gold);margin-bottom:.9rem;
  display:flex;align-items:center;gap:.8rem;
}
.proj-tag::before{content:'';width:28px;height:.5px;background:var(--gold);display:inline-block}

.proj-title{
  font-family:'Playfair Display','Cormorant Garamond',serif;
  font-size:clamp(2.6rem,5vw,4.2rem);
  font-weight:400;
  color:var(--off);
  line-height:1.05;margin-bottom:1rem;
}
.proj-desc{
  font-size:.95rem;
  color:rgba(240,237,232,.6);
  font-weight:300;line-height:1.85;max-width:560px;
}

/* ─── BACK LINK ─────────────────────────────────────────────────── */
.back-link{
  display:inline-flex;align-items:center;gap:.5rem;
  font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);text-decoration:none;
  border-bottom:.5px solid var(--border2);padding-bottom:2px;
  transition:color .25s,border-color .25s;
}
.back-link:hover{color:var(--gold);border-color:var(--gold)}

/* ─── FOOTER ────────────────────────────────────────────────────── */
footer{
  border-top:.5px solid var(--border);
  padding:2rem 4rem;
  display:flex;justify-content:space-between;align-items:center;
  margin-top:4rem;
}
footer p{font-size:.68rem;color:var(--muted);font-weight:300;letter-spacing:.06em}

/* ─── KEYFRAMES ─────────────────────────────────────────────────── */
@keyframes pu{0%,100%{opacity:1}50%{opacity:.3}}

/* ─── LIGHTBOX ──────────────────────────────────────────────────── */
.lightbox-trigger{cursor:zoom-in}

.lightbox-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.85);
  display:flex;align-items:center;justify-content:center;
  padding:2rem;
  opacity:0;visibility:hidden;
  transition:opacity .4s cubic-bezier(.16,1,.3,1),visibility 0s linear .4s;
  z-index:1000;
}
.lightbox-overlay.active{
  opacity:1;visibility:visible;
  transition:opacity .4s cubic-bezier(.16,1,.3,1),visibility 0s linear 0s;
}
.lightbox-img{
  max-width:92vw;max-height:92vh;
  width:auto;height:auto;
  object-fit:contain;
  border-radius:2px;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.7);
  cursor:zoom-out;
  transform:scale(.96);
  transition:transform .4s cubic-bezier(.16,1,.3,1);
}
.lightbox-overlay.active .lightbox-img{transform:scale(1)}
.lightbox-close{
  position:fixed;top:1.5rem;right:1.8rem;
  width:42px;height:42px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.05);
  border:.5px solid var(--border2);
  border-radius:2px;
  color:var(--off);
  font-size:1.05rem;
  cursor:pointer;
  transition:background .25s,border-color .25s,color .25s,transform .35s;
}
.lightbox-close:hover{background:var(--gold);border-color:var(--gold);color:#0a0a0a;transform:rotate(90deg)}

body.lightbox-open{overflow:hidden}

@media(max-width:768px){
  .lightbox-overlay{padding:1rem}
  .lightbox-close{top:1rem;right:1rem;width:38px;height:38px;font-size:.95rem}
}

/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media(max-width:768px){
  nav{padding:1.2rem 1.5rem}
  nav.scrolled{padding:.9rem 1.5rem}
  .content-section{padding:2rem 1.5rem}
  .grid-2,.grid-asymm{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr 1fr}
  hr.div{margin:0 1.5rem}
  .sec-head{padding:2rem 1.5rem 1.2rem}
  footer{padding:1.5rem;flex-direction:column;gap:.5rem;text-align:center}
  .proj-hero{padding:2rem 1.5rem}
}
