:root {
  --ice: #edfafd;
  --paper: #d7eef4;
  --ink: #16120e;
  --muted: #5d6a6e;
  --gold: #b08d57;
  --gold-deep: #8a6a3c;
  --gold-soft: #c9b08a;
  --line: rgba(22, 18, 14, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --max: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ice);
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--ice);
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  overflow-x: clip;
}

html.is-loading,
html.is-loading body {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
  touch-action: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.cursor {
  display: none;
}

.kicker {
  margin: 0 0 1rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.text-btn::after {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease);
}

.text-btn:hover::after,
.text-btn:focus-visible::after {
  width: 2.6rem;
}

.text-btn--lg {
  font-size: 0.8rem;
}

.display {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--ice);
  transition: transform 1.1s var(--ease), opacity 0.8s ease;
}

.loader.is-done {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  width: min(58vw, 16rem);
  height: auto;
  animation: mark-in 1.4s var(--ease) both;
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(0.9rem + env(safe-area-inset-top)) var(--pad) 1.4rem;
  background: linear-gradient(180deg, #edfafd 0%, #edfafd00 100%);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
}

.nav.is-on {
  opacity: 1;
  transform: none;
  pointer-events: none;
}

.nav-logo,
.nav .text-btn {
  pointer-events: auto;
}

.nav-logo {
  display: block;
  width: 7.4rem;
}

.nav-logo img {
  width: 100%;
  height: auto;
}

/* Intro + collection: il video resta sticky; i pannelli gli passano sopra. */
.hero-stack {
  position: relative;
}

.hero-back {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
}

.hero-back .media {
  height: 100%;
}

.intro {
  position: relative;
  z-index: 2;
  margin-top: -100svh;
  min-height: 100svh;
  background: var(--ice);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  padding: env(safe-area-inset-top) var(--pad) calc(var(--pad) + 1rem);
  overflow: hidden;
}

/* Due mani in cornice. Una entra da destra, l'altra da sinistra. */
.intro-hand {
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(22, 18, 14, 0.07));
}

.intro-hand--top {
  position: relative;
  grid-row: 1;
  z-index: 3;
  display: block;
  width: calc(100% + var(--pad));
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0 calc(-1 * var(--pad)) 0 0;
  object-fit: contain;
  object-position: right center;
  transform: none;
  translate: calc(var(--out, 0) * 120%) 0;
  will-change: translate;
  animation: hand-in-right 1.6s 1.15s var(--ease) both;
}

.intro-hand--bottom {
  position: relative;
  grid-row: 3;
  z-index: 3;
  display: block;
  width: calc(100% + var(--pad));
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0 0 0 calc(-1 * var(--pad));
  object-position: left center;
  transform: none;
  translate: calc(var(--out, 0) * -120%) 0;
  will-change: translate;
  animation: hand-in-left 1.55s 1.3s var(--ease) both;
}

/* I testi stanno nella fascia libera fra le due mani. */
.intro-copy {
  position: relative;
  grid-row: 2;
  z-index: 1;
  width: 100%;
  max-width: none;
  text-align: center;
}

.intro-mark {
  width: min(82vw, 28rem);
  height: auto;
  margin: 0 auto 0.7rem;
  opacity: 0;
  animation: rise 1.2s 1.35s var(--ease) forwards;
}

