/* ============================================================
   Monogram Sicilia — landing page
   Brand bg:  #526845  (verde salvia)
   Brand ink: #f4f2eb  (avorio)
   ============================================================ */

:root {
  --bg:      #526845;
  --ink:     #f4f2eb;
  --ink-90:  rgba(244, 242, 235, 0.92);
  --ink-70:  rgba(244, 242, 235, 0.70);
  --ink-45:  rgba(244, 242, 235, 0.45);
  --ink-20:  rgba(244, 242, 235, 0.22);

  --font-display: "Cormorant Garamond", "Times New Roman", "Cambria", serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-luxe: cubic-bezier(0.2, 0.7, 0, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(1.5rem, 5vw, 3rem);
}

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

html, body { margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: bg-breathe 22s ease-in-out infinite;
}

/* Sottilissimo respiro cromatico del bg principale (verde più caldo ↔ più freddo) */
@keyframes bg-breathe {
  0%, 100% { background-color: #526845; }  /* salvia base */
  33%      { background-color: #4f6843; }  /* leggermente più freddo */
  66%      { background-color: #566a47; }  /* leggermente più caldo */
}

/* ----- Overlay decorativi --------------------------------------------- */

/* Aurora: 3 blob organici che fluttuano lentamente — fonte primaria di "vita"
   sullo sfondo. Sono molto sfocati (blur 90px) e con mix-blend per integrarsi
   col verde brand senza diventare flat-color patches. */
.aurora {
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  filter: blur(90px) saturate(120%);
  opacity: 0.55;
}

.aurora .blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  transform-origin: center center;
  will-change: transform;
}

.aurora .blob-1 {
  width: 55vmax; height: 55vmax;
  top: -15%; left: -10%;
  background: radial-gradient(circle at 50% 50%,
    rgba(220, 215, 175, 0.45) 0%,
    rgba(220, 215, 175, 0.18) 35%,
    rgba(220, 215, 175, 0) 70%);
  animation: blob-drift-1 28s ease-in-out infinite alternate;
}

.aurora .blob-2 {
  width: 70vmax; height: 70vmax;
  bottom: -25%; right: -20%;
  background: radial-gradient(circle at 50% 50%,
    rgba(140, 175, 130, 0.55) 0%,
    rgba(140, 175, 130, 0.20) 35%,
    rgba(140, 175, 130, 0) 70%);
  animation: blob-drift-2 34s ease-in-out infinite alternate;
}

.aurora .blob-3 {
  width: 40vmax; height: 40vmax;
  top: 35%; left: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(244, 230, 200, 0.30) 0%,
    rgba(244, 230, 200, 0.10) 40%,
    rgba(244, 230, 200, 0) 75%);
  animation: blob-drift-3 24s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { transform: translate(12vw, 18vh) scale(1.15) rotate(40deg); }
}
@keyframes blob-drift-2 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { transform: translate(-18vw, -12vh) scale(0.9) rotate(-35deg); }
}
@keyframes blob-drift-3 {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-35%, -65%) scale(1.25); }
}

/* Raggio di luce diagonale che attraversa la scena ogni ~22s.
   Evoca il "raggio di sole" attraverso una persiana siciliana. */
.beam {
  position: fixed;
  top: -50vh;
  left: -50vw;
  width: 200vw;
  height: 200vh;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(244, 242, 235, 0.045) 48%,
    rgba(244, 242, 235, 0.075) 50%,
    rgba(244, 242, 235, 0.045) 52%,
    transparent 58%
  );
  mix-blend-mode: screen;
  animation: beam-sweep 26s linear infinite;
}

@keyframes beam-sweep {
  0%   { transform: translateX(-30%) translateY(-10%); }
  100% { transform: translateX(30%)  translateY(10%); }
}

/* Vignette ai bordi — profondità senza scurire troppo */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.10) 70%,
    rgba(0, 0, 0, 0.28) 100%
  );
  mix-blend-mode: multiply;
}

