/* 1. Réglages généraux */
:root {
  --primary: #7357e8;
  --primary-dark: #5840c4;
  --text: #202033;
  --muted: #69697b;
  --background: #ffffff;
  --soft: #f6f4ff;
  --border: #e9e6f3;
  --shadow: 0 12px 30px rgba(40, 30, 80, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.7;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(1100px, 90%);
  margin-inline: auto;
}

/* 2. Accessibilité */
.skip-link {
  position: absolute;
  top: -100px;
  left: 15px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
}

.skip-link:focus {
  top: 15px;
}

/* 3. Navigation */
.header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.navbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary);
}

/* 4. Accueil */
.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 55px;
  padding-block: 85px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: -1.5px;
  max-width: 650px;
}

.hero h1 span {
  color: var(--primary);
}

.hero-text {
  margin-top: 22px;
  color: var(--muted);
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 19px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.footer a:focus-visible {
  outline: 3px solid #b6a7ff;
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(115, 87, 232, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(115, 87, 232, 0.25);
}

.btn-outline {
  border: 1px solid var(--border);
  background: #ffffff;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.location {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  background: linear-gradient(145deg, #f1edff, #fbfaff);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 35px 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.code-icon {
  width: 65px;
  height: 65px;
  border-radius: 18px;
  background: var(--primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.hero-card-label {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.hero-card h2 {
  margin-block: 8px;
  line-height: 1.3;
}

.hero-card > p:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

/* 5. Sections */
.section {
  padding-block: 75px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.25;
  margin-bottom: 20px;
}

.section-text {
  color: var(--muted);
  max-width: 750px;
}

/* 6. Compétences */
.skills-section {
  background: var(--soft);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.skill-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 25px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-card h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.skill-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* 7. Projets */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 35px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 17px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-visual {
  min-height: 150px;
  display: grid;
  place-items: center;
  font-size: 3.5rem;
}

.visual-one {
  background: #fff0df;
}

.visual-two {
  background: #f4e8ff;
}

.visual-three {
  background: #e3f5ef;
}

.project-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.project-type {
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.project-body h3 {
  margin-block: 7px;
}

.project-body > p:not(.project-type):not(.tags) {
  color: var(--muted);
  font-size: 0.92rem;
}

.tags {
  margin-top: 16px;
  margin-bottom: 18px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-body .btn {
  margin-top: auto;
}

/* 8. Contact */
.contact-section {
  background: var(--soft);
  padding-block: 75px;
  text-align: center;
}

.contact-content > p:not(.eyebrow) {
  max-width: 600px;
  margin: 0 auto 25px;
  color: var(--muted);
}

.contact-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.3;
  margin-bottom: 15px;
}

/* 9. Pied de page */
.footer {
  padding-block: 25px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.footer a {
  color: var(--primary);
  font-weight: 700;
}

/* 10. Adaptation aux tablettes et téléphones */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr 0.8fr;
    gap: 30px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .navbar {
    padding-block: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 10px 17px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-block: 55px;
  }

  .hero-card {
    min-height: auto;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 55px;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    gap: 8px 12px;
  }

  .nav-links a {
    font-size: 0.82rem;
  }

  .logo {
    font-size: 1.2rem;
  }
}

/* 11. Respect des préférences de mouvement */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
