/* ═══════════════════════════════════════════════════════════════
   fabio-zanchetta.art — Foglio di stile centralizzato
   Versione 1.0 — Giugno 2026
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. RESET & BOX MODEL ──────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── 2. TOKEN DI DESIGN ────────────────────────────────────── */
:root {
  /* Palette */
  --ivory:      #f7f3ec;
  --paper:      #ede8de;
  --paper-dark: #e0d9cc;
  --ink:        #1c1917;
  --ink-soft:   #3d3830;
  --ink-faint:  #8a8278;
  --gold:       #b8935a;
  --gold-dim:   #d4b483;
  --gold-pale:  #f0e6d3;
  --rule:       #c8bfb0;
  --blue-acc:   #2e4a6b;
  --red-acc:    #7a2c2c;
  --green:      #2d6a4f;

  /* Tipografia */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sc:      'Cormorant SC', Georgia, serif;
  --font-body:    'EB Garamond', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Scala tipografica */
  --text-xs:   0.72rem;   /* 11.5px */
  --text-sm:   0.85rem;   /* 13.6px */
  --text-base: 1rem;      /* 16px   */
  --text-md:   1.1rem;    /* 17.6px */
  --text-lg:   1.25rem;   /* 20px   */
  --text-xl:   1.6rem;    /* 25.6px */
  --text-2xl:  2.2rem;    /* 35.2px */
  --text-3xl:  3rem;      /* 48px   */
  --text-4xl:  4rem;      /* 64px   */

  /* Spaziatura */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* Layout */
  --max-w:        860px;
  --max-w-narrow: 620px;
  --max-w-wide:   1080px;
  --nav-h:        56px;

  /* Transizioni */
  --ease:    cubic-bezier(.25, .46, .45, .94);
  --dur-fast: 180ms;
  --dur-mid:  280ms;
  --dur-slow: 420ms;

  /* Bordi */
  --radius-sm: 2px;
  --radius:    4px;
  --radius-lg: 8px;
}

/* ── 3. BASE ────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.8;
  min-height: 100vh;
  /* Grain overlay — carta invecchiata */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
}

/* ── 4. TIPOGRAFIA ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: var(--text-4xl); letter-spacing: -.02em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }

p { margin-bottom: var(--space-5); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--ink); }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

em, i { font-style: italic; }
strong { font-weight: 600; }

blockquote {
  border-left: 2px solid var(--gold);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
  color: var(--ink-soft);
  font-style: italic;
  font-size: var(--text-lg);
}

/* ── 5. LAYOUT CONTAINER ────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container--narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container--wide {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── 6. NAVIGAZIONE ─────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.site-nav__brand {
  font-family: var(--font-sc);
  font-size: var(--text-sm);
  letter-spacing: .18em;
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease);
}
.site-nav__brand:hover { color: var(--gold-dim); }

.site-nav__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  align-items: center;
}

.site-nav__links a {
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: .7;
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.site-nav__links a:hover,
.site-nav__links a.active {
  opacity: 1;
  color: var(--gold-dim);
}

/* Lingua switcher */
.lang-switcher {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .08em;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5);
  background: transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-transform: uppercase;
}
.lang-btn:hover { color: var(--paper); border-color: rgba(255,255,255,.5); }
.lang-btn.active {
  color: var(--gold-dim);
  border-color: var(--gold-dim);
  background: rgba(184,147,90,.12);
}

/* Hamburger mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--paper);
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-mid) var(--ease), opacity var(--dur-mid) var(--ease);
}

/* ── 7. HERO ────────────────────────────────────────────────── */
.hero {
  padding: var(--space-10) 0 var(--space-9);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.hero__eyebrow {
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-4);
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, var(--text-4xl));
  font-weight: 300;
  font-style: italic;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: var(--space-5);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  font-style: italic;
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: var(--space-7);
}

.hero__rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin-bottom: var(--space-7);
}

/* ── 8. SEZIONI ─────────────────────────────────────────────── */
.section {
  padding: var(--space-9) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-child { border-bottom: none; }

.section--paper {
  background: var(--paper);
}

.section__label {
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-5);
}

