/* ═══════════════════════════════════════════════════════════════════
   FUNDAMENTALS ADVISORY · CORE
   Design tokens · Reset · Typography · Buttons · Nav · Footer
   ═══════════════════════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Paper palette (warm off-white) */
  --paper:        #F1EBDD;
  --paper-deep:   #E8E1D0;
  --paper-soft:   #EFE8D6;
  --surface:      #FAF6EC;
  --surface-2:    #F6F0E0;

  /* Ink palette */
  --ink:          #181410;
  --ink-soft:     #3B342C;
  --ink-mute:     #6B6258;
  --ink-faint:    #9A9082;

  /* Accent palette */
  --moss:         #1E3A2C;
  --moss-soft:    #2C5240;
  --moss-glow:    #2F6A4F;
  --burgundy:     #5A1F22;
  --gold:         #B89968;
  --gold-soft:    #D4BB8A;
  --charcoal:     #24211D;

  /* Lines */
  --hairline:      #C5BCA8;
  --hairline-soft: #D9D1BF;
  --hairline-dark: #2A2521;

  /* Type */
  --serif: 'Fraunces', 'EB Garamond', Georgia, serif;
  --sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --max:          1320px;
  --max-wide:     1480px;
  --max-narrow:   980px;
  --gutter:       clamp(20px, 5vw, 80px);
  --gutter-tight: clamp(16px, 3vw, 36px);
  --section-y:    clamp(80px, 14vh, 180px);

  /* Motion */
  --ease:         cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:    cubic-bezier(0.4, 0, 0.2, 1);

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(24, 20, 16, 0.04), 0 4px 12px rgba(24, 20, 16, 0.04);
  --shadow-2: 0 4px 14px rgba(24, 20, 16, 0.06), 0 18px 48px rgba(24, 20, 16, 0.08);
  --shadow-3: 0 18px 50px rgba(24, 20, 16, 0.12), 0 30px 80px rgba(24, 20, 16, 0.10);
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.094 0 0 0 0 0.078 0 0 0 0 0.063 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--moss); color: var(--paper); }
::-moz-selection { background: var(--moss); color: var(--paper); }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(30,58,44,0.12); }
img, svg { display: block; max-width: 100%; }

/* Evita overflow orizzontale da parole lunghe / URL su mobile */
h1, h2, h3, p, a, li, span { overflow-wrap: break-word; }

/* ── ACCESSIBILITÀ ───────────────────────────────────────────────── */
/* Skip link */
.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--gold); outline-offset: 2px; }
#main-content { display: block; scroll-margin-top: 90px; }

/* Focus visibile coerente su tutti gli elementi interattivi */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
  border-radius: 3px;
}
#main-content:focus-visible { outline: none; }

/* Rispetto delle preferenze di movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none !important; }
}
button { font: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ── TYPE UTILITIES ──────────────────────────────────────────────── */
.serif { font-family: var(--serif); font-variation-settings: "opsz" 144, "SOFT" 50; }
.italic { font-style: italic; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.section-marker {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 56px;
}
.section-marker .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--moss);
  letter-spacing: 0.05em;
  font-variation-settings: "opsz" 12;
}
.section-marker .label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.section-marker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
  margin-left: 12px;
  align-self: center;
  margin-top: 2px;
}
.section-marker.center { justify-content: center; }
.section-marker.center::after { display: none; }

.section-intro {
  font-family: var(--serif);
  font-weight: 320;
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.25;
  color: var(--ink);
  max-width: 28ch;
  font-variation-settings: "opsz" 60, "SOFT" 50;
  margin-bottom: 80px;
  letter-spacing: -0.01em;
}
.section-intro em { font-style: italic; color: var(--moss); }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn .arrow {
  width: 14px; height: 1px; background: currentColor;
  position: relative;
  transition: width 0.3s var(--ease);
}
.btn .arrow::after {
  content: ""; position: absolute;
  right: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { width: 22px; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--moss); border-color: var(--moss); }
