/* ==========================================================================
   GAETANO CATACCHIO — EXECUTIVE STRATEGIC PORTFOLIO (minimal, Google Stitch)
   Palette: Primary #005F73 (teal) / Secondary #94A3B8 (slate) /
            Tertiary #7C4B17 (tan) / Neutral #0F172A (navy)
   ========================================================================== */

:root {
  --neutral: #0F172A;
  --neutral-alt: #131C33;
  --surface: #16213A;
  --border: rgba(148, 163, 184, 0.14);

  --primary: #005F73;
  --primary-light: #4FD1C5;
  --secondary: #94A3B8;
  --tertiary: #7C4B17;
  --tan-light: #C98A3E;

  --text: #F1F5F9;
  --text-dim: #94A3B8;
  /* #64748B era 3.6:1 su --neutral-alt/--surface (sotto WCAG AA 4.5:1).
     #7E8FA6 verificato 4.86-5.13:1 negli stessi contesti. */
  --text-faint: #7E8FA6;

  --font-head: 'Hanken Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

/* --------------------------------------------------------------------
   SCROLL REVEAL (taste-skill review 2026-09-02: motion era 0, aggiunto
   fade+translate leggero via IntersectionObserver, JS in fondo alla pagina).
   Rispetta prefers-reduced-motion: collassa a stato finale statico.
   -------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--neutral);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }

.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

/* taste-skill review 2026-09-02: la mono-eyebrow (.label) sopra OGNI
   sezione era il pattern piu' riconoscibile da "sito fatto con AI" (5
   eyebrow su 5 sezioni). Sostituita da un vero H2 in tutte le sezioni
   tranne "About" (unico punto dove l'eyebrow resta, per continuita' col
   pattern della Hero che non ne ha). Vecchio .label lasciato in CSS: e'
   ancora referenziato da index.html/en.html per la sezione About. */
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------
   NAV
   -------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--primary-light); }

.nav-actions {
  display: flex;
  gap: 1.5rem;
}

.nav-text-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.nav-text-link:hover { color: var(--primary-light); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
}

.lang-sep { color: var(--text-faint); }

.lang-option { color: var(--text-faint); transition: color 0.2s ease; }

.lang-option:hover { color: var(--text-dim); }

.lang-option.active {
  color: var(--primary-light);
  pointer-events: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
}

/* --------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------- */
.hero {
  padding: 4.5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.hero-name {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  margin-bottom: 0.85rem;
}

.hero-role {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--primary-light);
  font-weight: 500;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.hero-quote {
  border-left: 3px solid var(--primary);
  padding-left: 1.1rem;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 640px;
  margin-bottom: 0;
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  flex-shrink: 0;
}

.hero-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 180px;
}

.hero-actions .btn { width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 1.4rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: #00485a; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

/* --------------------------------------------------------------------
   STATS
   -------------------------------------------------------------------- */
.stats { padding: 1rem 0 3rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.1rem;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.accent-teal { color: var(--primary-light); }
.accent-white { color: var(--text); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------
   GENERIC SECTION
   -------------------------------------------------------------------- */
.section {
  padding: 3.25rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}

#experience { padding-bottom: 1.5rem; }
#projects { padding-top: 1.5rem; }

.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
}

.about-text {
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: 720px;
}

/* --------------------------------------------------------------------
   SKILLS ROWS
   taste-skill review 2026-09-02: era una griglia di 6 card identiche,
   stesso "surface + border + radius" gia' usato da stats e projects ->
   3 sezioni con lo stesso linguaggio visivo di fila (Section-Layout-
   Repetition). Sostituita con righe a 2 colonne, hairline invece di
   card, icona come unico accento visivo (nessun nuovo background).
   -------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 2rem;
}

.skill-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.skill-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary-light);
}

.skill-icon svg { width: 19px; height: 19px; }

.skill-row h3 {
  font-size: 0.98rem;
  margin-bottom: 0.3rem;
}

.skill-row p {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------
   EXPERIENCE
   -------------------------------------------------------------------- */
.exp-list {
  display: flex;
  flex-direction: column;
}

.exp-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
}

.exp-item:last-child { border-bottom: none; }

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary-light);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.exp-body h3 { font-size: 1.02rem; margin-bottom: 0.2rem; }

