/* ─────────────────────────────────────────────────────────────────────────────
   Design tokens
───────────────────────────────────────────────────────────────────────────── */
:root {
  --color-bg:          #f9fafb;
  --color-bg-alt:      #ffffff;
  --color-bg-dark:     #0f172a;
  --color-surface:     #ffffff;
  --color-border:      #e5e7eb;

  --color-text:        #111827;
  --color-text-muted:  #6b7280;
  --color-text-light:  #f1f5f9;

  --color-primary:     #2563eb;
  --color-primary-hov: #1d4ed8;
  --color-accent:      #0ea5e9;

  --radius-sm:  6px;
  --radius-md:  12px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-hov: 0 8px 30px rgba(0,0,0,.12);

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --nav-h:      64px;
  --container:  1040px;
  --section-v:  60px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Dark mode overrides
───────────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:          #0f172a;
  --color-bg-alt:      #1e293b;
  --color-surface:     #1e293b;
  --color-border:      #334155;
  --color-text:        #f1f5f9;
  --color-text-muted:  #94a3b8;
  --color-text-light:  #f1f5f9;
  --color-primary:     #60a5fa;
  --color-primary-hov: #93c5fd;
  --color-accent:      #38bdf8;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4), 0 1px 4px rgba(0,0,0,.2);
  --shadow-hov: 0 8px 30px rgba(0,0,0,.5);
}

[data-theme="dark"] #navbar {
  background: rgba(15,23,42,.88);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  background: rgba(96,165,250,.12);
}

[data-theme="dark"] .hero {
  background: var(--color-bg);
}

[data-theme="dark"] .skill-chip {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

[data-theme="dark"] .skill-chip:hover {
  background: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .tag {
  background: rgba(96,165,250,.15);
  color: #93c5fd;
  border-color: rgba(96,165,250,.25);
}

[data-theme="dark"] .img-placeholder {
  background: #1e293b;
  border-color: #334155;
  color: #475569;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Theme toggle button
───────────────────────────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.theme-toggle:hover {
  color: var(--color-primary);
  background: #eff6ff;
}
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(96,165,250,.12);
}
.theme-toggle svg { pointer-events: none; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ─────────────────────────────────────────────────────────────────────────────
   Reset & base
───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a     { color: inherit; text-decoration: none; }
ul    { list-style: none; }
img   { display: block; max-width: 100%; }

/* ─────────────────────────────────────────────────────────────────────────────
   Layout helpers
───────────────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Navigation
───────────────────────────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow .2s;
}
#navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--color-primary);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav-links a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
  background: #eff6ff;
}

/* ── Nav social icons ────────────────────────────────────────────────────── */
.nav-social {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: color .15s, background .15s;
}
.nav-social-link:hover { color: var(--color-primary); background: #eff6ff; }

/* ── Hamburger (animated) ─────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transform-origin: center;
  transition: transform .3s ease, opacity .2s ease, width .3s ease;
}
.nav-toggle span:nth-child(1) { width: 24px; }
.nav-toggle span:nth-child(2) { width: 18px; }
.nav-toggle span:nth-child(3) { width: 24px; }
/* Open state — morph to × */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 24px; }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 24px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Hero
───────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-bg-accent {
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.07) 0%, transparent 68%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 24px;
  width: 100%;
}

.hero-content { flex: 1; max-width: 580px; }

.hero-eyebrow {
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.hero-name {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.0;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 22px;
}

.hero-bio {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Profile photo — portrait shape ─────────────────────────────────────────── */
.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo-ring {
  width: 240px;
  /* 3:4 portrait ratio */
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background: var(--color-border);
  padding: 0;
  position: relative;
  box-shadow: var(--shadow-md);
}

.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  object-position: top center;
  background: #e5e7eb;
  position: relative;
  z-index: 1;
  display: block;
}

/* Fallback initials when photo is missing */
.hero-photo-ring.no-photo {
  background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-accent) 100%);
}
.hero-photo-initials {
  position: absolute;
  inset: 4px;
  border-radius: 15px;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -2px;
  z-index: 0;
}
.hero-photo[src]:not([src=""]) ~ .hero-photo-initials { display: none; }

/* ─────────────────────────────────────────────────────────────────────────────
   Buttons
───────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  transition: all .15s;
  cursor: pointer;
}
.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hov); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-outline  { border: 2px solid var(--color-border); color: var(--color-text); background: transparent; }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-1px); }
.btn-social   { border: 2px solid var(--color-border); color: var(--color-text); background: transparent; }
.btn-social:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────────────────────────
   Sections
───────────────────────────────────────────────────────────────────────────── */
.section     { padding-block: var(--section-v); background: var(--color-bg); }
.section-alt { background: var(--color-bg-alt); }
.section-dark{ background: var(--color-bg-dark); }

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 28px;    /* used when there's no subtitle */
}
.section-title.light { color: #fff; }

.section-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: -20px;      /* pulls closer to title */
  margin-bottom: 36px;
}
.section-subtitle.light { color: #94a3b8; }

.subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Cards
───────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hov); transform: translateY(-2px); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Badges
───────────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary   { background: #dbeafe; color: var(--color-primary); }
.badge-secondary { background: #f0fdf4; color: #16a34a; }

/* ─────────────────────────────────────────────────────────────────────────────
   Tags
───────────────────────────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag  {
  display: inline-block;
  padding: 3px 10px;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Item typography
───────────────────────────────────────────────────────────────────────────── */
.item-title       { font-size: 1.02rem; font-weight: 600; margin-bottom: 2px; }
.item-org         { font-size: .875rem; color: var(--color-primary); font-weight: 500; }
.item-meta        { font-size: .8rem; color: var(--color-text-muted); margin-bottom: 10px; }
.item-description { font-size: .9rem; color: var(--color-text-muted); line-height: 1.68; }
.item-date        { font-size: .78rem; font-family: var(--font-mono); color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Timeline
───────────────────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-border));
  border-radius: 2px;
}

