.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out),
    background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 70%, var(--accent)));
  color: var(--accent-text);
  box-shadow: 0 12px 40px rgb(124 107 255 / 0.25);
}

html[data-theme="light"] .btn--primary {
  color: #fff;
  box-shadow: 0 10px 30px rgb(79 70 229 / 0.22);
}

.btn--primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgb(124 107 255 / 0.35);
}

.btn--ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn--ghost:not(:disabled):hover {
  border-color: rgb(124 107 255 / 0.35);
  transform: translateY(-1px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hint {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 42ch;
}

.hero {
  --hero-photo: url("../img/me.jpg");
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding-block: var(--space-16) var(--space-12);
  padding-inline: 11px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background-color: var(--bg);
  background-image: linear-gradient(
      100deg,
      rgb(7 8 13 / 0.94) 0%,
      rgb(7 8 13 / 0.72) 28%,
      rgb(7 8 13 / 0.4) 52%,
      rgb(7 8 13 / 0.82) 100%
    ),
    var(--hero-photo);
  background-size: cover;
  background-position: 82% 18%;
  background-repeat: no-repeat;
}

.hero > * {
  position: relative;
  z-index: 1;
}

html[data-theme="light"] .hero::before {
  background-image: linear-gradient(
      100deg,
      rgb(246 247 251 / 0.96) 0%,
      rgb(246 247 251 / 0.82) 30%,
      rgb(246 247 251 / 0.42) 54%,
      rgb(246 247 251 / 0.88) 100%
    ),
    var(--hero-photo);
}

.hero__grid {
  display: grid;
  gap: var(--space-10);
  align-items: start;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-12);
  }
}

.hero__title {
  font-size: var(--text-5xl);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hero__role {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-2);
}

.hero__tagline {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 52ch;
}

.hero-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 60%;
  background: radial-gradient(circle at 30% 20%, rgb(124 107 255 / 0.22), transparent 60%);
  pointer-events: none;
}

.hero-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-card__metrics {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-4);
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
  border-top: 1px dashed var(--border);
}

.metric strong {
  font-size: var(--text-sm);
}

.prose p + p {
  margin-top: var(--space-4);
}

.prose {
  color: var(--text-muted);
  max-width: 65ch;
}

.skills-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.skill-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-5);
  min-height: 8.5rem;
}

.skill-card h3 {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  color: var(--text);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  color: var(--text-muted);
}

.timeline {
  display: grid;
  gap: var(--space-4);
}

.exp-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-6);
  position: relative;
}

.exp-card__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: baseline;
  justify-content: space-between;
}

.exp-card__role {
  font-size: var(--text-lg);
  font-weight: 600;
}

.exp-card__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.exp-card ul {
  margin-top: var(--space-4);
  color: var(--text-muted);
}

.exp-card li + li {
  margin-top: var(--space-2);
}

.stack-row {
  margin-top: var(--space-4);
}

.contact-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  max-width: 40rem;
  margin-inline: auto;
}

.contact-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-elevated) 55%, color-mix(in srgb, var(--accent) 6%, var(--bg-elevated)) 100%);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.contact-card--primary {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.contact-card--primary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.95;
}

.contact-card__lead {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 32ch;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgb(124 107 255 / 0.35);
}

/* Couleurs de fond par réseau (mêmes id sur index.html et projects.html) */
#contact-mail.social-link {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: rgb(255 255 255 / 0.22);
  color: #f8fafc;
}

#contact-github.social-link {
  background: #1f2328;
  border-color: rgb(255 255 255 / 0.18);
  color: #f0f3f6;
}

#contact-linkedin.social-link {
  background: #0a66c2;
  border-color: rgb(255 255 255 / 0.22);
  color: #ffffff;
}

#contact-portfolio.social-link {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 85%, var(--accent)));
  border-color: rgb(255 255 255 / 0.28);
  color: var(--accent-text);
}

#contact-mail.social-link:hover,
#contact-github.social-link:hover,
#contact-linkedin.social-link:hover,
#contact-portfolio.social-link:hover {
  filter: brightness(1.08);
  border-color: rgb(255 255 255 / 0.42);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.22);
}

.project-grid {
  display: grid;
  gap: var(--space-6);
}

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

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

.project-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgb(124 107 255 / 0.28);
  box-shadow: var(--shadow-md);
}

.project-card__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--surface-2)), var(--surface-2));
  display: grid;
  place-items: center;
  position: relative;
}

.project-card__initials {
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: 0.08em;
  color: rgb(255 255 255 / 0.85);
  text-shadow: 0 8px 30px rgb(0 0 0 / 0.35);
}

.project-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.project-card__title {
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.project-card__summary {
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex: 1;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

.pill-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.pill-link:hover {
  background: rgb(124 107 255 / 0.12);
  border-color: rgb(124 107 255 / 0.35);
}

.pill-link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.project-card__highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.project-card__highlights li {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-left: var(--space-4);
  position: relative;
}

.project-card__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-2);
}

.project-card__metric {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

.page-intro {
  max-width: 60ch;
  color: var(--text-muted);
  margin-top: var(--space-4);
}
