/* =========================================================
   1. VARIABLES & THEME
   ========================================================= */
:root {
  --bg: #0f1717;
  --bg-alt: #121d1d;
  --text: #ffffff;
  --muted: #cdd3d3;
  /* en dark: turquoise plus clair pour meilleur contraste */
  --accent: #14A0A5;
  --radius: 1.25rem;
  --avatar-border: var(--bg);
}

/* thème clair (basculé en JS) */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f3f5f5;
  --text: #0f1717;
  --muted: #4e5b5b;
  /* en light: on garde ton turquoise d'origine */
  --accent: #0E7478;
  --avatar-border: #fff;
}

/* =========================================================
   2. RESET DE BASE
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding-top: 70px;
}

/* =========================================================
   3. HEADER / TOPBAR
   ========================================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 23, 23, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* header en thème clair */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
}

/* logo AnnieCode */
.brand {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  gap: 0.15rem;
  align-items: center;
}
.brand-accent {
  color: var(--accent);
}
.brand-main {
  color: var(--text);
}

/* nav centrale */
.main-nav {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

/* liens nav */
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(14, 116, 120, 0.25);
}
/* en thème clair on force la visibilité */
[data-theme="light"] .nav-link {
  color: #0f1717;
}
[data-theme="light"] .nav-link.active,
[data-theme="light"] .nav-link:hover {
  background: var(--accent);
  color: #fff;
}

/* actions à droite (langue, thème, burger) */
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* boutons du header (turquoise) */
.lang-btn,
.theme-btn,
.burger {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
  transition: transform 0.1s ease-out;
}
.lang-btn:hover,
.theme-btn:hover,
.burger:hover {
  transform: translateY(-1px);
}

/* menu langue */
.lang-group {
  position: relative;
}
.lang-btn {
  padding: 0.3rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.lang-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0.75rem;
  overflow: hidden;
  display: none;
  min-width: 90px;
  z-index: 30;
}
.lang-menu button {
  background: transparent;
  border: none;
  color: var(--text);
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.lang-menu button:hover {
  background: rgba(14, 116, 120, 0.25);
}

/* burger mobile */
.theme-btn {
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 0.75rem;
}
.burger span {
  width: 22px;
  height: 2px;
  background: #fff;
  display: block;
  border-radius: 20px;
}

/* =========================================================
   4. SECTIONS GENERALES
   ========================================================= */
.section {
  padding: 5rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* accueil doit être full width */
#home.section {
  max-width: 100%;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* =========================================================
   5. HERO / ACCUEIL
   ========================================================= */
.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;        
  justify-content: center;    
  padding-top: 0;             
}

.hero-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 3.5rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* bloc texte */
.hero-content {
  max-width: 620px;
  text-align: center;
  margin: 0 auto;
}

.tag-en.big-intro {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.2rem;
}

/* le “Annie” stylé */
.name-highlight {
  color: var(--accent);
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: 3.3rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(14, 116, 120, 0.25);
}

.typed-wrapper {
  font-size: clamp(2.8rem, 3.5vw, 3.4rem);
  margin-bottom: 1.3rem;
  line-height: 1.1;
}

#typed-text {
  white-space: nowrap;
}

.typed-cursor {
  display: inline-block;
  width: 1px;
  background: var(--text);
  animation: blink 0.7s infinite;
  height: 1em;
  transform: translateY(3px);
  margin-left: 3px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.8;
  max-width: 680px;
  margin: 0 auto 2.8rem;
  text-align: center;
}

/* boutons du hero */
.hero-actions {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================================
   6. BOUTONS GLOBAUX (avec animation)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* balayage turquoise au hover */
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(14, 116, 120, 0.25) 50%,
    transparent 100%
  );
  transition: all 0.5s ease;
}
.btn:hover::before {
  left: 100%;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(14, 116, 120, 0.35);
}
.btn i {
  transition: transform 0.25s ease;
}
.btn:hover i {
  transform: translateY(-2px);
}

