/* ══════════════════════════════════════════════════════════════════════════════
   PsicoAI — Marketing Site
   Porta il design system "Tactile Sanctuary" dell'app sul web.
   Gestisce ciò che Tailwind non copre: neumorfismo, double-bezel, grana,
   mesh-orbs, loader, reveal cinematici, micro-interazioni.
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
  --sage:        #536443;
  --sage-dim:    #475838;
  --sage-deep:   #2c3622;
  --blue:        #4d6177;
  --cream:       #fbf9f5;
  --surface-low: #f5f4ef;
  --surface:     #efeee9;
  --ink:         #31332f;
  --muted:       #5e605b;
  --line:        #b2b2ad;
  --p-container: #d5e9bf;
  --s-container: #d0e4ff;

  /* Easing premium — expo-out & spring-ish */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
}

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

::selection { background: var(--p-container); color: var(--sage-deep); }

/* ── Headings ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Manrope', sans-serif; letter-spacing: -0.03em; margin: 0; }
.display { font-weight: 800; line-height: 0.98; letter-spacing: -0.045em; }

/* ── Film-grain overlay (fixed, non interattivo) ─────────────────────────── */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: #d8d7d1; border-radius: 99px; border: 3px solid var(--cream); }
::-webkit-scrollbar-thumb:hover { background: #c4c3bc; }

/* ══════════════════════════════════════════════════════════════════════════
   SUPERFICI — neumorfismo & glass (dal design system app)
   ══════════════════════════════════════════════════════════════════════════ */
.neu-elevated {
  background: #ffffff;
  box-shadow: 8px 8px 16px rgba(49,51,47,0.06), -8px -8px 16px #ffffff;
}
.neu-recessed {
  background: var(--surface);
  box-shadow: inset 4px 4px 8px #e1e0da, inset -4px -4px 8px #fdfdf8;
}
.glass {
  background: rgba(251,249,245,0.72);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

/* ── Double-bezel (Doppelrand): contenitore "macchinato" ──────────────────── */
.bezel {
  border-radius: 2rem;
  padding: 0.5rem;
  background: rgba(83,100,67,0.05);
  box-shadow: inset 0 0 0 1px rgba(49,51,47,0.06);
}
.bezel > .bezel-core {
  border-radius: calc(2rem - 0.5rem);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
  background: #fff;
  height: 100%;
}

/* ── Eyebrow tag ─────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem; border-radius: 99px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--sage);
  background: rgba(83,100,67,0.07);
  box-shadow: inset 0 0 0 1px rgba(83,100,67,0.12);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--sage); box-shadow: 0 0 0 4px rgba(83,100,67,0.15); }

/* ══════════════════════════════════════════════════════════════════════════
   BOTTONI — pill + button-in-button + magnetico
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.9rem 1.5rem;
  border-radius: 99px; border: none; cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--sage); color: #edffd8; box-shadow: 0 10px 30px -8px rgba(83,100,67,0.55); }
.btn-primary:hover { background: var(--sage-dim); box-shadow: 0 18px 44px -10px rgba(83,100,67,0.6); transform: translateY(-2px); }

.btn-ghost { background: rgba(49,51,47,0.04); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(49,51,47,0.08); }
.btn-ghost:hover { background: rgba(49,51,47,0.07); transform: translateY(-2px); }

.btn-ico {
  width: 2rem; height: 2rem; border-radius: 99px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.16);
  transition: transform 0.5s var(--ease), background 0.4s var(--ease);
}
.btn-ghost .btn-ico { background: rgba(49,51,47,0.07); }
.btn:hover .btn-ico { transform: translate(3px,-1px) scale(1.06); }
.btn-ico svg { width: 16px; height: 16px; }

/* Icone hairline globali */
.icn { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }

/* ══════════════════════════════════════════════════════════════════════════
   MESH ORBS — bagliori soft di sfondo
   ══════════════════════════════════════════════════════════════════════════ */
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; pointer-events: none; z-index: 0; will-change: transform; }
.orb-sage { background: radial-gradient(circle, rgba(83,100,67,0.45), transparent 70%); }
.orb-blue { background: radial-gradient(circle, rgba(77,97,119,0.40), transparent 70%); }
.orb-green { background: radial-gradient(circle, rgba(213,233,191,0.85), transparent 70%); }

/* ══════════════════════════════════════════════════════════════════════════
   NAV — Fluid Island
   ══════════════════════════════════════════════════════════════════════════ */
.nav-wrap { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 1.5rem 1rem; }
.nav-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem; border-radius: 99px;
  width: min(960px, 100%);
  transition: box-shadow 0.6s var(--ease), background 0.6s var(--ease), transform 0.6s var(--ease), max-width 0.6s var(--ease);
}
.nav-pill.scrolled { box-shadow: 0 16px 50px -16px rgba(49,51,47,0.22); background: rgba(251,249,245,0.85); }
.nav-links { display: flex; align-items: center; gap: 0.35rem; margin: 0 auto; }
.nav-links a {
  font-size: 0.875rem; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 0.5rem 0.95rem; border-radius: 99px; transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(49,51,47,0.04); }

