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

/* ===== Variables ===== */
:root {
  /* Fond clair, texte quasi noir : structure reprise de QYRA, palette inversée (clair + multicolore) */
  --color-bg: oklch(98% 0 0);
  --color-bg-elevated: oklch(94% 0 0);
  --color-bg-elevated-2: oklch(90% 0 0);
  --color-border: oklch(82% 0 0);
  --color-border-soft: rgb(0 0 0 / 8%);

  --color-text: oklch(22% 0 0);
  --color-text-muted: oklch(42% 0 0);
  --color-text-faint: oklch(56% 0 0);

  /* Accent par défaut (page Accueil) : dégradé multicolore des 4 pages */
  --accent: oklch(50% 0.18 255);
  --accent-soft: color-mix(in oklch, var(--accent) 10%, white);

  --gradient-multi: linear-gradient(90deg,
    oklch(50% 0.18 255) 0%,
    oklch(50% 0.20 300) 33%,
    oklch(50% 0.17 45) 66%,
    oklch(48% 0.15 150) 100%);

  --glow-soft: rgb(0 0 0 / 6%);

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 16px;
  --container-width: 1100px;
}

/* Accent par page */
body.page-parcours { --accent: oklch(50% 0.18 255); --accent-soft: color-mix(in oklch, var(--accent) 10%, white); }
body.page-competences { --accent: oklch(50% 0.20 300); --accent-soft: color-mix(in oklch, var(--accent) 10%, white); }
body.page-projets { --accent: oklch(50% 0.17 45); --accent-soft: color-mix(in oklch, var(--accent) 10%, white); }
body.page-contact { --accent: oklch(48% 0.15 150); --accent-soft: color-mix(in oklch, var(--accent) 10%, white); }

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

section {
  padding: 96px 0;
  position: relative;
}

@media (max-width: 640px) {
  section {
    padding: 56px 0;
  }
}

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

