/* ===========================
   GPZ Software — style.css
   =========================== */

:root {
  --blue: #2B6CB0;
  --blue-dark: #1e4e8c;
  --blue-light: #4299e1;
  --orange: #ED8936;
  --orange-lt: #f6ad55;
  --dark: #1A202C;
  --dark-2: #2D3748;
  --mid: #4A5568;
  --light: #718096;
  --bg: #F7FAFC;
  --bg-alt: #EDF2F7;
  --white: #ffffff;
  --border: #E2E8F0;
  --footer-bg: var(--bg-alt);
  --footer-color: var(--light);
  --footer-border: var(--border);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius: 12px;
  --shadow: 0 4px 24px rgba(43, 108, 176, 0.10);
  --shadow-h: 0 8px 40px rgba(43, 108, 176, 0.18);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   NAV
   =========================== */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#nav.scrolled {
  background: rgba(247, 250, 252, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 20px rgba(43, 108, 176, 0.10);
  padding: 10px 0;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  transition: color 0.3s;
  flex-shrink: 0;
}

#nav.scrolled .nav-logo {
  color: var(--blue);
}

.nav-logo span {
  display: none;
}

@media (min-width: 480px) {
  .nav-logo span {
    display: inline;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: flex-end;
  margin-right: 4px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  transition: color 0.2s;
}

#nav.scrolled .nav-links a {
  color: var(--mid);
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--orange) !important;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--orange) !important;
  color: var(--white) !important;
  padding: 8px 22px;
  border-radius: 50px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s !important;
}

.nav-cta:hover {
  background: var(--blue-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(43, 108, 176, 0.35) !important;
}

.nav-cta::after {
  display: none !important;
}

/* === Nav controls (lang + theme toggle) === */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* === Language toggle === */
.lang-toggle {
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 50px;
  height: 36px;
  padding: 0 13px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.80);
  transition: border-color 0.25s, background 0.25s, color 0.25s;
  font-family: var(--font-body);
  line-height: 1;
}

#nav.scrolled .lang-toggle {
  border-color: var(--border);
  color: var(--mid);
}

.lang-toggle:hover {
  background: rgba(237, 137, 54, 0.15);
  border-color: var(--orange);
  color: var(--orange);
}

/* === Mobile hamburger === */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  order: 10; /* sempre ultimo nel flex row su mobile */
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

#nav.scrolled .nav-toggle span {
  background: var(--dark);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  /* Logo prende tutto lo spazio disponibile, spinge controls e toggle a destra */
  .nav-logo {
    flex: 1;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(247, 250, 252, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 0;
    padding: 12px 0 24px;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.3s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    flex: none;
    justify-content: flex-start;
    margin-right: 0;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-links a {
    display: block;
    padding: 13px 28px;
    font-size: 1rem;
    color: var(--mid) !important;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-cta {
    margin: 10px 28px 0;
    display: block;
    text-align: center;
    border-radius: var(--radius);
  }
}

/* ===========================
   HERO
   =========================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 130px 0 90px;
  background: linear-gradient(140deg, #0d2d5e 0%, #1e4e8c 40%, #2B6CB0 75%, #2d7dc7 100%);
}

.hero-bg-geo {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 15% 85%, rgba(237, 137, 54, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 15%, rgba(255, 255, 255, 0.06) 0%, transparent 45%),
    repeating-linear-gradient(-45deg, transparent, transparent 80px,
      rgba(255, 255, 255, 0.015) 80px, rgba(255, 255, 255, 0.015) 81px);
}

.hero-watermark {
  position: absolute;
  right: -40px;
  bottom: -60px;
  font-family: var(--font-display);
  font-size: clamp(200px, 30vw, 380px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 44px;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .hero-inner {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 64px;
  }
}

.hero-logo {
  flex-shrink: 0;
  max-width: min(460px, 100%);
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.35));
}

.hero-logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.logo-svg-fallback {
  width: 220px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav logo */
.nav-logo img {
  height: 38px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.hero-text {
  flex: 1;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-lt);
  margin-bottom: 14px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.0;
  color: #ffffff;
  margin-bottom: 18px;
}

.name-accent {
  color: var(--orange);
}

.hero-role {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.80);
  margin-bottom: 20px;
  line-height: 1.65;
}

.hero-role em {
  color: var(--orange-lt);
  font-style: normal;
  font-weight: 300;
}

.hero-tagline {
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.62);
  max-width: 520px;
  line-height: 1.85;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-actions {
    justify-content: flex-start;
  }
}

