/* ============================================================
   E-Stile Roma — sections.css
   Stili sezioni, griglie, card, responsive (mobile-first)
   ============================================================ */

/* ============ HEADER / NAV ============ */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 3vh, 30px) var(--gutter);
  transition: padding 0.4s var(--ease-expo), background 0.4s ease, color 0.4s ease;
  background: transparent;
  color: #F6F1E7; /* chiaro sopra la hero a tutto schermo */
}
.site-header .wordmark,
.site-header .nav-links a,
.site-header .nav-cart { color: inherit; }
.site-header.is-condensed {
  background: rgba(251, 250, 247, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding-block: clamp(10px, 1.6vh, 16px);
  border-bottom: 1px solid var(--hair);
  color: var(--ink); /* scuro quando l'header si condensa su fondo chiaro */
}
.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .accent-text { color: var(--accent); }
.nav-links {
  display: none;
  gap: clamp(18px, 2.2vw, 38px);
}
.nav-links a {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  position: relative;
  padding-block: 4px;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-right { display: flex; align-items: center; gap: var(--s4); }
.nav-cart {
  font-family: var(--body); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-cart .cart-count {
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--surface);
  font-size: 0.65rem; display: inline-flex;
  align-items: center; justify-content: center;
}
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__inner {
  position: relative;
  width: 100%;
  text-align: center;
  display: grid;
  place-items: center;
  perspective: 900px; /* tilt 3D foreshortened, niente schiacciamento */
}
.hero__title {
  position: relative;
  z-index: 3;
  max-width: 16ch;
  color: #F6F1E7;
  text-shadow: 0 2px 34px rgba(8,7,5,0.40);
}
.hero__title .word { display: inline-block; will-change: transform, opacity; }
/* Immagine a tutta larghezza come sfondo della hero */
.hero__object {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
  pointer-events: none;
}
.hero__object img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Velatura per leggibilità del titolo chiaro sopra la foto */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8,7,5,0.34) 0%, rgba(8,7,5,0.10) 30%, rgba(8,7,5,0.16) 60%, rgba(8,7,5,0.58) 100%),
    radial-gradient(120% 82% at 50% 48%, rgba(8,7,5,0.04) 0%, rgba(8,7,5,0.40) 100%);
}
.hero__corner {
  position: absolute;
  z-index: 4;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246,241,231,0.74);
  will-change: transform, opacity;
}
.hero__corner--tl { top: clamp(90px,12vh,140px); left: var(--gutter); text-align: left; }
.hero__corner--tr { top: clamp(90px,12vh,140px); right: var(--gutter); text-align: right; }
.hero__corner--bl { bottom: clamp(40px,8vh,80px); left: var(--gutter); text-align: left; }
.hero__corner--br { bottom: clamp(40px,8vh,80px); right: var(--gutter); text-align: right; }
.hero__sweep {
  position: absolute;
  z-index: 2;
  top: 50%; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
.hero__scroll {
  position: absolute;
  bottom: clamp(20px,4vh,40px);
  left: 50%; transform: translateX(-50%);
  z-index: 4;
  font-size: 0.65rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(246,241,231,0.82);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll .line { width: 1px; height: 32px; background: rgba(246,241,231,0.5); position: relative; overflow: hidden; }
.hero__scroll .line::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%;
  background: var(--accent); animation: scrollPulse 1.8s var(--ease-out) infinite;
}
@keyframes scrollPulse { 0% { transform: translateY(-100%);} 60%,100% { transform: translateY(250%);} }
@media (max-width: 640px) { .hero__corner--tr, .hero__corner--bl { display: none; } }

/* ============ MANIFESTO ============ */
.manifesto { text-align: left; }
.manifesto__text {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 20ch;
}
.manifesto__text .reveal-line > span { padding-bottom: 0.06em; }

/* ============ MARQUEE BRAND ============ */
.marquee { overflow: hidden; padding-block: clamp(48px, 8vh, 110px); position: relative; }
.marquee__track {
  display: flex;
  gap: clamp(32px, 5vw, 90px);
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}
.marquee__row + .marquee__row { margin-top: clamp(8px, 1.5vh, 22px); }
.marquee__item {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 7rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.35s ease, opacity 0.35s ease;
  cursor: default;
}
.marquee.dim .marquee__item { color: var(--muted); opacity: 0.35; }
.marquee.dim .marquee__item.active { color: var(--ink); opacity: 1; }
.marquee__sep { height: 1px; background: var(--accent); margin-block: clamp(8px,1.5vh,18px); transform-origin: left; }

/* ============ SHOWCASE TRILOby ============ */
.showcase { position: relative; }
.showcase__pin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--s5);
  position: relative;
}
.showcase__object {
  position: relative;
  justify-self: center;
  width: clamp(220px, 40vw, 440px);
  aspect-ratio: 3 / 4;
  will-change: transform;
}
.showcase__object img {
  width: 100%; height: 100%; object-fit: contain;
  position: relative; z-index: 2;
  will-change: transform;
}
.showcase__shadow {
  position: absolute; z-index: 1;
  left: 50%; bottom: 6%;
  width: 60%; height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(21,19,15,0.22), transparent 70%);
  filter: blur(6px);
  will-change: transform;
}
.showcase__captions { position: relative; min-height: 220px; }
.showcase__cap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  gap: var(--s3);
  opacity: 0;
  will-change: transform, opacity;
}
.showcase__cap .eyebrow .thread { color: var(--accent); }
.showcase__name { font-family: var(--display); font-weight: 400; }
.showcase__thread {
  position: absolute;
  height: 1px; background: var(--accent);
  left: 0; top: 50%;
  width: 0;
  transform-origin: left center;
  display: none;
}
@media (min-width: 980px) {
  .showcase__pin { grid-template-columns: 1.05fr 0.95fr; gap: var(--s7); }
  .showcase__object { justify-self: end; }
  .showcase__thread { display: block; }
}

