/* ═══════════════════════════════════════════════════════════
   Sébastien WALD — Cybersécurité & Sécurité IA
   Custom Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── Base ─── */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0f1c;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); }
  50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.3); }
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink {
  50% { border-color: transparent; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.animate-fade-up {
  animation: fadeUp 0.6s ease-out forwards;
}
.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}
.animate-slide-left {
  animation: slideInLeft 0.6s ease-out forwards;
}
.animate-slide-right {
  animation: slideInRight 0.6s ease-out forwards;
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Staggered reveal */
.reveal-item { opacity: 0; transform: translateY(30px); transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal-item.visible { opacity: 1; transform: translateY(0); }
.reveal-item:nth-child(2) { transition-delay: 0.1s; }
.reveal-item:nth-child(3) { transition-delay: 0.2s; }
.reveal-item:nth-child(4) { transition-delay: 0.3s; }
.reveal-item:nth-child(5) { transition-delay: 0.4s; }
.reveal-item:nth-child(6) { transition-delay: 0.5s; }

/* ─── Gradient Text ─── */
.gradient-text {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Cyber Grid Background ─── */
.cyber-grid {
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ─── Glow Effects ─── */
.glow-ai {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}
.glow-accent {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}
.glow-cyber {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
}

/* ─── Card hover ─── */
.card-hover {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ─── Content body (articles) ─── */
.content-body p {
  margin-bottom: 1.25rem;
  line-height: 1.85;
  color: #94a3b8;
}
.content-body ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.content-body li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 0.25rem;
}
.content-body li::marker {
  color: #3b82f6;
  content: '▸ ';
}

/* ─── Terminal Prompt ─── */
.terminal-prompt::before {
  content: '$ ';
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Timeline ─── */
.timeline-dot {
  transition: all 0.3s ease;
}
.timeline-dot:hover {
  transform: scale(1.2);
}

/* ─── Mobile Menu ─── */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* ─── Active nav indicator ─── */
.nav-active {
  position: relative;
}
.nav-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 1px;
}

/* ─── Skill Bar ─── */
.skill-bar {
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}
.skill-bar-fill.animated {
  /* width set inline */
}

/* ─── Particle Background ─── */
.particles-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem !important;
    line-height: 1.15 !important;
  }
  /* Stack skill bars */
  .skill-bar {
    height: 8px;
  }
  /* Ensure CTA buttons are touch-friendly */
  a, button {
    min-height: 44px;
  }
  /* Timeline spacing */
  .timeline-dot {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ─── Accessibility ─── */
/* Visible focus states for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Tooltips au survol ─── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  white-space: normal;
  width: 220px;
  text-align: left;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 201;
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* Cookie banner animation */
#cookie-banner {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-item {
    opacity: 1;
    transform: none;
  }
  .skill-bar-fill {
    transition: none;
    width: var(--target-width) !important;
  }
  .particle {
    display: none;
  }
}

/* Custom select dropdown arrow */
select.appearance-none {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