.btn-primary {
  background: var(--orange);
  color: #ffffff;
  padding: 14px 34px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 20px rgba(237, 137, 54, 0.40);
}

.btn-primary:hover {
  background: var(--orange-lt);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(237, 137, 54, 0.50);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  transition: background 0.25s, transform 0.25s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-chevron {
  width: 18px;
  height: 18px;
  border-right: 2px solid rgba(255, 255, 255, 0.35);
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }

  50% {
    transform: rotate(45deg) translateY(6px);
  }
}

/* ===========================
   SECTIONS (shared)
   =========================== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--dark);
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 18px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
}

/* Screen-reader only (SEO h1) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   REVEAL ANIMATION
   =========================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal {
  opacity: 0;
}

.reveal.visible {
  animation: fadeUp 0.55s var(--ease) forwards;
}

.reveal-left.visible {
  animation: fadeLeft 0.55s var(--ease) forwards;
}

/* ===========================
   COMPETENZE GRID
   =========================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 580px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.skill-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--blue);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    border-top-color 0.28s;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-h);
  border-top-color: var(--orange);
}

.skill-icon {
  width: 52px;
  height: 52px;
  background: rgba(43, 108, 176, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--blue);
  flex-shrink: 0;
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--blue);
  margin-bottom: 18px;
  font-weight: 600;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.pill {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--dark-2);
  font-size: 0.79rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.skill-card:hover .pill {
  background: #e2ecf8;
  border-color: #b8d0ee;
}

.skill-note {
  font-size: 0.81rem;
  color: var(--light);
  line-height: 1.55;
  font-style: italic;
}

/* ===========================
   TIMELINE
   =========================== */
.timeline {
  position: relative;
  padding-left: 44px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue) 0%, var(--border) 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 44px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--blue);
  transition: border-color 0.2s;
}

.timeline-item.current .timeline-marker {
  background: var(--orange);
  border-color: var(--orange);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.22);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(237, 137, 54, 0.08);
  }
}

.timeline-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: transform 0.28s var(--ease), box-shadow 0.28s, border-left-color 0.28s;
}

.timeline-item.current .timeline-content {
  border-left-color: var(--orange);
}

.timeline-content:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-h);
}

.timeline-period {
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 7px;
}

.timeline-company {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 10px;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--light);
  line-height: 1.72;
}

/* ===========================
   SOFT SKILLS
   =========================== */
.soft-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 640px) {
  .soft-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.soft-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 26px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.28s var(--ease), box-shadow 0.28s;
}

.soft-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-h);
}

.soft-icon {
  width: 52px;
  height: 52px;
  background: rgba(43, 108, 176, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--blue);
}

.soft-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--dark);
  margin-bottom: 12px;
  font-weight: 600;
}

.soft-card p {
  font-size: 0.88rem;
  color: var(--light);
  line-height: 1.72;
}

/* ===========================
   FORMAZIONE
   =========================== */
.formation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 640px) {
  .formation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.formation-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  transition: transform 0.28s var(--ease), box-shadow 0.28s;
}

.formation-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-h);
}

.formation-icon {
  width: 52px;
  height: 52px;
  background: rgba(43, 108, 176, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--blue);
}

.formation-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--blue);
  margin-bottom: 18px;
  font-weight: 600;
}

.formation-school {
  font-weight: 600;
  color: var(--dark);
  font-size: 1rem;
  margin-bottom: 4px;
}

.formation-degree {
  color: var(--mid);
  font-size: 0.93rem;
  margin-bottom: 4px;
}

