/* ==========================================================================
   PERSONAL PORTFOLIO — FILIPPO XAUSA
   Clean, Minimal, Modern & Highly Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   PALETTE COLORI (Facilmente modificabile)
   Per cambiare il colore di base, basta modificare questi valori HEX:
   - Sfondo beige caldo: #fbf9f5
   - Accento caldo (terracotta): #c46830
   -------------------------------------------------------------------------- */
:root {
  /* Modalità Chiara (Default Warm Beige) */
  --bg-body: #fbf9f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f5f0e6;
  --bg-hover: #ece5d8;
  
  --border-color: #e5ded3;
  --border-subtle: #efeae1;
  --border-focus: #c46830;

  --text-primary: #23201b;
  --text-secondary: #595349;
  --text-muted: #857e72;

  --accent: #c46830;
  --accent-hover: #a65422;
  --accent-subtle: #faeee4;
  --accent-text: #ffffff;

  --badge-bg: #efe8db;
  --badge-text: #484136;

  --card-shadow: 0 4px 20px -2px rgba(40, 30, 15, 0.05), 0 2px 6px -1px rgba(40, 30, 15, 0.03);
  --card-shadow-hover: 0 10px 25px -4px rgba(40, 30, 15, 0.09), 0 4px 10px -2px rgba(40, 30, 15, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --header-height: 70px;
  --container-max-width: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Modalità Scura (Dark Mode Elegante e Caldo) */
[data-theme="dark"] {
  --bg-body: #141312;
  --bg-surface: #1d1b18;
  --bg-subtle: #262420;
  --bg-hover: #312e29;

  --border-color: #38342e;
  --border-subtle: #2a2722;
  --border-focus: #e07f45;

  --text-primary: #f2eee8;
  --text-secondary: #b5afa4;
  --text-muted: #807a70;

  --accent: #e07f45;
  --accent-hover: #f1955f;
  --accent-subtle: #2f1d12;
  --accent-text: #141312;

  --badge-bg: #2d2a25;
  --badge-text: #dfd8cd;

  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --card-shadow-hover: 0 10px 25px -4px rgba(0, 0, 0, 0.65);
}

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

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: rgba(251, 249, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .site-header {
  background-color: rgba(20, 19, 18, 0.88);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-moon { display: block; }
.icon-sun { display: none; }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Section Common Styles */
.section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 2.75rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  max-width: 650px;
}

/* ==========================================================================
   1. HERO / ABOUT SECTION
   ========================================================================== */
.hero-section {
  padding-top: 4rem;
  padding-bottom: 4.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3.5rem;
  align-items: center;
}

.hero-greeting {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.hero-headline {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

.hero-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hero-quick-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.fact-item {
  display: flex;
  flex-direction: column;
}

.fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.fact-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-avatar-card {
  position: relative;
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 2px solid var(--border-color);
  background-color: var(--bg-surface);
  aspect-ratio: 1 / 1;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2. ISTRUZIONE (EDUCATION) & 3. ESPERIENZE (EXPERIENCE)
   Clean Timeline Layout
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timeline-item {
  position: relative;
  padding: 1.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-org {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.15rem;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.timeline-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.timeline-list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.timeline-list li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   4. PROGETTI (PROJECTS)
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.project-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-img {
  transform: scale(1.02);
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.project-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  flex: 1;
}

.project-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.project-highlights li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.project-highlights li::before {
  content: "•";
  position: absolute;
  left: 0.15rem;
  color: var(--accent);
  font-weight: 800;
}

.project-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   5. RISULTATI & ATTIVITÀ EXTRA (ACHIEVEMENTS)
   ========================================================================== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.achievement-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.achievement-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.achievement-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achievement-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.achievement-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background-color: var(--accent-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.achievement-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.achievement-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.achievement-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.achievement-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.achievement-points li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.achievement-points li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.15rem;
}

/* ==========================================================================
   6. COMPETENZE (SKILLS & INTERESTS)
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.skill-category-card {
  padding: 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.skill-category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--bg-surface);
}

/* Extra Skills Row: Languages and Interests */
.skills-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.languages-box, .interests-box {
  padding: 1.5rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.extra-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.language-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.language-name {
  font-weight: 600;
  color: var(--text-primary);
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-tag {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   7. CONTATTI & FOOTER
   ========================================================================== */
.footer-section {
  padding-top: 4.5rem;
  padding-bottom: 3.5rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.contact-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 3.5rem;
}

.contact-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.contact-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2rem auto;
}

.contact-links-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
}

.contact-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.contact-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.rpi-badge span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
}

