@charset "utf-8";

/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0a09;
  --bg-alt: #131110;
  --ink: #f4ede3;
  --ink-dim: rgba(244, 237, 227, 0.68);
  --ink-faint: rgba(244, 237, 227, 0.4);
  --gold: #c9a876;
  --gold-soft: rgba(201, 168, 118, 0.35);
  --line: rgba(244, 237, 227, 0.12);
  --serif: 'Cormorant Garamond', serif;
  --sans: 'Jost', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============ FILM GRAIN ============ */
.grain {
  position: fixed; inset: 0; z-index: 9998; 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='140' height='140'%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");
}

/* ============ CUSTOM CURSOR (heart) ============ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  display: flex; align-items: center; justify-content: center;
}
.cursor-dot svg { width: 13px; height: 12px; fill: var(--gold); display: block; filter: drop-shadow(0 0 4px rgba(201,168,118,0.5)); }
.cursor-ring svg {
  width: 28px; height: 26px; display: block; fill: none; stroke: var(--gold-soft); stroke-width: 1.4px;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), stroke 0.3s ease, opacity 0.3s ease;
}
.cursor-ring.grow svg { width: 46px; height: 42px; stroke: var(--gold); }

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity 0.8s var(--ease), visibility 0.8s var(--ease);
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader-mark {
  font-family: var(--serif); font-style: italic; font-size: 2rem; letter-spacing: 2px; color: var(--ink);
  opacity: 0; animation: fadeUp 1s var(--ease) 0.2s forwards;
}
.preloader-bar { width: 160px; height: 1px; background: var(--line); overflow: hidden; }
.preloader-bar span {
  display: block; height: 100%; width: 0%; background: var(--gold);
  animation: loadBar 1.6s var(--ease) 0.3s forwards;
}
@keyframes loadBar { to { width: 100%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============ HEADER ============ */
header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 50px; transition: all 0.4s var(--ease);
}
header.scrolled { padding: 16px 50px; background: rgba(11, 10, 9, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }

.logo {
  font-family: var(--serif); font-style: italic; font-size: 1.6rem; letter-spacing: 1px; color: var(--ink);
}
.logo span { color: var(--gold); }
.logo.small { font-size: 1.2rem; }

nav#mainNav { display: flex; align-items: center; gap: 38px; }
nav#mainNav a {
  font-size: 0.8rem; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase;
  position: relative; padding-bottom: 4px;
}
nav#mainNav a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--gold);
  transition: width 0.35s var(--ease);
}
nav#mainNav a:not(.nav-cta):hover::after { width: 100%; }

.nav-cta {
  border: 1px solid var(--gold-soft); border-radius: 30px; padding: 10px 22px !important;
  transition: all 0.35s var(--ease);
}
.nav-cta:hover { background: var(--gold); color: #100d0a; border-color: var(--gold); }

.menu-toggle { display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 1001; }
.menu-toggle span { width: 26px; height: 1px; background: var(--ink); transition: all 0.3s var(--ease); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 34px;
  font-size: 0.8rem; letter-spacing: 1.5px; text-transform: uppercase; border-radius: 40px;
  transition: all 0.4s var(--ease); cursor: pointer; border: 1px solid transparent;
}
.btn-outline { border-color: var(--gold-soft); color: var(--ink); }
.btn-outline:hover { background: var(--gold); border-color: var(--gold); color: #100d0a; }
.btn-solid { background: var(--gold); color: #100d0a; border: none; font-family: var(--sans); }
.btn-solid:hover { background: var(--ink); }

/* ============ HERO ============ */
.hero { position: relative; width: 100%; height: 100vh; overflow: hidden; }
.hero-slider { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute; inset: 0; opacity: 0; z-index: 1;
  transition: opacity 1.2s var(--ease);
}
.hero-slide.active { opacity: 1; z-index: 2; }

.hero-layer { position: absolute; inset: 0; }
.hero-layer img {
  width: 112%; height: 112%; object-fit: cover; position: absolute; top: -6%; left: -6%;
  filter: contrast(1.08) brightness(0.6) saturate(1.05); transform: scale(1.08);
  transition: transform 9s linear;
}
.hero-slide.active .hero-layer img { transform: scale(1); }

.hero-slide::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,10,9,0.55) 0%, rgba(11,10,9,0.1) 28%, rgba(11,10,9,0.25) 60%, rgba(11,10,9,0.85) 100%);
}

