/* =====================================================================
   Jeans Replicator — landing editoriale / cinematografica
   Ispirazione: blacknegative.com (dark, serif, scroll a schermo pieno)
   ===================================================================== */

:root {
  --ink: #eae1cf;         /* bianco caldo (cotone) */
  --ink-dim: #8a7f6b;     /* beige smorzato */
  --bg: #0b0b0b;
  --bg-2: #161514;
  --indigo: #2a2a66;
  --gold: #8fa7ff;        /* accento: blu indaco chiaro (era oro, adesso blu) */
  --accent: #8fa7ff;      /* alias leggibile */
  --accent-deep: #4a68d6; /* blu indaco scuro per bordi/hover */
  --cursor: rgba(234, 225, 207, 0.9);
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  cursor: none;  /* il cursore personalizzato lo disegniamo noi */
}

body.is-mobile { cursor: auto; }
body.is-mobile .cursor-dot,
body.is-mobile .cursor-ring { display: none; }

/* ---- tipografia ---------------------------------------------------- */

.serif  { font-family: 'Playfair Display', Georgia, serif; font-weight: 400; }
.serif-i { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 400; }

/* display grande con clamp fluido (ridimensionato -30%) */
.display {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 7.7vw, 7.7rem);
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---- cursor personalizzato ---------------------------------------- */

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cursor);
  transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease;
}
.cursor-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--cursor);
  transform: translate(-50%, -50%);
  transition: width .3s ease, height .3s ease, transform .08s linear;
}
.cursor-hover .cursor-ring { width: 70px; height: 70px; }
.cursor-hover .cursor-dot  { width: 14px; height: 14px; }

/* ---- nav laterale -------------------------------------------------- */

.menu-btn {
  position: fixed; top: 30px; right: 30px; z-index: 80;
  display: flex; flex-direction: column; justify-content: center;
  width: 52px; height: 52px;
  border: 1px solid rgba(234,225,207,0.2);
  border-radius: 50%;
  background: rgba(11,11,11,0.6);
  backdrop-filter: blur(10px);
  cursor: none;
}
.menu-btn span {
  display: block; height: 1px; background: var(--ink);
  margin: 3px auto;
  transition: transform .4s ease, width .4s ease;
}
.menu-btn span:nth-child(1) { width: 18px; }
.menu-btn span:nth-child(2) { width: 12px; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(4px) rotate(45deg); width: 18px; }
.menu-open .menu-btn span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); width: 18px; }

.brand-lockup {
  position: fixed; top: 30px; left: 30px; z-index: 80;
  display: flex; align-items: baseline; gap: 10px;
}
.brand-lockup .mark {
  font-family: 'Playfair Display', serif; font-size: 22px; letter-spacing: .01em;
}
.brand-lockup .sub {
  font-family: 'Inter', sans-serif; font-size: 10px; text-transform: uppercase;
  letter-spacing: .3em; color: var(--ink-dim);
}

.nav-drawer {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg);
  display: flex;
  transform: translateX(100%);
  transition: transform .7s cubic-bezier(.7, 0, .2, 1);
}
.menu-open .nav-drawer { transform: translateX(0); }

.nav-drawer .bg-image {
  flex: 0 0 40%; position: relative; overflow: hidden; background: var(--bg-2);
}
.nav-drawer .bg-image::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(42,42,102,0.3) 0%, rgba(11,11,11,0) 70%);
}
.nav-drawer .bg-image svg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.3;
}

.nav-drawer nav {
  flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 8vw;
}
.nav-drawer nav a {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.75rem, 4.2vw, 3.5rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.05;
  padding: 8px 0;
  position: relative;
  transform: translateY(40px);
  opacity: 0;
  transition: color .4s ease;
}
.menu-open .nav-drawer nav a { animation: slideUp .8s forwards; }
.menu-open .nav-drawer nav a:nth-child(1) { animation-delay: 0.25s; }
.menu-open .nav-drawer nav a:nth-child(2) { animation-delay: 0.32s; }
.menu-open .nav-drawer nav a:nth-child(3) { animation-delay: 0.39s; }
.menu-open .nav-drawer nav a:nth-child(4) { animation-delay: 0.46s; }
.menu-open .nav-drawer nav a:nth-child(5) { animation-delay: 0.53s; }
.nav-drawer nav a:hover { color: var(--gold); font-style: italic; }

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---- sezioni full-screen ------------------------------------------ */

