/* ==========================================================
   MODEL PORTFOLIO — v2
   Colori e font nelle variabili qui sotto.
   ========================================================== */

:root {
  --bg: #f3f2ef;
  --ink: #0c0c0c;
  --grey: #85847f;
  --line: rgb(12 12 12 / .14);
  --line-inv: rgb(243 242 239 / .18);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --g: clamp(16px, 3vw, 44px);          /* margine laterale */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --hd: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.locked { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }
.skip { position: absolute; left: var(--g); top: -80px; z-index: 99; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.skip:focus { top: 12px; }

/* Etichette mono */
.label, .hero-meta, .hero-stats, .units, .menu-btn, .hd-nav, .hd-mark, .foot, figcaption, .btn, .menu small, .menu-foot {
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: .04em; text-transform: uppercase;
}
.label { margin: 0; }
.label > span:first-child { color: var(--grey); margin-right: .9em; }

/* Display condensato */
.display {
  font-family: var(--sans); font-stretch: 62%; font-weight: 700;
  text-transform: uppercase; line-height: .82; letter-spacing: -.01em;
}

/* ---------- Header (si inverte sopra le foto) ---------- */
.hd {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--hd);
  padding: 0 var(--g);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  color: #fff; mix-blend-mode: difference;
  pointer-events: none;
}
.hd > * { pointer-events: auto; }
.hd-mark { justify-self: start; font-weight: 500; }
.hd-nav { display: flex; gap: clamp(16px, 2.4vw, 34px); }
.hd-nav a { position: relative; }
.hd-nav a::before { content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: currentColor; transform: scale(0); transition: transform .3s var(--ease); }
.hd-nav a[aria-current]::before, .hd-nav a:hover::before { transform: scale(1); }
.hd-tools { justify-self: end; display: flex; align-items: center; gap: 20px; }

.units { display: inline-flex; gap: 2px; }
.units button { padding: 4px 6px; opacity: .45; transition: opacity .2s; }
.units button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.units button:hover { opacity: 1; }
.menu-btn { display: none; }

/* ---------- Menu mobile ---------- */
.menu {
  position: fixed; inset: 0; z-index: 35; background: var(--ink); color: var(--bg);
  padding: calc(var(--hd) + 24px) var(--g) calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a {
  display: flex; align-items: baseline; gap: 14px; padding: 6px 0;
  border-bottom: 1px solid var(--line-inv);
  font-stretch: 62%; font-weight: 700; text-transform: uppercase;
  font-size: clamp(3.4rem, 17vw, 6rem); line-height: .95;
  animation: menuIn .6s var(--ease) both;
}
.menu nav a:nth-child(2) { animation-delay: .05s; }
.menu nav a:nth-child(3) { animation-delay: .1s; }
.menu nav a:nth-child(4) { animation-delay: .15s; }
.menu small { color: var(--grey); }
@keyframes menuIn { from { opacity: 0; transform: translateY(24px); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 560px;
  background: var(--ink); color: #fff; overflow: hidden;
}
.hero-panels { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.hero-panel { position: relative; overflow: hidden; clip-path: inset(100% 0 0 0); animation: panelIn 1.4s var(--ease) forwards; }
.hero-panel:nth-child(2) { animation-delay: .12s; }
.hero-panel:nth-child(3) { animation-delay: .24s; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); animation: panelZoom 2.4s var(--ease) forwards; animation-delay: inherit; }
@keyframes panelIn { to { clip-path: inset(0 0 0 0); } }
@keyframes panelZoom { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .45), rgb(0 0 0 / 0) 22%),
    linear-gradient(to top, rgb(0 0 0 / .55), rgb(0 0 0 / 0) 45%);
}
.hero-meta {
  position: absolute; z-index: 2; left: var(--g); right: var(--g); top: calc(var(--hd) + 8px);
  display: flex; justify-content: space-between; gap: 16px;
}
.hero-meta p { margin: 0; }
.hero-name {
  position: absolute; z-index: 2; left: var(--g); right: var(--g); bottom: calc(var(--g) + 30px);
  margin: 0; display: flex; flex-direction: column;
  font-stretch: 62%; font-weight: 700; text-transform: uppercase; line-height: .8; letter-spacing: -.005em;
}
.hero-name span { display: block; white-space: nowrap; animation: nameIn 1.2s .5s var(--ease) both; }
.hero-name span:first-child { font-size: clamp(2rem, 6.4vw, 7rem); margin-bottom: .08em; }
.hero-name span:last-child { font-size: 22vw; animation-delay: .6s; }
@keyframes nameIn { from { opacity: 0; transform: translateY(40%); } }
.hero-stats {
  position: absolute; z-index: 2; left: var(--g); right: var(--g); bottom: var(--g);
  margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px;
  animation: fadeIn 1s 1s both;
}
.hero-stats div { display: flex; gap: 6px; }
.hero-stats dt { opacity: .6; }
.hero-stats dd { margin: 0; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Book (scorrimento orizzontale) ---------- */
.book { position: relative; }
.book-sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); gap: 18px;
  padding: calc(var(--hd) + 16px) 0 var(--g);
}
.book-head { padding: 0 var(--g); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.book-count { font-variant-numeric: tabular-nums; }
.book-hint { justify-self: end; color: var(--grey); }
.book-track {
  display: flex; gap: clamp(10px, 1.6vw, 24px); align-items: stretch;
  padding: 0 var(--g); min-height: 0; will-change: transform;
}
.book-item { margin: 0; flex: none; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.book-item button { position: relative; display: block; flex: 1; min-height: 0; overflow: hidden; background: #e4e2dd; cursor: zoom-in; }
.book-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.book-item button:hover img { transform: scale(1.03); }
.book-item figcaption { display: flex; justify-content: space-between; gap: 20px; color: var(--grey); }
.book-bar { margin: 0 var(--g); height: 1px; background: var(--line); }
.book-bar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* ---------- Runway ---------- */
.runway { background: var(--ink); color: var(--bg); padding: clamp(60px, 8vw, 120px) 0 clamp(80px, 10vw, 160px); overflow: hidden; }
.marquee { overflow: hidden; border-block: 1px solid var(--line-inv); padding: .12em 0; margin-bottom: clamp(40px, 6vw, 90px); }
.marquee-inner {
  display: flex; width: max-content;
  font-stretch: 62%; font-weight: 700; text-transform: uppercase;
  font-size: clamp(4.5rem, 14vw, 15rem); line-height: .9;
  animation: marquee 40s linear infinite;
}
.marquee-inner span { padding-right: .35em; }
.marquee-inner span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--bg); }
@keyframes marquee { to { transform: translateX(-50%); } }
.runway-head { padding: 0 var(--g); margin-bottom: 28px; }
.runway-head .label > span:first-child { color: var(--grey); }
.runway-grid { padding: 0 var(--g); display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.4vw, 20px); align-items: start; }
.runway-grid figure { margin: 0; }
.runway-grid figure:nth-child(even) { margin-top: clamp(40px, 8vw, 140px); }
.runway-grid button { display: block; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: #1c1c1b; cursor: zoom-in; }
.runway-grid img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .8s, transform 1.2s var(--ease); }
.runway-grid button:hover img { filter: none; transform: scale(1.03); }
.runway-grid figcaption { display: flex; justify-content: space-between; padding-top: 10px; color: var(--grey); }