.hero-copy {
  position: absolute; left: 60px; bottom: 170px; z-index: 10; max-width: 640px;
}
.hero-copy .kicker { display: inline-block; margin-bottom: 18px; }
.hero-copy h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(2.6rem, 5.5vw, 4.6rem);
  line-height: 1.05; letter-spacing: -0.5px; margin-bottom: 20px; color: var(--ink);
  text-shadow: 0 4px 30px rgba(0,0,0,0.35);
}
.hero-copy p { font-size: 1rem; color: var(--ink-dim); letter-spacing: 0.3px; max-width: 460px; }

.kicker {
  font-size: 0.78rem; letter-spacing: 3px; text-transform: uppercase; color: var(--gold);
  position: relative; padding-left: 34px;
}
.kicker::before { content: ''; position: absolute; left: 0; top: 50%; width: 24px; height: 1px; background: var(--gold); }

.reveal-line { display: block; opacity: 0; transform: translateY(24px); }
.hero-slide.active .reveal-line { animation: revealLine 1s var(--ease) forwards; }
.hero-slide.active .kicker.reveal-line { animation-delay: 0.15s; }
.hero-slide.active h1.reveal-line { animation-delay: 0.32s; }
.hero-slide.active p.reveal-line { animation-delay: 0.55s; }
@keyframes revealLine { to { opacity: 1; transform: translateY(0); } }

.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--ink);
  background: rgba(244,237,227,0.03); backdrop-filter: blur(6px);
  transition: all 0.35s var(--ease);
}
.hero-nav:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,118,0.08); }
.hero-nav.prev { left: 40px; }
.hero-nav.next { right: 40px; }

.hero-dots {
  position: absolute; bottom: 46px; right: 60px; z-index: 20; display: flex; gap: 12px;
}
.hero-dots .dot, .testi-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(244,237,227,0.3); cursor: pointer;
  transition: all 0.35s var(--ease);
}
.hero-dots .dot.active, .testi-dots .dot.active { background: var(--gold); transform: scale(1.3); }

.scroll-cue {
  position: absolute; bottom: 40px; left: 62px; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
}
.scroll-cue i {
  width: 1px; height: 50px; background: linear-gradient(var(--gold), transparent);
  position: relative; overflow: hidden; display: block;
}
.scroll-cue i::after {
  content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 100%; background: var(--ink);
  animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop { to { top: 100%; } }

/* ============ REVEAL UTILITY ============ */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============ SECTION HEAD ============ */
.section-head { text-align: center; margin-bottom: 60px; }
.section-head .kicker { justify-content: center; display: inline-flex; align-items: center; }
.section-head h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 3.2rem);
  margin-top: 18px; letter-spacing: -0.5px;
}

/* ============ MANIFESTO ============ */
.manifesto {
  padding: 200px 20px; text-align: center; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}
.manifesto p {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  max-width: 900px; line-height: 1.5; color: var(--ink);
}
.manifesto p em { color: var(--gold); font-style: italic; }
.manifesto-sign { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.2rem; }

/* ============ PORTFOLIO ============ */
.portfolio { padding: 60px 60px 140px; }

.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 50px; }
.filter-btn {
  background: none; border: 1px solid var(--line); color: var(--ink-dim); font-family: var(--sans);
  padding: 10px 24px; border-radius: 30px; font-size: 0.78rem; letter-spacing: 1.2px; text-transform: uppercase;
  cursor: pointer; transition: all 0.35s var(--ease);
}
.filter-btn:hover { border-color: var(--gold-soft); color: var(--ink); }
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: #100d0a; }