/* Luce calda sottile in alto, evoca "luce siciliana" */
.glow {
  position: fixed;
  top: -30vh;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 80vh;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(244, 242, 235, 0.10) 0%,
    rgba(244, 242, 235, 0.04) 40%,
    rgba(244, 242, 235, 0) 70%
  );
  mix-blend-mode: screen;
  animation: glow-drift 18s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  0%   { transform: translateX(-52%) translateY(0); opacity: 0.8; }
  100% { transform: translateX(-48%) translateY(2vh); opacity: 1; }
}

/* Grain SVG noise — texture "carta artigianale" */
.grain {
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  animation: grain-shift 7.5s steps(8) infinite;
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(-3%, 2%); }
  40%      { transform: translate(2%, -3%); }
  60%      { transform: translate(-2%, -2%); }
  80%      { transform: translate(3%, 1%); }
}

/* ----- Layout ---------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 3;
  min-height: 100dvh;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) var(--gutter);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: clamp(1.75rem, 4.5vh, 2.75rem);
  text-align: center;
  align-items: start;
  justify-items: center;
}

/* ----- Brand / logo --------------------------------------------------- */

.brand {
  display: flex;
  justify-content: center;
  width: 100%;
}

.logo {
  display: block;
  width: clamp(220px, 50vw, 340px);
  height: auto;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.06));
  animation: breathe 7s ease-in-out infinite;
  will-change: transform;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.018); }
}

/* ----- Copy ----------------------------------------------------------- */

.copy { max-width: 32ch; }

.tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.55rem, 3.4vw + 0.6rem, 2.55rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--ink);
}

.tagline em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  position: relative;
}

.sub {
  margin: 0.9rem 0 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-70);
}

/* ----- CTA / form ----------------------------------------------------- */

.cta {
  width: 100%;
  max-width: 460px;
  display: flex;
  justify-content: center;
}

#subscribe {
  width: 100%;
  position: relative;
}

.field {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--ink-45);
  transition: border-color 500ms var(--ease-luxe);
}

.field:focus-within {
  border-bottom-color: var(--ink);
}

.field input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.85rem 0;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.field input[type="email"]::placeholder {
  color: var(--ink-45);
  font-style: italic;
}

.field button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0 0.85rem 1.25rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: opacity 350ms var(--ease-luxe), transform 500ms var(--ease-luxe);
}

.field button:hover  { opacity: 0.7; }
.field button:active { transform: translateX(1px); }

.field button .arrow {
  display: inline-block;
  font-size: 1rem;
  transition: transform 500ms var(--ease-luxe);
}

.field button:hover .arrow { transform: translateX(4px); }

.field button[disabled] {
  cursor: progress;
  opacity: 0.5;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.status {
  min-height: 1.2em;
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-70);
  opacity: 0;
  transition: opacity 500ms var(--ease-luxe);
}

.status.show  { opacity: 1; }
.status.error { color: #f0d8c0; }

/* ----- Footer / links ------------------------------------------------- */

.links {
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-70);
}

.links a {
  color: var(--ink-90);
  text-decoration: none;
  position: relative;
  padding: 0.35rem 0.1rem;
  transition: color 350ms var(--ease-luxe);
}

.links a::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  right: 0.1rem;
  bottom: 0.1rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 500ms var(--ease-luxe);
}

.links a:hover { color: var(--ink); }
.links a:hover::after { transform: scaleX(1); }

.links .dot { color: var(--ink-45); }

/* ----- Feed Instagram (slider marquee) -------------------------------- */

