/* ==============================================
   RESET + BASE — Portfolio v2
   Apple-quality scroll snap system
   ============================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll;
  height: 100%;
}

/* Le scroll est piloté par JS sur la snap-page — pas de CSS snap */

body {
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Fond grille + lueur subtile --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 500px at 80% 0%, rgba(45,212,191,0.07), transparent 60%),
    radial-gradient(ellipse 600px 400px at 10% 100%, rgba(96,165,250,0.05), transparent 60%),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100%, 100%, 64px 64px, 64px 64px;
}

/* --- Titres --- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.03em;
}

/* --- Liens --- */
a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--c-accent-dim);
  text-decoration: underline;
  text-decoration-color: var(--c-accent-dim);
  text-underline-offset: 4px;
}
a:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- Images --- */
img { max-width: 100%; height: auto; display: block; }

/* --- Listes --- */
ul, ol { list-style: none; }

/* --- Boutons --- */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* --- Sélection --- */
::selection { background: var(--c-accent); color: var(--c-bg); }

/* --- Scrollbar masquée pour l'effet snap propre --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--c-accent);
  color: var(--c-bg);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--t-base);
}
.skip-link:focus { top: 8px; color: var(--c-bg); }

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

/* --- Menu mobile ouvert — bloquer le scroll --- */
body.menu-open {
  overflow: hidden !important;
}

/* --- Mobile touch — empêcher le rubber-band scroll --- */
@media (max-width: 768px) {
  html { overflow-y: auto; }
  body { -webkit-overflow-scrolling: touch; }
}

/* --- Respect animations réduites --- */
@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;
  }
  html {
    scroll-snap-type: none !important;
  }
  body::before { animation: none !important; }
}
