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

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

:root {
  --black: #0a0a0a;
  --black2: #111111;
  --black3: #1a1a1a;
  --white: #f5f2ee;
  --white2: rgba(245,242,238,0.75);
  --white3: rgba(245,242,238,0.35);
  --white4: rgba(245,242,238,0.12);
  --accent: #c8a96e;
  --accent2: rgba(200,169,110,0.2);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', sans-serif;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; height: 100%; }
body {
  background: var(--black); color: var(--white); font-family: var(--sans); font-weight: 300; overflow-x: hidden; cursor: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Spinge il footer in fondo: il contenuto principale "cresce"
   per occupare tutto lo spazio rimasto, così il footer resta
   sempre attaccato al bordo inferiore della pagina, anche se
   il testo sopra è poco. */
body > footer { margin-top: auto; }

/* CUSTOM CURSOR */
.cursor { position: fixed; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%,-50%); transition: transform 0.1s; }
.cursor-ring { position: fixed; width: 36px; height: 36px; border: 1px solid rgba(200,169,110,0.5); border-radius: 50%; pointer-events: none; z-index: 9998; transform: translate(-50%,-50%); transition: all 0.18s ease; }
.cursor-ring.expand { width: 56px; height: 56px; border-color: var(--accent); }

/* NAVBAR */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 28px 48px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(to bottom, rgba(10,10,10,0.85) 0%, transparent 100%); backdrop-filter: blur(0px); transition: var(--transition); }
nav.scrolled { background: rgba(10,10,10,0.92); backdrop-filter: blur(12px); padding: 18px 48px; border-bottom: 0.5px solid var(--white4); }
.nav-brand { font-family: var(--serif); font-size: 22px; font-weight: 300; letter-spacing: 0.12em; color: var(--white); text-decoration: none; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 36px; align-items: center; list-style: none; }
.nav-links a { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white2); text-decoration: none; transition: color var(--transition); position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 0; height: 0.5px; background: var(--accent); transition: width var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-menu { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-menu span { width: 22px; height: 0.5px; background: var(--white); display: block; transition: var(--transition); }

/* HERO SLIDESHOW */
.hero { position: relative; height: 100vh; overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.slide.active { opacity: 1; }
.slide-bg { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); transition: transform 8s ease; }
.slide.active .slide-bg { transform: scale(1); }
.slide-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.2) 50%, rgba(10,10,10,0.65) 100%); }

.hero-content { position: absolute; bottom: 72px; left: 48px; z-index: 5; }
.hero-label { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; opacity: 0; transform: translateY(10px); transition: all 0.6s ease 0.3s; }
.slide.active .hero-label { opacity: 1; transform: translateY(0); }
.hero-title { font-family: var(--serif); font-size: clamp(32px, 5vw, 58px); font-weight: 300; line-height: 1.1; color: var(--white); opacity: 0; transform: translateY(16px); transition: all 0.7s ease 0.5s; }
.slide.active .hero-title { opacity: 1; transform: translateY(0); }
.hero-title em { font-style: italic; color: var(--accent); }

.hero-nav { position: absolute; right: 48px; bottom: 72px; display: flex; gap: 12px; z-index: 5; }
.hero-btn { width: 44px; height: 44px; border: 0.5px solid var(--white3); background: rgba(10,10,10,0.3); color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: var(--transition); }
.hero-btn:hover { border-color: var(--accent); background: var(--accent2); }

.slide-counter { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.slide-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--white3); cursor: pointer; transition: all var(--transition); }
.slide-dot.active { background: var(--accent); height: 20px; border-radius: 2px; }

.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0.5; }
.scroll-hint span { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--white); }
.scroll-line { width: 0.5px; height: 40px; background: linear-gradient(to bottom, var(--white), transparent); animation: scrollPulse 2s ease infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.3; transform: scaleY(1); } 50% { opacity: 1; transform: scaleY(1.1); } }

/* SECTIONS */
section { padding: 100px 48px; }
.section-header { margin-bottom: 64px; display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 0.5px solid var(--white4); padding-bottom: 24px; }
.section-label { font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.section-title { font-family: var(--serif); font-size: clamp(28px, 4vw, 46px); font-weight: 300; line-height: 1.1; }
.section-title em { font-style: italic; }
.section-link { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--white2); text-decoration: none; border-bottom: 0.5px solid var(--white3); padding-bottom: 2px; transition: var(--transition); white-space: nowrap; }
.section-link:hover { color: var(--accent); border-color: var(--accent); }