/* variantes */
.btn.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  background: transparent;
}

/* rendre “Me contacter” bien visible en thème clair */
[data-theme="light"] .btn.ghost#contact-btn {
  border: 2px solid var(--accent);
  color: var(--accent);
}
[data-theme="light"] .btn.ghost#contact-btn:hover {
  background: rgba(14, 116, 120, 0.1);
  box-shadow: 0 0 10px rgba(14, 116, 120, 0.25);
}

/* avatar rond avec double bord */
.hero-avatar {
  position: relative;
  width: 340px;
  height: 340px;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.hero-avatar img {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 45%;
  border: 10px solid var(--avatar-border);
  box-shadow: 0 0 0 4px var(--accent);
}

/* titres de sections */
.section-head h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}
.section-head p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* =========================================================
   7. SECTION A PROPOS
   ========================================================= */
.about-section {
  max-width: 1100px;
  margin: 0 auto;
}
.about-grid {
  display: grid;
  grid-template-columns: 0.55fr 0.45fr;
  gap: 2rem;
  align-items: flex-start;
}
.about-intro {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 1.1rem;
  padding: 1.5rem 1.4rem;
}
.about-name {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.about-text {
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.about-highlight {
  background: rgba(14, 116, 120, 0.15);
  border: 1px solid rgba(14, 116, 120, 0.35);
  border-radius: 0.8rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.about-intro .btn.ghost:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(14, 116, 120, 0.35);
  transform: translateY(-2px);
}

/* petit accordéon à droite */
.about-accordion {
  position: relative;
  transition: height 0.25s ease;
}
.accordion-item {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 0.85rem;
  overflow: hidden;
  margin: 0.4rem;
  margin-top: 0;
}
.accordion-header {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
.accordion-header .chevron {
  transition: transform 0.2s ease-out;
}
.accordion-item.active .chevron {
  transform: rotate(180deg);
}
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  background: rgba(0, 0, 0, 0.03);
}
.accordion-item.active .accordion-panel {
  max-height: 250px;
  padding: 0.5rem 1rem 1rem;
}
.accordion-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
/* accordéon en clair */
[data-theme="light"] .accordion-item {
  background: #fff;
  border: 1px solid #e0e0e0;
}
[data-theme="light"] .accordion-panel {
  background: #f8fafa;
}

/* =========================================================
   8. COMPETENCES (3 CARTES)
   ========================================================= */
.skills-section {
  max-width: 1100px;
  margin: 0 auto;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.skill-card {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 1.2rem;
  padding: 2.4rem 1.8rem;
  display: flex;
  min-height: 260px; 
  flex-direction: column;
  gap: 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 18px rgba(14, 116, 120, 0.25);
}
[data-theme="light"] .skill-card {
  background: #fff;
  border: 1px solid #e3e3e3;
}
.skill-card h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}
.skill-card h3 i {
  color: var(--accent);
  font-size: 1.4rem;
}
.skill-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: -0.3rem;
}
.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-left: 0.4rem;
  margin-top: 0.5rem;
}
.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
}
.skill-list i {
  font-size: 2rem;
  width: 28px;
  text-align: center;
}

/* responsive pour compétences */
@media (max-width: 1000px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .skill-card {
    padding: 1.6rem;
  }
}

/* =========================================================
   9. PROJETS
   ========================================================= */
.projects-section {
  max-width: 1100px;
  margin: 0 auto;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}
