/* ============================================
   PAN Landing — Premium Scroll-Driven
   ============================================ */

:root {
  --bg-cream: #f9faf8;
  --bg-cream-deep: #efeeea;
  --text-primary: #0a0a0a;
  --text-secondary: #444444;
  --text-tertiary: #6f6f6f;
  --accent: #e8327c;
  --accent-deep: #c01f64;
  --white: #ffffff;
  --black: #0a0a0a;
  --border-soft: rgba(10, 10, 10, 0.08);
  --radius-pill: 999px;
  --shadow-soft: 0 1px 3px rgba(10, 10, 10, 0.06), 0 4px 16px rgba(10, 10, 10, 0.04);
  --header-h: 72px;
  --minibar-h: 56px;
  --strip-h: 56px;
  --font-display: 'Inter Tight', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================
   LOADER
   ============================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner {
  text-align: center;
}
.loader-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
#loader-bar {
  width: 240px;
  height: 2px;
  background: var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 0.75rem;
}
#loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}
#loader-percent {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

/* ============================================
   HEADER (fixed)
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5vw;
  background: rgba(245, 243, 240, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.site-nav {
  display: flex;
  gap: 2.5rem;
}
.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--text-primary); }
.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
}
.lang-chip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
  transition: all 0.2s;
}
.lang-chip:hover { color: var(--text-primary); }
.lang-chip.active {
  background: var(--text-primary);
  color: var(--white);
}

/* ============================================
   CTA pill
   ============================================ */
.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-soft);
}
.cta-pill:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.cta-pill--small {
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
}
.cta-pill--large {
  padding: 1.1rem 1.8rem;
  font-size: 1.05rem;
  margin-top: 1.5rem;
}
.cta-pill svg { transition: transform 0.2s; }
.cta-pill:hover svg { transform: translateX(3px); }

/* ============================================
   CANVAS (fixed full viewport, fades for FAQ)
   ============================================ */
.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: none;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Dark overlay (for pricing emphasis) */
#dark-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   MARQUEE (during avatar fade-out)
   ============================================ */
.marquee-wrap {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 6;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}
.marquee-text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13vw;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--text-primary);
  text-transform: uppercase;
  will-change: transform;
}

/* ============================================
   SCROLL CONTAINER
   ============================================ */
#scroll-container {
  position: relative;
  min-height: 1000vh;
  z-index: 10;
}

/* Scroll sections — fixed in viewport; visibility driven by ScrollTrigger opacity.
   The 1000vh container is just empty scroll real estate; sections 1-5 layer fixed
   on top of the canvas and fade in/out as scroll progress crosses their range.
   Sections 6 (FAQ) and 7 (Footer) flow normally at the END of the container. */
.scroll-section {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
}

/* ============================================
   SEZIONE 1 — HERO (3-col grid: text | avatar | stats)
   ============================================ */
.section-hero {
  top: var(--header-h);
  height: calc(100vh - var(--header-h) - var(--minibar-h) - var(--strip-h));
  width: 100%;
  display: flex;
  align-items: center;
  opacity: 1;
  pointer-events: auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 22vw 56vw 22vw;
  width: 100%;
  align-items: center;
  gap: 0;
}
.hero-left, .hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.hero-left {
  grid-column: 1;
  padding-left: 2.5vw;
  padding-right: 1vw;
  max-width: 22vw;
  align-self: center;
}
.hero-left .cta-pill {
  margin-top: 1rem;
  margin-bottom: 1rem;
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.75rem 1.2rem;
}
.hero-right {
  grid-column: 3;
  padding-right: 2.5vw;
  padding-left: 1vw;
  max-width: 22vw;
  align-self: center;
  align-items: flex-end;
  text-align: right;
}
.hero-right .stat-block { align-items: flex-end; }
.hero-right .stat-headline { justify-content: flex-end; }
.hero-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.hero-heading span {
  display: block;
  white-space: nowrap;
}
.hero-heading span {
  display: block;
}
.hero-tagline {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 28ch;
  margin-bottom: 0.5rem;
}
.hero-foot {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 1rem;
  max-width: 30ch;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  align-self: flex-start;
}

/* Stat block */
.stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: flex-start;
}
.stat-headline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2vw, 2rem);
  color: var(--accent);
}
.stat-suffix {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2vw, 2rem);
  color: var(--accent);
  margin-right: 0.3rem;
}
.stat-headline-text { display: inline; }
.stat-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 28ch;
}

/* ============================================
   CONTENT SECTIONS (align-left / align-right)
   ============================================ */
