/* =========================================================
   GAIA PANERONI — Portfolio
   Palette: solo bianco e nero. Font display condensato (Anton, simile a
   Bulevar di axelvanhessche.com) + grotesk (Inter Tight, simile a Neue Montreal).
   ========================================================= */

:root {
  --black: #000;
  --white: #fff;
  --display: 'Anton', 'Bebas Neue', Impact, sans-serif;
  --text: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --heavy: 'Archivo Black', 'Arial Black', sans-serif;
  --gutter: clamp(16px, 2vw, 32px);
  --small: clamp(11px, 0.78vw, 13px);
  --nav: clamp(15px, 1.25vw, 21px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--text);
  font-size: var(--small);
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.dark { background: var(--black); color: var(--white); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.upper { text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

/* ---------- HEADER ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--gutter);
  color: var(--white);
  mix-blend-mode: difference;           /* resta leggibile sopra qualsiasi foto */
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.logo {
  font-family: var(--display);
  font-size: clamp(24px, 2.6vw, 44px);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}
.logo span { display: block; }
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.tagline { text-transform: uppercase; font-size: var(--small); }
.nav { display: flex; gap: 0.7em; font-size: var(--nav); text-transform: uppercase; letter-spacing: 0.005em; }
.nav a { opacity: 0.45; transition: opacity .25s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.menu-btn { display: none; font-size: var(--nav); text-transform: uppercase; }

/* Menu mobile */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--black); color: var(--white);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--gutter);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a { font-family: var(--display); font-size: 19vw; line-height: .9; text-transform: uppercase; }
.mobile-menu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.mobile-menu .close { position: absolute; top: var(--gutter); right: var(--gutter); font-size: 15px; text-transform: uppercase; }

@media (max-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: block; }
}

/* ---------- LOADER ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center; gap: 22px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .02em;
  transition: opacity .8s ease, visibility .8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader .star { width: 64px; height: 64px; animation: spin 2.2s linear infinite; }
.loader .pct {
  min-width: 56px; padding: 4px 12px; border: 1px solid var(--white); border-radius: 99px;
  text-align: center; font-variant-numeric: tabular-nums;
}
@keyframes spin { to { transform: rotate(360deg); } }
html.no-loader .loader { display: none; }

/* ---------- HOME ---------- */
/* Nome fisso: scala da enorme a logo (vedi assets/js/home.js) */
.home-name {
  position: fixed; top: var(--gutter); left: var(--gutter); z-index: 40;
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: 15.2vw; line-height: 0.83;
  text-transform: uppercase; letter-spacing: -0.012em;
  color: var(--black); transition: color .3s;       /* le foto passano dietro al nome */
  transform-origin: 0 0; will-change: transform;
}
.home-name a > span { display: block; }
.home-name.on-dark { color: var(--white); }
.home { position: relative; }
.home-role { position: absolute; margin: 0; text-transform: uppercase; white-space: nowrap; }
.home-copy {
  position: absolute; left: 25vw; top: calc(var(--gutter) + 15.2vw * 1.66 + 4vw);
  margin: 0; text-transform: uppercase;
}
.seq { padding-top: max(40vh, calc(100vh - var(--gutter) - 37.5vw - 30px)); }
.seq-item { width: 30vw; margin: 0 0 24vh; }
.seq-item.right { margin-left: auto; margin-right: var(--gutter); }
.seq-item.left { margin-left: 9vw; }
.seq-item.small { width: 23vw; }
.seq-item img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.caption { margin-top: 8px; text-transform: uppercase; font-size: var(--small); }
.hover-img { overflow: hidden; }
.hover-img img { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
a:hover .hover-img img { transform: scale(1.035); }

/* Immagini finali a tutto schermo, rivelate da una stella (vedi assets/js/home.js) */
.reveal-stage { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.reveal {
  position: absolute; inset: 0; overflow: hidden; visibility: hidden;
  pointer-events: auto; background: var(--black); will-change: clip-path;
}
.reveal img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.reveal-text {
  position: absolute; left: var(--gutter); bottom: 14vh; color: var(--white); opacity: 0;
}
.reveal-text .pills { justify-content: flex-start; margin-bottom: 14px; }
.reveal-title {
  display: block; font-family: var(--display); text-transform: uppercase;
  font-size: clamp(56px, 9vw, 170px); line-height: .86;
}

@media (max-width: 760px) {
  .home-name { font-size: 23vw; top: 70px; }
  .home-copy { left: var(--gutter); top: calc(70px + 23vw * 1.66 + 16px); }
  .seq { padding-top: calc(70px + 23vw * 1.66 + 90px); }
  .seq-item { width: 62vw; margin-bottom: 14vh; }
  .seq-item.left { margin-left: var(--gutter); }
  .seq-item.small { width: 48vw; }
}

/* ---------- WORK ---------- */
.work { padding: calc(var(--gutter) * 6) var(--gutter) var(--gutter); min-height: 100vh; }
.work-title {
  font-family: var(--heavy); font-weight: 400; text-transform: uppercase;
  font-size: 17vw; line-height: .84; letter-spacing: -0.04em; margin: 0 0 clamp(40px, 6vw, 100px);
}
.work-title span { display: block; }
.work-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.work-cols h2 { margin: 0 0 18px; font-size: var(--small); font-weight: 400; text-transform: uppercase; opacity: .45; }
.work-cols ul { list-style: none; margin: 0; padding: 0; }
.work-cols li { font-size: clamp(12px, 0.95vw, 16px); line-height: clamp(19.5px, 1.77vw, 29.3px); text-transform: uppercase; }
.work-cols a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s; }
.work-cols a:hover { background-size: 100% 1px; }
@media (max-width: 1024px) { .work-cols { grid-template-columns: repeat(2, 1fr); row-gap: 48px; } }
@media (max-width: 520px)  { .work-cols { grid-template-columns: 1fr; } .work-title { font-size: 17vw; } }

/* ---------- PAGINA PROGETTO ---------- */
.project { display: grid; grid-template-columns: 45.5% 54.5%; height: 100vh; height: 100svh; overflow: hidden; }
.project-info {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 90px clamp(24px, 4vw, 70px);
  overflow-y: auto;
}
.project-logo { position: fixed; top: var(--gutter); left: var(--gutter); z-index: 20; }
.close-btn {
  position: fixed; top: var(--gutter); right: var(--gutter); z-index: 20;
  text-transform: uppercase; font-size: clamp(13px, 1.05vw, 17px);
  color: var(--white); mix-blend-mode: difference;
}
.pills { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.pill { border: 1px solid currentColor; border-radius: 99px; padding: 5px 12px; text-transform: uppercase; font-size: clamp(11px, .9vw, 15px); }
.project-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(32px, 3.4vw, 60px); line-height: .92; margin: 0;
}
.project-star { width: 26px; height: 26px; margin: 26px auto; }
.project-desc { max-width: 460px; font-size: clamp(13px, .95vw, 15px); line-height: 1.45; }
.project-desc p { margin: 0 0 .9em; }
.disclaimer { max-width: 420px; margin-top: 22px; font-size: 10px; line-height: 1.4; opacity: .6; text-transform: uppercase; }

/* Carosello: fondo bianco (niente bande nere attorno alle foto orizzontali) e puntini sotto */
.slider-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--white); }
.slider { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--white); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.slider:active { cursor: grabbing; }
.track { display: flex; height: 100%; transition: transform .8s cubic-bezier(.7,0,.2,1); will-change: transform; }
.slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.frame { overflow: hidden; flex: none; cursor: zoom-in; }

