/* =============================================
   SYLVA — base_landing.css
   Tokens · Nav · Footer · Cookie · Utilities
   ============================================= */

/* ── TOKENS ─────────────────────────────────── */
:root {
  --white:       #ffffff;
  --cream:       #fafaf8;
  --gray-50:     #f7f7f5;
  --gray-100:    #efefec;
  --gray-200:    #e0e0db;
  --gray-400:    #a8a89e;
  --gray-500:    #7a7a70;
  --gray-700:    #3d3d35;
  --gray-900:    #1a1a14;

  --sage:        #2f5132;
  --sage-mid:    #4a7c54;
  --sage-light:  #8aaf8f;
  --sage-ghost:  #edf3ee;
  --sage-border: rgba(47, 81, 50, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  --nav-h:      80px;
  --r-sm:       6px;
  --r-md:       10px;
  --r-lg:       16px;
  --r-xl:       22px;
  --r-full:     9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.10);

  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ── RESET ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Prevent font scaling on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
img    { max-width: 100%; display: block; }
a      { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; touch-action: manipulation; }
ul, ol { list-style: none; }

/* ── LAYOUT UTILITIES ────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.0rem;
}
.container-wide {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── NAV ─────────────────────────────────────── */
.l-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 400;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  transition: box-shadow 0.25s var(--ease);
}
.l-nav.is-scrolled {
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.l-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 0;
}

/* Brand */
.l-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  text-decoration: none;
  padding: 0 2rem 0 0;
  /* Minimum touch target */
  min-height: 44px;
}
.l-nav__logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.l-nav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.l-nav__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.l-nav__by {
  font-size: 0.625rem;
  color: var(--gray-400);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Center links */
.l-nav__links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.l-nav__link {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  position: relative;
}
.l-nav__link:hover { background: rgba(0,0,0,0.04); color: var(--gray-900); }
.l-nav__link.is-active {
  background: rgba(0,0,0,0.06);
  color: var(--gray-900);
  font-weight: 600;
}
.l-nav__link.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px; right: 20px;
  height: 2px;
  background: var(--gray-900);
  border-radius: 2px 2px 0 0;
}

/* Actions */
.l-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  padding: 0 0 0 2rem;
}
.l-nav__login {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--gray-500);
  padding: 0.5rem 0.875rem;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.l-nav__login:hover { color: var(--gray-900); background: var(--gray-50); }

.l-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white);
  background: var(--sage);
  padding: 0.5625rem 1.125rem;
  border-radius: var(--r-sm);
  transition: background 0.15s, box-shadow 0.15s;
  letter-spacing: -0.005em;
  min-height: 44px;
}
.l-nav__cta:hover {
  background: #1e3422;
  box-shadow: 0 2px 8px rgba(47, 81, 50, 0.25);
}
.l-nav__cta svg { width: 13px; height: 13px; }