/* GALLERY GRID */
.gallery-home { background: var(--black2); }
.gallery-categories { display: flex; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.cat-btn { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--white3); background: none; border: 0.5px solid transparent; padding: 8px 16px; cursor: pointer; transition: var(--transition); }
.cat-btn:hover, .cat-btn.active { color: var(--white); border-color: var(--white4); }
.cat-btn.active { color: var(--accent); border-color: var(--accent2); }

.grid-masonry { columns: 3; gap: 10px; }
.grid-item { break-inside: avoid; margin-bottom: 10px; overflow: hidden; position: relative; cursor: pointer; }
.grid-item img { width: 100%; display: block; transition: transform 0.8s ease; filter: brightness(0.88); }
.grid-item:hover img { transform: scale(1.04); filter: brightness(1); }
.grid-item-info { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,0.75) 0%, transparent 50%); opacity: 0; transition: opacity var(--transition); display: flex; align-items: flex-end; padding: 20px; }
.grid-item:hover .grid-item-info { opacity: 1; }
.grid-item-info p { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); }

/* ABOUT STRIP */
.about-strip { background: var(--black3); display: flex; align-items: center; gap: 80px; padding: 80px 48px; }
.about-img-wrap { flex: 0 0 340px; position: relative; }
.about-img-wrap img { width: 100%; aspect-ratio: 3/4; object-fit: cover; filter: grayscale(20%); }
.about-img-wrap::before { content: ''; position: absolute; top: -16px; left: -16px; right: 16px; bottom: 16px; border: 0.5px solid var(--accent2); z-index: -1; }
.about-text { flex: 1; }
.about-text p { font-size: 15px; line-height: 1.9; color: var(--white2); margin-bottom: 24px; }
.about-text p.lead { font-family: var(--serif); font-size: 22px; font-weight: 300; color: var(--white); line-height: 1.5; margin-bottom: 32px; }
.btn-outline { display: inline-block; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--white); border: 0.5px solid var(--white3); padding: 14px 32px; text-decoration: none; transition: var(--transition); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent2); }

/* PROJECTS — progetto in corso (focus singolo) */
.projects { background: var(--black); }
.project-current { display: flex; gap: 64px; align-items: center; max-width: 1100px; margin: 0 auto; }
.project-current-text { flex: 1 1 0; }
.project-current-text h3 { font-family: var(--serif); font-size: clamp(26px, 3.5vw, 38px); font-weight: 300; margin-bottom: 22px; }
.project-current-text h3 em { font-style: italic; color: var(--accent); }
.project-current-text p { font-size: 15px; line-height: 1.85; color: var(--white2); margin-bottom: 20px; }
.project-current-meta { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-top: 8px; }
.project-current-grid { flex: 0 0 502px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-decoration: none; color: inherit; cursor: pointer; }
.project-thumb { position: relative; overflow: hidden; cursor: pointer; aspect-ratio: 4/3; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.88); transition: transform 0.8s ease, filter var(--transition); }
.project-thumb:hover img { transform: scale(1.05); filter: brightness(1); }

/* CONTACT */
.contact { background: var(--black2); text-align: center; padding: 100px 48px; }
.contact .section-label { display: block; margin-bottom: 12px; }
.contact h2 { font-family: var(--serif); font-size: clamp(32px, 5vw, 56px); font-weight: 300; margin-bottom: 20px; }
.contact p { color: var(--white2); font-size: 14px; line-height: 1.8; max-width: 480px; margin: 0 auto 40px; }
.contact-email { font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--accent); text-decoration: none; border-bottom: 0.5px solid var(--accent2); padding-bottom: 4px; transition: var(--transition); }
.contact-email:hover { color: var(--white); border-color: var(--white3); }
.social-links { display: flex; justify-content: center; gap: 28px; margin-top: 48px; padding-top: 48px; border-top: 0.5px solid var(--white4); }
.social-links a { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--white3); text-decoration: none; transition: color var(--transition); }
.social-links a:hover { color: var(--accent); }

/* FOOTER */
footer { background: var(--black); padding: 28px 48px; display: flex; justify-content: space-between; align-items: center; border-top: 0.5px solid var(--white4); }
footer p { font-size: 10px; letter-spacing: 0.12em; color: var(--white3); }

