/* =========================================================
   Dott. Roberto Fanciano — Psicologo online
   Moodboard: "Lo studio del professore"
   Warm, photo-driven, bookish humanist. Mobile-first.
   ========================================================= */

:root {
  /* --- Colore (OKLCH) --- */
  --paper:      oklch(0.966 0.012 80);   /* avorio carta, sfondo */
  --paper-2:    oklch(0.944 0.018 74);   /* superficie leggermente piu calda */
  --card:       oklch(0.992 0.006 85);   /* card quasi bianco caldo */
  --ink:        oklch(0.265 0.018 55);   /* espresso, testo */
  --ink-soft:   oklch(0.435 0.026 52);   /* noce, testo secondario */
  --clay:       oklch(0.55 0.115 45);    /* terracotta, accent decorativo/grande */
  --clay-deep:  oklch(0.445 0.108 42);   /* terracotta scuro, testo accent + CTA bg */
  --clay-tint:  oklch(0.93 0.034 58);    /* sabbia calda, tinte di sfondo */
  --line:       oklch(0.875 0.018 72);   /* bordo caldo */
  --line-soft:  oklch(0.915 0.014 74);
  --on-accent:  oklch(0.99 0.005 85);    /* testo su terracotta/espresso (avorio quasi bianco) */

  /* --- Tipografia --- */
  --font-display: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Literata", Georgia, "Times New Roman", serif;

  /* --- Spazio / forma --- */
  --maxw: 1140px;
  --pad: clamp(1.15rem, 5vw, 2rem);
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px oklch(0.265 0.018 55 / 0.06), 0 6px 18px -12px oklch(0.265 0.018 55 / 0.25);
  --shadow-md: 0 18px 48px -26px oklch(0.265 0.018 55 / 0.45);
  --ring: 0 0 0 3px oklch(0.55 0.115 45 / 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;            /* 17px */
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, .eyebrow, .brand, .btn, .nav-desktop a, .nav-drawer a,
.trust-num, .trust-strong, .step-k, .areas-list li, .contact-label, .footer-name {
  font-family: var(--font-display);
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.018em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 7.5vw, 3.7rem); }
h2 { font-size: clamp(1.65rem, 5vw, 2.55rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

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

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

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--clay-deep);
  margin-bottom: 0.7rem;
}

.accent { color: var(--clay-deep); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 0 0 10px 0; z-index: 10000;
  font-family: var(--font-display); font-size: 0.95rem;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.966 0.012 80 / 0.92);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }

.brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand-role { font-size: 0.74rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; }

.nav-desktop { display: none; }

.nav-cta {
  background: var(--clay-deep); color: var(--on-accent) !important;
  padding: 0.55rem 1.05rem; border-radius: 999px;
}

/* Hamburger */
.hamburger {
  position: relative; z-index: 101;  /* sopra il drawer (z-99), resta tappabile come "X" di chiusura */
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 46px; height: 46px; padding: 11px;
  background: transparent; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; color: var(--ink);
}
.hamburger span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer — full-screen overlay, no transform math */
.nav-drawer {
  position: fixed; inset: 0; z-index: 99;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; gap: 0.4rem;
  padding: 5rem var(--pad) 3rem;
  opacity: 0; visibility: hidden;
  /* visibility instant on open (so focus() lands), delayed on close (so the fade-out is seen) */
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.nav-drawer.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s linear 0s; }
.nav-drawer:focus { outline: none; }
.nav-drawer a {
  font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none;
  padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--line-soft);
}
.nav-drawer a:last-child { border-bottom: 0; }
.nav-drawer .drawer-cta { color: var(--clay-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.8rem 1.5rem;
  border-radius: 999px; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn-primary { background: var(--clay-deep); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); border-color: var(--ink-soft); transform: translateY(-2px); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(2rem, 6vw, 3.5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 6vw, 3.5rem); align-items: center; }
.hero-copy { max-width: 38rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero-lead { font-size: 1.18rem; color: var(--ink-soft); margin-bottom: 1.8rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2rem; }

.hero-trust { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.hero-trust li {
  position: relative; padding-left: 1.5rem;
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
}
.hero-trust li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--clay);
}

.hero-media { justify-self: center; width: 100%; }
.portrait {
  position: relative; max-width: 420px; margin-inline: auto;
  background: var(--card); padding: 12px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  transform: rotate(-1.2deg);
}
.portrait img { border-radius: calc(var(--radius-lg) - 12px); width: 100%; }
.portrait figcaption {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 500;
  color: var(--ink-soft); text-align: center; padding: 0.7rem 0 0.2rem;
}

/* ---------- Quote band ---------- */
.band-quote { background: var(--clay-tint); padding: clamp(2.5rem, 7vw, 4rem) 0; }
.band-quote blockquote {
  font-size: clamp(1.5rem, 4.2vw, 2.3rem); line-height: 1.32; font-style: italic;
  color: var(--ink); max-width: 30ch; margin-inline: auto; text-align: center; font-weight: 400;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 9vw, 5.5rem) 0; }
.section-soft { background: var(--paper-2); }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-head h2 { margin-bottom: 0.7rem; }
.section-sub { color: var(--ink-soft); font-size: 1.1rem; }

