/* ==========================================================================
   Verdìa — Landing page
   Palette Editorial Cream + WebGL background fluid + scroll reveal
   ========================================================================== */

:root {
  --paper:        #FAF6EB;
  --paper-soft:   #F5EFE0;
  --olive:        #5C6B3A;
  --olive-deep:   #3D4334;
  --olive-soft:   #94A57F;
  --terra:        #B8553F;
  --terra-deep:   #9C4A37;
  --gold:         #B89B5E;
  --ink:          #1F2419;
  --ink-mute:     #595D4F;
  --line:         rgba(31,36,25,0.10);
  --line-soft:    rgba(31,36,25,0.06);

  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:   'Newsreader', Georgia, 'Times New Roman', serif;

  --radius:       14px;
  --shadow-soft:  0 8px 30px rgba(31,36,25,0.08);
  --shadow-card:  0 4px 18px rgba(31,36,25,0.06), 0 1px 3px rgba(31,36,25,0.04);
  --shadow-lift:  0 16px 48px rgba(31,36,25,0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── WebGL background + veil ─────────────────────────────────────────── */

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  display: block;
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Layered veil per leggibilità testo */
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(250,246,235,0.0) 0%, rgba(250,246,235,0.55) 70%),
    linear-gradient(180deg, rgba(250,246,235,0.20) 0%, rgba(250,246,235,0.85) 100%);
}

/* ─── Layout ──────────────────────────────────────────────────────────── */

.ld-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.ld-center { text-align: center; }

/* ─── Header ──────────────────────────────────────────────────────────── */

.ld-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,246,235,0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.ld-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.ld-brand {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-style: italic;
}
.ld-accent { color: var(--olive); }

.ld-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ld-nav-link {
  color: var(--ink-mute);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
}
.ld-nav-link:hover { color: var(--ink); background: var(--line-soft); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
  white-space: nowrap;
}

.ld-btn-primary {
  background: var(--olive);
  color: var(--paper);
  box-shadow: 0 6px 16px rgba(92,107,58,0.25);
}
.ld-btn-primary:hover {
  background: var(--olive-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(92,107,58,0.32);
}

.ld-btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.ld-btn-ghost:hover {
  background: var(--paper-soft);
  border-color: var(--olive-soft);
}

.ld-btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ─── Hero ────────────────────────────────────────────────────────────── */

.ld-hero {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 80px 0 100px;
}

.ld-kicker {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 18px;
}

.ld-h1 {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--ink);
}
.ld-h1 em {
  font-style: italic;
  color: var(--olive);
}

.ld-lede {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 640px;
  margin: 0 0 36px;
}

.ld-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.ld-cta-group.ld-center { justify-content: center; }

/* Stats strip */
.ld-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px dashed var(--line);
}

.ld-stat-num {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  color: var(--olive-deep);
  margin-bottom: 4px;
}

.ld-stat-label {
  font-size: 13px;
  color: var(--ink-mute);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

/* Scroll hint */
.ld-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0.7;
}
.ld-scroll-hint svg {
  width: 16px;
  height: 16px;
  animation: bounce 2.4s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ─── Sections ────────────────────────────────────────────────────────── */

.ld-section {
  padding: 120px 0;
  position: relative;
}

.ld-section-alt {
  background: rgba(250,246,235,0.40);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.ld-h2 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 60px;
}

/* ─── Cards grid ──────────────────────────────────────────────────────── */

.ld-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.ld-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.ld-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--olive-soft);
}
.ld-card-tall { display: flex; flex-direction: column; }

.ld-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--olive);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.ld-card-icon svg { width: 26px; height: 26px; }

.ld-card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.ld-card-body {
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.ld-card-tag {
  margin-top: auto;
  padding-top: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive);
}

/* ─── Split: text + visual ────────────────────────────────────────────── */

.ld-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.ld-feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}
.ld-feature-list li {
  padding: 12px 0;
  padding-left: 28px;
  font-size: 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.ld-feature-list li:last-child { border-bottom: none; }
.ld-feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 16px;
  height: 16px;
  background: var(--olive);
  border-radius: 50%;
  background-image:
    linear-gradient(135deg, transparent 50%, var(--paper) 50%),
    linear-gradient(45deg, transparent 50%, var(--paper) 50%);
}
.ld-feature-list li::before {
  content: '✓';
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
  background: var(--olive);
  background-image: none;
}

/* ─── Chat mockup ─────────────────────────────────────────────────────── */

.ld-chat-mock {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lift);
  font-family: var(--font-ui);
}

.ld-chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.ld-chat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper-soft);
}
.ld-chat-dot:nth-child(1) { background: #ff5f57; }
.ld-chat-dot:nth-child(2) { background: #febc2e; }
.ld-chat-dot:nth-child(3) { background: #28c840; }
.ld-chat-title {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
}

.ld-chat-msg {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 88%;
}
.ld-chat-user {
  background: var(--olive);
  color: var(--paper);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.ld-chat-bot {
  background: var(--paper-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.ld-chat-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.ld-chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--paper-soft);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  margin: 8px 0;
}
.ld-chat-typing span {
  width: 6px; height: 6px;
  background: var(--ink-mute);
  border-radius: 50%;
  animation: typing 1.2s infinite ease-in-out;
}
.ld-chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.ld-chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ─── Final CTA ───────────────────────────────────────────────────────── */

.ld-cta-final {
  padding: 140px 0 160px;
  text-align: center;
  position: relative;
}
.ld-cta-final::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(184,155,94,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.ld-cta-final .ld-h2 { margin-bottom: 24px; }
.ld-cta-final .ld-lede { margin-left: auto; margin-right: auto; }

/* ─── Footer ──────────────────────────────────────────────────────────── */

.ld-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 0 32px;
}
.ld-footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.ld-footer .ld-brand { color: var(--paper); }
.ld-footer .ld-accent { color: var(--gold); }

.ld-footer-tagline {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(250,246,235,0.7);
  font-size: 15px;
}

.ld-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.ld-footer-nav a {
  color: rgba(250,246,235,0.78);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.16s;
}
.ld-footer-nav a:hover { color: var(--paper); }

.ld-footer-bottom {
  grid-column: 1 / -1;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(250,246,235,0.10);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(250,246,235,0.55);
}
.ld-footer-disclaim { font-style: italic; }

/* ─── Reveal animations ───────────────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.9s cubic-bezier(0.22,0.61,0.36,1) forwards;
  animation-delay: calc(var(--delay, 0) * 1ms);
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22,0.61,0.36,1),
              transform 0.9s cubic-bezier(0.22,0.61,0.36,1);
  transition-delay: calc(var(--delay, 0) * 1ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Mobile / responsive ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .ld-nav-link[href="#benefici"],
  .ld-nav-link[href="#solution"],
  .ld-nav-link[href="#product"] { display: none; }
  .ld-grid-3 { grid-template-columns: 1fr; gap: 18px; }
  .ld-split { grid-template-columns: 1fr; gap: 40px; }
  .ld-stats { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .ld-section { padding: 80px 0; }
  .ld-hero { padding: 60px 0 80px; }
  .ld-footer-inner { grid-template-columns: 1fr; }
  .ld-footer-nav { align-items: flex-start; }
  .ld-footer-bottom { flex-direction: column; }
}

@media (max-width: 540px) {
  .ld-stats { grid-template-columns: 1fr 1fr; }
  .ld-header-inner { height: 60px; }
  .ld-brand { font-size: 24px; }
}

/* ─── Reduce motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .fade-in, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .ld-scroll-hint svg { animation: none; }
  .ld-chat-typing span { animation: none; }
  html { scroll-behavior: auto; }
}