/* GALLERY PAGE */
.page-hero { display: flex; align-items: center; padding: 22px 48px; background: var(--black2); border-bottom: 0.5px solid var(--white4); margin-top: 80px; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(24px, 3.5vw, 40px); font-weight: 300; }
.page-hero h1 em { font-style: italic; color: var(--accent); }
.gallery-full { padding: 43px 32px; background: var(--black); min-height: 60vh; }
.lightbox { display: none; position: fixed; inset: 0; background: rgba(10,10,10,0.97); z-index: 1000; align-items: center; justify-content: center; flex-direction: column; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 82vh; max-width: 88vw; object-fit: contain; }
.lightbox-close { position: absolute; top: 28px; right: 36px; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--white3); cursor: pointer; background: none; border: none; transition: color var(--transition); }
.lightbox-close:hover { color: var(--white); }
.lightbox-caption { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white3); margin-top: 20px; }
.lightbox-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0.5px solid var(--white3); background: rgba(10,10,10,0.3); color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: var(--transition); z-index: 1001; }
.lightbox-nav-btn:hover { border-color: var(--accent); background: var(--accent2); color: var(--accent); }
.lightbox-prev { left: 36px; }
.lightbox-next { right: 36px; }
@media (max-width: 768px) {
  .lightbox-nav-btn { width: 38px; height: 38px; font-size: 15px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* COOKIE BANNER */
/* Iniettato da js/main.js su ogni pagina che include lo script,
   quindi compare sull'intero sito, non solo sulla home. */
.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  max-width: 640px;
  margin: 0 auto;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: rgba(17,17,17,0.97);
  border: 0.5px solid var(--white4);
  border-top: 0.5px solid var(--accent2);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.cookie-banner.visible { opacity: 1; transform: translateY(0); }
.cookie-banner p { font-size: 12px; line-height: 1.7; color: var(--white2); flex: 1; }
.cookie-banner .cookie-accept {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--accent);
  border: none;
  padding: 12px 26px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.cookie-banner .cookie-accept:hover { background: var(--white); }
@media (max-width: 600px) {
  .cookie-banner { left: 16px; right: 16px; bottom: 16px; padding: 18px 20px; flex-direction: column; align-items: stretch; gap: 16px; }
  .cookie-banner .cookie-accept { width: 100%; padding: 14px; }
}

/* MOBILE — nasconde il cursore dorato finto sui dispositivi touch.
   Senza mouse, i div .cursor/.cursor-ring restavano fermi in alto
   a sinistra (posizione di default), creando un puntino/anello
   dorato visibile nell'angolo dello schermo. */
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* MOBILE — evita che gli effetti hover restino "bloccati" dopo
   un tocco (comportamento tipico di Safari/Chrome su smartphone):
   li riporta subito allo stato normale. */
@media (hover: none) {
  .grid-item:hover img { transform: none; filter: brightness(0.88); }
  .grid-item:hover .grid-item-info { opacity: 0; }
  .project-thumb:hover img { transform: none; filter: brightness(0.88); }
  .hero-btn:hover { border-color: var(--white3); background: rgba(10,10,10,0.3); }
  .btn-outline:hover { border-color: var(--white3); color: var(--white); background: none; }
  .section-link:hover { color: var(--white2); border-color: var(--white3); }
  .contact-email:hover { color: var(--accent); border-color: var(--accent2); }
  .social-links a:hover { color: var(--white3); }
  .lightbox-nav-btn:hover { border-color: var(--white3); background: rgba(10,10,10,0.3); color: var(--white); }
}

/* FADE IN ANIMATION */
.fade-up { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 768px) {
  nav { padding: 20px 24px; }
  nav.scrolled { padding: 14px 24px; }
  .nav-links { display: none; }
  .nav-menu { display: flex; }
  section { padding: 72px 24px; }
  .about-strip { flex-direction: column; padding: 64px 24px; gap: 40px; }
  .about-img-wrap { flex: none; width: 100%; max-width: 320px; }
  .grid-masonry { columns: 2; }
  .project-current { flex-direction: column; gap: 32px; align-items: stretch; max-width: 100%; }
  .project-current-grid { flex: 0 0 auto; width: 100%; max-width: 502px; }
  .hero-content { left: 24px; }
  .hero-nav { right: 24px; }
  .slide-counter { display: none; }
  footer { padding: 20px 24px; flex-direction: column; gap: 12px; text-align: center; }
  .nav-menu { padding: 10px; margin: -10px; } /* area di tocco più ampia, aspetto invariato */
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cat-btn { padding: 10px 16px; }
}

/* SMARTPHONE PICCOLI */
@media (max-width: 480px) {
  section { padding: 56px 20px; }
  .hero-content { bottom: 56px; }
  .hero-nav { bottom: 56px; right: 20px; }
  .about-strip { padding: 48px 20px; }
  .contact { padding: 72px 20px; }
  .project-current-grid { gap: 8px; }
}
