/* =========================================================
   Camilla Stelluti — sito vetrina
   Palette calda, editoriale, minimale. Niente icone.
   ========================================================= */

:root {
  --cream:     #f6f1ea;
  --cream-2:   #ede3d6;
  --ink:       #241b16;
  --ink-soft:  #6b5d52;
  --rose:      #c77f6a;
  --rose-deep: #9c4a37;
  --gold:      #d8a878;
  --line:      rgba(36, 27, 22, 0.14);
  --line-soft: rgba(36, 27, 22, 0.08);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad-x: clamp(1.5rem, 6vw, 7rem);
  --maxw:  1240px;
  --ease:  cubic-bezier(0.22, 0.68, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Lenis (smooth scroll) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Grana ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: url("../assets/grain.png") repeat;
  background-size: 200px 200px;
  opacity: 0.38;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 9000;
  animation: grain 7s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

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

/* Senza JavaScript i contenuti restano comunque visibili */
html:not(.js) .reveal { opacity: 1; transform: none; }
html:not(.js) .hero__title .reveal-mask > span { transform: none; }

/* piccolo stagger su gruppi */
.stats__grid .stat:nth-child(2) { transition-delay: 0.1s; }
.stats__grid .stat:nth-child(3) { transition-delay: 0.2s; }
.links__list li:nth-child(1) { transition-delay: 0.04s; }
.links__list li:nth-child(2) { transition-delay: 0.1s; }
.links__list li:nth-child(3) { transition-delay: 0.16s; }
.links__list li:nth-child(4) { transition-delay: 0.22s; }
.links__list li:nth-child(5) { transition-delay: 0.28s; }

/* =========================================================
   Navigazione
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.1rem, 2.4vw, 1.9rem) var(--pad-x);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease),
              box-shadow 0.4s var(--ease);
}
.nav.scrolled {
  padding-block: clamp(0.7rem, 1.4vw, 1rem);
  background: rgba(246, 241, 234, 0.78);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 var(--line-soft);
}
.nav__brand {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.nav__menu { display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); }
.nav__menu a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav__menu a:hover { color: var(--ink); }
.nav__menu a:hover::after { transform: scaleX(1); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  padding: 7rem var(--pad-x) 5rem;
}
.hero__bg {
  position: absolute;
  inset: -12% -6%;
  background: url("../assets/hero.jpg") center / cover no-repeat;
  z-index: -2;
  will-change: transform;
}
.hero__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 35%, transparent 40%, rgba(246,241,234,0.35) 100%),
    linear-gradient(to bottom, transparent 55%, var(--cream) 99%);
}
.hero__inner { max-width: 60rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}
.eyebrow .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rose);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 10rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .reveal-mask { display: block; overflow: hidden; }
.hero__title .reveal-mask > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}
body.loaded .hero__title .reveal-mask > span { transform: translateY(0); }
.hero__title .line:nth-child(2) .reveal-mask > span { transition-delay: 0.12s; }

.hero__tagline {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.3vw, 1.55rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34ch;
  margin: clamp(1.6rem, 3.5vw, 2.4rem) auto clamp(2rem, 4vw, 2.8rem);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero__scroll {
  position: absolute;
  bottom: clamp(1.4rem, 4vh, 2.6rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__scroll-line {
  width: 1px; height: 46px;
  background: linear-gradient(var(--ink-soft), transparent);
  transform-origin: top;
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(46px); opacity: 0; }
}

/* =========================================================
   Bottoni
   ========================================================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  padding: 0.95em 1.9em;
  border-radius: 100px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.4s var(--ease);
}
.btn > span { position: relative; z-index: 1; transition: color 0.45s var(--ease); }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateY(102%);
  transition: transform 0.5s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn--solid { background: var(--ink); color: var(--cream); }
.btn--solid::before { background: var(--rose-deep); }

.btn--ghost { color: var(--ink); border-color: var(--line); }
.btn--ghost::before { background: var(--ink); }
.btn--ghost:hover > span { color: var(--cream); }

/* =========================================================
   Marquee
   ========================================================= */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line-soft);
  padding-block: clamp(1.1rem, 2.4vw, 1.7rem);
  background: linear-gradient(var(--cream), var(--cream-2));
}
.marquee__inner {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 28s linear infinite;
}
.marquee__inner span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 4vw, 2.7rem);
  color: var(--ink);
}
.marquee__inner .sep { color: var(--rose); font-style: normal; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee:hover .marquee__inner { animation-play-state: paused; }

/* =========================================================
   Sezioni generiche
   ========================================================= */
.section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(5rem, 13vh, 9.5rem) var(--pad-x);
}
.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 1.4rem;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.2vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 18ch;
}

