/* ============================================
   Giampaolo Tranchida — Personal Landing Page
   ============================================ */

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --green: #4ade80;
  --radius: 12px;
  --max-w: 900px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Language toggle ---- */
.lang-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.lang-bar .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.lang-btn.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

.lang-sep {
  color: var(--border);
  font-size: 0.8rem;
}

/* ---- Header / Hero ---- */
.hero {
  padding: 100px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 20% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 500px 350px at 80% 10%, rgba(79, 140, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 50% 100%, rgba(123, 97, 255, 0.05) 0%, transparent 60%);
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, #7b61ff 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.15);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero .title {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.hero .location {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero .location::before {
  content: '📍 ';
}

/* ---- Tagline ---- */
.tagline {
  max-width: 650px;
  margin: 0 auto 40px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---- Buttons ---- */
.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

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

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

/* ---- Sections ---- */
section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Skills (grouped) ---- */
.skill-group {
  margin-bottom: 24px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

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

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

.timeline-item {
  position: relative;
  margin-bottom: 36px;
  padding-left: 20px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

/* Current job — green dot + subtle glow */
.timeline-item.current::before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.timeline-item .role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-item .company {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline-item .period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-item .description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  list-style: none;
  padding: 0;
}

.timeline-item .description li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
}

.timeline-item .description li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.timeline-item .description li:last-child {
  margin-bottom: 0;
}

/* ---- Open Source ---- */
.oss-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.oss-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.oss-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #7b61ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  flex-shrink: 0;
}

.oss-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.oss-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.oss-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.oss-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.oss-btn {
  font-size: 0.85rem;
  padding: 8px 18px;
}

.oss-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Education ---- */
.edu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

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

.edu-item .school {
  font-weight: 600;
  font-size: 1rem;
}

.edu-item .degree {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

footer a:hover {
  text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero {
    padding: 50px 0 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-avatar {
    width: 90px;
    height: 90px;
    font-size: 36px;
  }

  section {
    padding: 40px 0;
  }

  .container {
    padding: 0 16px;
  }
}
