/* ─── Pina Angemi — Stylesheet ─────────────────────────────────── */

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:          #090908;
  --bg-2:        #0f0f0e;
  --bg-card:     #131312;
  --fg:          #ede8df;
  --fg-muted:    #7c7c72;
  --fg-dim:      #2c2c28;
  --green:       #4e7a5c;
  --green-light: #6fa07e;
  --green-dim:   #1a2e22;
  --amber:       #c4883a;
  --border:      rgba(237,232,223,0.07);
  --border-g:    rgba(78,122,92,0.35);
  --ease:        cubic-bezier(0.25,0.1,0.25,1);
  --ease-out:    cubic-bezier(0,0,0.2,1);
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}
img   { display: block; max-width: 100%; height: auto; }
a     { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* ─── GRAIN ─────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 250px 250px;
}

/* ─── TYPOGRAPHY HELPERS ────────────────────────────────────── */
.serif { font-family: 'Cormorant Garamond', serif; }
.label {
  font-family: 'Jost', sans-serif;
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green-light);
}

/* ─── NAV ───────────────────────────────────────────────────── */
#nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 3rem;
  transition: background 0.4s var(--ease), padding 0.3s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(9,9,8,0.94);
  backdrop-filter: blur(14px);
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom-color: var(--border);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--fg);
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--green-light);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

/* hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
}
.nav-burger span {
  display: block;
  width: 22px; height: 1px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}

/* mobile overlay */
#mobileMenu {
  position: fixed;
  inset: 0;
  background: rgba(9,9,8,0.98);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#mobileMenu.open { opacity: 1; pointer-events: all; }
#mobileMenu a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--fg-muted);
  transition: color 0.2s;
}
#mobileMenu a:hover { color: var(--fg); }
#mobileClose {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none; border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
}

/* ─── HERO ──────────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  padding: 8rem 3rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Background image on ::after so transform animation is GPU-composited */
#hero::after {
  content: '';
  position: absolute;
  inset: -6%;          /* extra margin lets the drift stay in-bounds */
  background: url('../assets/imgs/quadri/gorilla_quadri_2.jpg') center / cover no-repeat;
  z-index: 0;
  will-change: transform;
  animation: heroDrift 28s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  0%   { transform: scale(1)    translate(0,    0   ); }
  33%  { transform: scale(1.04) translate(-1%,  0.5%); }
  66%  { transform: scale(1.03) translate( 0.5%, 1% ); }
  100% { transform: scale(1.06) translate(-1.5%, -1%); }
}

/* Dark overlay on ::before — sits above image, below content */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /* bottom-weighted: gorilla visible in the middle, text stays legible below */
  background:
    linear-gradient(
      to bottom,
      rgba(9,9,8,0.68) 0%,
      rgba(9,9,8,0.42) 28%,
      rgba(9,9,8,0.68) 60%,
      rgba(9,9,8,0.96) 100%
    );
  z-index: 1;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 36px; height: 1px;
  background: var(--green);
  flex-shrink: 0;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(4.5rem, 11vw, 10.5rem);
  font-weight: 300;
  line-height: 0.88;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.hero-name em {
  font-style: italic;
  color: rgba(237,232,223,0.78);
}
.hero-lower {
  margin-top: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 4rem;
  flex-wrap: wrap;
}
.hero-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 300;
  color: var(--fg-muted);
  max-width: 460px;
  line-height: 1.75;
  border-left: 1px solid var(--green);
  padding-left: 1.5rem;
}
.hero-scroll {
  position: absolute;
  bottom: 3rem; right: 3rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-muted);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--green), transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:0.35; transform:scaleY(0.6); }
  50%      { opacity:1;    transform:scaleY(1); }
}

/* ─── SECTION COMMONS ───────────────────────────────────────── */
.section {
  padding: 7rem 3rem;
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-hd {
  margin-bottom: 4rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
}
.section-title em { font-style: italic; }
.section-rule {
  width: 56px; height: 1px;
  background: var(--green);
  margin-top: 1.4rem;
}

/* ─── ARTISTA ───────────────────────────────────────────────── */
#artista {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.artista-grid {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 6rem;
  align-items: start;
}
.artista-img-wrap {
  position: relative;
}
.artista-img-wrap::before {
  content: '';
  position: absolute;
  inset: -10px -10px 10px 10px;
  border: 1px solid var(--border-g);
  pointer-events: none;
}
.artista-img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
}
.artista-bio { padding-top: 1.5rem; }
.artista-formation {
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}
.artista-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 2rem;
}
.artista-text {
  font-size: 1.02rem;
  color: rgba(237,232,223,0.8);
  line-height: 1.9;
  margin-bottom: 1.4rem;
}
.artista-pullquote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 300;
  color: var(--green-light);
  line-height: 1.55;
  border-left: 2px solid var(--green);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
}
.artista-hen {
  font-style: italic;
  color: var(--fg-muted);
  font-size: 0.92rem;
  margin-top: 1rem;
}

/* ─── CATALOGO ──────────────────────────────────────────────── */
#catalogo { background: var(--bg); }