/* Lightbox: immagine intera a schermo intero su fondo scuro semi-opaco */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.9);
  opacity: 0; transition: opacity .3s ease;
  color: var(--white);
}
.lightbox.open { opacity: 1; }
.lb-area { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.lb-area:active { cursor: grabbing; }
.lb-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.7,0,.2,1); will-change: transform; }
.lb-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px clamp(16px, 4vw, 64px); }
.lb-slide img, .lb-slide video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; -webkit-user-drag: none; }
.lb-close {
  position: absolute; top: var(--gutter); right: var(--gutter); z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center; color: var(--white);
}
.lb-close svg { width: 22px; height: 22px; }
.lb-close:hover { opacity: .6; }
.lb-count { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: var(--small); letter-spacing: .04em; opacity: .7; pointer-events: none; }
.sound-btn {
  position: absolute; left: var(--gutter); bottom: var(--gutter); text-transform: uppercase;
  color: var(--white); mix-blend-mode: difference;
}
.dots { flex: 0 0 56px; display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; padding: 0 var(--gutter); }
.dot { width: 18px; height: 18px; display: grid; place-items: center; }
.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--black); opacity: .2; transition: opacity .3s, transform .3s; }
.dot:hover::before { opacity: .5; }
.dot.on::before { opacity: 1; transform: scale(1.2); }

@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 78svh; height: auto; overflow: visible; }
  .project-info { padding: 110px var(--gutter) 40px; }
  .project-logo, .close-btn { position: absolute; }
}

