/* ============================================================
   GLOBAL CSS — Solferino Technology
   Design System: Swiss Editorial / Anti-AI-Slop
   Palette: #F9F8F6 · #1A1A1A · #8B1E2F · #8C8A85
   Fonts: Plus Jakarta Sans / Playfair Display
   ============================================================ */

/* --- Custom Properties ---------------------------------------- */
:root {
  --bg:            #F9F8F6;
  --text:          #1A1A1A;
  --accent:        #004aad;
  --muted:         #8C8A85;
  --border:        rgba(26, 26, 26, 0.10);

  --font-sans:     'Plus Jakarta Sans', sans-serif;
  --font-serif:    'Playfair Display', serif;

  --nav-h:         72px;
  --section-pad:   clamp(80px, 10vw, 160px);
  --container-max: 1440px;
  --gutter:        clamp(24px, 5vw, 80px);
}

/* --- Text selection ------------------------------------------ */
::selection {
  background: #1A1A1A;
  color: #F9F8F6;
}

::-moz-selection {
  background: #1A1A1A;
  color: #F9F8F6;
}

/* --- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth; /* GSAP manages smooth scrolling */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* --- Typography Scale ----------------------------------------- */
.t-display {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(3.5rem, 9vw, 10rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
}

.t-headline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.t-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.t-editorial {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: inherit;
  line-height: inherit;
}

.t-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.75;
  color: #3a3a3a;
}

.t-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- Utility -------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.accent { color: var(--accent); }
.muted  { color: var(--muted); }

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

/* hardware-acceleration hint classes */
.gpu { will-change: transform, opacity; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  transition: background 0.45s ease, border-color 0.45s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled,
body.page-project .site-nav {
  background: rgba(249, 248, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

body.page-legal .site-nav {
  background: rgba(22, 22, 22, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(249, 248, 246, 0.08);
}
body.page-legal .site-nav .nav-logo-svg { color: var(--bg); }
body.page-legal .site-nav .logo-mark { color: var(--bg); }
body.page-legal .site-nav .logo-sub { color: rgba(249,248,246,0.45); }
body.page-legal .site-nav .nav-links a { color: rgba(249,248,246,0.75); }
body.page-legal .site-nav .nav-links a:hover { color: var(--bg); }
body.page-legal .site-nav .nav-cta { background: var(--accent) !important; color: var(--bg) !important; border-color: transparent; }
body.page-legal .site-nav .nav-hamburger span { background: var(--bg); }

.nav-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1;
  transition: opacity 0.25s ease;
}

.nav-logo:hover { opacity: 0.75; }

/* SVG icon in nav */
.nav-logo-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--text);
  transition: color 0.25s ease;
}

.nav-logo:hover .nav-logo-svg { color: var(--accent); }

/* Text column */
.nav-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-logo .logo-mark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  color: var(--text);
  transition: color 0.25s ease;
}

.nav-logo:hover .logo-mark { color: var(--accent); }

.nav-logo .logo-sub {
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Dark nav variant (page-home before scroll) */
body.page-home .site-nav:not(.scrolled) .nav-logo-svg {
  color: #F9F8F6; /* currentColor paths = white (explicit, not var(--bg)) */
  --bg: #080808;  /* fill:var(--bg) inner paths = dark chip detail */
}
body.page-home .site-nav:not(.scrolled) .nav-logo .logo-mark { color: var(--bg); }
body.page-home .site-nav:not(.scrolled) .nav-logo .logo-sub { color: rgba(249,248,246,0.45); }
body.page-home .site-nav:not(.scrolled) .nav-links a { color: rgba(249,248,246,0.85); }
body.page-home .site-nav:not(.scrolled) .nav-links a:hover { color: var(--bg); }
body.page-home .site-nav:not(.scrolled) .nav-cta { background: rgba(249,248,246,0.15) !important; color: var(--bg) !important; border: 1px solid rgba(249,248,246,0.3); }
body.page-home .site-nav:not(.scrolled) .nav-cta:hover { background: var(--accent) !important; border-color: var(--accent); }
body.page-home .site-nav:not(.scrolled) .nav-hamburger span { background: var(--bg); }

/* Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.25s;
}

.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover        { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active       { color: var(--accent); }
.nav-links a.active::after{ width: 100%; }

/* CTA pill in nav */
.nav-cta {
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase;
  color: var(--bg) !important;
  background: var(--text);
  padding: 9px 20px !important;
  border-radius: 2px;
  transition: background 0.3s ease !important;
}

.nav-cta:hover  { background: var(--accent) !important; }
.nav-cta::after { display: none !important; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Mobile overlay */
.nav-mobile-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 99;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.nav-mobile-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-mobile-overlay .mobile-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-mobile-overlay .mobile-links a {
  font-weight: 800;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  transition: color 0.2s ease;
}

.nav-mobile-overlay .mobile-links a:hover { color: var(--accent); }
.nav-mobile-overlay .mobile-links a.active { color: var(--accent); }

/* ============================================================
   GLOBAL CTA SECTION
   ============================================================ */
.section-global-cta {
  padding: var(--section-pad) var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.section-global-cta .cta-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: clamp(32px, 5vw, 80px);
}

.section-global-cta .cta-headline {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.8rem, 7.5vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text);
}

.section-global-cta .cta-headline em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.section-global-cta .cta-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  flex-shrink: 0;
  padding-bottom: 8px;
}

