/* =========================================================
   Yves Rocher con Dikra — "Il consiglio di un'amica"
   Verde foglia + crema caldo + accent corallo
   ========================================================= */

:root {
  /* Palette (OKLCH con fallback hex per cache/browser datati) */
  --cream:        #f8f5ef;
  --cream:        oklch(0.972 0.012 95);
  --cream-2:      #efe9dd;
  --cream-2:      oklch(0.935 0.018 92);
  --sage:         #e7efe7;
  --sage:         oklch(0.945 0.024 152);
  --green:        #3f6f56;
  --green:        oklch(0.488 0.066 158);
  --green-deep:   #21402f;
  --green-deep:   oklch(0.315 0.052 158);
  --ink:          #1b2a22;
  --ink:          oklch(0.255 0.024 160);
  --muted:        #51604f;
  --muted:        oklch(0.455 0.028 150);
  --coral:        #c4654d;
  --coral:        oklch(0.622 0.122 35);
  --coral-deep:   #a44d38;
  --coral-deep:   oklch(0.535 0.122 35);
  --border:       #ddd6c7;
  --border:       oklch(0.875 0.018 95);
  --white:        #fffdf9;

  /* Tipografia */
  --font-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --font-body:    "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-script:  "Caveat", "Segoe Script", cursive;

  /* Spazi & forma */
  --radius:    18px;
  --radius-lg: 30px;
  --maxw:      1140px;
  --shadow:    0 18px 50px -28px rgba(33, 64, 47, 0.45);
  --shadow-sm: 0 8px 24px -16px rgba(33, 64, 47, 0.4);
}

* { box-sizing: border-box; }

html { font-size: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  /* grana sottile per dare atmosfera */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green-deep); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--green-deep);
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-deep);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--green-deep); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--green-deep);
  border: 1.5px solid var(--green);
}
.btn-ghost:hover { background: var(--sage); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--cream) 88%, transparent);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { backdrop-filter: saturate(1.1) blur(8px); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.05;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.brand-tag {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-top: 2px;
}

.nav-desktop { display: none; }
.nav-desktop a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 10px 4px;
  position: relative;
}
.nav-desktop a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-desktop a:not(.nav-cta):hover::after,
.nav-desktop a[aria-current="true"]:not(.nav-cta)::after { transform: scaleX(1); }
.nav-cta {
  background: var(--green);
  color: var(--white) !important;
  padding: 10px 20px !important;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--green-deep); }

/* Hamburger */
.nav-toggle {
  width: 48px; height: 48px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--green-deep);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Full-screen overlay menu (robusto, niente translateY math) */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.nav-overlay-link {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--green-deep);
  text-decoration: none;
  padding: 14px 24px;
  min-height: 44px;
}
.nav-overlay-link:hover { color: var(--coral-deep); }

/* ---------- Hero ---------- */
.hero { padding-top: 46px; }
.hero-inner { text-align: center; max-width: 760px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--sage);
  color: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  margin: 0 0 22px;
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
}
.hero-title {
  font-size: clamp(2.7rem, 9vw, 4.6rem);
  font-weight: 700;
  margin-bottom: 20px;
}
.hero-lead {
  font-size: clamp(1.08rem, 2.4vw, 1.3rem);
  color: var(--muted);
  margin: 0 auto 30px;
  max-width: 620px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.hero-figure {
  margin: 50px auto 0;
  max-width: var(--maxw);
  padding-inline: 22px;
}
.hero-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* ---------- Section rhythm ---------- */
section { padding-block: clamp(60px, 9vw, 110px); }
section[id] { scroll-margin-top: 84px; }
.consiglio { background: var(--sage); }
.cosa { background: var(--cream); }
.perche { background: var(--cream-2); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.section-title { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: 14px; }
.section-sub { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---------- Split layouts ---------- */
.split { display: grid; gap: 36px; align-items: center; }
.split-figure, .consiglio-figure, .perche-figure { margin: 0; }
.consiglio-figure img, .perche-figure img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.consiglio-text p, .perche-text p { color: var(--muted); }
.consiglio-text .section-title { margin-bottom: 18px; }
.consiglio-text p { margin: 0 0 16px; }
.signature {
  font-family: var(--font-script);
  font-size: 2.6rem;
  color: var(--coral-deep);
  line-height: 1;
  margin-top: 8px !important;
}

/* ---------- Cards (Cosa propongo) ---------- */
.cards {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 22px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card-icon {
  display: inline-flex;
  width: 60px; height: 60px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--sage);
  color: var(--green);
  margin-bottom: 18px;
}
.card-icon svg { width: 32px; height: 32px; }
.card h3 { font-size: 1.32rem; margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Reasons (Perché da me) ---------- */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.reasons li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.reasons h3 { font-size: 1.24rem; margin-bottom: 6px; color: var(--green); }
.reasons p { margin: 0; color: var(--muted); }

/* ---------- Novità ---------- */
.novita { background: var(--green-deep); }
.novita-inner { text-align: center; max-width: 660px; margin: 0 auto; }
.novita .section-title { color: var(--white); }
.novita p { color: color-mix(in oklab, var(--white) 82%, transparent); font-size: 1.12rem; }
.novita-note {
  margin-top: 26px !important;
  font-size: 0.9rem !important;
  color: color-mix(in oklab, var(--white) 62%, transparent) !important;
  letter-spacing: 0.01em;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding-block: 50px; }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { display: flex; flex-direction: column; }
.footer-brand .brand-name { color: var(--cream); }
.footer-brand .brand-tag { color: color-mix(in oklab, var(--cream) 60%, transparent); }
.footer-note {
  margin: 0;
  max-width: 540px;
  color: color-mix(in oklab, var(--cream) 72%, transparent);
  font-size: 0.92rem;
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid color-mix(in oklab, var(--cream) 18%, transparent);
  font-size: 0.86rem;
  color: color-mix(in oklab, var(--cream) 65%, transparent);
}
.footer-credit a { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.footer-credit a:hover { color: var(--coral); }

/* ---------- Reveal / hero animation ---------- */
/* Default: tutto visibile (sicuro anche senza JS). Si nasconde solo con .js attivo. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Hero: animazione al load (CSS puro, non dipende dallo scroll/observer) */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.hero-anim { animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-anim { animation: none; }
}

/* =========================================================
   Responsive — mobile-first scaling up
   ========================================================= */
@media (min-width: 768px) {
  .container { padding-inline: 32px; }
  .hero-figure { padding-inline: 32px; }
  .nav-toggle { display: none; }
  .nav-desktop { display: flex; align-items: center; gap: 26px; }
  .nav-overlay { display: none; }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
  .split-reverse .perche-text { order: 2; }
  .split-reverse .perche-figure { order: 1; }

  .cards { grid-template-columns: repeat(3, 1fr); }
  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 40px;
    row-gap: 16px;
  }
  .footer-meta { grid-column: 1 / -1; justify-content: space-between; }
}

@media (min-width: 1024px) {
  .hero { padding-top: 70px; }
  .hero-figure img { aspect-ratio: 21 / 9; }
}
