/* ==========================================================================
   Niccolò Nencini — Portfolio
   Breakpoints (identici al sito Framer):
   desktop ≥ 1200px · tablet 810–1199px · mobile < 810px
   ========================================================================== */

@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.15);  /* linee sottili di Experience ed Expertise */
  --pad: 20px;
  --gap: 5px;
  --col: calc(50% + 10px);   /* inizio colonna destra */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* molla Framer "bounce 0" (smorzamento critico) e curva "ease in-out" di Framer */
  --spring: linear(0, 0.0229 2.5%, 0.0788 5%, 0.1531 7.5%, 0.2359 10%, 0.3206 12.5%, 0.4028 15%, 0.48 17.5%, 0.5507 20%, 0.6144 22.5%, 0.6709 25%, 0.7205 27.5%, 0.7636 30%, 0.8008 32.5%, 0.8327 35%, 0.86 37.5%, 0.8831 40%, 0.9026 42.5%, 0.919 45%, 0.9328 47.5%, 0.9444 50%, 0.9621 55%, 0.9743 60%, 0.9826 65%, 0.9883 70%, 0.9922 75%, 0.9948 80%, 0.9965 85%, 0.9977 90%, 0.9985 95%, 1);
  --inout: cubic-bezier(.44, 0, .56, 1);
  /* molla fisica Framer (rigidità 160, smorzamento 30, massa 0.1) usata per gli effetti "in view" */
  --soft: linear(0, 0.2235 3.8%, 0.4082 7.7%, 0.5489 11.5%, 0.6562 15.4%, 0.738 19.2%, 0.8003 23.1%, 0.8478 26.9%, 0.884 30.8%, 0.9116 34.6%, 0.9326 38.5%, 0.9486 42.3%, 0.9609 46.2%, 0.9702 50%, 0.9773 53.8%, 0.9827 57.7%, 0.9868 61.5%, 0.9899 65.4%, 0.9923 69.2%, 0.9942 73.1%, 0.9955 76.9%, 0.9966 80.8%, 0.998 88.5%, 0.9989 96.2%, 1);
}
@media (max-width: 809.98px) {
  :root { --pad: 15px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter Display", "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.16;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Typography ------------------------------------------------------------- */
.t-label { font-size: 14px; line-height: 1.1; font-weight: 500; letter-spacing: 0.01em; text-transform: uppercase; }
.t-small { font-size: 14px; line-height: 1.16; font-weight: 500; }
.t-title { font-size: 32px; line-height: 1.1; font-weight: 400; letter-spacing: -0.03em; }
.t-muted { color: var(--muted); }
.indent { text-indent: 3.9em; }
.pre { white-space: pre-wrap; }

/* Letter-roll buttons (hover: le lettere scorrono verso l'alto) ------------ */
.roll { display: inline-flex; font-family: "Inter", sans-serif; font-weight: 400; letter-spacing: -0.02em; line-height: 1; cursor: pointer; white-space: pre; }
.roll .l { position: relative; display: inline-block; overflow: hidden; }
.roll .l > span { display: block; padding-bottom: 2px; transition: transform .3s cubic-bezier(.25,.1,.25,1); transition-delay: calc(var(--i) * var(--stagger, 40ms)); }
.roll .l > span + span { position: absolute; left: 0; top: 0; transform: translateY(120%); }
@media (hover: hover) {
  .roll:hover .l > span:first-child { transform: translateY(-120%); }
  .roll:hover .l > span + span { transform: none; }
}

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 200px; height: 30px; padding: 0; border: 1px solid #fff; border-radius: 100px; overflow: hidden;
  font-family: "Inter", sans-serif; font-size: 14px; font-weight: 400;
}
.pill .roll { --stagger: 30ms; font-size: 14px; }

/* Header ----------------------------------------------------------------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 70;
  display: grid; grid-template-columns: 1fr 1fr; align-items: start;
  padding: 12px var(--pad);
  mix-blend-mode: difference; color: #fff;
  pointer-events: none;
}
.header a, .header button { pointer-events: auto; }
.header .nav { display: flex; justify-content: space-between; padding-left: calc(var(--pad) / 2); }
.header .nav-main { display: flex; gap: 8px; }
.header .nav .roll { font-size: 14px; padding: 3px 0; }
.menu-btn { display: none; }

@media (max-width: 809.98px) {
  .header { mix-blend-mode: normal; grid-template-columns: 1fr auto; align-items: center; padding: 15px var(--pad); }
  .header .nav { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; height: 28px; width: 47px; padding: 0; border: 0; border-radius: 0;
    background: transparent; color: #fff; font: 500 14px/1.16 "Inter Display", sans-serif; cursor: pointer;
  }
}

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 60; background: #000;
  padding: 0 var(--pad);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.menu.open { opacity: 1; visibility: visible; }
.menu-links { position: absolute; left: var(--pad); top: 143px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.menu-links .roll { font-size: 32px; line-height: 32px; letter-spacing: -0.02em; }
.menu-social { position: absolute; left: var(--pad); top: 349px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.menu-social .roll { font-size: 14px; line-height: 14px; letter-spacing: -0.02em; }
.menu .menu-links a, .menu .menu-social a { transform: translateY(20px); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease); }
.menu.open .menu-links a, .menu.open .menu-social a { transform: none; opacity: 1; }
.menu.open .menu-links a:nth-child(2) { transition-delay: .05s; }
.menu.open .menu-links a:nth-child(3) { transition-delay: .1s; }
.menu.open .menu-links a:nth-child(4) { transition-delay: .15s; }

/* Appear animation ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(var(--ry, 20px)); transition: opacity var(--rt, .8s) var(--spring), transform var(--rt, .8s) var(--spring); transition-delay: var(--d, 0s); }
.reveal.slide { opacity: 1; }
.reveal.in { opacity: 1; transform: none; }
.reveal.repeat { transition: transform 1.3s var(--soft); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Main stacking ------------------------------------------------------------ */
main { position: relative; }

/* Hero (home) ------------------------------------------------------------ */
.hero {
  position: sticky; top: 0; z-index: 1;
  height: 94vh; min-height: 520px;
  padding: 0 var(--pad);
}
.hero-name-wrap { position: absolute; left: var(--col); top: 50%; translate: 0 -50%; }
.hero-name {
  font-size: 10.5vw; line-height: 0.8; font-weight: 400; letter-spacing: -0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.hero-name sup { font-size: 0.42em; vertical-align: top; position: relative; top: 0.06em; letter-spacing: -0.02em; }
.hero-intro { width: 210px; margin: 20px 0 0 16.45vw; color: var(--muted); }
.hero-bottom { position: absolute; left: var(--pad); right: var(--pad); bottom: 2px; display: flex; justify-content: space-between; align-items: center; }
.hero-bottom svg { width: 14px; height: 14px; }

@media (max-width: 809.98px) {
  .hero { height: 100svh; height: calc(100svh - 48px); }
  .hero-name-wrap { left: 25%; translate: 0 calc(-50% - 9px); }
  .hero-name { font-size: 16vw; }
  .hero-intro { width: 175px; margin: 24px 0 0 19vw; }
  .hero-bottom { bottom: 12px; }
}

/* Work cards ------------------------------------------------------------- */
.works { position: relative; z-index: 2; background: var(--bg); display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: 20px 0 0; }
/* nelle pagine progetto (More works) restano i margini laterali */
.more .works { padding: 0; }
.card { position: relative; display: block; overflow: hidden; overflow: clip; aspect-ratio: 698 / 810; padding: 20px 20px 40px; background: #111; }
.card.full { grid-column: span 2; aspect-ratio: 1400 / 893; }
.card .media, .card .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .media { transition: transform .5s cubic-bezier(.12,.23,.5,1); }
@media (hover: hover) { .card:hover .media { transform: scale(1.04); } }
/* titolo e servizi: restano fermi mentre l'immagine scorre, finché non si appoggiano al fondo della card */
.card .info {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: flex-end; gap: 20px;
  height: 55%;
  pointer-events: none;
}
.card .info .t-title { flex: 1 0 0; min-width: 0; font-feature-settings: "blwf", "cv09", "cv03", "cv04", "cv11"; }
.card .info .services { flex: none; width: auto; max-width: 160px; margin-left: auto; }

@media (max-width: 809.98px) {
  .works { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .card, .card.full { grid-column: auto; aspect-ratio: 390 / 550; }
  .card, .card.full { padding: 20px 15px 40px; display: flex; flex-direction: column; justify-content: flex-end; }
  .card .info { position: relative; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 0; height: 55%; flex: none; }
  .card .info .services { margin-left: 0; }
  .card .info .t-title { flex: none; }
}

/* Sections --------------------------------------------------------------- */
.section { position: relative; z-index: 3; background: var(--bg); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 var(--pad); }

/* About */
.about { padding: 60px 0 200px; }
.about-text { display: flex; flex-direction: column; gap: 57px; font-size: 24px; line-height: 1.2; font-weight: 400; letter-spacing: -0.01em; }
.about-images { display: flex; justify-content: flex-end; align-items: flex-end; gap: 20px; margin-top: 60px; padding: 0 var(--pad); }
.about-images .sign { width: 132px; height: auto; }
.about-images .portrait { width: calc((100vw - 100px) / 4); max-width: 335px; aspect-ratio: 335 / 413; object-fit: cover; }
.exp { margin: 100px var(--pad) 0 auto; width: calc(100% - 493px); max-width: 927px; }
/* righe Experience: linea sopra, il testo sale da sotto la linea (come su Framer) */
.exp-row { padding: 12px 0; box-shadow: inset 0 1px 0 var(--line); overflow: hidden; overflow: clip; }
.exp-row .mv, .exp-row.head { display: grid; grid-template-columns: 335fr 335fr 217fr; gap: 20px; }
.exp-row.head { color: var(--muted); padding: 0 0 12px; box-shadow: none; }
.exp-mobile-title { display: none; }

@media (min-width: 810px) and (max-width: 1199.98px) {
  .exp { width: auto; margin-left: 347px; }
  .about-images .portrait { width: 318px; }
}
@media (max-width: 809.98px) {
  .about { padding: 60px 0 60px; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .about-text { gap: 64px; }
  .about-images { justify-content: space-between; margin-top: 60px; }
  .about-images .portrait { width: 208px; }
  .exp { width: auto; margin: 114px var(--pad) 0; }
  .exp-row.head { display: none; }
  .exp-mobile-title { display: block; margin-bottom: 41px; }
  .exp-row { padding: 12px 0 0; margin-bottom: 20px; }
  .exp-row .mv { grid-template-columns: 1fr auto; row-gap: 20px; }
  .exp-row .mv > :first-child { grid-column: 1 / -1; color: var(--muted); }
  .exp-row .mv > :last-child { text-align: right; }
}

/* Parallax full-bleed images */
.para { position: relative; z-index: 2; overflow: hidden; height: 115vh; }
.para.tall { height: 175vh; }
.para img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
@media (max-width: 809.98px) {
  .para { height: 750px; }
  .para.tall { height: 750px; }
  .para.book { height: 1817px; }
}

/* Expertise — struttura e misure del componente Framer */
.expertise { padding: 60px var(--pad) 63px; }
.expertise .split { display: flex; gap: 20px; padding: 168px 0 0; }
.expertise .label-col { flex: 1 0 0; min-width: 0; position: sticky; top: 80px; align-self: flex-start; }
.expertise .groups { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 100px; }
.exp-group { display: flex; flex-direction: column; gap: 100px; padding-top: 14px; box-shadow: inset 0 1px 0 var(--line); overflow: hidden; overflow: clip; }
.exp-group .head { display: flex; flex-direction: column; gap: 20px; }
.exp-group .head h3 { line-height: 1; }
.exp-group .d-row { display: flex; gap: 20px; }
.exp-group .d-row::before { content: ""; flex: 1 0 0; height: 8px; }
.exp-group .d-row .desc-wrap { flex: 1 0 0; display: flex; justify-content: flex-end; min-width: 0; }
.exp-group .desc { flex: 1 0 0; max-width: 280px; }
.exp-group .deliv { display: flex; justify-content: space-between; }
.exp-group .deliv::before { content: ""; width: 25%; flex: none; }
.exp-group .list { flex: 1 0 0; max-width: 440px; display: flex; gap: 20px; }
.exp-group .list ul { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.exp-group .list li { padding: 0 0 14px; box-shadow: inset 0 -1px 0 var(--line); overflow: hidden; overflow: clip; }
@media (max-width: 809.98px) {
  .expertise { padding: 60px 14px 100px; }
  .expertise .split { flex-direction: column; gap: 99px; padding-top: 188px; }
  .expertise .label-col { position: relative; top: auto; flex: none; width: 100%; }
  .expertise .groups { flex: none; width: 100%; gap: 80px; }
  .exp-group { gap: 80px; }
  .exp-group .d-row { flex-direction: column; }
  .exp-group .d-row::before { display: none; }
  .exp-group .d-row .desc-wrap { justify-content: flex-start; }
  .exp-group .deliv::before { display: none; }
  .exp-group .list { max-width: none; }
}

/* Testo che sale da sotto un bordo quando entra nello schermo (e torna giù quando esce) */
.mask { overflow: hidden; overflow: clip; }
.mask .mv { display: block; transform: translateY(var(--ry, 40px)); transition: transform 1.3s var(--soft); }
.mask.in .mv { transform: none; }
.exp-row.mask .mv { display: grid; }
@media (max-width: 809.98px) { .exp-row.mask .mv { display: grid; } }
@media (prefers-reduced-motion: reduce) { .mask .mv { transform: none; } }

/* Archive (3D carousel + download) — misure del componente Framer */
.archive { overflow: hidden; overflow: clip; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 180px; padding: 250px 0 0; }
.archive::after { content: ""; display: block; min-height: 59px; }
.corners { position: absolute; inset: 20px; pointer-events: none; }
.corners svg { position: absolute; width: 24px; height: 24px; }
.corners svg:nth-child(1) { left: 0; top: 0; } .corners svg:nth-child(2) { right: 0; top: 0; }
.corners svg:nth-child(3) { left: 0; bottom: 0; } .corners svg:nth-child(4) { right: 0; bottom: 0; }
.ring-stage { position: relative; z-index: 1; width: 718px; height: 190px; flex: none; perspective: 1200px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center; }
.ring { position: relative; width: 0; height: 190px; transform-style: preserve-3d; transform: rotateY(15deg); }
.ring-stage.dragging { cursor: grabbing; }
.ring figure { position: absolute; left: 0; top: 0; width: 330px; height: 190px; margin: 0; border-radius: 6px; overflow: hidden; transform-origin: 0 50%; transform: rotateY(calc(var(--i) * 30deg)) translateX(24px); backface-visibility: visible; }
.ring figure img { pointer-events: none; -webkit-user-drag: none; }
.ring figure img { width: 100%; height: 100%; object-fit: cover; }
.archive-text { position: relative; z-index: 2; width: 800px; max-width: calc(100% - 40px); text-align: center; font-feature-settings: "blwf", "cv09", "cv03", "cv04", "cv11"; }
.archive .pill { position: relative; z-index: 2; }
@media (min-width: 810px) and (max-width: 1199.98px) { .archive { min-height: 120vh; } .archive-text { width: 568px; } }
@media (max-width: 809.98px) {
  .archive { gap: 120px; }
  .archive-text { width: 320px; max-width: none; }
}

/* Big image link ("All Projects" / "All works") */
.big-link { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; height: 110vh; overflow: hidden; background: #000; }
.big-link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.big-link .roll { position: relative; font-size: 80px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.2; }
.big-link a { position: relative; z-index: 1; display: block; }
@media (max-width: 809.98px) { .home .big-link { height: 100vh; } .big-link .roll { font-size: 32px; font-weight: 400; letter-spacing: -0.02em; line-height: 1; } }

/* Footer ----------------------------------------------------------------- */
.footer { position: relative; z-index: 3; background: #000; height: 100vh; min-height: 750px; overflow: hidden; display: flex; flex-direction: column; }
.ticker { display: flex; flex: none; width: max-content; white-space: nowrap; font: 400 388px/0.8 "Inter", sans-serif; letter-spacing: -0.07em; padding-top: 2px; will-change: transform; }
.ticker span { padding-right: 100px; }
.footer .ticker { height: 310.4px; padding-top: 0; }
.footer-body { flex: 1 0 0; min-height: 0; display: flex; gap: 20px; padding: 40px 20px 20px; }
.footer-spacer { flex: 1 0 0; height: 33px; }
/* la linea verticale bianca accanto ai profili */
.footer-links { flex: 1 0 0; display: flex; flex-direction: column; align-items: flex-start; padding-left: 20px; border-left: 1px solid #fff; mix-blend-mode: difference; }
.footer-links .roll { font-size: 32px; letter-spacing: -0.02em; }
@media (min-width: 810px) and (max-width: 1199.98px) {
  .footer { min-height: 500px; }
  .ticker { font-size: 280px; letter-spacing: -0.05em; }
  .footer .ticker { height: 224px; }
  .ticker span { padding-right: 80px; }
  .footer-links { gap: 6px; }
  .footer-links .roll .l > span { padding-bottom: 0; }
}
@media (max-width: 809.98px) {
  .footer { min-height: 500px; padding-top: 8px; }
  .ticker { font-size: 144px; letter-spacing: -0.03em; }
  .footer .ticker { height: 115.2px; }
  .ticker span { padding-right: 40px; }
  /* telefono: profili in alto e linea verticale lunga fino in fondo, come su computer */
  .footer-body { align-items: stretch; padding: 40px 15px 15px; }
  .footer-links { flex: 2 0 0; gap: 4px; justify-content: flex-start; }
  .footer-links .roll .l > span { padding-bottom: 0; }
}

/* Projects page ------------------------------------------------------------ */
.projects-title { position: relative; z-index: 1; height: 310.4px; margin-top: 250px; overflow: hidden; overflow-x: clip; overflow-y: visible; }
.projects-page .works { margin-top: 0; padding-top: 0; }
@media (min-width: 810px) and (max-width: 1199.98px) {
  .projects-title { height: 224px; margin-top: 250px; }
  .projects-title .ticker { font-size: 280px; }
}
@media (max-width: 809.98px) {
  .projects-title { height: 115.2px; margin-top: 248px; }
  .projects-title .ticker { font-size: 144px; }
  .projects-page .works { margin-top: 3px; padding-top: 0; }
}

/* Contact page ------------------------------------------------------------ */
.contact-hero { position: relative; z-index: 1; height: 99vh; min-height: 750px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; padding: 0 20px; }
.contact-hero h1 { font-size: 128px; line-height: 0.95; font-weight: 300; letter-spacing: -0.04em; }
@media (min-width: 810px) and (max-width: 1199.98px) { .contact-hero h1 { font-size: 80px; } }
@media (max-width: 809.98px) { .contact-hero { min-height: 650px; padding: 0 15px; } .contact-hero h1 { font-size: 56px; } }

/* Project page ------------------------------------------------------------ */
.p-hero { position: relative; z-index: 1; height: 100vh; overflow: hidden; }
.p-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.85); }
.p-hero h1 { position: absolute; z-index: 1; left: var(--pad); bottom: 40px; font-size: 128px; line-height: 0.95; font-weight: 300; letter-spacing: -0.04em; text-shadow: 0 0 40px rgba(0,0,0,0.08); }
.p-detail { position: relative; z-index: 2; background: #000; padding: 60px var(--pad) 0; }
.p-info { display: grid; grid-template-columns: 224px 1fr; gap: 20px; }
.p-desc { font-size: 48px; line-height: 1; font-weight: 300; letter-spacing: -0.03em; }
.p-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 60px 20px; margin: 200px 0 0 calc(50% + 10px); }
.p-meta dl { margin: 0; }
.p-meta dt { color: var(--muted); margin-bottom: 8px; }
.p-meta dd { margin: 0; font: 500 16px/1 "Geist", "Inter Display", sans-serif; letter-spacing: -0.03em; }
.p-meta dd.upper { text-transform: uppercase; }

.underline { position: relative; display: inline-block; padding-bottom: 2px; color: #fff; }
.underline::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) { .underline:hover::after { transform: scaleX(1); transform-origin: left; } }
.p-meta .services dd { font: inherit; letter-spacing: 0.01em; text-transform: uppercase; font-size: 14px; line-height: 1.1; font-weight: 500; font-family: "Inter Display", sans-serif; }
/* galleria e "More works" a tutta larghezza, come i progetti in home */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: 200px 0 0; margin: 0 calc(var(--pad) * -1); }
.gallery .g { position: relative; overflow: hidden; aspect-ratio: 698 / 810; background: #111; }
.gallery .g.full { grid-column: span 2; aspect-ratio: 1400 / 893; }
.gallery .g img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery .g.full img { will-change: transform; }
.more { padding: 600px 0 0; }
.more-head { display: flex; justify-content: space-between; margin-bottom: 20px; }
.more .works { padding: 0; margin: 0 calc(var(--pad) * -1); }
.p-detail + .big-link, .p-detail + .footer { margin-top: 0; }
.p-page .footer { margin-top: 5px; }

@media (min-width: 810px) and (max-width: 1199.98px) {
  .p-hero h1 { font-size: 80px; bottom: 40px; }
  .p-info { grid-template-columns: 154px 1fr; }
  .p-desc { font-size: 38px; }
  .p-meta { margin-top: 200px; }
  .gallery { padding-top: 504px; }
}
@media (max-width: 809.98px) {
  .p-hero { height: 100vh; }
  .p-hero h1 { font-size: 56px; bottom: 40px; max-width: none; }
  .p-info { grid-template-columns: 1fr; }
  .p-desc { font-size: 32px; line-height: 1.1; }
  .p-meta { margin: 100px 0 0; }
  .gallery { padding-top: 200px; gap: 7px; margin: 0 calc(var(--pad) * -1); }
  .gallery .g { aspect-ratio: var(--arm, 0.7208); align-self: start; }
  .gallery .g.full { aspect-ratio: 376 / 282; }
  .more { padding-top: 596px; }
  .more .works { margin: 0 calc(var(--pad) * -1); }
}
.pill.upper { text-transform: uppercase; }

/* Hero: scia di immagini che segue il cursore */
.trail { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: visible; }
.trail-img {
  position: absolute; left: 0; top: 0; width: 210px; height: 240px;
  background-size: cover; background-position: center;
  transform: translate3d(var(--x), var(--y), 0) scale(0);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.trail-img.in { transform: translate3d(var(--x), var(--y), 0) scale(1); }
.trail-img.out { transform: translate3d(var(--x), var(--y), 0) scale(0); }
.hero-name-wrap { z-index: 1; }

/* Animazioni d'ingresso al caricamento (valori presi dall'originale Framer) */
.appear { animation: appear 1s var(--spring) var(--d, 0s) both; }
.appear.tween { animation-name: appear15; animation-timing-function: var(--inout); }
@keyframes appear { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes appear15 { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
/* barra in alto: scende dall'alto solo quando si apre il sito (non cambiando pagina) */
html.first-load .header { animation: header-in 1s var(--inout) both; }
@keyframes header-in { from { opacity: 0; translate: 0 -49px; } to { opacity: 1; translate: 0 0; } }

/* Foto About: zoom in apertura (contenitore 0.7→1, immagine 1.4→1) */
.zoom { overflow: hidden; transform: scale(.7); transition: transform 1.2s var(--spring); }
.zoom img { transform: scale(1.4); transition: transform 1.2s var(--spring); }
.zoom.in, .zoom.in img { transform: none; }

/* Pulsante "Download full book": hover 1.1, click 0.9 (molla 0.4s, rimbalzo 0.2) */
.pop { transition: transform .4s cubic-bezier(.34,1.45,.64,1); }
@media (hover: hover) { .pop:hover { transform: scale(1.1); } }
.pop:active { transform: scale(.9); }
.reveal.fade { transform: none; transition: opacity .4s ease-out; }

/* Hero progetto */
.p-hero-inner { position: absolute; inset: 0; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .appear, html.first-load .header { animation: none; }
  .zoom, .zoom img { transform: none; }
}
.p-meta .live dd { font: 500 14px/1.1 "Inter Display", sans-serif; letter-spacing: 0.01em; text-transform: uppercase; }
.contact-hero h1 a { color: inherit; }

@media (min-width: 1200px) { .p-hero h1 { max-width: calc(50% - 30px); } }

/* Dettagli progetto: spazio come nell'originale quando manca il cliente; su tablet la galleria parte sempre alla stessa altezza */
@media (min-width: 1200px) { .p-meta.noclient { margin-bottom: 82px; } }
@media (min-width: 810px) and (max-width: 1199.98px) { .p-top { height: 1140px; } .gallery { padding-top: 0; } }
@media (max-width: 809.98px) { .p-meta.noclient { margin-bottom: 78px; } }

/* come su Framer: da tablet in su il footer passa sopra la barra in alto */
@media (min-width: 810px) { .footer { z-index: 71; } }

/* come su Framer: niente barra di scorrimento visibile, niente evidenziazione al tocco, immagini non trascinabili */
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body, * { -ms-overflow-style: none; scrollbar-width: none; }
* { -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; user-drag: none; }

/* Transizione tra le pagine (valori della transizione globale di Framer) */
::view-transition-group(root) { animation-duration: 1.2s; }
::view-transition-old(root) { animation: page-exit .7s cubic-bezier(.27, 0, .51, 1) both; }
::view-transition-new(root) { animation: page-enter .7s cubic-bezier(.27, 0, .51, 1) .5s both; }
@keyframes page-exit { from { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); } to { opacity: 0; transform: translateY(-40%); clip-path: inset(0 0 100% 0); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(30%); clip-path: inset(100% 0 0 0); } to { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); } }

/* Telefono e tablet: immagini della scia un po' più piccole */
@media (hover: none), (pointer: coarse) { .trail-img { width: 189px; height: 216px; margin: 12px 0 0 10px; } }