.section-content {
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  min-height: 50vh;
}
.align-left {
  padding-left: 4vw;
  padding-right: 76vw;
}
.align-right {
  padding-left: 76vw;
  padding-right: 4vw;
}
.section-inner {
  max-width: 20vw;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 2.9vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.section-body {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 36ch;
}

/* ============================================
   SEZIONE 5 — PRICING (with dark overlay)
   ============================================ */
.section-pricing {
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  min-height: 60vh;
  padding-left: 76vw;
  padding-right: 4vw;
  z-index: 11;
}
.section-pricing .section-inner {
  max-width: 20vw;
  align-items: flex-start;
}
.section-pricing .section-label,
.section-pricing .section-heading,
.section-pricing .section-body {
  color: var(--white);
}
.section-pricing .section-label {
  color: rgba(255, 255, 255, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
.section-pricing .cta-pill {
  background: var(--white);
  color: var(--text-primary);
}
.section-pricing .cta-pill:hover {
  background: var(--accent);
  color: var(--white);
}

/* ============================================
   FULL-WIDTH SECTIONS (FAQ + Footer, after avatar fade-out)
   ============================================ */
.full-width-section {
  position: relative;
  width: 100%;
  z-index: 10;
  background: var(--bg-cream);
}
.section-faq {
  position: absolute;
  top: 91%;
  left: 0;
  right: 0;
  padding: 12vh 8vw 8vh;
  background: var(--bg-cream);
  z-index: 12;
}
.section-faq .full-width-inner {
  max-width: 920px;
  margin: 0 auto;
}
.section-label--center {
  display: block;
  text-align: center;
  border-bottom: none;
  margin-bottom: 1rem;
}
.section-heading--center {
  text-align: center;
  margin-bottom: 3rem;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
}
.faq-item {
  border-top: 1px solid var(--border-soft);
  padding: 1.25rem 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border-soft); }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}
.faq-item p {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 60ch;
}

/* ============================================
   FOOTER (full-width, end of page)
   ============================================ */
.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6vh 8vw 4vh;
  background: var(--bg-cream-deep);
  border-top: 1px solid var(--border-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
}
.footer-tagline {
  margin-top: 0.5rem;
  color: var(--text-secondary);
}
.footer-meta {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}
.footer-meta p { margin-bottom: 0.25rem; }

/* ============================================
   BOTTOM STRIP (Brandly-style channels, fixed)
   ============================================ */
.bottom-strip {
  position: fixed;
  bottom: var(--minibar-h);
  left: 0;
  right: 0;
  height: var(--strip-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 2vw;
  background: rgba(245, 243, 240, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-soft);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: opacity 0.4s, transform 0.4s;
}
.strip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.strip-glyph {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.05em;
}

/* ============================================
   MINI-BAR (fixed bottom CTA persistent)
   ============================================ */
.mini-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--minibar-h);
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5vw;
  background: var(--text-primary);
  color: var(--white);
  transition: opacity 0.4s, transform 0.4s;
}
.mini-bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.mini-bar .cta-pill {
  background: var(--accent);
  color: var(--white);
}
.mini-bar .cta-pill:hover {
  background: var(--white);
  color: var(--text-primary);
}

.bottom-strip.hidden,
.mini-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

/* ============================================
   DEMO REQUEST MODAL
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-backdrop.open {
  opacity: 1;
}
.modal-card {
  background: var(--bg-cream);
  border-radius: 16px;
  padding: 2.75rem 2.5rem 2.5rem;
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1.1rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-tertiary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.modal-close:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.45;
}
#demo-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.modal-field input,
.modal-field textarea {
  font: 400 0.95rem var(--font-body);
  color: var(--text-primary);
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
.modal-field input:focus,
.modal-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 50, 124, 0.15);
}
.modal-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
}
.modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
.modal-field-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
  letter-spacing: 0;
}
.modal-status {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  min-height: 1.2em;
  color: var(--text-tertiary);
}
.modal-status.success { color: #1f7a32; }
.modal-status.error   { color: var(--accent-deep); }

/* ============================================
   SCROLL HINT (visible only at the start of scroll)
   ============================================ */
.scroll-hint {
  position: fixed;
  bottom: calc(var(--minibar-h) + var(--strip-h) + 1.25rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.scroll-hint svg {
  animation: scrollHintBob 1.8s ease-in-out infinite;
}
.scroll-hint.hidden {
  opacity: 0;
}
@keyframes scrollHintBob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(7px); opacity: 1; }
}
@media (max-width: 767px) {
  .scroll-hint { bottom: calc(var(--minibar-h) + 1rem); font-size: 0.65rem; }
}

/* Mobile modal */
@media (max-width: 640px) {
  .modal-backdrop { padding: 2vh 4vw; align-items: flex-start; padding-top: 4vh; }
  .modal-card { padding: 2rem 1.5rem 1.75rem; }
  .modal-title { font-size: 1.5rem; }
}

/* ============================================
   MOBILE (<768px) — collapse sides, dark backdrops
   ============================================ */
@media (max-width: 767px) {
  :root {
    --header-h: 60px;
    --minibar-h: 50px;
    --strip-h: 0px;
  }
  .site-nav { display: none; }
  .header-right .lang-switcher { display: none; }
  .bottom-strip { display: none; }

  #scroll-container { min-height: 600vh; }

  .section-hero {
    min-height: 100vh;
    padding-top: var(--header-h);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 4vh;
  }
  .hero-left, .hero-right {
    padding: 4vh 6vw;
    max-width: 100%;
    background: rgba(245, 243, 240, 0.92);
    backdrop-filter: blur(8px);
  }
  .hero-heading { font-size: 14vw; }

  .section-content,
  .section-pricing {
    padding: 12vh 6vw;
    min-height: 80vh;
  }
  .align-left, .align-right { padding-left: 6vw; padding-right: 6vw; }
  .section-inner { max-width: 100%; }
  .section-content .section-inner,
  .section-pricing .section-inner {
    background: rgba(245, 243, 240, 0.92);
    backdrop-filter: blur(8px);
    padding: 4vh 6vw;
    border-radius: 8px;
  }

  .section-faq {
    padding: 8vh 6vw 6vh;
    top: 92vh;
  }
  .faq-item summary { font-size: 1.05rem; }

  .marquee-text { font-size: 22vw; }
}