.nav-burger { display: none; width: 44px; height: 44px; border-radius: 99px; border: none; background: rgba(49,51,47,0.05); cursor: pointer; position: relative; }
.nav-burger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--ink); transition: transform 0.5s var(--ease), opacity 0.3s var(--ease); }
.nav-burger span:nth-child(1) { top: 17px; }
.nav-burger span:nth-child(2) { bottom: 17px; }
body.menu-open .nav-burger span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
body.menu-open .nav-burger span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Mobile overlay menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 49; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem;
  background: rgba(251,249,245,0.92); backdrop-filter: blur(28px);
  opacity: 0; visibility: hidden; transition: opacity 0.5s var(--ease), visibility 0.5s;
}
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 2rem; color: var(--ink);
  text-decoration: none; letter-spacing: -0.03em;
  opacity: 0; transform: translateY(28px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
body.menu-open .mobile-menu a { opacity: 1; transform: translateY(0); }
body.menu-open .mobile-menu a:nth-child(1){ transition-delay: 0.08s; }
body.menu-open .mobile-menu a:nth-child(2){ transition-delay: 0.14s; }
body.menu-open .mobile-menu a:nth-child(3){ transition-delay: 0.20s; }
body.menu-open .mobile-menu a:nth-child(4){ transition-delay: 0.26s; }
body.menu-open .mobile-menu a:nth-child(5){ transition-delay: 0.32s; }

/* ══════════════════════════════════════════════════════════════════════════
   LOADER — entrata d'effetto
   ══════════════════════════════════════════════════════════════════════════ */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--cream);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.75rem;
}
.loader-mark { display: flex; align-items: center; gap: 0.85rem; opacity: 0; transform: translateY(10px); }
.loader-spa { width: 46px; height: 46px; border-radius: 99px; background: var(--sage); display: flex; align-items: center; justify-content: center; color: #edffd8; }
.loader-spa svg { width: 24px; height: 24px; }
.loader-word { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.75rem; letter-spacing: -0.04em; color: var(--ink); }
.loader-bar { width: 180px; height: 2px; background: rgba(49,51,47,0.08); border-radius: 99px; overflow: hidden; opacity: 0; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--sage); border-radius: 99px; }
body.loaded .loader { pointer-events: none; }

/* ══════════════════════════════════════════════════════════════════════════
   REVEAL — IntersectionObserver-driven (robusto, GPU-only)
   ══════════════════════════════════════════════════════════════════════════ */
