/* =========================================
   ENRICO STANCANELLI · PORTFOLIO
   Theme: Dark Clean Minimal
   ========================================= */

/* 1. VARIABLES
   ========================================= */
:root {
  --bg:          #0f1117;
  --surface:     #161a26;
  --card:        #1c2030;
  --accent:      #4a9eff;
  --accent-dim:  rgba(74, 158, 255, 0.12);
  --success:     #3ecf8e;
  --text:        #dde1f0;
  --muted:       #6b728c;
  --border:      #242840;

  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  64px;
  --space-xxl: 96px;

  --font-head: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  --max-width: 1140px;
  --radius:    8px;
  --t:         0.25s ease;
}

/* 2. RESET & BASE
   ========================================= */
*, *::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(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

/* 3. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.5px; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.15rem; }

p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

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

a:hover { color: #82bcff; }

/* 4. NAVBAR
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--space-lg);
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}

.navbar.scrolled {
  background: rgba(15, 17, 23, 0.96);
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  text-decoration: none;
}

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

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: var(--t);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: var(--t);
}

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

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

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--t);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 767px) {
  .hamburger { display: flex; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: var(--t);
  }

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

/* 5. HERO
   ========================================= */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: var(--space-xxl) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  display: block;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero-tagline {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--muted);
  max-width: 520px;
  margin-bottom: var(--space-lg);
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* Hero Timeline */
.hero-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.hero-timeline-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

/* htl = hero timeline */
.htl {
  position: relative;
  padding-left: 24px;
}

.htl::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.htl-item {
  position: relative;
  margin-bottom: var(--space-md);
}

.htl-item:last-child {
  margin-bottom: 0;
}

.htl-dot {
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--muted);
}

.htl-dot--active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.htl-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.htl-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.htl-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.htl-company {
  font-size: 0.8rem;
  color: var(--muted);
}

.htl-tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74, 158, 255, 0.25);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  width: fit-content;
}

.htl-tag--current {
  background: rgba(62, 207, 142, 0.1);
  color: var(--success);
  border-color: rgba(62, 207, 142, 0.25);
}

@media (max-width: 767px) {
  .hero-timeline {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* 6. BUTTONS
   ========================================= */
.btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #82bcff;
  color: #fff;
  transform: translateY(-1px);
}

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

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

/* 7. SECTION LAYOUT
   ========================================= */
section {
  padding: var(--space-xxl) var(--space-lg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: var(--space-xl);
  text-align: center;
  position: relative;
  padding-bottom: var(--space-md);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* 8. ABOUT
   ========================================= */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.05rem;
  text-align: left;
  margin-bottom: var(--space-md);
  line-height: 1.8;
  color: var(--muted);
}

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

.competency-badge {
  background: var(--card);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  transition: var(--t);
}

.competency-badge:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* 9. PROJECTS
   ========================================= */
.projects {
  background: var(--bg);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

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

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

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--t);
  cursor: pointer;
}

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

.project-thumbnail {
  width: 100%;
  height: 150px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.chart-placeholder {
  width: 110px;
  height: 65px;
  color: var(--accent);
}

.chart-placeholder rect {
  fill: var(--accent);
}

.chart-placeholder polyline {
  stroke: var(--accent);
}

.chart-placeholder circle {
  fill: var(--accent);
}

.chart-placeholder line {
  stroke: var(--accent);
}

.project-content {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.project-metrics {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--success);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.5px;
}

.project-description {
  flex-grow: 1;
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

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

.tech-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-mono);
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--t);
}

.project-link:hover {
  gap: 10px;
  color: #82bcff;
}

/* 10. SKILLS
   ========================================= */
.skills {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.skill-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: var(--t);
}

.skill-category:hover {
  border-color: var(--accent);
}

.skill-category h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.skill-list { list-style: none; }

.skill-item { margin-bottom: var(--space-sm); }

.skill-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.skill-name span:first-child { color: var(--muted); }

.skill-name span:last-child {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.skill-bar {
  background: var(--surface);
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0;
  transition: width 1.2s ease;
}

/* 11. CONTACT
   ========================================= */
.contact {
  background: var(--bg);
}

.contact-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-content > p {
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.contact-methods {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: var(--space-md) var(--space-lg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--t);
  min-width: 175px;
  text-decoration: none;
}

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

.contact-icon {
  font-size: 1.6rem;
}

.contact-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.contact-value {
  font-size: 0.82rem;
  color: var(--muted);
}

.contact-value a {
  color: var(--accent);
  font-size: 0.82rem;
}

/* 12. FOOTER
   ========================================= */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-lg);
  text-align: center;
}

footer p {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  transition: var(--t);
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 13. ANIMATIONS
   ========================================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:nth-child(2) { transition-delay: 0.08s; }
.project-card:nth-child(3) { transition-delay: 0.16s; }

/* 14. SCROLL TO TOP
   ========================================= */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: var(--t);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 15. RESPONSIVE
   ========================================= */
@media (max-width: 767px) {
  :root {
    --space-xxl: 64px;
    --space-xl:  40px;
  }

  .hero { min-height: 85vh; }

  .hero-stats { gap: var(--space-lg); }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    text-align: center;
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .contact-methods { flex-direction: column; }
  .contact-item { width: 100%; }
}