.formation-subjects {
  font-size: 0.83rem;
  color: var(--light);
  font-style: italic;
}

.lang-item {
  margin-bottom: 20px;
}

.lang-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 7px;
}

.lang-native {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: white;
  font-size: 0.77rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 50px;
}

.lang-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.lang-row {
  display: grid;
  grid-template-columns: 70px 1fr 82px;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--mid);
}

.lang-bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--blue), var(--blue-light));
  border-radius: 3px;
}

.lang-label {
  font-size: 0.77rem;
  color: var(--light);
  text-align: right;
}

/* ===========================
   CONTATTI
   =========================== */
.contact-section {
  background: #1A202C;
}

.contact-section .section-label {
  color: var(--orange-lt);
}

.contact-section .section-header h2 {
  color: #ffffff;
}

.contact-section .section-header h2::after {
  background: var(--orange);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 580px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.contact-card {
  display: block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 34px 22px;
  text-align: center;
  transition: background 0.28s, border-color 0.28s, transform 0.28s, box-shadow 0.28s;
}

.contact-card:not(.no-link):hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--orange);
  transform: translateY(-5px);
  box-shadow: 0 8px 32px rgba(237, 137, 54, 0.18);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: rgba(237, 137, 54, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--orange-lt);
}

.contact-label {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 8px;
  font-weight: 600;
}

.contact-value {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.93rem;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: var(--footer-bg);
  padding: 22px 0;
  text-align: center;
  font-size: 0.79rem;
  color: var(--footer-color);
  border-top: 1px solid var(--footer-border);
}

/* ===========================
   THEME TOGGLE BUTTON
   =========================== */
.theme-toggle {
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.80);
  transition: border-color 0.25s, background 0.25s, color 0.25s;
  flex-shrink: 0;
}

#nav.scrolled .theme-toggle {
  border-color: var(--border);
  color: var(--mid);
}

.theme-toggle:hover {
  background: rgba(237, 137, 54, 0.15);
  border-color: var(--orange);
  color: var(--orange);
}

/* ===========================
   ICON VISIBILITY — 3 temi
   light → moon (next: dark)
   dark  → contrast (next: contrast)
   contrast → sun (next: light)
   =========================== */
.icon-sun      { display: none; }
.icon-moon     { display: none; }
.icon-contrast { display: none; }

html[data-theme="light"]    .icon-moon     { display: block; }
html[data-theme="dark"]     .icon-contrast { display: block; }
html[data-theme="contrast"] .icon-sun      { display: block; }

/* Fallback: se nessun tema è impostato, mostra contrast (come dark) */
:root:not([data-theme]) .icon-contrast { display: block; }

/* ===========================
   LIGHT MODE (esplicito)
   Ripete le variabili :root per
   sovrascrivere dark/contrast
   =========================== */
html[data-theme="light"] {
  --bg: #F7FAFC;
  --bg-alt: #EDF2F7;
  --white: #ffffff;
  --dark: #1A202C;
  --dark-2: #2D3748;
  --mid: #4A5568;
  --light: #718096;
  --border: #E2E8F0;
  --footer-bg: #EDF2F7;
  --footer-color: #4A5568;
  --footer-border: #E2E8F0;
  --shadow: 0 4px 24px rgba(43, 108, 176, 0.10);
  --shadow-h: 0 8px 40px rgba(43, 108, 176, 0.18);
}

/* Nav light: sfondo colorato al scroll */
html[data-theme="light"] #nav.scrolled {
  background: var(--blue-light);
  box-shadow: 0 2px 20px rgba(237, 137, 54, 0.28);
}

html[data-theme="light"] #nav.scrolled .nav-logo,
html[data-theme="light"] #nav.scrolled .nav-links a,
html[data-theme="light"] #nav.scrolled .theme-toggle,
html[data-theme="light"] #nav.scrolled .lang-toggle {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] #nav.scrolled .nav-toggle span {
  background: #ffffff;
}

