/* ═══════════════════════════════════════════════════
   PORTFOLIO — Design System
   ═══════════════════════════════════════════════════ */

:root {
  --bg:          #f8fafc;
  --bg-surface:  #ffffff;
  --bg-alt:      #f1f5f9;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;
  --border:      #e2e8f0;
  --accent:      #6366f1;
  --accent-light:#eef2ff;
  --nav-h:       60px;
  --radius:      14px;
  --shadow:      0 4px 24px rgba(0,0,0,.07);
  --transition:  200ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ═══════════ NAV ═══════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 99px;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--bg-alt); color: var(--text); }
.nav-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* ═══════════ SECTIONS ═══════════ */
.section {
  min-height: calc(100vh - var(--nav-h));
  padding: 64px 24px;
}
.section--alt { background: var(--bg-alt); }
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: 8px;
  color: var(--text);
}
.section-sub {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 48px;
}

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

/* ═══════════ CARD ═══════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

/* image */
.card-img-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-alt);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.card:hover .card-img { transform: scale(1.03); }

.card-img-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--c) 12%, white);
  color: var(--c);
  font-weight: 700;
  font-size: .95rem;
}
.card-img-placeholder span:first-child { font-size: 2.5rem; }

/* body */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.card-desc {
  font-size: .825rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* stack button */
.stack-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  width: fit-content;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.stack-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.stack-btn[aria-expanded="true"] { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.stack-chevron {
  width: 14px; height: 14px;
  transition: transform var(--transition);
}
.stack-btn[aria-expanded="true"] .stack-chevron { transform: rotate(180deg); }

/* stack panel */
.stack-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition);
  overflow: hidden;
}
.stack-panel.open { grid-template-rows: 1fr; }
.stack-panel > div { overflow: hidden; padding-top: 2px; }

/* ═══════════ TAGS ═══════════ */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: .02em;
}
.tag--html     { background: #fff4ec; color: #e44d26; }
.tag--css      { background: #eef6ff; color: #2965f1; }
.tag--js       { background: #fefce8; color: #b45309; }
.tag--ts       { background: #eff6ff; color: #1d4ed8; }
.tag--react    { background: #ecfeff; color: #0891b2; }
.tag--vite     { background: #f5f3ff; color: #7c3aed; }
.tag--php      { background: #f0f0ff; color: #6366f1; }
.tag--symfony  { background: #f0fdf4; color: #15803d; }
.tag--laravel  { background: #fff1f2; color: #e11d48; }
.tag--postgres { background: #eff6ff; color: #1e40af; }
.tag--mysql    { background: #fff7ed; color: #c2410c; }
.tag--docker   { background: #eff6ff; color: #2563eb; }
.tag--nginx    { background: #f0fdf4; color: #16a34a; }
.tag--railway  { background: #faf5ff; color: #9333ea; }
.tag--ovh      { background: #fff0f0; color: #c0392b; }

/* ═══════════ PROFIL ═══════════ */
.section-inner--profil {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}
.profil-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid var(--accent);
}
.profil-content { flex: 1; }
.profil-bio {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 600px;
}
.profil-skills-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 640px) {
  .section { padding: 40px 16px; }
  .section-title { font-size: 1.5rem; }
  .section-inner--profil { flex-direction: column; gap: 24px; }
  .projects-grid { grid-template-columns: 1fr; }
}