.text-gradient {
  background: linear-gradient(90deg,
    oklch(50% 0.18 255) 0%,
    oklch(50% 0.20 300) 25%,
    oklch(50% 0.17 45) 50%,
    oklch(48% 0.15 150) 75%,
    oklch(50% 0.18 255) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 6s linear infinite;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ===== Logo (coin haut-gauche) ===== */
.site-logo {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

@media (max-width: 640px) {
  .site-logo {
    top: calc(16px + env(safe-area-inset-top, 0px));
    font-size: 16px;
  }
}

/* ===== Navbar (pilule flottante) ===== */
.navbar {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--color-bg-elevated) 85%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-soft);
  box-shadow: 0 8px 32px rgb(0 0 0 / 10%);
}

.navbar__link {
  position: relative;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.navbar__link:hover {
  color: var(--color-bg);
}

.navbar__link.is-active {
  color: var(--color-bg);
}

.navbar:has(.navbar__link:hover) .navbar__link.is-active:not(:hover) {
  color: var(--color-text);
}

.navbar__indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 999px;
  background: var(--accent);
  z-index: -1;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.navbar__link span.short {
  display: none;
}

@media (max-width: 640px) {
  .navbar {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .navbar::-webkit-scrollbar {
    display: none;
  }
  .navbar__link {
    padding: 8px 12px;
    font-size: 12px;
  }
  .navbar__link span.full {
    display: none;
  }
  .navbar__link span.short {
    display: inline;
  }
}

/* ===== Page header (pages secondaires) ===== */
.page-header {
  background: var(--color-bg);
  color: var(--color-text);
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 50% 25%, var(--accent-soft), transparent 60%),
    linear-gradient(var(--color-border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-soft) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(circle 480px at 50% 30%, black 0%, transparent 75%);
  mask-image: radial-gradient(circle 480px at 50% 30%, black 0%, transparent 75%);
  transform: skewY(-6deg) scale(1.2);
  animation: grid-drift 30s linear infinite;
  pointer-events: none;
}

.page-header__title {
  position: relative;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 16px;
}

.page-header__subtitle {
  position: relative;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== Hero (accueil) ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: oklch(9% 0.025 255);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 28%, oklch(52% 0.22 255 / 55%), transparent 48%),
    radial-gradient(circle at 82% 18%, oklch(52% 0.24 300 / 48%), transparent 48%),
    radial-gradient(circle at 76% 82%, oklch(52% 0.20 45 / 40%), transparent 48%),
    radial-gradient(circle at 18% 76%, oklch(50% 0.18 150 / 40%), transparent 48%),
    linear-gradient(oklch(100% 0 0 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, oklch(100% 0 0 / 6%) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(circle 700px at 50% 42%, black 0%, transparent 82%);
  mask-image: radial-gradient(circle 700px at 50% 42%, black 0%, transparent 82%);
  transform: skewY(-6deg) scale(1.2);
  animation: grid-drift 30s linear infinite;
  pointer-events: none;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 0 0, 0 0, 0 0, 48px 48px, 48px 48px; }
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes hero-in-photo {
  from { opacity: 0; transform: scale(0.82); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes photo-glow {
  0%, 100% {
    box-shadow: 0 0 0 6px oklch(20% 0.06 255),
                0 0 48px oklch(52% 0.22 255 / 40%);
  }
  50% {
    box-shadow: 0 0 0 6px oklch(22% 0.08 255),
                0 0 72px oklch(52% 0.24 270 / 65%);
  }
}

@keyframes gradient-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 0 24px;
  color: white;
}

.hero__photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 28px;
  border: 3px solid oklch(35% 0.12 255);
  box-shadow: 0 0 0 6px oklch(20% 0.06 255), 0 0 48px oklch(52% 0.22 255 / 40%);
  animation: hero-in-photo 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
             photo-glow 3.5s ease-in-out 0.8s infinite;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: oklch(18% 0.05 255 / 80%);
  border: 1px solid oklch(40% 0.10 255 / 40%);
  backdrop-filter: blur(12px);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(75% 0.04 255);
  margin-bottom: 32px;
  animation: hero-in 0.7s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-multi);
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  margin-bottom: 20px;
  animation: hero-in 0.7s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  color: oklch(70% 0.02 255);
  max-width: 560px;
  margin: 0 auto 40px;
  animation: hero-in 0.7s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: hero-in 0.7s 0.50s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  transform: translateY(-2px);
}

/* Contour qui se remplit au survol (page Parcours) */
.btn--outline-fill {
  position: relative;
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
  overflow: hidden;
  isolation: isolate;
  transition: color 0.25s ease;
}

.btn--outline-fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}

.btn--outline-fill:hover {
  color: white;
  border-color: var(--accent);
}

.btn--outline-fill:hover::before {
  transform: scaleX(1);
}

/* Halo lumineux au survol (page Projets) */
.btn--glow {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.btn--glow:hover {
  box-shadow: 0 0 36px 6px color-mix(in oklch, var(--accent) 45%, transparent);
  transform: translateY(-2px);
}

/* Lien avec flèche glissante (page Contact) */
.btn--arrow {
  background: transparent;
  border-color: transparent;
  padding: 10px 4px;
  color: var(--accent);
}

.btn--arrow:hover {
  transform: none;
  color: color-mix(in oklch, var(--accent) 70%, black);
}

.btn__arrow-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn--arrow:hover .btn__arrow-icon {
  transform: translateX(6px);
}

/* Bouton outline dans le hero sombre */
.hero .btn--outline-fill {
  color: oklch(88% 0 0);
  border-color: oklch(38% 0.06 255 / 70%);
  background: oklch(18% 0.04 255 / 40%);
  backdrop-filter: blur(8px);
}

.hero .btn--outline-fill:hover {
  color: white;
  border-color: var(--accent);
}

/* ===== Sections communes ===== */
.section-heading {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}

.section-heading__title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 12px;
}

.section-heading__subtitle {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* ===== Sections distinctes (page d'accueil) : une couleur par teaser ===== */
.section-teaser {
  border-top: 1px solid var(--color-border-soft);
}

.section-teaser:nth-of-type(1) { --accent: oklch(50% 0.18 255); background: color-mix(in oklch, oklch(50% 0.18 255) 5%, white); }
.section-teaser:nth-of-type(2) { --accent: oklch(50% 0.20 300); background: color-mix(in oklch, oklch(50% 0.20 300) 5%, white); }
.section-teaser:nth-of-type(3) { --accent: oklch(50% 0.17 45);  background: color-mix(in oklch, oklch(50% 0.17 45) 5%, white); }
.section-teaser:nth-of-type(4) { --accent: oklch(48% 0.15 150); background: color-mix(in oklch, oklch(48% 0.15 150) 5%, white); }

.section-teaser__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 40px 0;
}

@media (max-width: 640px) {
  .section-teaser__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.section-teaser__title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  margin-bottom: 8px;
}

.section-teaser__text {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  max-width: 480px;
}

/* ===== Cards ===== */
.card {
  position: relative;
  background: white;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--accent) 30%, var(--color-border-soft));
  box-shadow: 0 16px 40px -16px rgb(0 0 0 / 14%);
}

/* Bordure animée au survol (équivalent CSS du BorderBeam) : le halo plein laisse place à un trait lumineux qui tourne */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle), transparent 0deg, var(--accent) 50deg, transparent 110deg, transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: border-beam-spin 3.5s linear infinite;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