/* ---------- GALLERY ---------- */
body.gallery-page { overflow: hidden; height: 100vh; height: 100svh; touch-action: none; }
.g-bg {
  position: fixed; inset: -200px; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  will-change: background-position;
}
.g-stage { position: fixed; inset: 0; z-index: 1; cursor: grab; }
.g-stage.dragging { cursor: grabbing; }
.g-item { position: absolute; left: 0; top: 0; will-change: transform, opacity; transform-origin: 0 0; }
.g-item a { display: block; }
.g-item img, .g-item video { width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; background: #111; }
.g-item .caption { color: var(--white); font-size: 10px; margin-top: 6px; white-space: nowrap; }
.g-ruler {
  position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 3; pointer-events: none;
  color: var(--white); overflow: hidden;
}
.g-ruler .ticks { position: absolute; left: 50%; bottom: 0; height: 100%; display: flex; align-items: flex-end; will-change: transform; }
.g-ruler .tick { width: 22px; flex: 0 0 22px; height: 8px; border-left: 1px solid rgba(255,255,255,.55); position: relative; }
.g-ruler .tick.major { height: 16px; border-left-color: #fff; }
.g-ruler .tick.major span { position: absolute; bottom: 24px; left: 0; transform: translateX(-50%); font-size: 12px; opacity: .6; }
.g-ruler .needle { position: absolute; left: 50%; bottom: 0; width: 2px; height: 22px; background: #fff; }
.g-hint { position: fixed; right: var(--gutter); bottom: 80px; z-index: 3; color: var(--white); text-transform: uppercase; opacity: 0; transition: opacity .6s; pointer-events: none; }

.unlock {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,.78);
  transition: opacity .9s ease, visibility .9s;
  touch-action: none; user-select: none;
}
.unlock.open { opacity: 0; visibility: hidden; }
.unlock h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; text-align: center;
  font-size: clamp(64px, 12vw, 210px); line-height: .84; margin: 0 0 3vh; pointer-events: none;
}
.unlock h1 span { display: block; }
.draw-area { position: relative; width: min(220px, 50vw); aspect-ratio: 1; cursor: crosshair; }
.draw-area svg, .draw-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.draw-area .dot { fill: rgba(255,255,255,.28); transition: fill .2s, r .2s; }
.draw-area .dot.on { fill: #fff; }
.draw-hint { margin-top: 18px; font-size: 10px; text-transform: lowercase; letter-spacing: .04em; opacity: .75; pointer-events: none; }

/* ---------- ABOUT (+ CONTACT in fondo) ---------- */
.about-bg {
  position: fixed; inset: 0; z-index: -2;
  background: url("../img/about-sfondo.jpg") center / cover no-repeat;
  transform: scaleX(-1);                 /* foto specchiata */
}
.about-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.3) 40%, rgba(0,0,0,.62) 100%); }
.about-fade { position: fixed; inset: 0; z-index: -1; background: var(--black); opacity: 0; pointer-events: none; }
/* sezione alta: il testo resta fermo mentre le parole si riempiono */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: calc(var(--gutter) * 2); padding: 0 var(--gutter); height: 240vh; }
.about-body { grid-column: 2; position: sticky; top: 0; align-self: start; padding-top: calc(var(--gutter) * 6.5); }
.about-text { font-size: clamp(24px, 2.9vw, 50px); line-height: 1.08; letter-spacing: -0.02em; }
.about-text p { margin: 0 0 .7em; }
.about-text .pill { font-size: .42em; vertical-align: .45em; margin-right: .3em; letter-spacing: 0; }
.about-text .kw { color: rgba(255,255,255,.3); }
.about-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); margin-top: clamp(40px, 5vw, 80px); padding-top: 18px; border-top: 1px solid currentColor; }
.about-meta h2 { font-size: var(--small); font-weight: 400; text-transform: uppercase; opacity: .6; margin: 0 0 10px; }
.about-meta p { margin: 0; font-size: clamp(13px, 1vw, 16px); line-height: 1.4; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; height: auto; padding-top: 50vh; padding-bottom: 60vh; }
  .about-body { grid-column: 1; position: static; padding-top: 0; }
  .about-bg { background-position: 40% top; }
  .about-bg::after { background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.55) 50%, rgba(0,0,0,.85) 100%); }
  .about-meta { grid-template-columns: 1fr; }
}

/* ---------- CONTACT ---------- */
.contact {
  --reveal: 1;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--gutter) * 6.5) var(--gutter) var(--gutter);
}
.contact > * { opacity: var(--reveal); transform: translateY(calc((1 - var(--reveal)) * 40px)); }
.contact-big {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 13.5vw; line-height: .84; margin: 0; word-break: break-word;
}
.contact-big a { display: inline-block; }
.contact-big a:hover { opacity: .6; }
.contact-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); margin-top: 60px; }
.contact-cols h3 { font-size: var(--small); font-weight: 400; text-transform: uppercase; opacity: .5; margin: 0 0 10px; }
.contact-cols a, .contact-cols p { display: block; margin: 0; font-size: clamp(16px, 1.45vw, 24px); text-transform: uppercase; line-height: 1.25; }
.contact-cols a:hover { opacity: .6; }
.contact-cols .email { text-transform: none; word-break: break-all; }
@media (max-width: 860px) { .contact-cols { grid-template-columns: 1fr 1fr; row-gap: 36px; } .contact { padding-top: 120px; } }
@media (max-width: 480px) { .contact-cols { grid-template-columns: 1fr; } .contact-big { font-size: 19vw; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