.exp-company {
  color: var(--tan-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.exp-body p {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.exp-details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-light);
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.85rem;
  min-height: 44px;
  border: 1px solid rgba(0, 95, 115, 0.4);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.exp-details summary::-webkit-details-marker { display: none; }

.exp-details summary:hover {
  border-color: var(--primary-light);
  background: rgba(0, 95, 115, 0.12);
}

.exp-details[open] summary::after { content: '−'; margin-left: 0.15rem; }
.exp-details summary::after { content: '+'; margin-left: 0.15rem; }

.exp-bullets {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.exp-bullets li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.exp-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary-light);
}

.exp-bullets strong { color: var(--text); }

.exp-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.exp-stack span {
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--tan-light);
  background: rgba(124, 75, 23, 0.14);
  border: 1px solid rgba(124, 75, 23, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------
   MAIN PROJECTS
   -------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
}

.project-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.9rem;
}

.badge-teal, .badge-grey, .badge-tan {
  background: rgba(0, 95, 115, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(0, 95, 115, 0.4);
}

.project-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.65rem;
  line-height: 1.3;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.76rem;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.project-meta strong { color: var(--text); }

.project-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-light);
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  border: 1px solid rgba(0, 95, 115, 0.4);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.project-details summary::-webkit-details-marker { display: none; }

.project-details p { margin-top: 0.9rem; }

.project-details summary:hover {
  border-color: var(--primary-light);
  background: rgba(0, 95, 115, 0.12);
}

.project-details[open] summary::after { content: '−'; margin-left: 0.15rem; }
.project-details summary::after { content: '+'; margin-left: 0.15rem; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.project-tags span {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

/* --------------------------------------------------------------------
   CERTIFICATIONS & EDUCATION
   -------------------------------------------------------------------- */
.cert-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.cert-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.cert-list li:last-child { border-bottom: none; }

.check {
  color: var(--primary-light);
  font-weight: 700;
  flex-shrink: 0;
  display: inline-flex;
}

.check svg { width: 1rem; height: 1rem; }

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.edu-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.edu-item:last-child { border-bottom: none; padding-bottom: 0; }

.edu-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary-light);
  white-space: nowrap;
  padding-top: 0.15rem;
  flex-shrink: 0;
  min-width: 88px;
}

.edu-item h3 { font-size: 0.92rem; margin-bottom: 0.3rem; }

.edu-school { color: var(--tan-light); font-size: 0.82rem; font-weight: 600; }

.edu-score { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.15rem; }

/* --------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--neutral-alt);
  padding: 2rem 0 1.25rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
}

.footer-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-links a svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.footer-links a:hover { color: var(--primary-light); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------
   MODALS (Contact / CV Download)
   -------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  padding-right: 1.5rem;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-close:hover { color: var(--primary-light); }

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}

.modal-item:hover {
  border-color: var(--primary-light);
}

.modal-item-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.modal-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
}

.modal-item-icon svg { width: 100%; height: 100%; }

.modal-card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-card h3 svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; color: var(--primary-light); }

/* Senza flex:1+min-width:0 il wrapper (label+value) non si restringe mai in un
   flex item, quindi l'ellipsis su .modal-item-value non scattava: il testo
   lungo (es. URL LinkedIn) usciva dai bordi sovrapponendosi al bottone copia. */
.modal-item-text {
  display: block;
  flex: 1;
  min-width: 0;
}

.btn-copy {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--primary-light);
  background: rgba(0, 95, 115, 0.14);
  border: 1px solid rgba(0, 95, 115, 0.4);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: rgba(0, 95, 115, 0.25);
  border-color: var(--primary-light);
}

.btn-copy .icon-copy,
.btn-copy .icon-check {
  width: 1.1rem;
  height: 1.1rem;
}

.btn-copy .icon-check { display: none; }

.btn-copy.copied {
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
}

.btn-copy.copied .icon-copy { display: none; }
.btn-copy.copied .icon-check { display: block; }

.modal-item-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.modal-item-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-download-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-block { width: 100%; }

/* --------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-edu-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }

  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--neutral-alt);
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle { display: flex; }

  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-side { order: -1; }
  .hero-quote { margin-left: auto; margin-right: auto; text-align: left; }
  .hero-actions { flex-direction: row; width: auto; }
  .hero-actions .btn { width: auto; white-space: nowrap; padding-left: 1.1rem; padding-right: 1.1rem; }

  .about-grid { grid-template-columns: 1fr; gap: 1rem; }

  .exp-item { grid-template-columns: 1fr; gap: 0.4rem; }

  .cert-edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