/* ---------- Profile ---------- */
.profile {
  padding: clamp(80px, 10vw, 160px) var(--g);
  display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 6vw, 110px); align-items: start;
}
.profile-photo { margin: 0; position: sticky; top: calc(var(--hd) + 10px); background: #e4e2dd; aspect-ratio: 3 / 4; overflow: hidden; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { display: flex; flex-direction: column; gap: clamp(36px, 5vw, 64px); }
.profile-bio {
  margin: 0; font-size: clamp(1.5rem, 2.8vw, 2.6rem); line-height: 1.12; font-weight: 400; letter-spacing: -.02em;
  font-stretch: 85%; max-width: 22ch;
}
.measure-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.units--inline button { padding: 2px 6px; }
.measure-list { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(20px, 4vw, 60px); }
.measure-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.measure-list dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--grey); }
.measure-list dd {
  margin: 0; text-align: right; font-stretch: 62%; font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.measure-list dd small { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--grey); margin-left: 4px; }
.btn {
  align-self: start; display: inline-flex; gap: 14px; align-items: center;
  padding: 16px 22px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background .3s, color .3s;
}
.btn:hover { background: var(--ink); color: var(--bg); }

/* ---------- Booking / footer ---------- */
.booking { padding: clamp(80px, 10vw, 150px) var(--g) 0; border-top: 1px solid var(--line); overflow: hidden; }
.booking-email {
  display: inline-block; margin: clamp(26px, 4vw, 50px) 0 clamp(50px, 7vw, 100px);
  font-stretch: 62%; font-weight: 700; text-transform: uppercase; line-height: .9;
  font-size: clamp(2.6rem, 8vw, 9rem); overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  transition: background-size .6s var(--ease);
}
.booking-email:hover { background-size: 100% 3px; }
.booking-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; border-top: 1px solid var(--ink); padding-top: 18px; }
.booking-cols p { margin: 0 0 4px; }
.booking-cols .label { color: var(--grey); margin-bottom: 12px; }
.booking-cols a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.booking-cols a:hover { border-color: currentColor; }
.agency + .agency { margin-top: 22px; }
.agency strong { font-weight: 500; }
.booking-name {
  margin: clamp(60px, 10vw, 140px) 0 0; height: .52em; overflow: hidden;
  font-stretch: 62%; font-weight: 700; text-transform: uppercase; line-height: .78; white-space: nowrap;
  font-size: 27vw; letter-spacing: -.01em;
}
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0 calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink); }

