:root {
  --gold: #d4a843;
  --navy-dark: #070f28;
  --navy: #0c1a3d;
  --cream: #f8f5ee;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background-color: var(--cream);
  color: #1a1a1a;
  overflow-x: hidden;
}

/* ——— NAVBAR ——— */
#navbar {
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
#navbar.scrolled {
  background: rgba(7, 15, 40, 0.97) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}

/* ——— NAV DROPDOWN ——— */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 280px;
  background: rgba(7, 15, 40, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212,168,67,0.18);
  border-radius: 2px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  padding: 0.5rem 0;
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-family: 'Raleway', sans-serif;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.nav-dropdown-menu a:hover {
  background: rgba(212,168,67,0.06);
  color: var(--gold);
  border-left-color: var(--gold);
  padding-left: 1.5rem;
}
.nav-dropdown-menu a .item-sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  letter-spacing: 0.06em;
}

/* ——— HERO ——— */
.hero-bg {
  background-image: url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
  position: relative;
}
@media (max-width: 768px) {
  .hero-bg { background-attachment: scroll; }
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(4, 9, 26, 0.88) 0%,
    rgba(7, 15, 40, 0.82) 50%,
    rgba(12, 26, 61, 0.75) 100%
  );
}
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--cream));
}
.hero-bg-service {
  min-height: 60vh;
}
.hero-bg-service::after { height: 80px; }

/* Gold accent line */
.gold-line {
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.gold-line-center {
  display: block;
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto;
}

/* ——— SECTION TITLES ——— */
.section-label {
  font-family: 'Raleway', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  line-height: 1.15;
}

/* ——— HERO TEXT ANIMATION ——— */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-hero-1 { animation: fadeSlideUp 0.9s ease forwards; animation-delay: 0.2s; opacity: 0; }
.animate-hero-2 { animation: fadeSlideUp 0.9s ease forwards; animation-delay: 0.5s; opacity: 0; }
.animate-hero-3 { animation: fadeSlideUp 0.9s ease forwards; animation-delay: 0.8s; opacity: 0; }
.animate-hero-4 { animation: fadeSlideUp 0.9s ease forwards; animation-delay: 1.1s; opacity: 0; }

/* ——— COMPETENCE CARDS ——— */
.comp-card {
  background: white;
  border-top: 3px solid transparent;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.3s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.comp-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 20px 48px rgba(0,0,0,0.14), 0 0 0 1px rgba(212,168,67,0.15);
  border-top-color: var(--gold);
}
.comp-card-featured {
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0c1a3d 100%);
  border-top: 3px solid var(--gold);
  color: white;
}
.comp-card-featured:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 24px 60px rgba(4,9,26,0.4), 0 0 0 1px rgba(212,168,67,0.2);
}
.comp-card-featured-2 {
  background: linear-gradient(135deg, #4a0e1a 0%, var(--navy-dark) 100%);
  border-top: 3px solid #e07070;
  color: white;
}
.comp-card-featured-2:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 24px 60px rgba(74,14,26,0.4), 0 0 0 1px rgba(224,112,112,0.2);
}

/* ——— SCROLL REVEAL ——— */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ——— TIMELINE ANIMATION ——— */
.timeline-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}
.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item.visible .timeline-dot {
  animation: dotPulse 0.6s ease forwards;
}
@keyframes dotPulse {
  0%   { transform: scale(0); box-shadow: 0 0 0 0 rgba(212,168,67,0.6); }
  60%  { transform: scale(1.4); box-shadow: 0 0 0 6px rgba(212,168,67,0); }
  100% { transform: scale(1);  box-shadow: 0 0 0 0 rgba(212,168,67,0); }
}

/* ——— STAT COUNTER ——— */
.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  transition: transform 0.3s ease;
}
.stat-item:hover .stat-number {
  transform: scale(1.08);
}

/* ——— SECTION TITLE UNDERLINE ANIM ——— */
.gold-line-anim {
  display: block;
  height: 2px;
  background: var(--gold);
  margin: 0 auto;
  width: 0;
  transition: width 0.8s ease;
}
.gold-line-anim.visible {
  width: 60px;
}