/* ============ CAMERA OSCURA ============ */
.camera {
  position: relative;
  background: var(--dark); /* sempre scuro: testo crema leggibile fin dal primo frame */
  color: var(--surface);
  min-height: 100vh;
  overflow: hidden;
}
.camera__inner {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}
.camera__title {
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  color: #EDE6D6;
  margin-bottom: var(--s6);
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1;
}
.camera__beam {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  /* gradient STATICO: il cono viene mosso via transform in motion.js (fluido, GPU) */
  background: radial-gradient(circle 38vw at 0% 55%, rgba(200,161,90,0.55), transparent 60%);
  will-change: transform;
}
.camera__stage {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--s5);
  padding-inline: var(--gutter);
  flex-wrap: wrap;
}
.camera__piece {
  width: clamp(140px, 22vw, 300px);
  text-align: center;
  will-change: transform, filter, opacity;
  opacity: 0;
  filter: blur(14px);
  transform: scale(0.92);
}
.camera__piece img {
  width: 100%; aspect-ratio: 3/4; object-fit: contain;
  border-radius: var(--r-card);
}
.camera__piece .glow {
  position: absolute; inset: -10% -8%;
  background: radial-gradient(circle at center, rgba(200,161,90,0.45), transparent 65%);
  z-index: -1; opacity: 0; border-radius: 50%;
}
.camera__piece-wrap { position: relative; }
.camera__cap {
  margin-top: var(--s3);
  color: #D9CFBA;
}
.camera__cap .nm { font-family: var(--body); font-weight: 600; font-size: 0.9rem; }
.camera__cap .br { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9A8F78; }
.camera__noise {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ CATEGORIE ============ */
.categories__list { border-top: 1px solid var(--hair); }
.cat-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: clamp(22px, 3.2vh, 44px);
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
  transition: padding 0.5s var(--ease-out);
}
.cat-row__label {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 4rem);
  line-height: 1;
  position: relative; z-index: 2;
  transition: transform 0.5s var(--ease-out), color 0.4s ease;
}
.cat-row__index { font-family: var(--body); font-size: 0.75rem; letter-spacing: 0.16em; color: var(--muted); z-index: 2; }
.cat-row__img {
  position: absolute;
  right: clamp(120px, 22vw, 320px);
  top: 50%;
  width: clamp(140px, 18vw, 240px);
  height: 78%;
  transform: translateY(-50%) scale(1.02);
  opacity: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--r-card);
  transition: opacity 0.5s ease;
}
.cat-row__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-out); }
.categories__list:hover .cat-row:not(:hover) .cat-row__label { color: var(--muted); }
.cat-row:hover { padding-block: clamp(34px, 4.6vh, 64px); }
.cat-row:hover .cat-row__label { color: var(--accent); transform: translateX(14px); }
.cat-row:hover .cat-row__img { opacity: 1; }
.cat-row:hover .cat-row__img img { transform: scale(1.06); }
@media (max-width: 640px) { .cat-row__img { display: none; } }