@keyframes border-beam-spin {
  to { --border-angle: 360deg; }
}

.card__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.card__title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.card__description {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.card__meta {
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-faint);
}

.card__link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

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

/* ===== Timeline (page Parcours) ===== */
.timeline {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding-left: 32px;
  border-left: 2px solid var(--color-border);
}

.timeline__item {
  position: relative;
  padding-bottom: 40px;
}

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

.timeline__item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px white;
}

.timeline__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.timeline__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.timeline__text {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.timeline__list {
  margin-top: 10px;
  padding-left: 18px;
  list-style: disc;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.timeline__list li {
  margin-bottom: 4px;
}

/* ===== Compétences : barres de niveau ===== */
.skill {
  margin-bottom: 22px;
}

.skill__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 600;
}

.skill__level {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--color-bg-elevated-2);
  overflow: hidden;
}

.skill__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.skill__bar-fill[data-level="debutant"] { width: 33%; }
.skill__bar-fill[data-level="intermediaire"] { width: 66%; }
.skill__bar-fill[data-level="avance"] { width: 100%; }

.skill-group {
  margin-bottom: 48px;
}

.skill-group__title {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border-soft);
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@supports (animation-timeline: view()) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }

  @keyframes reveal-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}

/* ===== Footer ===== */
.footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
  padding: 56px 0 32px;
  text-align: center;
}

.footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
  font-family: var(--font-body);
}

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

.footer__copy {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-faint);
  margin-top: 24px;
}

/* ===== Focus visible (accessibilité clavier) ===== */
a:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Réduction de mouvement ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card,
  .navbar__indicator,
  .btn,
  .reveal {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__photo,
  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__actions,
  .text-gradient {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .card::after {
    animation: none !important;
  }

  .hero::before,
  .page-header::before {
    animation: none !important;
  }

  .vtile { transition: none !important; }
  #vtiles-preloader { display: none; }
  .hero__boids { display: none; }
  .cstack__card, .cstack__card.is-exiting { transition: none !important; }
  .atl__dot, .atl__line-fill, .atl__title {
    transition: none !important;
    transition-delay: 0s !important;
  }
}

/* ===================================================================
   Animata components — styles
   =================================================================== */

/* ── Preloader : Vertical Tiles ─────────────────────────────────── */
#vtiles-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.vtile {
  position: absolute;
  top: 0;
  height: 100%;
  background: oklch(9% 0.025 255);
  transform: translateY(0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  will-change: transform;
}

/* ── Shooting Stars : keyframes ─────────────────────────────────── */
@keyframes ss-shoot {
  0%   { transform: translate(0, 0);                      opacity: 0; }
  6%   { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy));       opacity: 0; }
}

@keyframes ss-twinkle {
  0%, 100% { opacity: var(--o); }
  50%       { opacity: calc(var(--o) * 0.25); }
}

/* ── Page-header sombre (Shooting Stars) ────────────────────────── */
.page-header--ss {
  background: oklch(9% 0.025 255);
  color: white;
}

