/* ============================================================
   ESPINOR — STYLES
   Conseil Finance & Data — Thomas Bosshard
   ------------------------------------------------------------
   Sommaire du fichier :
   1. Tokens (couleurs, typographies, espacements)
   2. Reset / base
   3. Layout utilitaires
   4. Header & navigation
   5. Rail de navigation (points, desktop)
   6. Hero
   7. Expertises
   8. Expériences / cas d'usage
   9. Articles
   10. À propos
   11. Contact
   12. Footer
   13. Animations
   14. Responsive
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Couleurs de marque */
  --navy: #0B1020;
  --ink: #16213E;
  --cobalt: #245CFF;
  --violet: #4B2A7B;
  --icy: #9FD6FF;
  --white: #FFFFFF;
  --off-white: #F5F7FB;
  --grey: #A7B0C0;

  /* Rôles sémantiques */
  --bg-dark: var(--navy);
  --bg-dark-alt: var(--ink);
  --bg-light: var(--off-white);
  --bg-light-alt: var(--white);

  --text-on-dark: var(--white);
  --text-on-dark-muted: var(--grey);
  --text-on-light: var(--navy);
  --text-on-light-muted: #5B6478;

  --accent: var(--cobalt);
  --accent-soft: var(--icy);
  --border-dark: rgba(159, 214, 255, 0.16);
  --border-light: rgba(11, 16, 32, 0.10);

  /* Typographie */
  --font-display: 'Space Grotesk', 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Échelle */
  --fs-eyebrow: 0.72rem;
  --fs-body: 1rem;
  --fs-body-lg: 1.125rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h1: clamp(2.4rem, 5.5vw, 4.2rem);

  /* Espacements */
  --section-pad-y: clamp(4.5rem, 9vw, 8rem);
  --container-w: 1180px;
  --gutter: clamp(1.5rem, 5vw, 3rem);

  /* Autres */
  --radius: 2px;
  --transition: 420ms cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 84px;
}

/* ---------- 2. RESET / BASE ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg-light);
  color: var(--text-on-light);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

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

::selection {
  background: var(--cobalt);
  color: var(--white);
}

/* Accessibilité : focus visible clair partout */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. LAYOUT UTILITAIRES ---------- */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--section-pad-y) 0;
  position: relative;
}

.section--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--light {
  background: var(--bg-light);
  color: var(--text-on-light);
}