/* Chi sono */
.chi-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.chi-text h2 { margin-bottom: 1.2rem; }
.chi-text p { margin-bottom: 1.1rem; color: var(--ink); max-width: 40rem; }
.chi-text .pledge {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; color: var(--ink);
  font-style: italic;
}
.chi-text .note-fb { color: var(--ink-soft); font-size: 0.98rem; }

.chi-cards { display: grid; gap: 1rem; }
.trust-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; box-shadow: var(--shadow-sm);
}
.trust-num { font-size: 2.6rem; font-weight: 700; color: var(--clay-deep); line-height: 1; }
.trust-strong { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.trust-label { font-family: var(--font-body); font-size: 0.96rem; color: var(--ink-soft); }

/* Come ti aiuto */
.offer-grid { display: grid; gap: 1.1rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.offer-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.offer-card h3 { margin-bottom: 0.5rem; color: var(--clay-deep); }
.offer-card p { color: var(--ink-soft); }

.steps-title { margin-bottom: 1.5rem; }
.steps-list { list-style: none; padding: 0; display: grid; gap: 1.1rem; }
.steps-list li { display: flex; gap: 1rem; align-items: flex-start; }
.step-k {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: var(--clay-tint); color: var(--clay-deep);
  display: grid; place-items: center; font-weight: 700; font-size: 1.15rem;
}
.steps-list strong { font-family: var(--font-display); display: block; font-size: 1.08rem; margin-bottom: 0.15rem; }
.steps-list p { color: var(--ink-soft); }

/* Per chi */
.who-grid { display: grid; gap: 1.1rem; }
.who-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.who-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.who-card h3 { margin-bottom: 0.45rem; }
.who-card p { color: var(--ink-soft); font-size: 1rem; }

/* Aree */
.areas-wrap { display: grid; gap: clamp(1.8rem, 4vw, 2.5rem); }
.areas-head { max-width: 38rem; }
.areas-head h2 { margin: 0.6rem 0; }
.areas-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.areas-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.6rem 1.15rem; font-weight: 500; font-size: 0.98rem; color: var(--ink);
}

/* Contatti */
.section-contact { padding-bottom: clamp(4rem, 10vw, 7rem); }
.contact-card {
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-lg); padding: clamp(1.8rem, 6vw, 3.5rem);
  max-width: 60rem;
}
.contact-card .eyebrow { color: oklch(0.78 0.09 55); }
.contact-card h2 { color: var(--paper); margin-bottom: 0.9rem; }
.contact-lead { color: oklch(0.85 0.015 75); font-size: 1.12rem; max-width: 42rem; margin-bottom: 2rem; }
.contact-rows { display: grid; gap: 0.9rem; margin-bottom: 1.6rem; }
.contact-row {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding-bottom: 0.9rem; border-bottom: 1px solid oklch(0.4 0.02 60 / 0.6);
}
.contact-row:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; color: oklch(0.74 0.04 60);
}
.contact-value {
  font-size: clamp(1.2rem, 3.5vw, 1.5rem); font-weight: 500; color: var(--paper);
  user-select: all; -webkit-user-select: all;
}
.contact-note { color: oklch(0.78 0.015 75); font-size: 0.96rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-bottom: 0.3rem; }
.footer-meta { font-size: 0.9rem; color: var(--ink-soft); }
.footer-copy { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Reveal animation (progressive: visible without JS) ---------- */
body.reveal-init .reveal { opacity: 0; transform: translateY(18px); }
body.reveal-init .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1);
}
@media (prefers-reduced-motion: reduce) {
  body.reveal-init .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Weeby badge ---------- */
.weeby-badge {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(10, 10, 10, 0.92); color: #fff;
  padding: 8px 16px 8px 8px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease, padding 0.25s ease;
  animation: weebyBadgeIn 0.6s ease 1.5s both;
}
.weeby-badge:hover { transform: translateY(-2px); padding-right: 20px; }
.weeby-badge img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.weeby-badge .label { color: rgba(255, 255, 255, 0.9); }
.weeby-badge .label strong { color: #fff; font-weight: 700; }
.weeby-badge .cta {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  color: #ffb547; font-weight: 600; margin-left: -6px;
  transition: max-width 0.3s ease, opacity 0.2s ease 0.05s, margin-left 0.3s ease;
}
.weeby-badge:hover .cta { max-width: 200px; opacity: 1; margin-left: 0; }
@keyframes weebyBadgeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .weeby-badge { animation: none; } }

/* =========================================================
   Breakpoints
   ========================================================= */
@media (min-width: 600px) {
  .offer-grid { grid-template-columns: repeat(3, 1fr); }
  .who-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

@media (min-width: 768px) {
  .hamburger { display: none; }
  .nav-drawer { display: none; }
  .nav-desktop { display: flex; align-items: center; gap: 1.6rem; }
  .nav-desktop a {
    display: inline-flex; align-items: center; min-height: 44px;
    text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.98rem;
    transition: color .15s ease;
  }
  .nav-desktop a:not(.nav-cta):hover { color: var(--clay-deep); }

  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .hero-media { justify-self: end; }
  .portrait { margin-inline: 0; }

  .chi-grid { grid-template-columns: 1.4fr 1fr; }
  .steps-list { grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
  .steps-list li { flex-direction: column; }
}

@media (min-width: 1024px) {
  .who-grid { grid-template-columns: repeat(4, 1fr); }
}
