/* ============================================================
   CV – D'ALMEIDA Ayélé Merveille
   Design : accordion sections, responsive-first, rouge/bordeaux
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --red-deep:   #c31432;
  --purple-deep:#240b36;
  --glass-bg:   rgba(255,255,255,0.07);
  --glass-bd:   rgba(255,255,255,0.18);
  --dark-tile:  rgba(10, 5, 20, 0.55);
  --dark-bd:    rgba(255,255,255,0.12);
  --text-main:  #f0e8ff;
  --text-muted: rgba(240,232,255,0.6);
  --accent:     #ff4d6d;
  --gold:       #e8c87a;
  --radius:     14px;
  --transition: 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  --content-max:900px;
  --content-pad:clamp(12px, 5vw, 60px);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body & fond ──────────────────────────────────────────── */
body {
  min-height: 100vh;
  background: var(--purple-deep);
  background: linear-gradient(135deg, var(--purple-deep) 0%, #5a0d20 50%, var(--red-deep) 100%);
  background-attachment: fixed;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-main);
  /* Grain subtil */
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Wrapper principal ────────────────────────────────────── */
.cv-wrapper {
  position: relative;
  z-index: 1;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  padding: clamp(20px, 6vw, 60px) var(--content-pad);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Grille 2 colonnes ────────────────────────────────────── */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-full {
  grid-column: 1 / -1;
}

/* ── Section : état fermé ─────────────────────────────────── */
.cv-section {
  background: var(--dark-tile);
  border: 1px solid var(--dark-bd);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.cv-section:hover,
.cv-section.open {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 8px 40px rgba(195, 20, 50, 0.25), 0 2px 12px rgba(0,0,0,0.35);
  background: rgba(10, 5, 20, 0.68);
}

/* ── Header de section ────────────────────────────────────── */
.section-header {
  padding: 18px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.section-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 1px;
  background: var(--dark-bd);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.cv-section.open .section-header::after {
  transform: scaleX(1);
}

.section-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.section-icon {
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition), transform var(--transition);
}
.cv-section.open .section-icon,
.cv-section:hover .section-icon {
  opacity: 1;
  transform: rotate(90deg) scale(1.1);
}

.section-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-main);
  line-height: 1.2;
}
.section-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-main);
}

.section-sub {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.section-meta .sep {
  opacity: 0.4;
}

/* hint discret */
.toggle-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.cv-section.open .toggle-hint,
.cv-section:hover .toggle-hint {
  opacity: 0;
}

/* ── Corps accordéon ─────────────────────────────────────── */
.section-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition);
}
.cv-section.open .section-body {
  grid-template-rows: 1fr;
}

.section-content {
  overflow: hidden;
  padding: 0 24px;
  transition: padding var(--transition);
}
.cv-section.open .section-content {
  padding: 18px 24px 22px;
}

/* ── Typographie du contenu ──────────────────────────────── */
.section-content p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-weight: 300;
}
.section-content p strong {
  color: var(--text-main);
  font-weight: 500;
}
.section-content strong {
  color: var(--text-main);
  font-weight: 500;
}

/* ── Skill groups ────────────────────────────────────────── */
.skill-group {
  margin-bottom: 14px;
}
.skill-group:last-child { margin-bottom: 0; }

.skill-group h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,77,109,0.2);
  padding-bottom: 4px;
}

.skill-group ul {
  list-style: none;
  padding: 0;
}
.skill-group ul li {
  font-size: 0.87rem;
  color: var(--text-muted);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.5;
}
.skill-group ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1rem;
}

/* ── Langues ─────────────────────────────────────────────── */
.langue-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.langue-item {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.langue-name {
  font-size: 0.87rem;
  color: var(--text-main);
  font-weight: 500;
}
.langue-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.langue-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--red-deep));
  border-radius: 2px;
  transition: width 0.8s ease 0.1s;
}
.langue-level {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  font-weight: 400;
}

/* ── Timeline Formations ─────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 100px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 20px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: right;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--red-deep);
  box-shadow: 0 0 6px rgba(255,77,109,0.5);
  justify-self: center;
}

.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timeline-info strong {
  font-size: 0.9rem;
  color: var(--text-main);
}
.timeline-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Placeholder ─────────────────────────────────────────── */
.placeholder-text {
  color: var(--text-muted) !important;
  font-style: italic;
  opacity: 0.6;
  text-align: center;
  padding: 8px 0;
}

/* ── #sec-identity : layout header spécial ───────────────── */
#sec-identity .section-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
#sec-identity .section-title-block {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
#sec-identity .section-icon {
  font-size: 0.7rem;
  margin-bottom: 2px;
}
#sec-identity .toggle-hint {
  align-self: flex-end;
  position: absolute;
  right: 24px;
  top: 18px;
}

/* ── Responsive ──────────────────────────────────────────── */

/* Tablette : padding réduit */
@media (max-width: 700px) {
  .cv-grid {
    grid-template-columns: 1fr;
  }
  .grid-full {
    grid-column: 1;
  }
  .section-header {
    padding: 14px 16px 12px;
  }
  .section-content {
    padding: 0 16px;
  }
  .cv-section.open .section-content {
    padding: 14px 16px 18px;
  }
  .section-header::after {
    left: 16px; right: 16px;
  }
  .toggle-hint {
    display: none;
  }
  .timeline::before { left: 85px; }
}

/* Petit mobile */
@media (max-width: 420px) {
  .cv-wrapper {
    padding: 12px 8px;
    gap: 10px;
  }
  .section-header h1 {
    font-size: 1.05rem;
  }
  .section-meta {
    font-size: 0.7rem;
  }
  .langue-item {
    grid-template-columns: 70px 1fr 36px;
  }
  .timeline-item {
    grid-template-columns: 72px 18px 1fr;
  }
}

/* ── Animation d'entrée ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cv-section {
  animation: fadeUp 0.5s ease both;
}
.cv-section:nth-child(1) { animation-delay: 0.05s; }
.cv-section:nth-child(2) { animation-delay: 0.12s; }
.cv-grid .cv-section:nth-child(1) { animation-delay: 0.19s; }
.cv-grid .cv-section:nth-child(2) { animation-delay: 0.25s; }
.cv-grid .cv-section:nth-child(3) { animation-delay: 0.32s; }
.cv-section:last-child { animation-delay: 0.38s; }
