/* Flusso / Lorenzo De Sanctis
   Palette: alluminio e grafite, senza colori d'accento. Il metallo nelle immagini e' l'unico colore. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Archivo"; font-style: italic; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-italic.woff2") format("woff2-variations");
}

:root {
  --paper: #e7e8e9;     /* alluminio chiaro */
  --paper-2: #dcdee0;
  --ink: #1b1d20;       /* grafite */
  --ink-2: #4a4f55;
  --steel: #7b8188;
  --rule: #c5c9cd;
  --night: #0d0e10;     /* il fondale dei render */
  --night-2: #17191c;
  --night-ink: #e4e6e8;
  --night-dim: #8e949a;

  --f: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1360px;
  --pad: clamp(1.25rem, 4.5vw, 4rem);
  --space: clamp(6rem, 14vw, 12rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f); font-size: 1.0625rem; line-height: 1.6; font-weight: 380;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
a { color: inherit; }
h1, h2 { margin: 0; font-weight: 300; font-stretch: 118%; letter-spacing: -0.02em; line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.9rem); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- testata ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.6rem var(--pad); color: var(--night-ink); font-size: .875rem; letter-spacing: .01em;
}
.mark { text-decoration: none; font-stretch: 112%; font-weight: 450; }
.top nav { display: flex; gap: clamp(1rem, 2.6vw, 2.25rem); }
.top nav a { text-decoration: none; color: var(--night-dim); transition: color .2s; }
.top nav a:hover { color: var(--night-ink); }
@media (max-width: 700px) { .top nav a:not([href="#contact"]) { display: none; } }

/* ---------- apertura ---------- */
.hero { position: relative; background: var(--night); color: var(--night-ink); height: min(100svh, 58vw); min-height: 34rem; overflow: hidden; }
.hero picture { display: contents; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero-copy {
  position: absolute; left: var(--pad); bottom: clamp(2.5rem, 9vh, 6rem); max-width: 30rem;
  animation: rise 1.2s cubic-bezier(.2,.7,.2,1) .2s both;
}
.hero h1 { font-size: clamp(4.25rem, 10.5vw, 10.5rem); font-weight: 250; font-stretch: 125%; letter-spacing: -0.045em; margin: 0 0 1.4rem -0.05em; line-height: .85; }
.hero p { color: #aab0b6; font-size: 1rem; line-height: 1.55; margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-copy { animation: none; } }

@media (max-width: 700px) {
  .hero { height: min(100svh, 142vw); min-height: 0; }
  .hero-img { object-position: 50% 50%; }
  .hero-copy { left: var(--pad); right: var(--pad); bottom: 2.25rem; }
  .hero h1 { font-size: clamp(3.75rem, 21vw, 6rem); margin-bottom: .9rem; }
}

/* ---------- introduzione ---------- */
.intro { padding-block: var(--space); display: grid; grid-template-columns: 1fr minmax(0, 40rem); }
.intro p {
  grid-column: 2; margin: 0; font-size: clamp(1.45rem, 2.5vw, 2.25rem); line-height: 1.25;
  font-weight: 300; font-stretch: 108%; letter-spacing: -0.012em;
}
.intro p + p { color: var(--steel); }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; } .intro p { grid-column: 1; } }

/* ---------- composizione ---------- */
.compose { background: var(--night-2); color: var(--night-ink); padding-block: clamp(5rem, 10vw, 9rem); }
.compose-head { display: grid; grid-template-columns: 1fr minmax(0, 26rem); gap: 2rem; align-items: end; margin-bottom: clamp(3rem, 6vw, 5rem); }
.compose-head p { color: var(--night-dim); margin: 0; }
.stage { display: grid; justify-items: center; gap: 2.5rem; padding-inline: var(--pad); }
.board { --g: clamp(5px, .7vw, 10px); display: grid; gap: var(--g); width: 100%; }
.board[data-count="1"] { grid-template-columns: 1fr; max-width: 30rem; }
.board[data-count="3"] { grid-template-columns: repeat(3, 1fr); max-width: 66rem; }
.board[data-count="4"] { grid-template-columns: repeat(2, 1fr); max-width: 42rem; }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: #0b0c0d; cursor: pointer; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.3,.7,.2,1); }
.tile.turning img { transform: rotate(90deg); }
.tile:focus-visible { outline: 1px solid var(--night-ink); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }
.board-controls { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: center; }
.board-controls button {
  font: inherit; font-size: .875rem; color: var(--night-dim); background: none;
  border: 1px solid transparent; border-radius: 999px; padding: .5rem 1.05rem; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.board-controls button:hover { color: var(--night-ink); }
.board-controls button[aria-pressed="true"] { color: var(--night-ink); border-color: #4b5056; }
.board-controls #shuffle { margin-left: 1rem; }
@media (max-width: 700px) {
  .compose-head { grid-template-columns: 1fr; gap: .6rem; margin-bottom: 2rem; }
  .stage { gap: 1.75rem; }
  .board-controls #shuffle { margin-left: 0; }
}

/* ---------- ambienti ---------- */
.rooms { padding-block: var(--space) 0; }
.rooms figure { margin: 0; }
.rooms figcaption { font-size: .8125rem; color: var(--steel); padding-top: .9rem; }
.bleed img { width: 100%; }
.pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(1rem, 2.5vw, 2rem); margin-top: clamp(3rem, 7vw, 6rem); align-items: start; }
.pair figure:last-child { margin-top: clamp(4rem, 12vw, 10rem); }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } .pair figure:last-child { margin-top: 0; } }