html[data-theme="light"] #nav.scrolled .theme-toggle,
html[data-theme="light"] #nav.scrolled .lang-toggle {
  border-color: rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] #nav.scrolled .nav-links a:hover,
html[data-theme="light"] #nav.scrolled .nav-links a.active {
  color: #ffffff !important;
}

html[data-theme="light"] #nav.scrolled .nav-links a::after {
  background: #ffffff;
}

@media (max-width: 768px) {
  html[data-theme="light"] .nav-links {
    background: rgba(66, 153, 225, 0.98);
  }

  html[data-theme="light"] .nav-links a {
    color: #ffffff !important;
  }
}

/* Contatti — light */
html[data-theme="light"] .contact-section {
  background: var(--bg-alt);
}

html[data-theme="light"] .contact-section .section-label {
  color: var(--orange);
}

html[data-theme="light"] .contact-section .section-header h2 {
  color: var(--dark);
}

html[data-theme="light"] .contact-card {
  background: var(--white);
  border: 1px solid var(--border);
}

html[data-theme="light"] .contact-card:not(.no-link):hover {
  background: #ffffff;
  border-color: var(--orange);
  box-shadow: 0 8px 32px rgba(237, 137, 54, 0.16);
}

html[data-theme="light"] .contact-label {
  color: var(--light);
}

html[data-theme="light"] .contact-value {
  color: var(--dark);
}

/* ===========================
   ALTO CONTRASTO
   =========================== */
html[data-theme="contrast"] {
  --bg: #ffffff;
  --bg-alt: #f0f0f0;
  --white: #ffffff;
  --dark: #000000;
  --dark-2: #111111;
  --mid: #000000;
  --light: #222222;
  --blue: #0000bb;
  --blue-dark: #000088;
  --blue-light: #0000bb;
  --orange: #a03800;
  --orange-lt: #c04400;
  --border: #000000;
  --shadow: none;
  --shadow-h: none;
}

/* Rimuove animazioni per accessibilità */
html[data-theme="contrast"] *,
html[data-theme="contrast"] *::before,
html[data-theme="contrast"] *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

html[data-theme="contrast"] .hero {
  background: #000044;
}

html[data-theme="contrast"] .hero-bg-geo,
html[data-theme="contrast"] .hero-watermark {
  display: none;
}

html[data-theme="contrast"] #nav.scrolled {
  background: #000000;
  border-bottom: 3px solid #ffffff;
  box-shadow: none;
}

html[data-theme="contrast"] #nav.scrolled .nav-links a {
  color: #ffffff !important;
}

html[data-theme="contrast"] #nav.scrolled .nav-logo {
  color: #ffffff;
}

html[data-theme="contrast"] #nav.scrolled .nav-toggle span {
  background: #ffffff;
}

html[data-theme="contrast"] .theme-toggle,
html[data-theme="contrast"] .lang-toggle,
html[data-theme="contrast"] #nav.scrolled .theme-toggle,
html[data-theme="contrast"] #nav.scrolled .lang-toggle {
  border-color: #ffffff;
  color: #ffffff;
}

html[data-theme="contrast"] .skill-card,
html[data-theme="contrast"] .soft-card,
html[data-theme="contrast"] .formation-card,
html[data-theme="contrast"] .timeline-content {
  border: 2px solid #000000;
  box-shadow: none;
}

html[data-theme="contrast"] .skill-card:hover,
html[data-theme="contrast"] .soft-card:hover,
html[data-theme="contrast"] .formation-card:hover,
html[data-theme="contrast"] .timeline-content:hover {
  transform: none;
  box-shadow: none;
}

