/* ========================================
   Romain Lemenorel — Site officiel
   Stylesheet principal
   ======================================== */

/* ---------- VARIABLES ---------- */
:root {
  /* Couleurs (héritées du site existant) */
  --bg: #0A0A0A;
  --bg-alt: #0F0F0F;
  --card: #1A1A1A;
  --card-hover: #1F1F1F;
  --text: #F5F5F5;
  --text-muted: #999999;
  --text-dim: #666666;
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --accent-glow: rgba(59, 130, 246, 0.2);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(59, 130, 246, 0.3);

  /* Typo */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Tailles */
  --container: 1200px;
  --container-narrow: 900px;

  /* Rayons */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Transitions */
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* ---------- ACCESSIBILITY ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  z-index: 999;
  transition: top var(--transition);
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav__logo {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
  transition: color var(--transition);
}

.nav__links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.nav__mobile a {
  padding: 0.75rem 0;
  color: var(--text-muted);
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.nav__mobile a:last-child { border-bottom: none; }
.nav__mobile a:hover { color: var(--text); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.5rem 4rem;
  overflow: hidden;
}

.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  z-index: 0;
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__content { display: flex; flex-direction: column; gap: 1.5rem; }

.badge {
  display: inline-block;
  width: fit-content;
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  font-size: 0.825rem;
  color: var(--text-muted);
  white-space: nowrap;
}

#hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.hero__subtitle {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.4rem, 2.8vw, 1.875rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.hero__tagline {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  color: var(--text-muted);
  font-weight: 500;
}

.hero__description {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 60ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero__photo {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__photo-glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(40px);
  z-index: 0;
}

.hero__photo img {
  position: relative;
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border-accent);
  z-index: 1;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 500;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--secondary:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ---------- SECTION (générique) ---------- */
.section {
  padding: 6rem 1.5rem;
  position: relative;
}

.section--alt {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.section__header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 4rem;
}

.section__header h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section__header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.section__footnote {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- GRID ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--columns {
  grid-template-columns: repeat(3, 1fr);
}

/* ---------- CARD (générique) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card__icon svg { width: 28px; height: 28px; }

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__tags {
  font-size: 0.825rem;
  color: var(--accent);
  font-weight: 500;
}

.card p:not(.card__tags):not(.card__tag):not(.card__date) {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- ARTICLE CARD (Publications) ---------- */
.card--article {
  position: relative;
}

.card--article h3 a {
  color: var(--text);
  transition: color var(--transition);
}

.card--article h3 a:hover { color: var(--accent); }

.card__tag {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card__date {
  display: block;
  font-size: 0.825rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.card__link {
  margin-top: auto;
  padding-top: 0.75rem;
  color: var(--accent);
  font-size: 0.925rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--transition);
}

.card__link:hover { gap: 0.7rem; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(59, 130, 246, 0.3) 50%, var(--accent) 100%);
  transform: translateX(-50%);
}

.timeline__item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: 50%;
  top: 2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px var(--accent-glow);
  transform: translateX(-50%);
  z-index: 2;
}

.timeline__dot--active {
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 16px var(--accent-glow); }
  50% { box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(59, 130, 246, 0.4); }
}

.timeline__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  transition: border-color var(--transition);
}

.timeline__card:hover { border-color: var(--border-accent); }

.timeline__item--left .timeline__card {
  width: calc(50% - 2.5rem);
  margin-right: auto;
}

.timeline__item--right .timeline__card {
  width: calc(50% - 2.5rem);
  margin-left: auto;
}

.timeline__item--hero .timeline__card {
  width: 100%;
  margin-top: 1rem;
}

.timeline__meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.timeline__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline__icon svg { width: 18px; height: 18px; }