.js [data-reveal] {
  opacity: 0; transform: translateY(42px); filter: blur(7px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal="scale"] { transform: scale(0.94); }
.js [data-reveal].is-visible { opacity: 1; transform: none; filter: blur(0); }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   APP MOCKUP — replica fedele del design dell'app
   ══════════════════════════════════════════════════════════════════════════ */
.mock { display: grid; grid-template-columns: 92px 1fr; height: 100%; background: var(--cream); border-radius: inherit; overflow: hidden; }
.mock-sb { background: var(--cream); border-right: 1px solid rgba(178,178,173,0.25); padding: 1rem 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.mock-logo { width: 34px; height: 34px; border-radius: 99px; background: var(--sage); display: flex; align-items: center; justify-content: center; color: #edffd8; margin: 0.25rem auto 1rem; }
.mock-logo svg { width: 18px; height: 18px; }
.mock-nav { width: 40px; height: 40px; border-radius: 12px; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mock-nav.active { background: var(--p-container); color: var(--sage-deep); box-shadow: 0 2px 8px rgba(83,100,67,0.12); }
.mock-nav svg { width: 19px; height: 19px; }
.mock-main { padding: 1.25rem 1.4rem; overflow: hidden; }
.mock-h { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.03em; }
.mock-sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.mock-card { background: #fff; border-radius: 1.1rem; padding: 0.95rem 1.05rem; margin-top: 0.85rem; box-shadow: 6px 6px 14px rgba(49,51,47,0.05), -4px -4px 10px rgba(255,255,255,0.9); }
.mock-tag { font-size: 0.55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--sage); }
.mock-line { height: 6px; border-radius: 99px; background: var(--surface); margin-top: 7px; }
.mock-line.w90{width:90%} .mock-line.w70{width:70%} .mock-line.w80{width:80%} .mock-line.w50{width:50%} .mock-line.w60{width:60%}
.mock-pill-row { display: flex; gap: 6px; margin-top: 0.6rem; }
.mock-pill { font-size: 0.55rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(77,97,119,0.1); color: var(--blue); }
.mock-rec { display: inline-flex; align-items: center; gap: 6px; font-size: 0.6rem; font-weight: 700; color: var(--sage); }
.mock-rec i { width: 7px; height: 7px; border-radius: 99px; background: #a73b21; box-shadow: 0 0 0 4px rgba(167,59,33,0.15); animation: recpulse 1.6s var(--ease) infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 7px rgba(167,59,33,0); } }
.mock-wave { display: flex; align-items: center; gap: 3px; height: 26px; margin-top: 0.5rem; }
.mock-wave span { flex: 1; background: rgba(83,100,67,0.35); border-radius: 99px; animation: wave 1.3s var(--ease) infinite; }
@keyframes wave { 0%,100%{ height: 18%; } 50%{ height: 100%; } }

/* ══════════════════════════════════════════════════════════════════════════
   BENTO
   ══════════════════════════════════════════════════════════════════════════ */
.feat-ico { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: rgba(83,100,67,0.08); color: var(--sage); }
.feat-ico svg { width: 26px; height: 26px; }
.feat-ico.blue { background: rgba(77,97,119,0.1); color: var(--blue); }

/* ── Marquee trust bar ───────────────────────────────────────────────────── */
.marquee { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3.5rem; padding-right: 3.5rem; white-space: nowrap; animation: scrollx 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }

/* ══════════════════════════════════════════════════════════════════════════
   PRICING
   ══════════════════════════════════════════════════════════════════════════ */
.price-pop { position: relative; }
.price-badge { position: absolute; top: -0.9rem; left: 50%; transform: translateX(-50%); background: var(--sage); color: #edffd8; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; padding: 0.35rem 0.9rem; border-radius: 99px; box-shadow: 0 8px 20px -6px rgba(83,100,67,0.5); }
.price-feat { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.9rem; color: var(--ink); }
.price-feat .icn { width: 18px; height: 18px; color: var(--sage); flex-shrink: 0; margin-top: 2px; stroke-width: 1.5; }

/* ── Billing toggle ──────────────────────────────────────────────────────── */
.toggle { display: inline-flex; padding: 0.3rem; border-radius: 99px; gap: 0.25rem; }
.toggle button { border: none; background: transparent; cursor: pointer; padding: 0.5rem 1.1rem; border-radius: 99px; font-family: inherit; font-weight: 600; font-size: 0.85rem; color: var(--muted); transition: color 0.3s var(--ease); }
.toggle button.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -3px rgba(49,51,47,0.12); }

/* ══════════════════════════════════════════════════════════════════════════
   HOW IT WORKS — pinned horizontal scroll
   ══════════════════════════════════════════════════════════════════════════ */
.hsteps { position: relative; }
.hsteps-track { display: flex; gap: 2rem; will-change: transform; }
.hstep { flex: 0 0 78vw; max-width: 620px; }
@media (min-width: 1024px) { .hstep { flex: 0 0 46vw; } }

/* ── Accordion FAQ ───────────────────────────────────────────────────────── */
.acc-item { border-bottom: 1px solid rgba(178,178,173,0.3); }
.acc-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; background: none; border: none; cursor: pointer; text-align: left; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--ink); letter-spacing: -0.02em; }
.acc-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 99px; background: rgba(49,51,47,0.05); display: flex; align-items: center; justify-content: center; transition: transform 0.5s var(--ease), background 0.4s var(--ease); }
.acc-ico svg { width: 16px; height: 16px; }
.acc-item.open .acc-ico { transform: rotate(45deg); background: var(--sage); color: #edffd8; }
.acc-body { overflow: hidden; max-height: 0; transition: max-height 0.6s var(--ease); }
.acc-body-inner { padding-bottom: 1.5rem; color: var(--muted); line-height: 1.75; font-size: 0.95rem; max-width: 60ch; }

/* ══════════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════════ */
.foot-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.3s var(--ease); }
.foot-link:hover { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════════════════
   LEGAL — pagine documenti (privacy, termini, cookie)
   ══════════════════════════════════════════════════════════════════════════ */
.legal { max-width: 50rem; margin: 0 auto; }
.legal h1 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: -0.04em; color: var(--ink); }
.legal .legal-meta { color: var(--muted); font-size: 0.875rem; margin-top: 0.75rem; }
.legal h2 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.025em; color: var(--ink); margin: 2.75rem 0 0.5rem; padding-top: 1.75rem; border-top: 1px solid rgba(178,178,173,0.3); }
.legal h3 { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--sage); margin: 1.75rem 0 0.4rem; }
.legal p, .legal li { color: var(--ink); line-height: 1.8; font-size: 0.975rem; }
.legal p { margin: 0.75rem 0; }
.legal ul, .legal ol { padding-left: 1.4rem; margin: 0.75rem 0; }
.legal li { margin-bottom: 0.4rem; }
.legal a { color: var(--sage); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { font-weight: 700; color: var(--sage-deep); }
.legal .note {
  background: rgba(83,100,67,0.06); border-radius: 1rem; padding: 1.1rem 1.35rem; margin: 1.25rem 0;
  box-shadow: inset 0 0 0 1px rgba(83,100,67,0.12); font-size: 0.92rem; line-height: 1.75;
}
.legal .note.warn { background: rgba(167,59,33,0.06); box-shadow: inset 0 0 0 1px rgba(167,59,33,0.16); }
.legal .placeholder { background: rgba(122,92,48,0.14); color: #6b4f24; padding: 0 0.3em; border-radius: 0.3em; font-weight: 600; font-size: 0.9em; }
.legal .toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.legal .toc a { font-size: 0.8rem; text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 99px; background: rgba(49,51,47,0.05); color: var(--muted); }
.legal .toc a:hover { color: var(--ink); background: rgba(49,51,47,0.08); }

/* ══════════════════════════════════════════════════════════════════════════
   COOKIE BANNER
   ══════════════════════════════════════════════════════════════════════════ */
.cookie-bar {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 70;
  max-width: 540px; margin: 0 auto; padding: 1.4rem 1.5rem;
  border-radius: 1.5rem;
  transform: translateY(140%); transition: transform 0.7s var(--ease);
}
.cookie-bar.show { transform: translateY(0); }
.cookie-bar h4 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.cookie-bar p { font-size: 0.85rem; line-height: 1.6; color: var(--muted); }
.cookie-bar p a { color: var(--sage); text-decoration: underline; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.cookie-actions .btn { padding: 0.7rem 1.2rem; font-size: 0.85rem; }
.cookie-actions .btn-mini { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px rgba(49,51,47,0.12); padding: 0.7rem 1.2rem; border-radius: 99px; border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.85rem; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.cookie-actions .btn-mini:hover { background: rgba(49,51,47,0.05); color: var(--ink); }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-balance { text-wrap: balance; }
.divider-soft { border-top: 1px solid rgba(178,178,173,0.3); }