.page-header--ss::before {
  background-image:
    radial-gradient(circle at 50% 30%, oklch(52% 0.20 255 / 22%), transparent 55%);
  background-size: auto;
  -webkit-mask-image: none;
  mask-image: none;
  animation: none;
}

.page-header--ss .page-header__title,
.page-header--ss .page-header__subtitle {
  position: relative;
  z-index: 1;
}

.page-header--ss .page-header__subtitle {
  color: oklch(65% 0.04 255);
}

/* ── Boids canvas ───────────────────────────────────────────────── */
.hero__boids {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Slide Arrow Button ─────────────────────────────────────────── */
.btn--slide-arrow {
  position: relative;
  background: white;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 13px 28px 13px 54px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: color 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
}

.btn--slide-arrow::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 46px;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.22s ease-in-out;
  z-index: 0;
}

.btn--slide-arrow::after {
  content: '→';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 17px;
  z-index: 1;
  pointer-events: none;
}

.btn--slide-arrow > span {
  position: relative;
  z-index: 1;
  transition: transform 0.22s ease;
}

.btn--slide-arrow:hover {
  color: white;
  border-color: var(--accent);
}

.btn--slide-arrow:hover::before { width: 100%; }
.btn--slide-arrow:hover > span  { transform: translateX(-10px); }

/* Variante hero (fond sombre) */
.hero .btn--slide-arrow {
  background: oklch(14% 0.04 255 / 50%);
  border-color: oklch(40% 0.08 255 / 60%);
  color: white;
  backdrop-filter: blur(8px);
}

.hero .btn--slide-arrow:hover {
  color: white;
  border-color: var(--accent);
}

/* ── Card Stack ─────────────────────────────────────────────────── */
#cstack-wrapper {
  max-width: 560px;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
}

.cstack__viewport {
  position: relative;
  padding-top: 56px; /* hauteur pour les cartes qui dépassent par le haut */
  overflow: visible;
}

.cstack__card {
  position: absolute;
  inset-x: 0;
  top: 0;
  margin: 0;
  transform-origin: 50% 0%;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  will-change: transform, opacity;
}

.cstack__card[data-layer="0"] {
  transform: translateY(0%)   scale(1)    rotate(0deg);
  z-index: 20;
}
.cstack__card[data-layer="1"] {
  transform: translateY(-6%)  scale(0.85) rotate(-1.2deg);
  z-index: 10;
}
.cstack__card[data-layer="2"] {
  transform: translateY(-10%) scale(0.72) rotate(1.5deg);
  z-index: 5;
}

.cstack__card.is-exiting {
  transform: translateY(175%) scale(0.9) rotate(var(--exit-rotate, 4deg)) !important;
  opacity: 0 !important;
  z-index: 30 !important;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.8, 1),
              opacity   0.18s ease !important;
}

.cstack__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 4px;
}

.cstack__counter {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-faint);
}

.cstack__hint {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-faint);
}

/* ── Animated Timeline ──────────────────────────────────────────── */
.atl-container {
  position: relative;
  max-width: 680px;
  padding: 8px 0;
}

.atl__item {
  display: flex;
  gap: 20px;
}

.atl__spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
  padding-top: 2px;
}

.atl__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.12s ease;
}

.atl__dot.is-active {
  border-color: var(--accent);
  background-color: var(--accent);
  transform: scale(1.2);
}

.atl__line {
  flex: 1;
  width: 3px;
  min-height: 48px;
  margin-top: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.atl__line-fill {
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.15s ease-in-out;
}

.atl__line-fill.is-active { transform: scaleY(1); }
.atl__item:last-child .atl__line { display: none; }

.atl__content {
  flex: 1;
  padding-bottom: 44px;
}

.atl__item:last-child .atl__content { padding-bottom: 8px; }

.atl__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.atl__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  transition: color 0.12s ease;
}

.atl__title.is-active { color: var(--accent); }

.atl__text {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.atl__list {
  margin-top: 10px;
  padding-left: 18px;
  list-style: disc;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.atl__list li { margin-bottom: 4px; }