/* ---------- la piastra ---------- */
.object { padding-block: var(--space); display: grid; grid-template-columns: 1fr minmax(0, 38rem); gap: 2rem; align-items: start; }
.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.specs div:last-child { border-bottom: 1px solid var(--rule); }
.specs dt { color: var(--steel); font-size: .875rem; padding-top: .1rem; }
.specs dd { margin: 0; }
@media (max-width: 760px) { .object { grid-template-columns: 1fr; } }

/* ---------- firmato ---------- */
.signed { background: var(--paper-2); }
.signed img { width: 100%; }
.signed-copy { display: grid; grid-template-columns: 1fr minmax(0, 32rem); gap: 2rem; padding-block: clamp(3.5rem, 7vw, 6rem); }
.signed h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.12; }
.signed p { color: var(--ink-2); }
.signed .sig { font-style: italic; font-weight: 300; font-stretch: 100%; font-size: 1.35rem; color: var(--ink); margin-top: 1rem; }
@media (max-width: 760px) { .signed-copy { grid-template-columns: 1fr; } }

/* ---------- lavorazione ---------- */
.made { padding-block: var(--space); }
.made h2 { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--night); overflow: hidden; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-empty { display: none; position: absolute; left: 0; bottom: 0; margin: 0; padding: 1.25rem 1.5rem; color: var(--night-ink); font-size: .9375rem; }
.video-frame.is-empty video { visibility: hidden; }
.video-frame.is-empty { background: var(--night) url("../img/detail_macro.jpg") center / cover; }
.video-frame.is-empty::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,11,12,.65), rgba(10,11,12,0) 45%); }
.video-frame.is-empty .video-empty { display: block; z-index: 1; }

/* ---------- contatti ---------- */
.contact { background: var(--night-2); color: var(--night-ink); padding-block: var(--space); }
.contact-grid { display: grid; grid-template-columns: 1fr minmax(0, 32rem); gap: 2rem; }
.contact p { color: var(--night-dim); }
.wl-form { margin-top: 2.25rem; }
.wl-form label { display: block; font-size: .8125rem; color: var(--night-dim); }
.wl-row { display: flex; align-items: end; gap: 1.25rem; border-bottom: 1px solid #50555b; }
.wl-row:focus-within { border-color: var(--night-ink); }
.wl-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.125rem; color: var(--night-ink); background: none;
  border: 0; padding: .7rem 0; outline: none;
}
.wl-row button { font: inherit; font-size: .9375rem; color: var(--night-ink); background: none; border: 0; padding: .7rem 0; cursor: pointer; white-space: nowrap; }
.wl-row button:hover { text-decoration: underline; text-underline-offset: 4px; }
.wl-msg { margin-top: .9rem; font-size: .875rem; min-height: 1.4em; }
.wl-msg.err { color: #e0a39c; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- piede ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 2rem 2.5rem; font-size: .8125rem; color: var(--steel); }
.foot p { margin: 0; }

/* ---------- telefono ---------- */
@media (max-width: 700px) {
  :root { --space: 4.5rem; }
  body { font-size: 1rem; }
  .top { padding-block: 1.2rem; }
  h2 { font-size: 1.85rem; }
  .bleed figcaption { padding-inline: var(--pad); }
  .pair { gap: 2.25rem; }
  .object { gap: 1.25rem; }
  .specs div { grid-template-columns: 5.5rem 1fr; }
  .signed-copy { padding-block: 2.5rem var(--space); }
  .wl-row { flex-direction: column; align-items: stretch; gap: 1.25rem; border-bottom: 0; }
  .wl-row input { border-bottom: 1px solid #50555b; }
  .wl-row input:focus { border-color: var(--night-ink); }
  .wl-row button { align-self: flex-start; border: 1px solid #50555b; border-radius: 999px; padding: .75rem 1.4rem; }
  .bleed img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
  .pair figure:first-child img { aspect-ratio: 1 / 1; object-fit: cover; object-position: 45% 50%; }
  .signed img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 47% 40%; }
}