.scene {
  min-height: 100vh;
  padding: 12vh 8vw;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.section-index {
  position: absolute; top: 10vh; left: 8vw;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 8.4vw; line-height: 1; opacity: 0.04; pointer-events: none;
  user-select: none;
}

/* ---- hero ---------------------------------------------------------- */

.hero-media {
  position: absolute; inset: 0; z-index: 0;
  background: var(--bg);
}
.hero-media video,
.hero-media .media-placeholder,
.scene-video {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.45;
  filter: grayscale(0.2) contrast(1.05);
  animation: slowZoom 18s ease-in-out infinite alternate;
}
.scene-video-wrap {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.scene-video-wrap::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,11,11,0.35) 0%, rgba(11,11,11,0.75) 60%, rgba(11,11,11,0.95) 100%);
}
@keyframes slowZoom {
  from { transform: scale(1.0);  }
  to   { transform: scale(1.08); }
}
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,11,11,0.3) 0%, rgba(11,11,11,0.85) 100%),
              radial-gradient(ellipse at center, rgba(11,11,11,0) 0%, rgba(11,11,11,0.4) 80%);
}

/* placeholder botanico SVG stilizzato (cotone/indaco) */
.media-placeholder {
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 30% 60%, #16213d 0%, #0b0b0b 70%);
  display: block;
}

/* ---- split-reveal text -------------------------------------------- */

.splitx { display: inline-block; overflow: hidden; vertical-align: baseline; }
.splitx span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.2s cubic-bezier(.7, 0, .2, 1);
}
.splitx.in span { transform: translateY(0); }

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

/* ---- scroll indicator --------------------------------------------- */

.scroll-indicator {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-dim);
}
.scroll-indicator .line {
  width: 1px; height: 40px; background: linear-gradient(to bottom, transparent, var(--ink-dim));
  animation: lineFall 2s ease-in-out infinite;
}
@keyframes lineFall {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---- botanical layout --------------------------------------------- */

.botanica {
  position: absolute; width: 320px; height: 320px;
  opacity: 0.22;
  pointer-events: none;
  animation: sway 16s ease-in-out infinite alternate;
}
@keyframes sway {
  from { transform: rotate(-3deg); }
  to   { transform: rotate(3deg); }
}
.botanica.cotton  { top: 10%; right: 5%; }
.botanica.indigo  { bottom: 10%; left: 5%; }

/* ---- slider before/after ------------------------------------------ */

.ba {
  position: relative; width: 100%; aspect-ratio: 4/5;
  max-width: 560px; margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(234,225,207,0.1);
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) contrast(1.1); }
.ba .top { clip-path: inset(0 0 0 50%); }
.ba .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink); }
.ba .handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: none;
}
.ba .tag {
  position: absolute; top: 20px; padding: 4px 12px;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink); background: rgba(11,11,11,0.5);
}
.ba .tag-l { left: 20px; }
.ba .tag-r { right: 20px; }

/* ---- marquee ------------------------------------------------------- */

.marquee { overflow: hidden; border-top: 1px solid rgba(234,225,207,0.08); border-bottom: 1px solid rgba(234,225,207,0.08); padding: 30px 0; }
.marquee-track {
  display: inline-block;
  animation: marquee 65s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.45rem);
  color: var(--ink-dim);
  padding: 0 40px;
}
.marquee-track .sep { color: var(--gold); font-style: normal; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- patents / timeline ------------------------------------------- */

.patent {
  border-top: 1px solid rgba(234,225,207,0.1);
  padding: 50px 0;
}
.patent:last-child { border-bottom: 1px solid rgba(234,225,207,0.1); }
.patent .grid {
  display: grid; grid-template-columns: 120px 1fr 280px; gap: 40px; align-items: start;
}
@media (max-width: 900px) { .patent .grid { grid-template-columns: 1fr; gap: 20px; } }
.patent .n { font-family: 'Playfair Display', serif; font-size: 30px; font-style: italic; color: var(--gold); }
.patent .title { font-family: 'Playfair Display', serif; font-size: clamp(1.05rem, 1.7vw, 1.55rem); line-height: 1.25; }
.patent .meta dt { color: var(--ink-dim); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.patent .meta dd { color: var(--ink); font-family: 'Inter', sans-serif; font-size: 13px; margin-bottom: 12px; }

/* ---- CTA buttons -------------------------------------------------- */

.btn-line {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 0; position: relative;
  font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: letter-spacing .4s ease, color .3s ease;
  cursor: none;
}
.btn-line::after {
  content: '→'; transition: transform .4s ease;
}
.btn-line:hover { letter-spacing: .3em; color: var(--gold); }
.btn-line:hover::after { transform: translateX(8px); }

/* ---- footer ------------------------------------------------------- */

footer.cine {
  padding: 40px 8vw; border-top: 1px solid rgba(234,225,207,0.1);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim);
}

/* ---- audio player fisso (stile blacknegative) --------------------- */

.audio-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(234,225,207,0.12);
  background: rgba(11,11,11,0.7);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  cursor: none;
}
.audio-widget:hover { border-color: rgba(234,225,207,0.3); color: var(--ink); }
.audio-widget .wave {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 12px;
}
.audio-widget .wave span {
  display: inline-block; width: 2px; background: var(--accent);
  height: 40%; border-radius: 1px;
}
.audio-widget.playing .wave span {
  animation: waveP 0.9s ease-in-out infinite alternate;
}
.audio-widget .wave span:nth-child(2) { animation-delay: 0.12s; }
.audio-widget .wave span:nth-child(3) { animation-delay: 0.24s; }
.audio-widget .wave span:nth-child(4) { animation-delay: 0.36s; }
@keyframes waveP { from { height: 20%; } to { height: 95%; } }
.audio-widget.paused .wave span { height: 30%; }

