/* ============================================================
   ShadowCore — Base : reset, fond spatial, typo, layout, nav
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-space);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Profondeur spatiale : nébuleuses fixes derrière tout --- */
.nebula {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 18% 8%, var(--nebula-red), transparent 70%),
    radial-gradient(ellipse 50% 45% at 85% 25%, var(--nebula-mauve), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(76, 29, 149, 0.22), transparent 70%),
    var(--bg-space);
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- Typographie --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-secondary); }

a {
  color: var(--accent-mauve);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-red-hover); }

.text-gradient {
  background: linear-gradient(100deg, var(--accent-red) 10%, var(--accent-mauve) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-mauve);
  margin-bottom: var(--space-3);
}

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

/* --- Layout --- */
.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding-block: var(--space-7); }
.section-head { max-width: 640px; margin-bottom: var(--space-5); }

.grid {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- Header / navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 5, 13, 0.72);
  border-bottom: 1px solid var(--border-glass);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: var(--space-4);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.logo span { color: var(--accent-red); }
.logo:hover { color: var(--text-primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--space-2) 0;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] { color: var(--text-primary); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: var(--space-2);
  cursor: pointer;
}
.nav-toggle svg { display: block; }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-glass);
    padding: var(--space-3) var(--space-4);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: var(--space-3) 0; }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: var(--space-5) 0;
  margin-top: var(--space-7);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-4); list-style: none; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-primary); }

/* --- Reveal au scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* --- Accessibilité --- */
:focus-visible {
  outline: 2px solid var(--accent-mauve);
  outline-offset: 3px;
  border-radius: 4px;
}

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

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