.feed {
  position: relative;
  z-index: 3;
  /* Full-bleed: la sezione è figlia di .stage (max-width 720px centrato)
     ma deve attraversare tutta la larghezza dello schermo. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(0.5rem, 1.5vh, 1rem) 0 0;
  text-align: center;
  color: var(--ink);
}

.feed[hidden] { display: none !important; }

.feed-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw + 0.5rem, 1.55rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  opacity: 0.92;
}

.feed-handle {
  display: inline-block;
  margin: 0.5rem 0 1.1rem;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-70);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 350ms var(--ease-luxe), border-color 350ms var(--ease-luxe);
}

.feed-handle:hover {
  color: var(--ink);
  border-bottom-color: var(--ink-45);
}

/* L'intero viewport è un <a> che apre Instagram: nessuna pausa su hover,
   le card scorrono sempre. */
.feed-viewport {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  mask-image: linear-gradient(to right,
    transparent 0,
    #000 8%,
    #000 92%,
    transparent 100%);
  -webkit-mask-image: linear-gradient(to right,
    transparent 0,
    #000 8%,
    #000 92%,
    transparent 100%);
  transition: filter 600ms var(--ease-luxe);
}

.feed-viewport:hover { filter: brightness(1.05); }
.feed-viewport:active { filter: brightness(0.96); }

.feed-track {
  display: flex;
  gap: clamp(0.6rem, 1.2vw, 1rem);
  width: max-content;
  padding: 0 clamp(0.6rem, 1.2vw, 1rem);
  animation: feed-scroll 80s linear infinite;
  will-change: transform;
}

@keyframes feed-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.feed-item {
  flex: 0 0 auto;
  width: clamp(120px, 14vw, 170px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(244, 242, 235, 0.04);
  position: relative;
  display: block;
  isolation: isolate;
  pointer-events: none; /* l'intero viewport è cliccabile, non i singoli item */
}

.feed-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92);
}

@media (max-width: 480px) {
  .feed { padding: clamp(0.25rem, 1vh, 0.75rem) 0 0; }
  .feed-title { font-size: 1.05rem; }
  .feed-handle { margin-bottom: 0.85rem; letter-spacing: 0.20em; font-size: 0.68rem; }
  .feed-track { animation-duration: 50s; gap: 0.55rem; }
  .feed-item { width: 38vw; max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .feed-track { animation: none !important; }
}

/* ----- A11y helpers --------------------------------------------------- */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  border-radius: 1px;
}

/* ----- Entrance (gestita in JS) --------------------------------------- */

.is-hidden {
  opacity: 0;
  transform: translateY(10px);
}

.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1100ms var(--ease-luxe),
    transform 1100ms var(--ease-luxe);
}

/* ----- Reduced motion ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body,
  .grain,
  .glow,
  .beam,
  .aurora .blob,
  .logo { animation: none !important; }

  .is-hidden, .is-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  * { transition-duration: 0.001ms !important; }
}

/* ----- Mobile fine-tuning -------------------------------------------- */

@media (max-width: 480px) {
  .stage { gap: 1.6rem; padding-top: clamp(2.5rem, 6vh, 4rem); }
  .sub   { font-size: 0.72rem; letter-spacing: 0.28em; }
  .field button .label { display: none; }
  .field button { padding-left: 0.75rem; }
  .links { flex-wrap: wrap; justify-content: center; gap: 0.6rem; }

  /* Background animations un filo più evidenti su mobile: schermo piccolo,
     blur grande "appiattisce" l'effetto se non lo si compensa. */
  .aurora {
    opacity: 0.80;
    filter: blur(70px) saturate(135%);
  }
  .aurora .blob-1 { width: 90vmax; height: 90vmax; }
  .aurora .blob-2 { width: 110vmax; height: 110vmax; }
  .aurora .blob-3 { width: 70vmax; height: 70vmax; }

  .beam {
    background: linear-gradient(
      105deg,
      transparent 40%,
      rgba(244, 242, 235, 0.07) 48%,
      rgba(244, 242, 235, 0.11) 50%,
      rgba(244, 242, 235, 0.07) 52%,
      transparent 60%
    );
    animation-duration: 20s;
  }

  .glow { opacity: 1; }
  .grain { opacity: 0.10; }
}
