/* Portfolio Alexandre Anélard - Styles principaux */

/* ===== VARIABLES DE BASE ===== */
:root {
  /* Couleurs du thème sombre (par défaut) */
  --bg-gradient-start: #0b1220;
  --bg-gradient-end: #0c1526;
  --card-gradient-start: #0f1a2e;
  --card-gradient-end: #0e1728;
  --card: #111a2b;
  --ink: #e6eefc;
  --muted: #a9b6d3;
  --brand: #5ea1ff;
  --brand-2: #87f5d1;
  --border: #1e2a44;
  --border-dark: #253655;
  --element-bg: #0f1a2e;
  --element-border: #1e2a44;
  --tag-bg: #0b1a30;
  --tag-border: #213459;
  --job-border: #223559;
  
  /* Dimensions et aspects */
  --radius: 18px;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  
  /* Animations */
  --transition-speed: 0.3s;
  --transition-easing: ease;
}

/* Thème clair */
html.light-theme {
  --bg-gradient-start: #f7f9fc;
  --bg-gradient-end: #edf2fa;
  --card-gradient-start: #ffffff;
  --card-gradient-end: #f8f9fc;
  --card: #ffffff;
  --ink: #2a3642;
  --muted: #6e7c8c;
  --brand: #3b82f6;
  --brand-2: #14b8a6;
  --border: #e0e7f2;
  --border-dark: #d0d9e8;
  --element-bg: #f0f5fc;
  --element-border: #d8e1f0;
  --tag-bg: #edf2fa;
  --tag-border: #d8e1f0;
  --job-border: #dce5f0;
  --shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  min-height: 100vh;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--brand-2);
}

a:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  margin-top: 0;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin: 6px 0;
}

li strong {
  color: var(--brand-2);
}

/* ===== LAYOUT ===== */
.wrap {
  max-width: 1000px;
  margin: auto;
  padding: 28px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 880px) {
  .grid-2 {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* ===== COMPOSANTS COMMUNS ===== */
.card {
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 28px;
  transition: all var(--transition-speed) var(--transition-easing);
  animation: slideUp 0.5s ease;
  animation-fill-mode: both;
}

.section-title {
  font-size: 1.15rem;
  margin: 0 0 14px;
  color: var(--brand);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--element-bg);
  border: 1px solid var(--element-border);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip svg {
  vertical-align: middle;
  display: inline-block;
  margin-right: 5px;
}

.chip:hover {
  background: var(--element-bg);
  border-color: var(--brand);
  transform: translateY(-1px);
  text-decoration: none;
}

.chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ===== HEADER ===== */
header {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 8px 0 22px;
}

.id {
  display: flex;
  gap: 18px;
  align-items: center;
  animation: fadeIn 0.8s ease;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 3px var(--bg-gradient-start), 0 0 0 6px var(--brand);
  flex-shrink: 0;
}

h1 {
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-weight: 500;
}

.links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--brand);
  color: white;
}

.theme-toggle-text {
  font-size: 0.9rem;
}

/* ===== COMPÉTENCES ===== */
.open-skills-modal {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: all 0.3s ease;
  background-color: rgba(94, 161, 255, 0.1);
}

.open-skills-modal:hover {
  background-color: rgba(94, 161, 255, 0.2);
  transform: scale(1.1);
}

.skills-summary {
  display: block;
  margin-bottom: 0.5rem;
  transition: opacity 0.3s ease, height 0.3s ease;
  padding: 0.5rem 0;
}

.skills-summary-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.skill-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--ink);
  border: 1px solid var(--tag-border);
  font-size: 0.85rem;
  font-weight: 500;
}

.expand-prompt {
  width: 100%;
  text-align: right;
  margin-top: 10px;
  color: var(--brand);
  font-size: 0.9rem;
  font-style: italic;
  cursor: pointer;
}

/* ===== MODAL ===== */
.skills-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.skills-modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.skills-modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-dark);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--brand);
}

.close-modal {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-modal:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
}

body.modal-open {
  overflow: hidden;
}

/* ===== SKILLS GRID ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  margin-bottom: 0.5rem;
}

.skill-category h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--brand);
}

.skill-category ul {
  margin: 0;
  padding-left: 1.2rem;
}

.skill-category li {
  margin-bottom: 0.3rem;
}

/* ===== TIMELINE & JOBS ===== */
.timeline {
  display: grid;
  gap: 14px;
}

.job {
  padding: 14px;
  border-radius: 14px;
  background: var(--element-bg);
  border: 1px dashed var(--job-border);
  transition: all 0.2s ease;
}

.job:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
}

.job small {
  color: var(--muted);
  font-weight: 500;
}

.job strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

/* ===== PROJETS ===== */
.project {
  padding: 14px;
  border-radius: 14px;
  background: var(--element-bg);
  border: 1px solid var(--element-border);
  transition: all 0.2s ease;
}

.project:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
}

.project h4 {
  margin: 0 0 6px;
  color: var(--brand-2);
}

.tag {
  display: inline-block;
  margin-right: 8px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--ink);
  border: 1px solid var(--tag-border);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== FOOTER ===== */
footer {
  margin: 34px 0 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

section:nth-child(1) .card {
  animation-delay: 0.1s;
}

section:nth-child(2) .card {
  animation-delay: 0.2s;
}

section:nth-child(3) .card {
  animation-delay: 0.3s;
}

section:nth-child(4) .card {
  animation-delay: 0.4s;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 640px) {
  .wrap {
    padding: 20px 16px;
  }
  
  header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .links {
    justify-content: center;
  }
  
  h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
  }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Mode sombre alternatif pour les systèmes qui le supportent */
@media (prefers-color-scheme: light) {
  /* Le design reste sombre car c'est le thème choisi */
}

/* Section informations personnelles */
.personal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-item svg {
  color: var(--brand);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .personal-info {
    grid-template-columns: 1fr;
  }
}