.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -26px; top: 22px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-primary);
  z-index: 1;
}
.section-alt .timeline-marker { border-color: var(--color-bg-alt); }
.marker-secondary { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }

.timeline-content { flex: 1; }

/* ── Company block (multiple roles) ──────────────────────────────────────── */
.company-block {
  padding: 0;
  overflow: hidden;
}

.company-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(37,99,235,.05);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

[data-theme="dark"] .company-header {
  background: rgba(96,165,250,.07);
}

.company-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.role-item {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}
.role-item:last-child { border-bottom: none; }

.role-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.role-title {
  font-size: .95rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Skills
───────────────────────────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.skill-card  { display: flex; flex-direction: column; gap: 14px; }
.skill-category {
  font-size: .9rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-chip {
  display: inline-block;
  padding: 5px 12px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.skill-chip:hover {
  background: #e5e7eb;
  color: var(--color-text);
}

/* ── Languages — CEFR ────────────────────────────────────────────────────── */
.language-grid { display: flex; flex-direction: column; gap: 10px; }

.language-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.language-flag { font-size: 1.25rem; flex-shrink: 0; }
/* When language-info wrapper is used (Italian with subtitle) */
.language-info { flex: 1; display: flex; flex-direction: column; }
/* When language-name is a direct child (no subtitle) */
.language-item > .language-name { flex: 1; }
.language-name { font-size: .875rem; font-weight: 600; line-height: 1.2; }
.language-sub  { font-size: .72rem; color: var(--color-text-muted); }

/* CEFR level badges */
.lang-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.lang-a1 { background: #f1f5f9; color: #64748b; }
.lang-a2 { background: #f1f5f9; color: #64748b; }
.lang-b1 { background: #fef9c3; color: #a16207; }
.lang-b2 { background: #fef3c7; color: #b45309; }
.lang-c1 { background: #dcfce7; color: #16a34a; }
.lang-c2 { background: #dbeafe; color: #1d4ed8; }

.cefr-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.cefr-label {
  font-size: .7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-right: 4px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Projects
───────────────────────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  position: relative;
}

/* Stretched link — makes the whole card clickable via the title <a> */
.project-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}
.project-links,
.project-links a {
  position: relative;
  z-index: 1;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.project-icon  { font-size: 1.8rem; }
.project-title { font-size: 1.05rem; font-weight: 700; }

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--color-text-muted);
}
.project-date { font-family: var(--font-mono); font-weight: 500; }
.project-context::before { content: '·'; margin-right: 8px; }

.project-description {
  font-size: .9rem;
  color: var(--color-text-muted);
  line-height: 1.72;
  flex: 1;
}

.project-links { display: flex; gap: 10px; }
.icon-link {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  transition: color .15s;
}
.icon-link:hover { color: var(--color-primary); }

/* ── Task list inside experience roles ───────────────────────────────────── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 10px;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--color-border);
}
.task-item:last-child { border-bottom: none; }

.task-desc {
  font-size: .875rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.task-item .tags { margin-top: 0; }

/* ─────────────────────────────────────────────────────────────────────────────
   Certifications
───────────────────────────────────────────────────────────────────────────── */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.cert-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cert-header { display: flex; align-items: center; }

.cert-body { flex: 1; }
.cert-title  { font-size: .95rem; font-weight: 700; margin-bottom: 3px; }
.cert-issuer { font-size: .78rem; color: var(--color-primary); font-weight: 500; margin-bottom: 8px; }
.cert-desc   { font-size: .83rem; color: var(--color-text-muted); line-height: 1.6; }

.cert-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.cert-badge-aws { background: #fff7e6; color: #c05621; border: 1px solid #fbd38d; }
.cert-badge-k8s { background: #ebf4ff; color: #326ce5; border: 1px solid #bee3f8; }

/* ── Verify / diploma links ─────────────────────────────────────────────── */
.verify-link {
  display: inline-block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-top: 6px;
  align-self: flex-start;
}
.verify-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────────────
   Publications block (inside Projects section)
───────────────────────────────────────────────────────────────────────────── */
.publications-block {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}
.publications-block .subsection-title { margin-bottom: 16px; }

.publication-card { display: flex; flex-direction: column; gap: 6px; }
.publication-authors { font-size: .8rem; color: var(--color-text-muted); }
.publication-title   { font-size: .95rem; font-weight: 600; line-height: 1.45; }
.publication-venue   { font-size: .78rem; color: var(--color-text-muted); font-style: italic; }
.publication-abstract{ font-size: .85rem; color: var(--color-text-muted); line-height: 1.65; margin-top: 6px; }
.publication-link    { font-size: .82rem; color: var(--color-primary); font-weight: 500; margin-top: 4px; align-self: flex-start; }
.publication-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────────────
   Hobbies
───────────────────────────────────────────────────────────────────────────── */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.hobby-card { display: flex; flex-direction: column; gap: 12px; }

.hobby-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.hobby-icon  { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.hobby-title { font-size: .98rem; font-weight: 600; margin-bottom: 2px; }
.hobby-org   { font-size: .8rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────────────────────────────────────
   Project detail pages
───────────────────────────────────────────────────────────────────────────── */
.project-page-hero {
  padding-top: calc(var(--nav-h) + 52px);
  padding-bottom: 44px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  transition: color .15s;
}
.project-back:hover { color: var(--color-primary); }

.project-page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 12px;
}

.project-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

.project-page-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.project-content {
  max-width: 800px;
  margin-inline: auto;
  padding-block: 56px;
}

.project-section {
  margin-bottom: 52px;
}

.project-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.project-section p {
  font-size: .95rem;
  color: var(--color-text-muted);
  line-height: 1.78;
  margin-bottom: 12px;
}

.project-section ul {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: .85rem;
  margin-block: 20px;
}

.img-placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-block: 20px;
}

@media (max-width: 600px) {
  .img-placeholder-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────────────────────────── */
footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding-block: 20px;
  text-align: center;
  font-size: .78rem;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive — tablet
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-photo-ring { width: 200px; }
  .two-col-grid    { grid-template-columns: 1fr; gap: 32px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive — mobile
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --section-v: 44px; }

  /* Nav social — keep visible but tighter */
  .nav-social { gap: 2px; }

  /* Nav */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px 16px;
    box-shadow: var(--shadow-md);
    /* Slide down animation */
    animation: slideDown .25s ease;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-links a { padding: 10px 12px; font-size: .9rem; }
  .nav-toggle  { display: flex; }

  /* Hero */
  .hero-inner {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    padding-top: 32px;
    padding-bottom: 16px;
    gap: 28px;
  }
  .hero-actions { justify-content: center; }
  .hero-photo-ring { width: 134px; }
  .hero-name { letter-spacing: -1px; }

  /* Skills */
  .skill-item { grid-template-columns: 1fr; gap: 4px; }

  /* Cards */
  .card-header { flex-direction: column; }
  .card-header-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .certs-grid { grid-template-columns: 1fr; }
  .hobbies-grid { grid-template-columns: 1fr; }
  .hero-photo-ring { width: 100px; }
  .nav-social { display: none; }
}