.section-global-cta .cta-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 18px 32px;
  border: none;
  border-radius: 2px;
  transition: background 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.btn-primary:hover            { background: var(--text); transform: translateY(-2px); }
.btn-primary .btn-arrow       { display: inline-block; transition: transform 0.3s ease; }
.btn-primary:hover .btn-arrow { transform: translateX(5px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  padding: 16px 30px;
  border: 1.5px solid var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-outline:hover { background: var(--text); color: var(--bg); }

/* ============================================================
   FOOTER — 4-column grid
   ============================================================ */
.site-footer {
  background: var(--text);
  color: var(--bg);
  padding: clamp(56px, 7vw, 100px) var(--gutter) clamp(32px, 4vw, 56px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

/* Brand column */
.footer-logo-svg {
  width: 44px;
  height: 44px;
  color: #F9F8F6; /* tutti i path fill="currentColor" → bianchi sul footer scuro */
  display: block;
  margin-bottom: 14px;
}

.footer-logo-mark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--bg);
  margin-bottom: 4px;
}

.footer-logo-sub {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249,248,246,0.35);
  margin-bottom: 16px;
}

.footer-tagline {
  font-size: 0.8rem;
  line-height: 1.65;
  color: rgba(249,248,246,0.5);
  max-width: 260px;
}

/* Column titles */
.footer-col-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249,248,246,0.35);
  margin-bottom: 18px;
}

/* Nav column */
.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav ul li a {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(249,248,246,0.7);
  transition: color 0.2s ease;
}

.footer-nav ul li a:hover { color: var(--bg); }

/* Contacts column */
.footer-contacts address {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-contacts address a {
  font-size: 0.82rem;
  color: rgba(249,248,246,0.7);
  transition: color 0.2s;
}

.footer-contacts address a:hover { color: var(--bg); }

.footer-contacts address span {
  font-size: 0.75rem;
  color: rgba(249,248,246,0.4);
  line-height: 1.5;
}

/* Legal column */
.footer-legal .copyright {
  font-size: 0.72rem;
  line-height: 1.7;
  color: rgba(249,248,246,0.35);
}

/* ============================================================
   PAGE TRANSITION OVERLAY
   ============================================================ */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

/* Two panels injected by JS */
.pt-panel {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* Panel 1 — dark grey, sits behind */
.pt-panel-1 {
  background: var(--text);
  z-index: 1;
}

/* Panel 2 — accent blue, sits on top */
.pt-panel-2 {
  background: var(--accent);
  z-index: 2;
}

/* ============================================================
   SECTION DIVIDER / COMMON LAYOUT
   ============================================================ */
.section-label-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 64px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Logo + testo nascosti quando il menu burger è aperto */
body.menu-open .nav-logo {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Nav logo più vicino al bordo sinistro su desktop */
@media (min-width: 901px) {
  .site-nav {
    padding-left: clamp(16px, 2vw, 36px);
  }
}

@media (max-width: 900px) {
  .nav-links    { display: none; }
  .nav-hamburger{ display: flex; }

  .section-global-cta .cta-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .section-global-cta .cta-action {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .section-global-cta .cta-label { display: none; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  :root { --gutter: 20px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-brand { grid-column: auto; }
}

