/* styles.css */
/* ==========================================================================
   Base, couleurs & typographie
   ========================================================================== */
:root {
  --bg: #0F1115;
  --surface: #12151c;
  --surface-2: #171a22;
  --text: #E6EAF2;
  --muted: #A8B0C2;
  --primary: #4F8DF7;
  /* bleu accent */
  --success: #7AE0B8;
  /* vert accent */
  --outline: 1px solid rgba(255, 255, 255, .06);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, .25);
  --focus: 0 0 0 3px rgba(79, 141, 247, .35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: #fff;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

/* Accessibilité */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: .5rem .75rem;
  background: var(--primary);
  color: #0b1020;
  border-radius: .5rem;
  z-index: 9999;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, black 15%);
  backdrop-filter: blur(8px);
  border-bottom: var(--outline);
}

.nav-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .9rem 0;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: #0b1020;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: var(--shadow-soft);
}

/* Burger (checkbox hack) */
.nav-toggle {
  display: none;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  place-items: center;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  width: 22px;
  background: #ccd5ee;
  margin: 5px auto;
  transition: transform .3s, opacity .3s;
}

.site-nav ul {
  display: flex;
  gap: .6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: .4rem .8rem;
  border-radius: 999px;
  line-height: 1.2;
  transition: background .2s, transform .15s;
}

.site-nav a:hover {
  background: #1a1f2a;
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.1rem;
  border-radius: 12px;
  background: #1a2130;
  border: var(--outline);
  transition: transform .15s, box-shadow .2s, background .2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-outline {
  background: transparent;
  border: 1px solid #2a3142;
}

.btn-accent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 85%, #ffffff 0%), color-mix(in srgb, var(--success) 75%, #ffffff 0%));
  color: #0b1020;
  border: none;
  font-weight: 600;
}

.btn-accent:hover {
  filter: brightness(1.05);
}

/* Mobile nav */
@media (max-width: 860px) {
  .burger {
    display: grid;
  }

  .site-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: color-mix(in srgb, var(--bg) 94%, black 6%);
    border-bottom: var(--outline);
    transform: translateY(-120%);
    transition: transform .25s ease;
  }

  .site-nav ul {
    flex-direction: column;
    gap: .2rem;
    padding: .6rem;
  }

  .site-nav a {
    padding: .9rem 1rem;
    border-radius: 10px;
  }

  .nav-toggle:checked~.site-nav {
    transform: translateY(0);
  }

  /* X animation */
  .nav-toggle:checked+.burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked+.burger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked+.burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(79, 141, 247, .15), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(122, 224, 184, .14), transparent 50%);
}

.hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.1fr .9fr;
}

.kicker {
  color: var(--success);
  font-weight: 600;
  letter-spacing: .4px;
  margin: 0 0 .3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: .1rem 0 .2rem;
  line-height: 1.15;
}

.baseline {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #d7def2;
  margin: 0 0 .8rem;
}

.hero-text {
  color: var(--muted);
  max-width: 60ch;
}