.btn.secondary { color: var(--ink); background: transparent; }
.btn.secondary:hover { background: var(--surface); border-color: var(--moss); color: var(--moss); }
.btn.ghost { border-color: var(--hairline); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--moss); color: var(--moss); }
.btn.invert { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn.invert:hover { background: transparent; color: var(--paper); }

/* Inline editorial link */
.editorial-link {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), gap 0.25s var(--ease);
}
.editorial-link:hover { color: var(--moss); border-color: var(--moss); gap: 16px; }
.editorial-link .arrow { width: 14px; height: 1px; background: currentColor; position: relative; }
.editorial-link .arrow::after {
  content: ""; position: absolute;
  right: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

/* ── NAV ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(241, 235, 221, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  padding: 14px var(--gutter);
  border-bottom-color: var(--hairline-soft);
}
.nav.dark {
  background: transparent;
  color: var(--paper);
}
.nav.dark.scrolled {
  background: rgba(24, 20, 16, 0.78);
  border-bottom-color: rgba(241, 235, 221, 0.10);
}
.nav.dark .brand .name { color: var(--paper); }
.nav.dark .brand .sub  { color: rgba(241,235,221,0.55); }
.nav.dark .nav-links a { color: rgba(241,235,221,0.78); }
.nav.dark .nav-links a:hover { color: var(--paper); }
.nav.dark .lang { color: rgba(241,235,221,0.55); }
.nav.dark .lang button.active { color: var(--paper); }

.brand {
  display: flex; flex-direction: column; line-height: 1;
  position: relative; z-index: 2;
}
.brand .name {
  font-family: var(--serif);
  font-weight: 390;
  font-size: 19px;
  letter-spacing: 0.20em;
  color: var(--ink);
  text-transform: uppercase;
  font-variation-settings: "opsz" 30, "SOFT" 30;
  transition: color 0.3s var(--ease);
}
.brand .sub {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 6px;
  padding-left: 1px;
  transition: color 0.3s var(--ease);
}

.nav-links {
  display: flex;
  gap: 34px;
  align-items: center;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav-links a[aria-current="page"] { color: var(--moss); }
.nav-links a:hover { color: var(--moss); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--moss);
  transition: right 0.4s var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { right: 0; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-cta .lock {
  width: 10px; height: 12px;
  border: 1px solid currentColor;
  border-radius: 1px;
  position: relative;
  margin-bottom: -1px;
}
.nav-cta .lock::before {
  content: "";
  position: absolute;
  top: -5px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 5px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.nav.dark .nav-cta { border-color: rgba(241,235,221,0.4); color: var(--paper); }
.nav.dark .nav-cta:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.lang {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.lang button {
  background: none; border: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: inherit;
  padding: 0;
  transition: color 0.2s var(--ease);
}
.lang button.active { color: var(--ink); }
.lang button:hover { color: var(--moss); }
.lang .sep { color: var(--hairline); }

/* Mobile nav burger + drawer */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  margin: -4px -8px -4px 0;
  position: relative;
  background: none; border: none; cursor: pointer;
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  position: absolute;
  left: 10px; right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-burger span:nth-child(1) { top: 18px; }
.nav-burger span:nth-child(2) { top: 25px; }
.nav.dark .nav-burger span { background: var(--paper); }

body.menu-open .nav-burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.menu-open .nav-burger span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 110px var(--gutter) 40px;
  transform: translateY(-100%);
  transition: transform 0.55s var(--ease);
  overflow-y: auto;
}
body.menu-open .nav-drawer { transform: translateY(0); }

