/* ============================================================
   index.css — styles spécifiques à la page d'accueil
   ============================================================ */

/* ---- Scroll Snapping (Effet site Gacha) ---- */
html {
  /* mandatory force la page à s'aimanter à chaque section */
  scroll-snap-type: y mandatory;
}

section,
footer {
  scroll-snap-align: start;
}

/* ---- Hero ---- */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 1.5rem 2rem;
  overflow: hidden;
}
.hero-slash {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  background: linear-gradient(105deg, var(--dark-red) 0%, transparent 55%);
  clip-path: polygon(0 0, 55% 0, 40% 100%, 0 100%);
  z-index: 0;
}
.hero-slash-2 {
  position: absolute;
  top: 0;
  right: -5%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(186, 1, 1, 0.08) 100%
  );
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 20% 100%);
  z-index: 0;
}
.hero-mask-bg {
  color: var(--white);
  position: absolute;
  right: -5%;
  bottom: 5%;
  width: min(60vw, 500px);
  opacity: 0.05;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-20px) rotate(3deg);
  }
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  text-align: left;
}
.hero-tag {
  display: inline-block;
  font-family: var(--font-h);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0.3rem 0.8rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: slideInTag 0.6s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes slideInTag {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.hero-title {
  font-family: var(--font-h);
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line-inner {
  display: block;
  opacity: 0;
  transform: translateY(110%);
  animation: revealLine 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.hero-title .line:nth-child(1) .line-inner {
  animation-delay: 0.5s;
}
.hero-title .line:nth-child(2) .line-inner {
  animation-delay: 0.7s;
  color: var(--red);
}
.hero-title .line:nth-child(3) .line-inner {
  animation-delay: 0.9s;
}
@keyframes revealLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero-subtitle {
  font-family: var(--font-sh);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--gray);
  margin-top: 1.5rem;
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 0.8s 1.1s ease forwards;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 1.3s ease forwards;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 1s 1.8s ease forwards;
}
a.scroll-hint {
  text-decoration: none;
  cursor: pointer;
}
.scroll-hint span {
  font-family: var(--font-h);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gray);
}
.scroll-arrow {
  width: 20px;
  height: 30px;
  border: 2px solid var(--red);
  border-radius: 10px;
  position: relative;
}
.scroll-arrow::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--red);
  border-radius: 2px;
  animation: scrollBounce 1.5s infinite;
}
@keyframes scrollBounce {
  0%,
  100% {
    top: 5px;
    opacity: 1;
  }
  50% {
    top: 14px;
    opacity: 0.3;
  }
}

/* ---- About ---- */
#about {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.about-text p {
  font-family: var(--font-b);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--gray);
  margin-bottom: 1rem;
}
.about-text strong {
  color: var(--white);
  font-weight: 500;
}
.values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.value-card {
  background: rgba(186, 1, 1, 0.06);
  border: 1px solid rgba(186, 1, 1, 0.25);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  transition:
    background 0.3s,
    border-color 0.3s;
}
.value-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--red);
}
.value-card:hover {
  background: rgba(186, 1, 1, 0.12);
  border-color: var(--red);
}
.value-card h3 {
  font-family: var(--font-h);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.35rem;
}
.value-card p {
  font-family: var(--font-b);
  font-size: 0.85rem;
  color: var(--gray);
}

/* ---- Skills ---- */
#skills {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(66, 3, 6, 0.15) 50%,
    transparent
  );
}
#skills .inner {
  max-width: 1100px;
  margin: 0 auto;
}
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.tab-btn {
  font-family: var(--font-h);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  background: transparent;
  border: 1px solid rgba(211, 210, 210, 0.3);
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  transition: all 0.2s;
}
.tab-btn.active,
.tab-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skill-name {
  font-family: var(--font-sh);
  font-size: 0.9rem;
  color: var(--white);
  display: flex;
  justify-content: space-between;
}
.skill-name span {
  color: var(--red);
  font-family: var(--font-h);
  font-size: 0.75rem;
}
.skill-bar {
  height: 4px;
  background: rgba(211, 210, 210, 0.15);
  position: relative;
  overflow: hidden;
}
.skill-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--dark-red), var(--red));
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-item.animated .skill-bar-fill {
  width: var(--pct);
}
.soft-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.soft-tag {
  font-family: var(--font-h);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  border: 1px solid rgba(211, 210, 210, 0.25);
  padding: 0.4rem 1rem;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.soft-tag:hover {
  border-color: var(--red);
  color: var(--white);
}

/* ---- Formation ---- */
#formation {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem 0; /* Padding bottom 0 pour enchaîner fluidement avec les projets */
  max-width: 1100px;
  margin: 0 auto;
}
.timeline {
  display: flex;
  position: relative;
  margin-top: 3rem;
  gap: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 15px; /* Aligné avec le centre des bulles */
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(186, 1, 1, 0.3);
  z-index: 0;
}
.timeline-item {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--black);
  border: 2px solid var(--red);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--black); /* Permet de couper visuellement la ligne du fond */
  transition:
    transform 0.3s,
    background 0.3s;
}
.timeline-dot::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  transition: transform 0.3s;
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.1);
}
.timeline-content {
  background: rgba(186, 1, 1, 0.05);
  border: 1px solid rgba(186, 1, 1, 0.2);
  padding: 1.5rem;
  width: 100%;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  transition:
    border-color 0.3s,
    background 0.3s,
    transform 0.3s;
}
.timeline-content:hover {
  border-color: var(--red);
  background: rgba(186, 1, 1, 0.1);
  transform: translateY(-5px);
}
.timeline-date {
  display: inline-block;
  font-family: var(--font-h);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.timeline-title {
  font-family: var(--font-sh);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.timeline-desc {
  font-family: var(--font-b);
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ---- Projects preview ---- */
#projects-preview {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid rgba(186, 1, 1, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  clip-path: polygon(
    0 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
  transition:
    border-color 0.3s,
    transform 0.3s;
}
.project-card:hover {
  border-color: var(--red);
  transform: translateY(-6px);
}
.project-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(40%) contrast(1.1);
  transition: filter 0.3s;
}
.project-card:hover .project-card-img {
  filter: grayscale(0%) contrast(1.1);
}
.project-card-body {
  padding: 1.25rem;
  flex-grow: 1;
}
.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.project-card-tag {
  font-family: var(--font-h);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid rgba(186, 1, 1, 0.35);
  padding: 0.2rem 0.6rem;
}
.project-card-title {
  font-family: var(--font-sh);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}
.timeline-subtitle {
  font-family: var(--font-h);
  font-size: 0.85rem;
  color: var(--red);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.project-card-desc {
  font-family: var(--font-b);
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
  text-align: justify;
  text-justify: auto;
}
.project-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(186, 1, 1, 0.15);
  display: flex;
  justify-content: flex-end;
}
.project-card-footer a {
  font-family: var(--font-h);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  transition: color 0.2s;
}
.project-card-footer a:hover {
  color: var(--white);
}
.all-projects-link {
  text-align: center;
  margin-top: 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .values-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }
  .timeline {
    flex-direction: column-reverse;
  }
  .timeline::before {
    top: 0;
    bottom: 0;
    left: 15px; /* Aligné avec les bulles à la verticale sur mobile */
    width: 2px;
    height: auto;
  }
  .timeline-item {
    flex-direction: row;
    gap: 1.5rem;
  }
  .timeline-dot {
    margin-bottom: 0;
    flex-shrink: 0;
  }
}