.hero-cta {
  display: flex;
  gap: .8rem;
  margin: 1.1rem 0;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  gap: .6rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.hero-meta li {
  padding: .35rem .7rem;
  border: 1px solid #2a3346;
  border-radius: 999px;
  color: #c8d2eb;
  font-size: .92rem;
}

.hero-card .card {
  padding: 1.2rem 1.2rem;
}

.card {
  background: var(--surface);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  transition: transform .15s ease, border-color .2s, background .2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-gradient {
  background:
    linear-gradient(180deg, rgba(79, 141, 247, .12), rgba(0, 0, 0, 0) 40%),
    var(--surface);
}

.stack {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .6rem;
}

.stack .dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: .5rem;
  background: radial-gradient(circle at 30% 30%, var(--success), var(--primary));
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Sections génériques
   ========================================================================== */
.section {
  padding: clamp(2.2rem, 5vw, 4rem) 0;
}

.section.alt {
  background: var(--surface-2);
  border-block: var(--outline);
}

.section-title {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin: 0 0 .4rem;
}

.section-subtitle {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

/* Grilles */
.cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.cards-grid>.skill {
  grid-column: span 4;
}

@media (max-width: 980px) {
  .cards-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .cards-grid>.skill {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Cartes de compétence */
.skill {
  padding: 1.1rem 1.1rem;
}

.skill .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 141, 247, .18), rgba(122, 224, 184, .18));
  color: #dce8ff;
  margin-bottom: .6rem;
  border: 1px solid #23304a;
}

.skill h3 {
  margin: .2rem 0 .4rem;
}

.skill p {
  color: var(--muted);
  margin: 0 0 .7rem;
}

.tags {
  display: flex;
  gap: .4rem;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}

.tags li {
  font-size: .85rem;
  color: #cbd7f5;
  padding: .3rem .6rem;
  border: 1px solid #2b3550;
  border-radius: 999px;
}

/* Projets */
.projects-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.project {
  grid-column: span 4;
  padding: 1.1rem 1.1rem;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .4rem;
}

.badge {
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  border: 1px solid #2a3654;
  color: #cfe0ff;
  background: #151b27;
}

.bullets {
  padding-left: 1.1rem;
  margin: .6rem 0 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .project {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .project {
    grid-column: span 12;
  }
}

/* Témoignages */
.testimonials {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.testimonial {
  grid-column: span 6;
  margin: 0;
  background: linear-gradient(180deg, rgba(122, 224, 184, .1), rgba(0, 0, 0, 0)), var(--surface);
  border: var(--outline);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.testimonial blockquote {
  margin: 0;
  font-size: 1.05rem;
  color: #eaf1ff;
}

.testimonial figcaption {
  margin-top: .6rem;
  color: #b7c1da;
  font-style: italic;
}

@media (max-width: 860px) {
  .testimonial {
    grid-column: span 12;
  }
}

/* À propos */
.about-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
}

.about-media {
  min-height: 220px;
  border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at -10% -10%, rgba(79, 141, 247, .18), transparent 55%),
    radial-gradient(600px 300px at 110% 110%, rgba(122, 224, 184, .18), transparent 60%),
    var(--surface);
  border: var(--outline);
  display: grid;
  place-items: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: #0b1020;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.about-list {
  margin: .8rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr .9fr;
  align-items: start;
}

.contact-form {
  padding: 1.1rem;
}

.field {
  display: grid;
  gap: .4rem;
  margin-bottom: .8rem;
}

label {
  font-weight: 600;
}

input,
textarea {
  background: #0d1118;
  color: var(--text);
  border: 1px solid #293243;
  border-radius: 12px;
  padding: .75rem .9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .05s;
}

input:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, #fff 0%);
  box-shadow: var(--focus);
}

.form-help {
  color: var(--muted);
  font-size: .9rem;
  margin: .6rem 0 0;
}

.contact-aside h3 {
  margin-top: 0;
}

.socials {
  list-style: none;
  padding: 0;
  margin: .4rem 0 1rem;
  display: grid;
  gap: .5rem;
}

.socials a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  border-radius: 12px;
  border: 1px solid #263149;
  background: #121827;
  transition: transform .12s, background .2s, border-color .2s;
}

.socials a:hover {
  transform: translateY(-1px);
  border-color: #344366;
}

.contact-note {
  color: var(--muted);
}

@media (max-width: 980px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 1.2rem 0;
  border-top: var(--outline);
  background: #0e1117;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.to-top {
  padding: .45rem .7rem;
  border-radius: 10px;
  border: 1px solid #24304a;
  background: #141a26;
}

.to-top:hover {
  background: #101522;
}

/* ==========================================================================
   Micro-interactions & Animations
   ========================================================================== */
/* Apparition douce au chargement */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy,
.hero-card .card,
.skill,
.project,
.testimonial,
.about-grid>*,
.contact-form,
.contact-aside {
  animation: fadeUp .6s ease both;
}

.skill:nth-child(odd) {
  animation-delay: .05s;
}

.project:nth-child(2) {
  animation-delay: .05s;
}

.testimonial:nth-child(2) {
  animation-delay: .06s;
}

/* Focus visible pour accessibilité */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* Sélection de texte améliorée */
::selection {
  background: color-mix(in srgb, var(--primary) 60%, var(--success) 40%);
  color: #0b1020;
}

/* Impressions (Nginx statique prêt) */
@media print {

  .site-header,
  .to-top,
  .burger,
  .nav-toggle {
    display: none !important;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .testimonial {
    border: 1px solid #999;
    box-shadow: none;
  }
}