/* ============================================
   GABRIELE MOTTOLA – Light Modern Design
   Blue/Azure palette
   ============================================ */

:root {
  /* Colors – Light & Blue */
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f6ff;
  --bg-accent-soft: #e8f0fe;
  --border-light: #dde4ef;
  --border-hover: #b0c4e8;

  --text-primary: #1a1f2e;
  --text-secondary: #4a5568;
  --text-muted: #8895a7;

  --accent-1: #2563eb;
  /* blue */
  --accent-2: #3b82f6;
  /* lighter blue */
  --accent-3: #60a5fa;
  /* azure */
  --accent-gradient: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa);
  --accent-gradient-h: linear-gradient(90deg, #2563eb, #3b82f6);

  --success: #16a34a;
  --danger: #dc2626;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 4px 20px rgba(37, 99, 235, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;

  /* Layout */
  --container-max: 1200px;
  --navbar-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-2);
}

::selection {
  background: var(--accent-2);
  color: #fff;
}

/* ========================
   CONTAINER
   ======================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ========================
   NAVBAR
   ======================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: -0.02em;
}

.navbar-brand:hover {
  color: var(--accent-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-1);
  border-radius: 1px;
  transition: width var(--transition-base);
}

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

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

/* Mobile toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

/* ========================
   HERO
   ======================== */
.hero {
  padding: calc(var(--navbar-height) + var(--space-4xl)) var(--space-lg) var(--space-4xl);
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  text-align: justify;
}

.hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-accent-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--accent-1);
  font-weight: 500;
}

/* ========================
   SECTIONS
   ======================== */
.section {
  padding: var(--space-4xl) 0;
}

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

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3xl);
  letter-spacing: -0.02em;
}

.section-title .accent {
  color: var(--accent-1);
}

/* ========================
   CARD
   ======================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

/* ========================
   FEATURES (Home)
   ======================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-md);
  transition: transform var(--transition-base);
}

.feature-card:hover .icon {
  transform: scale(1.1);
}

.feature-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  text-align: justify;
}

/* ========================
   TIMELINE (CV)
   ======================== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-1), var(--accent-3), var(--border-light));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-2xl);
  padding-left: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-1);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.timeline-item .period {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-1);
  background: var(--bg-accent-soft);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xs);
}

.timeline-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-item .org {
  color: var(--text-secondary);
  font-size: 0.86rem;
  margin-bottom: var(--space-sm);
}

.timeline-item p,
.timeline-item ul {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.7;
}

.timeline-item ul {
  list-style: none;
  padding: 0;
}

.timeline-item ul li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 3px;
}

.timeline-item ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.timeline-sub-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-1);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

/* ========================
   SKILLS
   ======================== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--bg-accent-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
  transform: translateY(-1px);
}

/* ========================
   CV GRID
   ======================== */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.cv-block h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Certifications */
.cert-list {
  list-style: none;
  padding: 0;
}

.cert-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cert-list li:last-child {
  border-bottom: none;
}

.cert-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

/* Language bars */
.lang-item {
  margin-bottom: var(--space-md);
}

.lang-item .lang-name {
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  display: flex;
  justify-content: space-between;
}

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

.lang-bar-fill {
  height: 100%;
  background: var(--accent-gradient-h);
  border-radius: var(--radius-full);
}

/* DigComp */
.digcomp-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.digcomp-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 200px;
}

.digcomp-bar {
  flex: 1;
  height: 7px;
  background: var(--bg-accent-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.digcomp-bar-fill {
  height: 100%;
  background: var(--accent-gradient-h);
  border-radius: var(--radius-full);
}

.digcomp-level {
  font-size: 0.78rem;
  color: var(--accent-1);
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

/* ========================
   CONTACTS
   ======================== */
.contacts-section {
  padding: calc(var(--navbar-height) + var(--space-4xl)) 0 var(--space-4xl);
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
}

.contact-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.contact-card .contact-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.contact-card h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.contact-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.contact-card a {
  font-weight: 500;
}

/* ========================
   PROJECTS
   ======================== */
.projects-section {
  padding: calc(var(--navbar-height) + var(--space-4xl)) 0 var(--space-4xl);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.project-card {
  padding: var(--space-2xl);
}

.project-card .project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-1);
  background: var(--bg-accent-soft);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.project-card .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-lg);
}

.project-card .tech-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-1);
  transition: gap var(--transition-fast);
}

.project-link:hover {
  gap: 10px;
}

/* ========================
   PRIVACY
   ======================== */
.privacy-content {
  max-width: 960px;
  margin: 0 auto;
}

.privacy-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.privacy-content h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--accent-1);
}

.privacy-content p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  text-align: justify;
}

.privacy-content ul {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.privacy-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* ========================
   BIO
   ======================== */
.bio-section {
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 var(--space-2xl);
  text-align: center;
}

.bio-section h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.03em;
}

.bio-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
  text-align: justify;
}

.bio-section .bio-text {
  max-width: 960px;
  margin: 0 auto;
}

.project-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  text-align: justify;
}

.section-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 960px;
  margin: 0 auto var(--space-2xl);
  text-align: justify;
}

/* ========================
   FOOTER
   ======================== */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
  background: var(--bg-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent-1);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    border-bottom: 1px solid var(--border-light);
  }

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

  .features-grid,
  .cv-grid,
  .cv-two-col,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .digcomp-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .digcomp-label {
    min-width: auto;
  }

  .digcomp-bar {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

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

  .timeline {
    padding-left: 22px;
  }

  .timeline-item::before {
    left: -27px;
    width: 8px;
    height: 8px;
  }
}

/* ========================
   TWO-COLUMN CV LAYOUT
   ======================== */
.cv-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-3xl);
  align-items: start;
}

.cv-two-col>div+div {
  border-left: 1px solid var(--border-light);
  padding-left: var(--space-3xl);
}

.cv-col-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2xl);
  color: var(--text-primary);
}

.cv-col-title .accent {
  color: var(--accent-1);
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) {
  animation-delay: 0.1s;
}

.animate-in:nth-child(2) {
  animation-delay: 0.2s;
}

.animate-in:nth-child(3) {
  animation-delay: 0.3s;
}