/* ===================================================================
   Clément HAOND — Portfolio · base.css
   Variables, reset, typographie de base, boutons, utilitaires partagés
   (section-label, reveal-on-scroll). Chargé en premier sur toutes les pages.
   =================================================================== */

/* ===================================================================
   Clément HAOND — Portfolio
   Direction artistique : "atelier minimalism"
   Papier chaud, encre presque noire, aplats pastel posés comme des
   touches uniques — typographie éditoriale, système numéroté,
   liens à soulignement tracé. Aucune gradient, aucun badge, aucune pilule.
   =================================================================== */

:root {
  /* Palette — aplats mats, pas de dégradés */
  --color-paper:       #F5F1E9; /* papier chaud */
  --color-paper-deep:  #EEE8DC; /* papier — sections alternées */
  --color-ink:         #1A1A1A; /* encre quasi noire */
  --color-muted:       #6B6660; /* gris chaud, texte secondaire */
  --color-line:        #DEDACD; /* trait fin chaud */

  --color-blue:        #B7C7DA; /* bleu poussiéreux */
  --color-clay:        #D9BFAE; /* terre cuite pâle */
  --color-sage:        #C2CBB8; /* sauge */
  --color-stone:       #D6D2DE; /* pierre lavande */
  --color-clay-deep:   #8B5E41; /* terre cuite — version texte (contraste AA) */

  --color-white:       #FFFFFF;

  /* Typographie */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Échelle d'espacement */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --space-7: 8rem;

  /* Mouvement */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 220ms;
  --duration-base: 460ms;

  --container-width: 1180px;
  --radius: 3px;
}

/* -------------------------------------------------------------- */
/* Reset & base                                                    */
/* -------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-paper);
}

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

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

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

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

h2 { font-size: clamp(2rem, 3.6vw, 2.625rem); font-weight: 450; }
h3 { font-size: 1.375rem; font-weight: 500; }

p { margin: 0; }

.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  z-index: 200;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

:focus-visible {
  outline: 1.5px solid var(--color-ink);
  outline-offset: 3px;
  border-radius: 1px;
}

/* -------------------------------------------------------------- */
/* Section label — système numéroté                               */
/* -------------------------------------------------------------- */

.section-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 0 0 var(--space-2);
}
.section-label__index {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--color-ink);
}

/* -------------------------------------------------------------- */
/* Transition de page (View Transitions API, navigation MPA)      */
/* -------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: var(--duration-base);
    animation-timing-function: var(--ease-out);
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* -------------------------------------------------------------- */
/* Reveal-on-scroll                                                */
/* -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
  transition-delay: calc(var(--delay, 0) * 70ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------- */
/* Buttons — rectangulaires, sans pilule                           */
/* -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn--dark {
  background: var(--color-ink);
  color: var(--color-paper);
}
.btn--dark:hover { background: #322F2A; }

.btn--ghost {
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}
.btn--ghost:hover { background: var(--color-ink); color: var(--color-paper); }

.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
}
.btn--primary:hover { background: #322F2A; }

.btn--small { padding: 0.65rem 1.35rem; font-size: 0.875rem; }
.btn--full { width: 100%; }

/* -------------------------------------------------------------- */
/* Easter egg — flash de transition vers /secret/                 */
/* -------------------------------------------------------------- */
.glitch-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background: #0a0118;
}
.glitch-flash.is-active {
  animation: glitch-flash-seq 650ms steps(1, end) forwards;
}
@keyframes glitch-flash-seq {
  0%   { opacity: 0; background: #0a0118; }
  10%  { opacity: 1; background: #ff2e9a; }
  25%  { opacity: 1; background: #00f0ff; }
  40%  { opacity: 1; background: #fbff2e; }
  55%  { opacity: 1; background: #39ff7a; }
  70%  { opacity: 1; background: #8b3bff; }
  85%  { opacity: 1; background: #0a0118; }
  100% { opacity: 1; background: #0a0118; }
}

/* -------------------------------------------------------------- */
/* Easter egg — miette discrète vers /secret/                     */
/* -------------------------------------------------------------- */
.secret-crumb {
  display: inline-block;
  margin-left: 0.5em;
  color: var(--color-line);
  text-decoration: none;
  font-size: 0.75em;
  line-height: 1;
  opacity: 0.5;
  transition: opacity var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}
.secret-crumb:hover,
.secret-crumb:focus-visible {
  opacity: 1;
  color: var(--color-clay-deep);
}