.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 260px; gap: 14px;
}
.gallery-item {
  position: relative; overflow: hidden; border-radius: 4px; cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gallery-item.hide { display: none; }
.gallery-item:nth-child(6n+1) { grid-row: span 2; }
.gallery-item:nth-child(6n+4) { grid-column: span 2; }

.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.6s ease;
  filter: contrast(1.05) brightness(0.88) saturate(1.05);
}
.gallery-item::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(11,10,9,0.85) 100%);
  opacity: 0; transition: opacity 0.5s ease;
}
.gallery-item figcaption {
  position: absolute; left: 20px; bottom: 18px; z-index: 3; font-family: var(--serif); font-style: italic;
  font-size: 1.2rem; color: var(--ink); opacity: 0; transform: translateY(10px);
  transition: all 0.5s var(--ease);
}
.gallery-item:hover img { transform: scale(1.08); filter: contrast(1.05) brightness(0.65) saturate(1.05); }
.gallery-item:hover::after { opacity: 1; }
.gallery-item:hover figcaption { opacity: 1; transform: translateY(0); }

/* ============ SERVIZI ============ */
.servizi { padding: 120px 60px; background: var(--bg-alt); }
.servizi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); max-width: 1200px; margin: 0 auto; }
.servizio { background: var(--bg-alt); padding: 50px 40px; transition: background 0.4s ease; }
.servizio:hover { background: #17140f; }
.servizio-num { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1rem; }
.servizio h3 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 16px 0 14px; }
.servizio p { color: var(--ink-dim); line-height: 1.7; font-size: 0.95rem; }

/* ============ CHI SONO ============ */
.chi-sono {
  display: grid; grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 0;
  min-height: 90vh; padding: 0 0 0 60px;
}
.chi-sono-img { height: 100%; overflow: hidden; }
.chi-sono-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; min-height: 500px; filter: contrast(1.05) brightness(0.92); }
.chi-sono-text { padding: 60px 80px; max-width: 560px; }
.chi-sono-text h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 4vw, 3rem); margin: 16px 0 26px; }
.chi-sono-text p { color: var(--ink-dim); line-height: 1.85; margin-bottom: 20px; font-size: 1.02rem; }
.chi-sono-text .btn { margin-top: 20px; }

/* ============ TESTIMONIANZE ============ */
.testimonianze { padding: 140px 20px; text-align: center; }
.testi-carousel { max-width: 780px; margin: 0 auto; }
.testi-track { position: relative; min-height: 200px; }
.testi-slide {
  position: absolute; inset: 0; opacity: 0; transform: translateY(14px); transition: all 0.7s var(--ease); pointer-events: none;
}
.testi-slide.active { opacity: 1; transform: translateY(0); pointer-events: auto; position: relative; }
.testi-slide p {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.6; color: var(--ink);
  margin-bottom: 26px;
}
.testi-slide cite {
  font-style: normal; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold);
}
.testi-dots { display: flex; justify-content: center; gap: 12px; margin-top: 40px; }

/* ============ CONTATTI ============ */
.contatti { padding: 140px 60px; background: var(--bg-alt); }
.contatti-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 100px; max-width: 1200px; margin: 0 auto; }
.contatti-text h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 4vw, 3.2rem); margin: 16px 0 24px; line-height: 1.15; }
.contatti-text p { color: var(--ink-dim); line-height: 1.8; margin-bottom: 40px; max-width: 420px; }

.contatti-list li {
  display: flex; justify-content: space-between; padding: 18px 0; border-top: 1px solid var(--line); max-width: 420px;
}
.contatti-list li:last-child { border-bottom: 1px solid var(--line); }
.contatti-list span { color: var(--ink-faint); font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }
.contatti-list a { font-family: var(--serif); font-size: 1.15rem; transition: color 0.3s ease; }
.contatti-list a:hover { color: var(--gold); }