.catalog-filters {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.filter-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.8rem 1.6rem;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.filter-btn:hover { color: var(--fg); }
.filter-btn.active {
  color: var(--green-light);
  border-bottom-color: var(--green-light);
}

.series-hd {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  color: var(--fg-muted);
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  margin: 3.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.series-count {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--fg-dim);
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
}
.art-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 1;
  cursor: pointer;
}
.art-card.tall { aspect-ratio: 3/4; }
.art-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease), filter 0.4s;
  filter: brightness(0.88);
}
.art-card:hover img {
  transform: scale(1.05);
  filter: brightness(1);
}
.art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,9,8,0.88) 0%, rgba(9,9,8,0.15) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.art-card:hover .art-overlay { opacity: 1; }
.art-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
.art-sub {
  font-size: 0.64rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-light);
}
.art-expand {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 30px; height: 30px;
  border: 1px solid rgba(237,232,223,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, border-color 0.3s;
}
.art-card:hover .art-expand { opacity: 1; }
.art-expand:hover { border-color: var(--green-light); }
.art-expand svg {
  width: 11px; height: 11px;
  stroke: var(--fg); fill: none;
  stroke-width: 1.5;
}

/* ─── PROCESSO (placeholder) ────────────────────────────────── */
#processo {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.processo-coming {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 3rem;
  border: 1px solid var(--border);
  max-width: 600px;
}
.processo-pill {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid var(--border-g);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-light);
}
.processo-coming p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* ─── MOSTRE ────────────────────────────────────────────────── */
#mostre { background: var(--bg); }

.mostre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2px;
}
.mostra-card {
  background: var(--bg-card);
  padding: 3rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s;
}
.mostra-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--green);
  transition: height 0.45s var(--ease);
}
.mostra-card:hover { border-color: var(--border-g); }
.mostra-card:hover::before { height: 100%; }
.mostra-anno {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.8rem;
  font-weight: 300;
  color: var(--fg-dim);
  line-height: 1;
  margin-bottom: 1rem;
}
.mostra-titolo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.65rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.mostra-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}
.mostra-detail {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  font-size: 0.83rem;
  color: rgba(237,232,223,0.68);
  line-height: 1.5;
}
.mostra-icon { color: var(--green-light); flex-shrink: 0; }
.mostra-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.6;
}
.mostra-footer strong { color: var(--fg); font-weight: 400; }

/* ─── CONTATTI ──────────────────────────────────────────────── */
#contatti {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.contact-lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--fg);
}
.contact-lead em { font-style: italic; color: var(--green-light); }
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-top: 0.5rem;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.86rem;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.contact-row:hover { color: var(--fg); }
.contact-lbl {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  width: 76px;
  flex-shrink: 0;
}

/* ─── FOOTER ────────────────────────────────────────────────── */
footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--fg-muted);
}
.footer-copy {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

/* ─── LIGHTBOX ──────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(9,9,8,0.97);
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
#lightbox.open { opacity: 1; pointer-events: all; }

.lb-img-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 3rem 4.5rem 4rem;
}
#lbImg {
  max-height: 82vh;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 24px 100px rgba(0,0,0,0.7);
}
.lb-panel {
  width: 340px;
  flex-shrink: 0;
  padding: 5rem 2.5rem 3rem;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
#lbSerie {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green-light);
}
#lbTitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.2;
}
#lbDesc {
  font-size: 0.9rem;
  color: rgba(237,232,223,0.72);
  line-height: 1.85;
  font-style: italic;
}
#lbTech {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.7;
}
#lbTech dt {
  font-size: 0.6rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--fg-muted);  /* #7c7c72 su #090908 → ~4.8:1 (WCAG 2.1 AA) */
  margin-top: 0.8rem;
}
#lbTech dd { margin: 0; }

#lbClose {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 1.1rem;
  transition: color 0.2s, border-color 0.2s;
}
#lbClose:hover { color: var(--fg); border-color: var(--border-g); }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
  padding: 1rem;
  transition: color 0.2s;
}
.lb-nav:hover { color: var(--fg); }
#lbPrev { left: 0.5rem; }
#lbNext { right: 355px; }

#lbCounter {
  position: fixed;
  bottom: 1.5rem;
  left: calc(50% - 170px);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
}

/* ─── PERFORMANCE ───────────────────────────────────────────── */
.art-card { contain: layout style; }
.art-card img { will-change: transform; }

/* ─── CATALOG LOADING STATE ──────────────────────────────────── */
.cat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
}
.cat-spinner {
  width: 48px; height: 1px;
  background: var(--green);
  animation: catLoad 1.3s ease-in-out infinite;
}
@keyframes catLoad {
  0%,100% { width: 28px; opacity: 0.35; }
  50%      { width: 70px; opacity: 1; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fi { transition: none; opacity: 1; transform: none; }
  .art-card img { transition: filter 0.2s; will-change: auto; }
  .mostra-card::before { transition: none; }
  .hero-scroll-line { animation: none; opacity: 0.5; }
  .cat-spinner { animation: none; }
}

/* ─── FADE-IN ────────────────────────────────────────────────── */
.fi {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}
.fi.vis { opacity: 1; transform: none; }
.fi-d1 { transition-delay: 0.1s; }
.fi-d2 { transition-delay: 0.2s; }
.fi-d3 { transition-delay: 0.3s; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  #nav { padding: 1.2rem 1.5rem; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .section { padding: 5rem 1.5rem; }
  #hero { padding: 7rem 1.5rem 4.5rem; }

  .artista-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .artista-img-wrap::before { display: none; }

  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem; }

  .lb-panel { display: none; }
  #lbNext { right: 0.5rem; }
  #lbCounter { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 600px) {
  .hero-name { font-size: clamp(3.2rem, 15vw, 5rem); }
  .art-grid { grid-template-columns: repeat(2, 1fr); }
  .mostre-grid { grid-template-columns: 1fr; }
  .hero-lower { gap: 2rem; }
}