html[data-theme="contrast"] .pill {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

html[data-theme="contrast"] .skill-card:hover .pill {
  background: #000000;
}

html[data-theme="contrast"] .timeline::before {
  background: #000000;
}

html[data-theme="contrast"] .timeline-marker {
  border-color: #000000;
}

html[data-theme="contrast"] .timeline-item.current .timeline-marker {
  background: #000000;
  border-color: #000000;
  box-shadow: none;
  animation: none;
}

html[data-theme="contrast"] .contact-section {
  background: #000000;
}

html[data-theme="contrast"] .contact-card {
  border-color: rgba(255, 255, 255, 0.6);
}

html[data-theme="contrast"] .footer {
  background: #000000;
  color: #ffffff;
  border-top: 2px solid #ffffff;
}

html[data-theme="contrast"] .lang-bar {
  background: #cccccc;
}

html[data-theme="contrast"] .lang-bar-fill {
  background: #000000;
}

html[data-theme="contrast"] .section-header h2::after {
  background: #000000;
}

html[data-theme="contrast"] .contact-section .section-header h2::after {
  background: #ffffff;
}

html[data-theme="contrast"] *:focus-visible {
  outline: 4px solid #000000;
  outline-offset: 3px;
}

/* ===========================
   DARK MODE
   =========================== */
html[data-theme="dark"] {
  --bg: #0c1a2e;
  --bg-alt: #1c3d6d;
  --white: #1c3d6d;
  --dark: #e2e8f0;
  --dark-2: #cbd5e0;
  --mid: #a0aec0;
  --light: #94a3b8; /* migliorato da #718096 per contrasto WCAG */
  --border: #2a4560;
  --footer-bg: #1c3d6d;
  --footer-color: #94a3b8;
  --footer-border: #2a4560;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-h: 0 8px 40px rgba(0, 0, 0, 0.65);
}

html[data-theme="dark"] #nav.scrolled {
  background: rgba(12, 26, 46, 0.96);
}

html[data-theme="dark"] #nav.scrolled .nav-logo {
  color: var(--blue-light);
}

html[data-theme="dark"] #nav.scrolled .nav-links a {
  color: var(--mid);
}

html[data-theme="dark"] #nav.scrolled .lang-toggle {
  border-color: var(--border);
  color: var(--mid);
}

html[data-theme="dark"] .nav-toggle span {
  background: var(--white);
}

html[data-theme="dark"] #nav.scrolled .nav-toggle span {
  background: var(--dark);
}

html[data-theme="dark"] .pill {
  background: #1a3550;
  border-color: var(--border);
  color: var(--dark-2);
}

html[data-theme="dark"] .skill-card:hover .pill {
  background: #1e3f5e;
  border-color: #3a6080;
}

html[data-theme="dark"] .lang-bar {
  background: #1a3550;
}

html[data-theme="dark"] .section-header h2 {
  color: var(--dark);
}

html[data-theme="dark"] .timeline-marker {
  background: var(--white);
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* ===========================
   ACCESSIBILITÀ — prefers-reduced-motion
   =========================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Rende visibili subito gli elementi reveal (gestito anche in JS) */
  .reveal {
    opacity: 1 !important;
  }

  .scroll-chevron {
    animation: none !important;
  }

  .timeline-item.current .timeline-marker {
    animation: none !important;
  }
}

/* ===========================
   PRINT
   =========================== */
@media print {

  #nav,
  .hero-scroll,
  .hero-actions,
  .hero-watermark {
    display: none !important;
  }

  .hero {
    background: none !important;
    padding: 20px 0;
    min-height: auto;
  }

  .hero-name,
  .hero-role,
  .hero-tagline,
  .hero-eyebrow {
    color: var(--dark) !important;
  }

  .section,
  .section-alt {
    padding: 28px 0;
    background: none !important;
  }

  .skill-card,
  .timeline-content,
  .soft-card,
  .formation-card {
    box-shadow: none !important;
    border: 1px solid var(--border);
    break-inside: avoid;
  }

  .reveal {
    opacity: 1 !important;
    animation: none !important;
  }

  .contact-section {
    background: none !important;
  }

  .contact-section .section-header h2,
  .contact-value {
    color: var(--dark) !important;
  }

  .contact-card {
    background: none !important;
    border: 1px solid var(--border) !important;
    color: var(--dark) !important;
  }

  .contact-label {
    color: var(--light) !important;
  }
}