.section--alt {
  background: var(--bg-light-alt);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section--dark .eyebrow { color: var(--accent-soft); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2 {
  margin-top: 0.9rem;
}

.section-head p {
  margin-top: 1.1rem;
  color: var(--text-on-light-muted);
  font-size: var(--fs-body-lg);
}

.section--dark .section-head p {
  color: var(--text-on-dark-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.7rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

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

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

.btn--primary:hover { background: #1c4bdb; }

.btn--ghost-dark {
  border-color: var(--border-dark);
  color: var(--text-on-dark);
}

.btn--ghost-dark:hover {
  border-color: var(--icy);
  background: rgba(159, 214, 255, 0.06);
}

.btn--ghost-light {
  border-color: var(--border-light);
  color: var(--text-on-light);
}

.btn--ghost-light:hover {
  border-color: var(--navy);
  background: rgba(11, 16, 32, 0.03);
}

.btn svg { width: 15px; height: 15px; }

/* ---------- 4. HEADER & NAVIGATION ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(11, 16, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-dark);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  height: 30px;
  width: auto;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--white);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.5vw, 2.4rem);
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-on-dark-muted);
  position: relative;
  padding: 0.4rem 0;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-soft);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  display: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--white);
}

.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- 5. RAIL DE NAVIGATION (points, desktop) ---------- */
.section-rail {
  position: fixed;
  right: clamp(1.2rem, 3vw, 2.6rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-rail__line {
  width: 1px;
  flex: 1;
  background: linear-gradient(to bottom, transparent, var(--grey) 15%, var(--grey) 85%, transparent);
  opacity: 0.35;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
}

.section-rail__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0;
}

.section-rail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--grey);
  background: var(--bg-light);
  transition: all var(--transition);
}

.section-rail__item.is-active .section-rail__dot {
  background: var(--cobalt);
  border-color: var(--cobalt);
  box-shadow: 0 0 0 4px rgba(36, 92, 255, 0.15);
}

.section-rail__label {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: var(--navy);
  color: var(--white);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.section-rail__item:hover .section-rail__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---------- 6. HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  overflow: hidden;
  padding-top: var(--header-h);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 85% 30%, rgba(75, 42, 123, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(36, 92, 255, 0.12), transparent 60%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow { margin-bottom: 1.4rem; }

.hero-copy h1 {
  max-width: 15ch;
}

.hero-copy p {
  margin-top: 1.6rem;
  max-width: 46ch;
  font-size: var(--fs-body-lg);
  color: var(--text-on-dark-muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}

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

.hero-visual svg {
  width: min(420px, 90%);
  height: auto;
}

/* Gyroscope — tous les anneaux tournent à la même vitesse (30s),
   chacun dans son sens, en conservant son inclinaison de départ.
   Les paires anneau clair + anneau net tournent à l'unisson.
   Le cœur (losange + points) reste fixe : l'axe stable du gyroscope. */
.hero-visual svg ellipse { transform-origin: 60px 60px; }
.hero-visual svg ellipse:nth-of-type(1),
.hero-visual svg ellipse:nth-of-type(4) { animation: spin-outer 30s linear infinite; }   /* anneau externe, horaire */
.hero-visual svg ellipse:nth-of-type(2),
.hero-visual svg ellipse:nth-of-type(5) { animation: spin-inner 30s linear infinite; }   /* anneau interne, anti-horaire */
.hero-visual svg ellipse:nth-of-type(3) { animation: spin-equator 30s linear infinite; } /* équateur, horaire */

.hero-meta {
  margin-top: 3.2rem;
  display: flex;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  flex-wrap: wrap;
}

.hero-meta div {
  border-left: 1px solid var(--border-dark);
  padding-left: 1rem;
}

.hero-meta .num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--white);
}

.hero-meta .label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
}

.scroll-cue {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  color: var(--text-on-dark-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.scroll-cue span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-cue .line {
  width: 1px;
  height: 26px;
  background: var(--grey);
  overflow: hidden;
  position: relative;
}

.scroll-cue .line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--icy);
  animation: cue-fall 2.2s ease-in-out infinite;
}

/* ---------- 7. EXPERTISES ---------- */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}

.expertise-card {
  background: var(--bg-light);
  padding: 2.2rem;
  transition: background var(--transition);
}

.expertise-card:hover {
  background: var(--bg-light-alt);
}

.expertise-card__ring {
  width: 34px;
  height: 34px;
  margin-bottom: 1.4rem;
}

.expertise-card h3 {
  font-size: 1.1rem;
}

.expertise-card p {
  margin-top: 0.8rem;
  color: var(--text-on-light-muted);
  font-size: 0.95rem;
}

.expertise-audience {
  margin-top: 1.8rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: var(--text-on-light-muted);
}

/* ---------- 8. EXPÉRIENCES / CAS D'USAGE ---------- */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}

.experience-card {
  background: var(--bg-dark-alt);
  border: 1px solid var(--border-dark);
  padding: 2.4rem;
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition);
}

.experience-card:hover {
  transform: translateY(-4px);
  border-color: var(--icy);
}

.experience-card__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid var(--border-dark);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
}

.experience-card h3 {
  font-size: var(--fs-h3);
  color: var(--white);
}

.experience-card p {
  margin-top: 1rem;
  color: var(--text-on-dark-muted);
  font-size: 0.95rem;
}

.experience-card__list {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.experience-card__list li {
  font-size: 0.85rem;
  color: var(--grey);
  padding-left: 1.1rem;
  position: relative;
}

.experience-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 5px;
  height: 1px;
  background: var(--accent-soft);
}