.intro-line {
  margin: 0 auto;
  max-width: 22rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.25;
  opacity: 0;
  animation: rise 1s 1.7s var(--ease) forwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hand-in-right {
  from {
    opacity: 0;
    transform: translate3d(48vw, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hand-in-left {
  from {
    opacity: 0;
    transform: translate3d(-48vw, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Reveals */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.media {
  overflow: hidden;
  background: var(--ice);
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(var(--sc, 1.08)) translate3d(0, var(--py, 0px), 0);
  transition: transform 1.6s var(--ease);
}

.media video {
  display: block;
  object-position: center center;
  pointer-events: none;
}

/* Reveal pilotato dallo scroll: reversibile, dentro e fuori.
   --p va da 0 (elemento al bordo basso) a 1 (elemento entrato del 14%).
   --sc è lo zoom-out leggero, --py la parallasse. */
[data-reveal="zoom"] {
  --p: 0;
  opacity: 1;
  transform: none;
}

[data-reveal="zoom"] img,
[data-reveal="zoom"] video {
  --sc: calc(1.08 - 0.08 * var(--p));
  transition: none;
}

/* Editorial blocks */
.bleed {
  margin: 0;
  padding: 0 0 4.5rem;
}

.bleed .media {
  height: min(88svh, 52rem);
}

.hero-hold {
  height: 100svh;
  pointer-events: none;
}

.hero-caption,
.collection {
  position: relative;
  z-index: 2;
  background: var(--ice);
}

.hero-caption {
  padding: 2.4rem 0 2rem;
}

.bleed-caption {
  margin: 1.4rem var(--pad) 0;
  max-width: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.12rem, 3.8vw, 1.7rem);
  line-height: 1.3;
  white-space: nowrap;
}

.bleed-caption em {
  font-style: italic;
}

.poem {
  padding: 2rem var(--pad) 5.5rem;
  max-width: 34rem;
}

.poem-line {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.2rem, 9vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.poem-line + .poem-line {
  font-style: italic;
  color: var(--muted);
}

.poem-body {
  margin: 1.8rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 22rem;
}

.collection {
  padding: 1.5rem 0 4rem;
  overflow-x: clip;
}

.collection-name {
  margin: 0 var(--pad) 3.2rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(3.2rem, 16vw, 6.5rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.collection > .kicker {
  margin: 0 var(--pad) 0.6rem;
}

.piece {
  padding: 0 var(--pad) 5.5rem;
  display: grid;
  gap: 1.5rem;
}

.piece-media {
  aspect-ratio: 3 / 2;
  height: auto;
}

@media (max-width: 859px) {
  .piece-media[data-slide] {
    --slide: 0;
    --fade: 0;
    --dir: -1;
    opacity: var(--fade);
    translate: calc((1 - var(--slide)) * var(--dir) * 42%) calc((1 - var(--slide)) * 14px);
    will-change: translate, opacity;
  }

  .piece-media[data-slide="right"] {
    --dir: 1;
  }
}

.piece-copy .piece-media {
  margin: 0.2rem 0 1.4rem;
}

.piece-name {
  margin: 0 0 0.8rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 5.5rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.piece-note {
  margin: 0 0 1.1rem;
  max-width: 22rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.piece-meta {
  display: flex;
  gap: 1.4rem;
  margin: 0 0 1.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.piece--end .piece-copy {
  text-align: right;
}

.piece--end .piece-note,
.piece--end .piece-meta {
  margin-left: auto;
}

.piece--end .piece-meta {
  justify-content: flex-end;
}

.bleed--quote {
  position: relative;
}

.bleed-quote {
  margin: 1.6rem var(--pad) 0;
  max-width: 22rem;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.15;
}

.bleed-quote p {
  margin: 0;
}

.atelier {
  padding: 1rem var(--pad) 5.5rem;
  display: grid;
  gap: 2rem;
}

.atelier-body {
  margin: 1.4rem 0 0;
  max-width: 24rem;
  color: var(--muted);
  line-height: 1.75;
}

.atelier-visuals {
  display: grid;
  gap: 0.7rem;
}

.atelier-main {
  height: min(70svh, 38rem);
}

.atelier-side {
  height: 16rem;
  width: 72%;
  justify-self: end;
}

.close {
  padding: 2rem var(--pad) 6rem;
  max-width: 36rem;
}

.close-line {
  margin: 0 0 1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 9vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.close-body {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 20rem;
}

.mail {
  display: block;
  margin-top: 1.8rem;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  width: max-content;
}

.mail:hover {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.foot {
  padding: 0 var(--pad) calc(2.4rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.foot p {
  margin: 0;
}

.foot-mark {
  width: 6.5rem;
  margin-bottom: 0.8rem;
  opacity: 0.7;
}

.foot-note {
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.7;
}

/* Sheet */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(22, 18, 14, 0.28);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.backdrop.is-on {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 46;
  max-height: min(92svh, 40rem);
  overflow: auto;
  padding: 1.4rem var(--pad) calc(2rem + env(safe-area-inset-bottom));
  background: var(--ice);
  transform: translateY(110%);
  transition: transform 0.7s var(--ease);
}

.sheet.is-on {
  transform: none;
}

.sheet-close {
  position: absolute;
  top: 1.3rem;
  right: var(--pad);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.sheet-lead {
  margin: 0 0 1.6rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
}

.form {
  display: grid;
  gap: 1rem;
}

.form label {
  display: grid;
  gap: 0.4rem;
}

.form span {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 0.55rem 0 0.7rem;
  outline: none;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-bottom-color: var(--gold);
}

.form textarea {
  resize: vertical;
}

.form-done {
  margin: 1rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
}

.form.is-sent {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 10px;
    height: 10px;
    pointer-events: none;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
  }

  .cursor span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.35s var(--ease);
  }

  .cursor.is-hover span {
    transform: scale(2.4);
  }

  body,
  a,
  button {
    cursor: none;
  }
}

@media (min-width: 860px) {
  .intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: calc(var(--pad) + 1.5rem) var(--pad) calc(var(--pad) + 1rem);
  }

  .intro-hand {
    width: min(58vw, 48rem);
    height: 72svh;
  }

  .intro-hand--top {
    position: absolute;
    top: 1.2rem;
    right: 0;
    left: auto;
    width: min(62vw, 52rem);
    height: auto;
    margin: 0;
    object-position: right top;
  }

  .intro-hand--bottom {
    position: absolute;
    bottom: 1.2rem;
    left: 0;
    width: min(62vw, 52rem);
    height: auto;
    margin: 0;
    object-position: left bottom;
  }

  .intro-copy {
    max-width: none;
    transform: translateY(-28px);
  }

  .intro-mark {
    width: min(42vw, 34rem);
    margin-bottom: 0.85rem;
  }

  .poem {
    padding: 6rem 12vw 8rem;
  }

  .collection-name,
  .collection > .kicker {
    margin-left: 8vw;
    margin-right: 8vw;
  }

  .piece {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    gap: 4vw;
    padding: 0 8vw 5rem;
    min-height: 0;
  }

  .piece:not(:has(> .piece-media)) {
    grid-template-columns: minmax(0, 42rem);
    min-height: 0;
    padding-top: 2rem;
  }

  .piece--flip {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .piece--flip .piece-media {
    order: 2;
  }

  .piece-copy {
    padding-bottom: 1.4rem;
  }

  .piece--end .piece-copy {
    text-align: left;
  }

  .piece--end .piece-note,
  .piece--end .piece-meta {
    margin-left: 0;
  }

  .piece--end .piece-meta {
    justify-content: flex-start;
  }

  .piece-media {
    height: auto;
  }

  .bleed {
    padding-bottom: 7rem;
  }

  .bleed .media {
    height: 100svh;
  }

  .bleed-caption {
    margin-left: 8vw;
    font-size: 1.7rem;
  }

  .atelier {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 5vw;
    padding: 6rem 8vw 8rem;
  }

  .atelier-side {
    height: 22rem;
    width: 58%;
    margin-top: -5rem;
  }

  .bleed-quote {
    margin-left: 8vw;
    position: relative;
    bottom: auto;
    left: auto;
  }

  .bleed--quote .media {
    height: 100svh;
  }

  .close {
    padding: 4rem 8vw 8rem;
  }

  .foot {
    padding-left: 8vw;
    padding-right: 8vw;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 1.5rem;
  }

  .foot-mark {
    grid-column: 1 / -1;
  }

  .sheet {
    left: auto;
    width: min(32rem, 42vw);
    height: 100%;
    max-height: none;
    padding: 3.2rem 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .loader,
  .intro-mark,
  .intro-line,
  [data-reveal],
  [data-reveal="zoom"] img,
  [data-reveal="zoom"] video {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