.project-card {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 1.1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.15s ease-out, box-shadow 0.2s ease-out;
}
[data-theme="light"] .project-card {
  background: #fff;
  border: 1px solid #e3e3e3;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(14, 116, 120, 0.12);
}
.project-thumb {
  width: 100%;
  height: 180px; /* tu peux ajuster (160–200px) selon ton rendu */
  overflow: hidden;
  background: rgba(14, 116, 120, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* ✅ crop plein cadre */
  object-position: center;  /* centré */
  display: block;
  transition: transform 0.4s ease;
}
.project-card:hover .project-thumb img {
  transform: scale(1.08);
}
.project-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.project-body {
  padding: 1.1rem 1.05rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.project-body h3 {
  font-size: 1.02rem;
}
.project-body p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  font-size: 1 rem;      
  font-weight: 600;       
  color: var(--text);     
  padding: 0;
  margin: 0;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
}

.project-tags span::after {
  content: "·";
  margin-left: 0.3rem;
  opacity: 0.6;
}

.project-tags span:last-child::after {
  content: "";
}

.project-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
}

/* effets spéciaux sur boutons de projets */
.project-actions .btn {
  overflow: hidden;
}
.project-actions .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(14, 116, 120, 0.25) 50%,
    transparent 100%
  );
  transition: all 0.5s ease;
}
.project-actions .btn:hover::before {
  left: 100%;
}
.project-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(14, 116, 120, 0.35);
}
.project-actions .btn i {
  transition: transform 0.25s ease;
}
.project-actions .btn:hover i {
  transform: translateY(-2px);
}

/* =========================================================
   10. CONTACT
   ========================================================= */
.contact-section {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* formulaire de contact (version finale) */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 480px;
}
.contact-form input,
.contact-form textarea {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
/* version claire du form */
[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea {
  background: #fff;
  border: 1px solid #ccc;
  color: #0f1717;
}
/* bouton envoyer centré */
.contact-form button {
  align-self: center;
  margin-top: 0.4rem;
}

/* liens email / github / linkedin */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
}
.contact-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s, transform 0.2s;
}
.contact-links a i {
  margin-right: 0.4rem;
  font-size: 1.2rem;
  color: var(--accent);
}
.contact-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* message de confirmation du formulaire */
.form-success {
  margin-top: 1rem;
  background: rgba(14, 116, 120, 0.15);
  border: 1px solid rgba(14, 116, 120, 0.4);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.4s ease;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.form-success.hide {
  opacity: 0;
  transform: translateY(-10px);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   11. FOOTER
   ========================================================= */
.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* =========================================================
   12. RESPONSIVE
   ========================================================= */
@media (max-width: 880px) {
  /* menu mobile */
  .main-nav {
    position: fixed;
    inset: 64px 1rem auto;
    background: var(--bg-alt);
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    display: none;
  }
  .main-nav.open {
    display: flex;
  }
  .burger {
    display: flex;
  }
  .topbar {
    justify-content: space-between;
  }

  /* hero vertical */
  .hero {
    min-height: auto;
  }
  .hero-container {
    flex-direction: column;
    text-align: center;
  }
  .hero-content {
    text-align: center;
  }
  #typed-text {
    white-space: normal;
  }

  /* avatar plus petit */
  .hero-avatar {
    width: 280px;
    height: 280px;
  }
  .hero-avatar img {
    width: 240px;
    height: 240px;
  }

  /* à propos en 1 colonne */
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* projets en 1 colonne */
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   13. CANVAS ANIMÉ (FOND HERO)
   ========================================================= */
#home {
  position: relative;
  overflow: visible;
}
#hero-bg {
  position: absolute;
  top: -4.5rem;                     /* on le remonte */
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: calc(100% + 4.5rem);      /* on rallonge un peu */
  z-index: -1;
  pointer-events: none;
}
.about-intro .btn + .btn {
  margin-top: 1.5rem;
}

/* lisibilité générale des paragraphes */
p {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.7;
  color: var(--muted);
}

/* textes dans les cartes (compétences, projets) */
.skill-desc,
.project-body p,
.about-text,
.accordion-panel p {
  font-size: 1rem;
  line-height: 1.65;
}

.form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--accent-color, #0E7478);
}

.form-status.visible {
  opacity: 1;
}