.experience-card__result {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-dark);
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--icy);
}

/* ---------- 9. ARTICLES ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.6rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-light-alt);
  border: 1px solid var(--border-light);
  padding: 2.2rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.article-card:hover {
  border-color: var(--cobalt);
  box-shadow: 0 12px 32px -18px rgba(36, 92, 255, 0.35);
}

.article-card__status {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-card h3 {
  margin-top: 1rem;
  font-size: 1.15rem;
}

.article-card p {
  margin-top: 0.9rem;
  color: var(--text-on-light-muted);
  font-size: 0.94rem;
  flex: 1;
}

.article-card__link {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--navy);
}

.article-card__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.article-card:hover .article-card__link svg {
  transform: translateX(4px);
}

/* ---------- 10. À PROPOS ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about-visual {
  display: flex;
  justify-content: center;
}

.about-visual svg {
  width: min(220px, 70%);
}

.about-copy p {
  color: var(--text-on-light-muted);
  font-size: var(--fs-body-lg);
}

.about-copy p + p {
  margin-top: 1.2rem;
}

.about-copy strong {
  color: var(--navy);
  font-weight: 600;
}

/* Valeurs de marque : nom en display + ligne d'incarnation */
.about-values {
  margin-top: 2.4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.about-value {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.2rem;
  align-items: baseline;
}

.about-value__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--navy);
  position: relative;
  padding-left: 1.1rem;
}

.about-value__name::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 1px;
  background: var(--cobalt);
}

.about-value p {
  font-size: 0.96rem;
  color: var(--text-on-light-muted);
  line-height: 1.55;
}

.about-signature {
  margin-top: 2.2rem;
  font-size: 0.9rem;
  color: var(--text-on-light-muted);
  opacity: 0.85;
}

@media (max-width: 560px) {
  .about-value {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* ---------- 11. CONTACT ---------- */
.contact-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: end;
}

.contact-copy h2 { max-width: 12ch; }

.contact-copy p {
  margin-top: 1.4rem;
  color: var(--text-on-dark-muted);
  font-size: var(--fs-body-lg);
  max-width: 40ch;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.contact-links {
  display: flex;
  gap: 1.6rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.contact-links a {
  font-size: 0.9rem;
  color: var(--text-on-dark-muted);
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.contact-links a:hover {
  color: var(--white);
  border-color: var(--icy);
}

/* ---------- 12. FOOTER ---------- */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  border-top: 1px solid var(--border-dark);
  padding: 2.4rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer img { height: 20px; }

.footer-meta {
  display: flex;
  gap: 1.6rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.footer-meta a:hover { color: var(--white); }

/* ---------- 13. ANIMATIONS ---------- */
/* Chaque anneau part de son inclinaison d'origine et effectue un tour complet.
   Même amplitude (360°) et même durée pour tous → vitesse identique. */
@keyframes spin-outer {   /* inclinaison -10°, sens horaire */
  from { transform: rotate(-10deg); }
  to   { transform: rotate(350deg); }
}

@keyframes spin-inner {   /* inclinaison 28°, sens anti-horaire */
  from { transform: rotate(28deg); }
  to   { transform: rotate(-332deg); }
}

@keyframes spin-equator { /* équateur horizontal, sens horaire */
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes cue-fall {
  0% { top: -100%; }
  100% { top: 100%; }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 900ms ease, transform 900ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 14. RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 1rem;
  }

  .hero-visual svg { width: min(280px, 70%); }

  .about-grid,
  .contact-inner {
    grid-template-columns: 1fr;
  }

  .about-visual { order: -1; margin-bottom: 1rem; }

  .section-rail { display: none; }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }

  .brand-mark { height: 24px; }
  .brand-name { font-size: 0.95rem; }

  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 1px solid var(--border-dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem var(--gutter) 2rem;
    gap: 1.2rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }

  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hero-meta { gap: 1.4rem; }

  .contact-inner { align-items: start; }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}