.contatti-form { display: flex; flex-direction: column; gap: 22px; }
.form-row { display: flex; flex-direction: column; gap: 10px; }
.form-row label { font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-faint); }
.form-row input, .form-row textarea {
  background: transparent; border: none; border-bottom: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; padding: 10px 2px; transition: border-color 0.35s ease;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--ink-faint); }
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--gold); }
.form-row textarea { min-height: 100px; resize: vertical; }
.contatti-form .btn { align-self: flex-start; margin-top: 10px; }
.form-note { font-size: 0.85rem; color: var(--gold); min-height: 1.2em; }

/* ============ MAGNETIC BUTTON ============ */
.magnetic { will-change: transform; }

/* ============ FOOTER ============ */
footer {
  padding: 50px 60px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  border-top: 1px solid var(--line);
}
footer p { color: var(--ink-faint); font-size: 0.82rem; text-align: center; }
.footer-links { display: flex; gap: 26px; }
.footer-links a { font-size: 0.8rem; letter-spacing: 1px; color: var(--ink-dim); transition: color 0.3s ease; }
.footer-links a:hover { color: var(--gold); }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 5000; background: rgba(6,5,4,0.96); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.4s ease;
}
.lightbox.active { display: flex; opacity: 1; }
.lightbox figure { max-width: 88vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lightbox img {
  max-width: 88vw; max-height: 78vh; object-fit: contain; border-radius: 2px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6); filter: contrast(1.05);
  opacity: 0; transform: scale(0.96); transition: all 0.45s var(--ease);
}
.lightbox.active img { opacity: 1; transform: scale(1); }
.lightbox figcaption { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-dim); }
.lightbox-close {
  position: absolute; top: 30px; right: 40px; background: none; border: none; color: var(--ink);
  font-size: 2rem; cursor: pointer; z-index: 10; transition: all 0.3s ease; line-height: 1;
}
.lightbox-close:hover { color: var(--gold); transform: rotate(90deg); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; cursor: pointer;
  width: 54px; height: 54px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; font-size: 1.4rem; transition: all 0.3s ease;
}
.lightbox-nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox-nav.prev { left: 30px; }
.lightbox-nav.next { right: 30px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item:nth-child(6n+4) { grid-column: span 1; }
  .servizi-grid { grid-template-columns: 1fr; }
  .chi-sono { grid-template-columns: 1fr; padding: 0; }
  .chi-sono-img img { min-height: 400px; }
  .chi-sono-text { padding: 60px 40px; max-width: 100%; }
  .contatti-inner { grid-template-columns: 1fr; gap: 60px; }
}

@media (max-width: 768px) {
  header { padding: 20px 24px; }
  header.scrolled { padding: 14px 24px; }
  nav#mainNav {
    position: fixed; top: 0; right: 0; height: 100vh; width: 78%; max-width: 320px;
    background: rgba(11,10,9,0.98); backdrop-filter: blur(20px); flex-direction: column; justify-content: center;
    gap: 34px; transform: translateX(100%); transition: transform 0.5s var(--ease); border-left: 1px solid var(--line);
  }
  nav#mainNav.active { transform: translateX(0); }
  nav#mainNav a { font-size: 1rem; }
  .menu-toggle { display: flex; }

  .hero-copy { left: 24px; right: 24px; bottom: 110px; }
  .hero-nav { width: 40px; height: 40px; }
  .hero-nav.prev { left: 16px; }
  .hero-nav.next { right: 16px; }
  .hero-dots { right: 24px; bottom: 30px; }
  .scroll-cue { display: none; }

  .manifesto { padding: 120px 24px; }
  .portfolio { padding: 40px 20px 90px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 190px; gap: 8px; }
  .gallery-item:nth-child(6n+1) { grid-row: span 1; }
  .gallery-item figcaption { font-size: 1rem; }

  .servizi { padding: 80px 24px; }
  .contatti { padding: 90px 24px; }
  footer { flex-direction: column; text-align: center; padding: 40px 24px; }

  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-close { top: 20px; right: 20px; }
}