.timeline__period {
  font-size: 0.825rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline__card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.timeline__company {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.timeline__company--accent { color: var(--accent); }

.timeline__card > ul:not(.tiles) {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline__card > ul:not(.tiles) > li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.timeline__card > ul:not(.tiles) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__card--hero {
  background: linear-gradient(180deg, var(--card) 0%, rgba(26, 26, 26, 0.6) 100%);
  border: 1px solid var(--border-accent);
  padding: 2.5rem;
}

.timeline__card--hero h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.timeline__hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.timeline__hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline__hero-icon svg { width: 28px; height: 28px; }

.timeline__card--hero h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.timeline__card--hero > p {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Tiles dans la carte hero Primelis */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.tile {
  background: rgba(10, 10, 10, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.tile:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tile__icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.5rem;
  color: var(--accent);
  transition: transform var(--transition);
}

.tile:hover .tile__icon { transform: scale(1.1); }

.tile__icon svg { width: 100%; height: 100%; }

.tile__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.tile__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tile--wide { grid-column: span 2; }

/* ---------- COLUMNS (Méthode) ---------- */
.column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.column:hover { border-color: var(--border-accent); }

.column__header { margin-bottom: 1.5rem; }

.column__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.column__icon svg { width: 24px; height: 24px; }

.column__header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.column__sub {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
}

.column__block {
  margin-bottom: 1.5rem;
}

.column__block h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column__block h4::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.column__block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 0.875rem;
}

.column__footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.column__tools-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags li {
  padding: 0.35rem 0.7rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---------- STACK ---------- */
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stack__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: border-color var(--transition);
}

.stack__item:hover { border-color: var(--border-accent); }

.stack__abbr {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.stack__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.stack__cat {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- CTA BLOCK (publications) ---------- */
.cta-block {
  margin-top: 3rem;
  text-align: center;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.cta-block p {
  color: var(--text-muted);
  font-size: 1rem;
}

.cta-link {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--transition);
}

.cta-link:hover { gap: 0.6rem; }

/* ---------- FOOTER ---------- */
.footer {
  background: linear-gradient(180deg, var(--bg) 0%, var(--card) 100%);
  border-top: 1px solid var(--border);
  padding: 6rem 1.5rem 3rem;
}

.footer__inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
}

.footer__header { margin-bottom: 2.5rem; }

.footer__header h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.footer__header p {
  font-size: 1.125rem;
  color: var(--text-muted);
}

.footer__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

.footer__base {
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__base p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer__legal {
  margin-top: 1rem;
  color: var(--text-dim) !important;
  font-size: 0.825rem !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .grid--columns { grid-template-columns: 1fr; }
  .timeline__card > ul.tiles { grid-template-columns: repeat(3, 1fr); }
  .tile--wide { grid-column: span 1; }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile.is-open {
    display: flex;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .hero__content { align-items: center; }
  .badge { white-space: normal; text-align: center; }
  .hero__description { margin: 0 auto; }
  .hero__cta { justify-content: center; }

  .hero__photo img {
    width: 240px;
    height: 240px;
  }

  .section { padding: 4rem 1.5rem; }
  .section__header { margin-bottom: 2.5rem; }

  /* Timeline en mode mobile : tout à gauche */
  .timeline::before {
    left: 1rem;
    transform: none;
  }

  .timeline__dot {
    left: 1rem;
    transform: translateX(-50%);
  }

  .timeline__item--left .timeline__card,
  .timeline__item--right .timeline__card,
  .timeline__item--hero .timeline__card {
    width: calc(100% - 2.5rem);
    margin-left: 2.5rem;
    margin-right: 0;
  }

  .timeline__card--hero { padding: 1.75rem; }
  .timeline__card--hero h3 { font-size: 1.25rem; }

  .timeline__card > ul.tiles { grid-template-columns: repeat(2, 1fr); }

  .footer { padding: 4rem 1.5rem 2rem; }
  .footer__cta { flex-direction: column; align-items: stretch; }
  .footer__cta .btn { width: 100%; }
}

@media (max-width: 480px) {
  .hero { padding-top: 6rem; }
  .hero__cta { flex-direction: column; align-items: stretch; width: 100%; }
  .hero__cta .btn { width: 100%; }
  .timeline__card > ul.tiles { grid-template-columns: 1fr; }
  .stack { grid-template-columns: repeat(2, 1fr); }
}

/* Reduced motion : respect du préférence système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