/* ============ GRIGLIA PRODOTTI ============ */
.products__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}
@media (min-width: 720px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.card { position: relative; will-change: transform, opacity; }
/* Le immagini prodotto sono quadrate (600x600): media 1/1 + contain = mai croppato.
   Griglia uniforme e allineata (niente span verticale che lascia buchi). */
.card--tall { grid-row: auto; }
.card__media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--surface);
  aspect-ratio: 1 / 1;
}
.card__name-link { color: inherit; text-decoration: none; transition: color 0.25s var(--ease-out); }
.card__name-link:hover { color: var(--accent); }
.card--tall .card__media { aspect-ratio: 1 / 1; }
.card__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: clamp(16px, 3vw, 32px);
  transition: transform 0.7s var(--ease-out);
  will-change: transform;
}
.card:hover .card__media img { transform: scale(1.04); }
.card__media::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px var(--hair);
  border-radius: var(--r-card); pointer-events: none;
}
.card__tag { position: absolute; top: var(--s3); left: var(--s3); z-index: 3; }
.card__body {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: var(--s3);
}
.card__brand { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card__name { font-family: var(--body); font-weight: 600; font-size: 0.98rem; line-height: 1.2; }
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
.card__add {
  font-family: var(--body); font-weight: 600; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--ink);
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out), border-color 0.35s;
  cursor: pointer;
}
.card__add:hover { background: var(--ink); color: var(--surface); }
.card__add.added { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* ============ PARATA ORIZZONTALE ============ */
.parade { position: relative; overflow: hidden; }
.parade__pin {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}
.parade__track {
  display: flex;
  align-items: center;
  gap: clamp(40px, 6vw, 120px);
  padding-inline: 50vw;
  will-change: transform;
}
.parade__head {
  position: absolute;
  top: clamp(70px, 12vh, 120px);
  left: var(--gutter);
  z-index: 5;
  pointer-events: none;
}
.parade__item {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 360px);
  text-align: center;
  will-change: transform, filter, opacity;
}
.parade__item img {
  width: 100%; aspect-ratio: 3/4; object-fit: contain;
  border-radius: var(--r-card);
  will-change: transform;
}
.parade__cap { margin-top: var(--s3); opacity: 0; transition: opacity 0.4s ease; }
.parade__item.is-active .parade__cap { opacity: 1; }
.parade__cap .nm { font-family: var(--display); font-size: 1.1rem; line-height: 1.1; }
.parade__cap .meta { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.parade__cap .pr { color: var(--accent); font-weight: 600; margin-top: 4px; }
.parade__thread {
  position: absolute;
  bottom: clamp(60px, 14vh, 130px);
  left: 50%;
  width: clamp(120px, 18vw, 240px);
  height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 4;
  opacity: 0.85;
}
/* fallback reduced-motion: slider nativo */
.parade--static .parade__pin { height: auto; padding-block: var(--s6); }
.parade--static .parade__track {
  overflow-x: auto; padding-inline: var(--gutter);
  scroll-snap-type: x mandatory; gap: var(--s5);
}
.parade--static .parade__item { scroll-snap-align: center; }
.parade--static .parade__cap { opacity: 1; }
.parade--static .parade__thread { display: none; }

/* ============ EDITORIALE ============ */
.editorial__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: start;
}
.editorial__text { max-width: var(--read); }
.editorial__text p { color: var(--ink); }
.editorial__quote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  line-height: 1.12;
  margin-block: var(--s5);
}
.editorial__media { display: grid; gap: var(--s4); }
.editorial__media figure { overflow: hidden; border-radius: var(--r-card); }
.editorial__media img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.editorial__stats {
  display: flex; flex-wrap: wrap; gap: var(--s6);
  margin-top: var(--s6);
  border-top: 1px solid var(--hair);
  padding-top: var(--s5);
}
.stat__num { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; }
.stat__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
@media (min-width: 920px) {
  .editorial__grid { grid-template-columns: 1.1fr 0.9fr; gap: var(--s8); }
  .editorial__media { grid-template-columns: 1fr 1fr; }
  .editorial__media figure:first-child { grid-column: 1 / -1; }
}