/* ---------- Storia ---------- */
.storia {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: 0 30px 60px -30px rgba(36, 27, 22, 0.4);
}
.frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.frame:hover img { transform: scale(1.06); }
.storia__text h2 { margin-bottom: 1.6rem; }
.storia__text .lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.storia__text p:not(.lead):not(.kicker) { color: var(--ink-soft); }

/* ---------- Community / numeri ---------- */
.stats { text-align: center; }
.stats .kicker { display: inline-block; }
.stats__head { margin: 0 auto 3.5rem; max-width: 20ch; }
.stats__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(2rem, 7vw, 6rem);
}
.stat { display: flex; flex-direction: column; gap: 0.4rem; }
.stat__num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8.5vw, 6.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat__label {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stats__note {
  margin: 3.5rem auto 0;
  max-width: 36ch;
  color: var(--ink-soft);
}

/* =========================================================
   Galleria orizzontale
   ========================================================= */
.gallery { position: relative; }
.gallery__intro { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.gallery__intro h2 { margin-bottom: 1rem; }
.gallery__hint { color: var(--ink-soft); }

.gallery__sticky {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: clamp(3rem, 8vh, 6rem);
}
.gallery__sticky::-webkit-scrollbar { display: none; }
.gallery__track {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding-inline: var(--pad-x);
}

/* modalità "pinned": lo scroll verticale muove la galleria in orizzontale */
.gallery.is-pinned .gallery__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  padding-bottom: 0;
}
.gallery.is-pinned .gallery__track { will-change: transform; }

.card {
  flex: 0 0 auto;
  width: clamp(250px, 46vh, 380px);
  scroll-snap-align: center;
}
.card__img {
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: 0 24px 50px -28px rgba(36, 27, 22, 0.45);
}
.card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.card:hover .card__img img { transform: scale(1.07); }
.card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--ink);
}
.card__idx { color: var(--rose); font-family: var(--serif); }

/* =========================================================
   Link / dove trovarmi
   ========================================================= */
.links__head { margin-bottom: 1rem; }
.links__intro { color: var(--ink-soft); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.links__list { list-style: none; }
.links__list li { border-top: 1px solid var(--line); }
.links__list li:last-child { border-bottom: 1px solid var(--line); }
.links__list a {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(1.1rem, 3.2vw, 2.1rem);
  text-decoration: none;
  overflow: hidden;
}
.links__list a::before {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--rose-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.links__list a:hover::before { transform: scaleX(1); }
.links__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 5.4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.45s var(--ease), color 0.35s var(--ease);
}
.links__list a:hover .links__name {
  transform: translateX(clamp(8px, 1.6vw, 22px));
  color: var(--rose-deep);
}
.links__meta {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
  transition: opacity 0.35s var(--ease);
}

/* =========================================================
   Chiusura / contatti
   ========================================================= */
.closing { text-align: center; }
.closing .kicker { display: inline-block; }
.closing__head { margin: 0 auto 1.4rem; max-width: 16ch; }
.closing__text {
  margin: 0 auto clamp(2rem, 4vw, 2.8rem);
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding: 2.4rem var(--pad-x);
  border-top: 1px solid var(--line-soft);
  background: var(--cream-2);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.footer__name { font-family: var(--serif); color: var(--ink); }
.footer__top {
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  position: relative;
}
.footer__top::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.footer__top:hover::after { transform: scaleX(1); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 820px) {
  .nav__menu { gap: 1.1rem; }
  .nav__menu a:first-child { display: none; }
  .storia { grid-template-columns: 1fr; }
  .storia__media { order: -1; max-width: 26rem; }
  h2 { max-width: 100%; }
}

@media (max-width: 540px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .nav__menu a:nth-child(2) { display: none; }
  .links__meta { display: none; }
  .footer { justify-content: flex-start; }
}

/* =========================================================
   Riduzione del movimento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__title .reveal-mask > span { transform: none; }
  .grain { animation: none; }
  .marquee__inner { animation: none; }
}