.nav-drawer .menu-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav-drawer .menu-list a {
  display: block;
  font-family: var(--serif);
  font-weight: 320;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.05;
  color: var(--ink);
  font-variation-settings: "opsz" 96, "SOFT" 50;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.nav-drawer .menu-list a::before {
  content: attr(data-num);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--moss);
  position: absolute;
  left: 0; top: 18px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.nav-drawer .menu-list a:hover {
  color: var(--moss);
  padding-left: 38px;
}
.nav-drawer .menu-list a:hover::before { opacity: 1; transform: translateX(0); }
.nav-drawer .menu-foot {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-cta { display: none; }
}
@media (max-width: 520px) {
  .lang { display: none; }
}

/* ── FOOTER ──────────────────────────────────────────────────────── */
footer.site-footer {
  padding: 64px var(--gutter) 40px;
  background: var(--ink);
  color: rgba(241, 235, 221, 0.72);
  position: relative;
  overflow: hidden;
}
footer.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nn'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.86 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nn)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.footer-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(241, 235, 221, 0.15);
}
.footer-brand .name {
  font-family: var(--serif);
  font-weight: 380;
  font-size: 22px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--paper);
  font-variation-settings: "opsz" 30, "SOFT" 40;
  margin-bottom: 14px;
}
.footer-brand p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  max-width: 36ch;
  color: rgba(241, 235, 221, 0.68);
  font-variation-settings: "opsz" 18, "SOFT" 80;
}
.footer-brand .signature {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(241, 235, 221, 0.55);
}
.footer-brand .signature::before {
  content: ""; width: 28px; height: 1px; background: rgba(241,235,221,0.3);
}
.footer-col h6 {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(241, 235, 221, 0.45);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col li {
  font-family: var(--sans);
  font-size: 13.5px;
  margin-bottom: 10px;
  color: rgba(241, 235, 221, 0.78);
}
.footer-col a { transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--paper); }

.footer-base {
  position: relative;
  max-width: var(--max);
  margin: 28px auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(241, 235, 221, 0.45);
}
.footer-base a:hover { color: var(--paper); }

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
}

/* ── REVEAL ──────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

.split-line { display: block; overflow: hidden; }
.split-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}
.split-line.in > span { transform: translateY(0); }

/* ── CUSTOM CURSOR ───────────────────────────────────────────────── */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s var(--ease), width 0.35s var(--ease), height 0.35s var(--ease), background 0.35s var(--ease);
  opacity: 0;
}
.cursor-dot { width: 6px; height: 6px; background: var(--ink); }
.cursor-ring { width: 38px; height: 38px; border: 1px solid var(--ink); }
body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring { opacity: 1; }
body.cursor-hover .cursor-ring {
  width: 64px; height: 64px;
  background: var(--moss);
  border-color: var(--moss);
  mix-blend-mode: multiply;
}
body.cursor-hover .cursor-dot { opacity: 0; }

@media (hover: none), (max-width: 820px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ── PAGE TRANSITION ─────────────────────────────────────────────── */
.page-veil {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 100;
  pointer-events: none;
  transform-origin: top;
  transform: scaleY(1);
  transition: transform 0.7s var(--ease-out);
}
body.loaded .page-veil { transform: scaleY(0); transform-origin: bottom; }

/* ── UTILITIES ───────────────────────────────────────────────────── */
.container       { max-width: var(--max);        margin: 0 auto; padding: 0 var(--gutter); }
.container-wide  { max-width: var(--max-wide);   margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow{ max-width: var(--max-narrow); margin: 0 auto; padding: 0 var(--gutter); }
.section         { padding: var(--section-y) var(--gutter); max-width: var(--max); margin: 0 auto; position: relative; }
.section.bleed   { max-width: 100%; padding-left: var(--gutter); padding-right: var(--gutter); }
.spacer-lg       { height: clamp(60px, 10vh, 120px); }
.divider         { height: 1px; background: var(--hairline); width: 100%; margin: clamp(40px,7vh,80px) 0; }
.text-mute       { color: var(--ink-mute); }
.text-moss       { color: var(--moss); }
.no-wrap         { white-space: nowrap; }