/* ============ NEWSLETTER ============ */
.newsletter { background: var(--surface); text-align: center; }
.newsletter__inner { max-width: 760px; margin-inline: auto; }
.newsletter__title { margin-bottom: var(--s5); }
.newsletter__form {
  display: flex; gap: var(--s3);
  max-width: 520px; margin-inline: auto;
  flex-wrap: wrap; justify-content: center;
}
.newsletter__input {
  flex: 1 1 260px;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-input);
  background: var(--bg);
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}
.newsletter__input:focus { border-color: var(--accent); outline: none; }
.newsletter__note { margin-top: var(--s4); color: var(--muted); font-size: 0.8rem; }
.newsletter__top { max-width: 520px; margin: 0 auto var(--s6); }

/* ============ FOOTER ============ */
.site-footer { background: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.site-footer .hairline-accent { background: var(--accent); }
.footer__cols {
  display: grid; grid-template-columns: 1fr; gap: var(--s6);
  padding-block: var(--s7) var(--s6);
}
.footer__col h4 { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent2); margin-bottom: var(--s3); }
.footer__col ul { display: flex; flex-direction: column; gap: 8px; }
.footer__col a, .footer__col li { color: rgba(244,241,236,0.78); font-size: 0.92rem; }
.footer__link { position: relative; display: inline-block; }
.footer__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--accent2); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.footer__link:hover { color: var(--bg); }
.footer__link:hover::after { transform: scaleX(1); }
.footer__wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 16vw, 16rem);
  line-height: 0.84;
  letter-spacing: -0.02em;
  color: var(--bg);
  padding-bottom: var(--s4);
  white-space: nowrap;
}
.footer__wordmark .accent-text { color: var(--accent); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5);
  align-items: center; justify-content: space-between;
  padding-block: var(--s5);
  border-top: 1px solid rgba(244,241,236,0.14);
  font-size: 0.78rem; color: rgba(244,241,236,0.6);
}
@media (min-width: 760px) { .footer__cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* ============ TOAST (carrello finto) ============ */
.toast {
  position: fixed;
  bottom: var(--s5); left: 50%;
  transform: translate(-50%, 140%);
  background: var(--ink); color: var(--surface);
  padding: var(--s3) var(--s5);
  border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 500;
  z-index: 320;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  transition: transform 0.5s var(--ease-expo);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translate(-50%, 0); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ============ Reduced motion: rendi tutto già visibile ============ */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .hero__corner, .showcase__cap, .camera__piece,
  .hero__object, .parade__cap { opacity: 1 !important; transform: none !important; filter: none !important; }
  .camera__piece { filter: none !important; }
  .hero__sweep, .hairline-accent { transform: scaleX(1) !important; }
  .showcase__cap { position: relative; opacity: 1 !important; margin-bottom: var(--s5); }
  .showcase__captions { min-height: auto; }
}

/* ============ Fallback senza GSAP (offline file://): stessi override ============ */
body.no-motion [data-reveal],
body.no-motion .reveal-line > span,
body.no-motion .hero__corner,
body.no-motion .showcase__cap,
body.no-motion .camera__piece,
body.no-motion .hero__object,
body.no-motion .parade__cap {
  opacity: 1 !important; transform: none !important; filter: none !important;
}
body.no-motion .camera { background: var(--dark) !important; }
body.no-motion .camera__piece .glow { opacity: 0.5 !important; }
body.no-motion .hero__sweep,
body.no-motion .hairline-accent { transform: scaleX(1) !important; }
body.no-motion .showcase__cap { position: relative; margin-bottom: var(--s5); }
body.no-motion .showcase__captions { min-height: auto; }