/* Hamburger — 44×44 touch target */
.l-nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  padding: 0.375rem;
  transition: background 0.15s;
  /* Prevent double-tap zoom */
  touch-action: manipulation;
}
.l-nav__burger:hover { background: var(--gray-50); }
.l-nav__burger span {
  display: block;
  height: 1.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s;
  pointer-events: none;
}
.l-nav__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.l-nav__burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.l-nav__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.l-nav__drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.75rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 399;
  /* Safe area per notch iPhone */
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.l-nav__drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.l-nav__drawer-link {
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray-700);
  padding: 0.75rem 0.75rem;
  border-radius: var(--r-sm);
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.l-nav__drawer-link:hover { background: var(--gray-50); color: var(--gray-900); }
.l-nav__drawer-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0.5rem 0;
}
.l-nav__drawer-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0;
}
.l-nav__drawer-actions .l-nav__login {
  flex: 1;
  text-align: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  padding: 0.6875rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.l-nav__drawer-actions .l-nav__cta {
  flex: 1;
  justify-content: center;
  min-height: 44px;
}

.l-nav-spacer { height: var(--nav-h); }

/* ── FOOTER ──────────────────────────────────── */
.l-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  padding: 4rem 0 0;
  /* Safe area padding bottom per notch */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.l-footer__top {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 3rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.l-footer__brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  text-decoration: none;
}
.l-footer__brand-logo img {
  width: 22px; height: 22px;
  object-fit: contain;
}
.l-footer__brand-logo span {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
}
.l-footer__tagline {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 220px;
  margin-bottom: 1.5rem;
}
.l-footer__social {
  display: flex;
  gap: 0.5rem;
}
.l-footer__social-link {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.l-footer__social-link:hover {
  color: var(--sage);
  border-color: var(--sage-border);
  background: var(--sage-ghost);
}
.l-footer__social-link svg { width: 14px; height: 14px; }

.l-footer__col-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sage);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.l-footer__col-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.l-footer__col-link {
  font-size: 0.875rem;
  color: var(--gray-500);
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  /* Touch target */
  min-height: 36px;
  padding: 0.125rem 0;
}
.l-footer__col-link:hover { color: var(--sage); }
.l-footer__col-link--ext::after {
  content: '↗';
  font-size: 0.65rem;
  color: var(--sage-light);
}

.l-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}
.l-footer__copy {
  font-size: 0.8125rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.l-footer__copy-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gray-400);
  display: inline-block;
  flex-shrink: 0;
}
.l-footer__legal {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.l-footer__legal-link {
  font-size: 0.8125rem;
  color: var(--gray-400);
  transition: color 0.15s;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.l-footer__legal-link:hover { color: var(--sage); }

/* ── COOKIE BANNER ───────────────────────────── */
.l-cookie {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--gray-900);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  width: calc(100vw - 2rem);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.06);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.l-cookie.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}
.l-cookie__text {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.55;
  flex: 1;
}
.l-cookie__text strong { color: rgba(255,255,255,0.85); }
.l-cookie__text a {
  color: var(--sage-light);
  text-decoration: underline;
  text-decoration-color: rgba(138,175,143,0.4);
  transition: text-decoration-color 0.15s;
}
.l-cookie__text a:hover { text-decoration-color: var(--sage-light); }
.l-cookie__close {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  touch-action: manipulation;
}
.l-cookie__close:hover { background: rgba(255,255,255,0.15); color: white; }
.l-cookie__close svg  { width: 14px; height: 14px; }

/* ── SCROLL REVEAL ───────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
[data-reveal].is-revealed                  { opacity: 1; transform: translateY(0); }
[data-reveal][data-reveal-delay="100"]     { transition-delay: 0.1s; }
[data-reveal][data-reveal-delay="200"]     { transition-delay: 0.2s; }
[data-reveal][data-reveal-delay="300"]     { transition-delay: 0.3s; }

/* Disable reveal animation per utenti che preferiscono ridurre il movimento */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── RESPONSIVE ──────────────────────────────── */

/* Tablet large */
@media (max-width: 1024px) {
  .container { padding: 0 1.5rem; }
}

/* Tablet / Mobile nav */
@media (max-width: 820px) {
  :root { --nav-h: 64px; }

  .l-nav__links,
  .l-nav__actions { display: none; }
  .l-nav__burger  { display: flex; }

  .l-nav__brand { padding-right: 0; }
  .l-nav__logo  { width: 40px; height: 40px; }
}

/* Tablet footer */
@media (max-width: 900px) {
  .l-footer { padding: 3rem 0 0; }
  .l-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .l-footer__brand {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .l-footer__tagline { max-width: 100%; margin-bottom: 0; }
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 1rem; }

  /* Cookie banner full-width su mobile */
  .l-cookie {
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.5rem);
    border-radius: var(--r-md);
  }
  .l-cookie__text { font-size: 0.75rem; }
}

/* Mobile small */
@media (max-width: 560px) {
  .l-nav {
    /* Full-width nav su mobile piccolo */
    left: 0; right: 0;
    width: 100%;
    border-radius: 0;
  }
  .l-nav__drawer {
    left: 0; right: 0;
    width: 100%;
    border-radius: 0;
  }

  .l-footer__top    { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .l-footer__brand  { flex-direction: column; }
  .l-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
  .l-footer__legal { gap: 1rem; }
}

/* Mobile XS */
@media (max-width: 380px) {
  .l-footer__top { grid-template-columns: 1fr; }
  .l-footer__col { border-top: 1px solid var(--gray-100); padding-top: 1rem; }
}