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

:root {
  --bg:        #0a0d12;
  --bg-2:      #0d1117;
  --bg-3:      #161b22;
  --border:    #1a2332;
  --border-2:  #30363d;
  --text:      #c9d1d9;
  --text-muted:#8b949e;
  --accent:    #00ff88;
  --accent-dim:#00ff8820;
  --accent-mid:#00ff8855;
  --blue:      #79c0ff;
  --yellow:    #e3b341;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Syne', sans-serif;
  --radius:    8px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── UTILITIES ───────────────────────────────────────────────────── */
.mono    { font-family: var(--font-mono); }
.muted   { color: var(--text-muted); }
.accent  { color: var(--accent); }

/* ── SCANLINES ───────────────────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.012) 2px,
    rgba(0, 255, 136, 0.012) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ── NAVBAR ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 2rem;
  background: rgba(10, 13, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 2px;
}
.nav-logo .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* ── NAV TERMINAL PILL ───────────────────────────────────────────── */
.nav-terminal {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 4px 12px;
  min-width: 220px;
  max-width: 280px;
  overflow: hidden;
}
.nt-ps { font-size: 11px; flex-shrink: 0; }
.nt-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}
.nt-cursor {
  font-size: 11px;
  color: var(--accent);
  animation: blink 0.9s step-end infinite;
  flex-shrink: 0;
}

/* blog link accent diverso dal resto */
.nav-links .nav-blog { color: var(--accent) !important; opacity: 0.8; }
.nav-links .nav-blog:hover { opacity: 1; }
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.85); }
}

/* ── HERO ────────────────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}
.cursor-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.15} }

.hero-title {
  font-size: 48px;
  font-weight: 300;
  color: #e6edf3;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

/* ── SKILL BARS ──────────────────────────────────────────────────── */
.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.skill-row { display: flex; flex-direction: column; gap: 5px; }
.skill-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.skill-title { font-size: 11px; color: var(--text); letter-spacing: 0.5px; }
.skill-level { font-size: 10px; }

.skill-bar-track {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  width: var(--pct);
  background: var(--accent);
  border-radius: 2px;
  animation: grow 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
/* stagger secondo bar */
.skill-row:nth-child(2) .skill-bar-fill { animation-delay: 0.15s; }
@keyframes grow { from { width: 0 } to { width: var(--pct) } }

/* ── HERO BIO & TAGS ─────────────────────────────────────────────── */
.hero-bio {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 520px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.5rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--bg-2);
  letter-spacing: 0.3px;
}
.tag-active {
  border-color: var(--accent-mid);
  color: var(--accent);
  background: var(--accent-dim);
}

.hero-cta { display: flex; gap: 10px; }

.btn-primary {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-outline {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 20px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-outline:hover { background: var(--accent-dim); }

/* ── TERMINAL CARD ───────────────────────────────────────────────── */
.terminal-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
}
.terminal-bar {
  background: var(--bg-3);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-2);
}
.terminal-dots { display: flex; gap: 5px; align-items: center; }
.tdot { width: 10px; height: 10px; border-radius: 50%; display: block; }
.tdot-r { background: #ff5f57; }
.tdot-y { background: #febc2e; }
.tdot-g { background: #28c840; }
.terminal-title { font-size: 11px; margin-left: 4px; }
.terminal-body { padding: 1rem; line-height: 2; min-height: 160px; }

/* terminal color classes for JS */
.t-green  { color: var(--accent); }
.t-blue   { color: var(--blue); }
.t-yellow { color: var(--yellow); }
.t-gray   { color: var(--text-muted); }
.t-white  { color: var(--text); }
.t-cursor { display: inline-block; animation: blink 0.8s step-end infinite; }

/* ── STATS ROW ───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.stat-box {
  padding: 1.5rem 2rem;
  border-right: 1px solid var(--border);
}
.stat-box:last-child { border-right: none; }
.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }

/* ── SECTIONS ────────────────────────────────────────────────────── */
.section {
  padding: 2.5rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
/* full-width border trick */
.section { max-width: none; }
.section > *:not(.projects-grid):not(.links-grid) { max-width: 1100px; margin-left: auto; margin-right: auto; }
.projects-grid, .links-grid { max-width: 1100px; margin-left: auto; margin-right: auto; }

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
}
.section-title { font-size: 12px; color: var(--text-muted); letter-spacing: 1.5px; white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* ── PROJECT CARDS ───────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.project-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--accent-mid); transform: translateY(-2px); }
.project-card.featured { border-color: #00ff8840; }

.project-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.lang-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-name { font-size: 14px; font-weight: 500; color: #e6edf3; margin-bottom: 6px; }
.project-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; margin-bottom: 1rem; }
.project-footer { display: flex; gap: 5px; flex-wrap: wrap; }
.badge {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  color: var(--text-muted);
}

/* ── LINKS GRID ──────────────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.2s, color 0.2s;
}
.link-card:hover { border-color: var(--accent-mid); color: var(--accent); }
.link-icon {
  width: 30px; height: 30px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.link-label { flex: 1; font-size: 12px; }
.link-arrow { font-size: 12px; opacity: 0; transition: opacity 0.2s; }
.link-card:hover .link-arrow { opacity: 1; }

/* ── STATUS BAR ──────────────────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.5rem 2rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  font-size: 11px;
  flex-wrap: wrap;
}
.status-item { display: flex; align-items: center; gap: 6px; }
.status-right { margin-left: auto; }
.dot-green {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-title { font-size: 36px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-box:nth-child(2) { border-right: none; }
  .stat-box:nth-child(3), .stat-box:nth-child(4) { border-top: 1px solid var(--border); }
  .nav-links { display: none; }
  .status-right { display: none; }
}