.section__title {
  font-size: var(--text-2xl);
  font-weight: 300;
  margin-bottom: var(--space-4);
}

.section__intro {
  font-size: var(--text-md);
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: var(--space-7);
  max-width: 560px;
}

/* ── 9. COMPONENTI RICORRENTI ───────────────────────────────── */

/* Lineetta decorativa */
.rule { width: 100%; height: 1px; background: var(--rule); margin: var(--space-7) 0; }
.rule--short { width: 48px; height: 1px; background: var(--gold); margin: var(--space-5) auto; }
.rule--left  { width: 48px; height: 1px; background: var(--gold); margin: var(--space-5) 0; }

/* Dropcap */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 3.8em;
  font-weight: 300;
  float: left;
  line-height: .85;
  margin-right: .1em;
  margin-top: .05em;
  color: var(--gold);
}

/* Card generica */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-6);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 2px 16px rgba(28,25,23,.06);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .1em;
  color: var(--ink-faint);
}
.badge--gold   { border-color: var(--gold);    color: var(--gold);    }
.badge--blue   { border-color: var(--blue-acc); color: var(--blue-acc); }
.badge--red    { border-color: var(--red-acc);  color: var(--red-acc);  }

/* Bottoni */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 24px;
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.btn--primary {
  background: var(--gold);
  color: white;
}
.btn--primary:hover { background: #a07830; color: white; }

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--ink-soft);
}
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }

.btn--ghost {
  background: transparent;
  color: var(--gold);
  padding-left: 0;
  padding-right: 0;
}
.btn--ghost:hover { color: var(--ink); }

/* ── 10. GRIGLIA OPERE ──────────────────────────────────────── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

.work-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  text-decoration: none;
  color: inherit;
}
.work-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  color: inherit;
}

.work-card__tipo {
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}
.work-card__titolo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
}
.work-card__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* ── 11. FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-9) 0 var(--space-7);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: start;
  margin-bottom: var(--space-8);
}

.site-footer__brand {
  font-family: var(--font-sc);
  font-size: var(--text-base);
  letter-spacing: .2em;
  color: var(--paper);
  margin-bottom: var(--space-3);
}

.site-footer__tagline {
  font-size: var(--text-sm);
  color: rgba(237,232,222,.45);
  font-style: italic;
  line-height: 1.7;
  max-width: 320px;
}

.site-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: right;
}
.site-footer__links a {
  font-family: var(--font-sc);
  font-size: var(--text-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(237,232,222,.5);
  transition: color var(--dur-fast) var(--ease);
}
.site-footer__links a:hover { color: var(--gold-dim); }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.site-footer__copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(237,232,222,.3);
}

.site-footer__cc {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(237,232,222,.3);
}

/* ── 12. SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 80ms;  }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }

/* ── 13. MULTILINGUA ────────────────────────────────────────── */
[data-lang] { display: none; }
[data-lang].lang-active { display: block; }

/* Specifico per elementi inline */
span[data-lang].lang-active { display: inline; }

/* ── 14. UTILITIES ──────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-italic  { font-style: italic; }
.text-gold    { color: var(--gold); }
.text-faint   { color: var(--ink-faint); }
.text-small   { font-size: var(--text-sm); }
.text-mono    { font-family: var(--font-mono); }
.text-sc      { font-family: var(--font-sc); letter-spacing: .12em; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── 15. RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --nav-h: 52px;
  }

  body { font-size: 17px; }

  h1 { font-size: clamp(2rem, 8vw, 3rem); }

  .container,
  .container--narrow,
  .container--wide {
    padding: 0 var(--space-4);
  }

  /* Nav mobile */
  .nav-toggle { display: flex; }

  .site-nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: var(--space-3) 0;
  }
  .site-nav__links.open { display: flex; }
  .site-nav__links li { width: 100%; }
  .site-nav__links a {
    display: block;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
    opacity: 1;
  }

  .lang-switcher { gap: var(--space-1); }

  .hero { padding: var(--space-8) 0; }

  .section { padding: var(--space-7) 0; }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .site-footer__links { text-align: left; }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
.chapter, .story-section, .comp-section {
  scroll-margin-top: 110px; /* altezza site-nav + chapter-nav sticky */
}