/* ——— PUB ITEM HOVER ——— */
.pub-item {
  border-left: 2px solid var(--gold);
  padding-left: 1.5rem;
  transition: border-left-width 0.2s ease, background 0.3s ease, transform 0.3s ease;
  border-radius: 0 4px 4px 0;
}
.pub-item:hover {
  border-left-width: 4px;
  background: rgba(212,168,67,0.04);
  transform: translateX(4px);
}
a.pub-item { display: block; text-decoration: none; color: inherit; position: relative; }
a.pub-item:hover h3 { color: var(--gold); }
a.pub-item .pub-external {
  position: absolute;
  top: 0.9rem;
  right: 0.25rem;
  opacity: 0;
  color: var(--gold);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
a.pub-item:hover .pub-external { opacity: 1; transform: translateX(2px); }

/* ——— ATTESTATO ——— */
.attestato-frame {
  border: 1px solid rgba(212,168,67,0.3);
  box-shadow: 0 8px 40px rgba(0,0,0,0.15), inset 0 0 0 4px rgba(212,168,67,0.1);
  position: relative;
}
.attestato-frame::before,
.attestato-frame::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--gold);
  border-style: solid;
}
.attestato-frame::before {
  top: 8px; left: 8px;
  border-width: 1px 0 0 1px;
}
.attestato-frame::after {
  bottom: 8px; right: 8px;
  border-width: 0 1px 1px 0;
}

/* ——— FORM ——— */
.form-input {
  background: white;
  border: 1px solid #e0d8c8;
  border-radius: 2px;
  padding: 0.875rem 1rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.875rem;
  color: #1a1a1a;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}
.form-input::placeholder { color: #9a8f7e; }

/* ——— BUTTON ——— */
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8902f 100%);
  color: var(--navy-dark);
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.875rem 2.5rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,168,67,0.35);
}
.btn-outline {
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  padding: 0.75rem 2rem;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--navy-dark);
}

/* ——— BADGE ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 2px;
}
.badge-gold {
  background: rgba(212,168,67,0.15);
  color: var(--gold);
  border: 1px solid rgba(212,168,67,0.3);
}
.badge-red {
  background: rgba(224,112,112,0.15);
  color: #e07070;
  border: 1px solid rgba(224,112,112,0.3);
}

/* ——— BREADCRUMB ——— */
.breadcrumb {
  background: rgba(7, 15, 40, 0.04);
  border-bottom: 1px solid rgba(212,168,67,0.15);
}
.breadcrumb a {
  color: #6b5f4e;
  transition: color 0.2s ease;
}
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: #c0b59f; margin: 0 0.5rem; }
.breadcrumb .current { color: #1a1a1a; font-weight: 500; }

/* ——— STEP NUMBER (processo) ——— */
.step-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
  min-width: 64px;
}

/* ——— FILTER PILLS (pubblicazioni) ——— */
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5f4e;
  background: white;
  border: 1px solid #e0d8c8;
  border-radius: 2px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.filter-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,168,67,0.04);
}

/* ——— PUB PREVIEW CARDS (home) ——— */
.pub-preview-card:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 10px 30px rgba(4,9,26,0.08);
  transform: translateY(-4px);
}

/* ——— SCROLLBAR ——— */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ——— DECORATIVE PATTERN ——— */
.pattern-bg {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(212,168,67,0.08) 1px, transparent 0);
  background-size: 32px 32px;
}

/* ——— MOBILE NAV ——— */
#mobile-menu {
  display: none;
}
#mobile-menu.open {
  display: flex;
}

/* ——— FORM SUCCESS ——— */
#form-success {
  display: none;
}

/* hover on cta */
.cta-hero:hover {
  background: rgba(212,168,67,0.1);
  border-color: #e9c46a;
}

/* section dark bg */
.section-dark {
  background: linear-gradient(160deg, var(--navy-dark) 0%, #0c1a3d 100%);
}

/* ——— REDUCED MOTION ——— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .reveal-left, .reveal-scale, .timeline-item { opacity: 1; transform: none; }
  .animate-hero-1, .animate-hero-2, .animate-hero-3, .animate-hero-4 { opacity: 1; }
  .hero-bg { background-attachment: scroll; }
}