/* ---------- Visore foto ---------- */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--ink); color: var(--bg); overflow: hidden;
}
.viewer[open] { display: block; animation: fadeIn .35s ease; }
.viewer::backdrop { background: var(--ink); }
.viewer-top { position: absolute; inset: 0 0 auto; z-index: 3; height: var(--hd); padding: 0 var(--g); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.viewer-close { justify-self: end; }
.viewer img { position: absolute; inset: var(--hd) var(--g) var(--g); width: calc(100% - 2 * var(--g)); height: calc(100% - var(--hd) - var(--g)); object-fit: contain; }
.viewer-prev, .viewer-next { position: absolute; top: var(--hd); bottom: 0; width: 50%; z-index: 2; }
.viewer-prev { left: 0; cursor: w-resize; } .viewer-next { right: 0; cursor: e-resize; }

/* ---------- Comparsa ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s ease, transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.compcard { display: none; }
.noscript { padding: 120px var(--g); }

/* ---------- Mobile / tablet ---------- */
@media (max-width: 900px) {
  .runway-grid { grid-template-columns: repeat(2, 1fr); }
  .runway-grid figure:nth-child(even) { margin-top: 60px; }
  .profile { grid-template-columns: 1fr; }
  .profile-photo { position: relative; top: 0; max-width: 520px; }
}

@media (max-width: 760px) {
  :root { --hd: 56px; }
  .hd { grid-template-columns: 1fr auto; }
  .hd-nav { display: none; }
  .hd .units { display: none; }
  .menu-btn { display: block; padding: 8px 0; }
  .hd-mark { font-size: 10px; }

  .hero-panels { grid-template-columns: 1fr; }
  .hero-panel:not(:nth-child(2)) { display: none; }
  .hero-panel:nth-child(2) { animation-delay: 0s; }
  .hero-meta { flex-direction: column; gap: 2px; }
  .hero-name span:first-child { font-size: 9.5vw; }
  .hero-name { bottom: calc(var(--g) + 54px); }

  /* Book: scorrimento orizzontale col dito */
  .book-sticky { position: relative; height: auto; padding-bottom: 50px; }
  .book-head { grid-template-columns: 1fr auto; }
  .book-hint { display: none; }
  .book-track {
    height: 72svh; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    scrollbar-width: none; scroll-padding: 0 var(--g);
  }
  .book-track::-webkit-scrollbar { display: none; }
  .book-item { scroll-snap-align: start; }
  .book-item button { max-width: 86vw; }

  .marquee-inner { animation-duration: 24s; }
  .runway-grid figure:nth-child(even) { margin-top: 36px; }

  .measure-list { grid-template-columns: 1fr; }
  .booking-cols { grid-template-columns: 1fr; gap: 26px; }
  .foot { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-panel { clip-path: none; }
  .hero-panel img { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================
   COMP CARD — stampa / "Salva come PDF" (A4 orizzontale)
   ========================================================== */
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; }
  body > *:not(.compcard) { display: none !important; }
  .compcard {
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 0;
    width: 297mm; height: 209mm; overflow: hidden; color: #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .cc-cover { width: 100%; height: 209mm; object-fit: cover; }
  .cc-side { height: 209mm; padding: 10mm 10mm 8mm; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 5mm; min-height: 0; }
  .cc-name { font-family: var(--sans); font-stretch: 62%; font-weight: 700; text-transform: uppercase; font-size: 34pt; line-height: .85; margin: 0; }
  .cc-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5mm; min-height: 0; }
  .cc-grid img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  .cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm 4mm; margin: 0; font-family: var(--mono); font-size: 7.5pt; text-transform: uppercase; }
  .cc-stats dt { color: #777; }
  .cc-stats dd { margin: 0; font-size: 9pt; }
  .cc-contact { display: flex; justify-content: space-between; gap: 4mm; border-top: .3mm solid #000; padding-top: 2.5mm; font-family: var(--mono); font-size: 7.5pt; text-transform: uppercase; }
}