/* ---- loader fullscreen elegante ----------------------------------- */

.jr-loader {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11, 11, 11, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 36px;
  opacity: 0;
  transition: opacity .5s ease;
}
.jr-loader.active { display: flex; }
.jr-loader.in     { opacity: 1; }

.jr-loader .ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(234,225,207,0.12);
  border-top-color: var(--accent);
  animation: jrSpin 1.6s cubic-bezier(.65, .05, .36, 1) infinite;
  position: relative;
}
.jr-loader .ring::before,
.jr-loader .ring::after {
  content: ''; position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(234,225,207,0.06);
  border-top-color: rgba(143,167,255,0.4);
  animation: jrSpin 2.4s cubic-bezier(.65, .05, .36, 1) infinite reverse;
}
.jr-loader .ring::after {
  inset: 18px; animation-duration: 3.2s;
  border-top-color: rgba(143,167,255,0.2);
}
@keyframes jrSpin { to { transform: rotate(360deg); } }

.jr-loader .label {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink);
  text-align: center;
}
.jr-loader .label .dot1,
.jr-loader .label .dot2,
.jr-loader .label .dot3 {
  display: inline-block;
  animation: jrDot 1.4s ease-in-out infinite;
}
.jr-loader .label .dot2 { animation-delay: 0.2s; }
.jr-loader .label .dot3 { animation-delay: 0.4s; }
@keyframes jrDot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-3px); }
}

.jr-loader .hint {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-dim); text-align: center;
}
.jr-loader .progress-bar {
  width: min(340px, 60vw); height: 1px;
  background: rgba(234,225,207,0.08); overflow: hidden; position: relative;
}
.jr-loader .progress-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: jrSlide 2.2s linear infinite;
}
@keyframes jrSlide {
  from { left: -30%; } to { left: 100%; }
}

/* ---- lightbox / zoom sulle immagini -------------------------------- */

.zoomable { cursor: zoom-in; transition: filter .3s ease; }
.zoomable:hover { filter: brightness(1.05); }

.lightbox {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(11, 11, 11, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity .35s ease;
}
.lightbox.active { display: flex; }
.lightbox.in     { opacity: 1; }

.lightbox .stage {
  position: relative;
  width: 92vw; height: 88vh;
  overflow: hidden;
  cursor: grab;
}
.lightbox .stage:active { cursor: grabbing; }
.lightbox .stage img {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(var(--zoom, 1));
  transform-origin: center center;
  max-width: none;
  transition: transform .15s ease;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox .controls {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px;
  border: 1px solid rgba(234,225,207,0.15);
  background: rgba(11,11,11,0.6);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink);
}
.lightbox .controls button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(234,225,207,0.2);
  background: none; color: var(--ink); cursor: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-family: 'Inter', sans-serif;
  transition: background .2s ease, border-color .2s ease;
}
.lightbox .controls button:hover { background: rgba(234,225,207,0.08); border-color: var(--accent); color: var(--accent); }
.lightbox .controls .zoom-val { min-width: 46px; text-align: center; color: var(--ink-dim); font-family: 'JetBrains Mono', 'Menlo', monospace; }

.lightbox .close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(234,225,207,0.15);
  background: rgba(11,11,11,0.6); backdrop-filter: blur(10px);
  color: var(--ink); cursor: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-family: 'Inter', sans-serif;
  transition: background .2s ease, border-color .2s ease;
}
.lightbox .close:hover { border-color: var(--accent); color: var(--accent); }

/* ---- responsive polish -------------------------------------------- */

@media (max-width: 700px) {
  .scene { padding: 14vh 6vw; }
  .brand-lockup { top: 20px; left: 20px; }
  .menu-btn    { top: 20px; right: 20px; width: 44px; height: 44px; }
  .botanica { width: 200px; height: 200px; }
}
