/* ══════════════════════════════════════════════════════════════════
   RYMOUENZAR · PORTFOLIO — css/global.css
   DA : Dark Codex — encre noire, or ancien, texture de parchemin
   Chargé sur toutes les pages (index + pages de projet).
   ══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────
   0. POLICES
───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@300;400;600&family=Fraunces:ital,opsz,wght@0,9..144,300;1,9..144,400&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');


/* ─────────────────────────────────────────────
   1. TOKENS (variables CSS — source unique)
   Modifier ici pour changer toute la DA.
───────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:             #0d0d0f;
  --surface:        rgba(255, 255, 255, 0.025);
  --surface-hover:  rgba(255, 255, 255, 0.04);

  /* Bordures */
  --border:         rgba(255, 255, 255, 0.06);
  --border-hover:   rgba(184, 134, 11, 0.28);
  --border-focus:   rgba(212, 168, 67, 0.25);
  --bdgc:           #8a6010;
  --bdgbg:          rgba(200, 160, 60, 0.07);
  --bdgbd:          rgba(200, 160, 60, 0.15);

  /* Palette or / ambre */
  --gold-dim:       #b8860b;
  --gold:           #d4a843;
  --gold-bright:    #f0c85a;
  --gold-pale:      #a07020;
  --gold-muted:     #8b6947;
  --beige:          #a09080;

  /* Texte */
  --text:           #e8e0d5;
  --text-muted:     #9a9080;
  --text-dim:       #5a5050;
  --text-link:      #fcd34d;
  --text-link-hover:#fbbf24;
  --link-inline:    #e6d59a;

  /* Rayons */
  --r-sm:   6px;
  --r:      12px;
  --r-pill: 999px;

  /* Transitions */
  --t:      0.18s ease;
  --t-fast: 0.12s ease;

  /* Polices */
  --f-display: 'Fraunces', serif;
  --f-body:    'Outfit', sans-serif;
  --f-mono:    'JetBrains Mono', 'Cascadia Code', monospace;

  /* Espacement de section */
  --section-gap: 28px;
}


/* ─────────────────────────────────────────────
   2. RESET
───────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  cursor: default;
}

::-webkit-scrollbar             { width: 5px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: var(--gold-dim); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }


/* ─────────────────────────────────────────────
   3. BODY
───────────────────────────────────────────── */
body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--f-body);
  font-size:   16px;
  line-height: 1.6;
  min-height:  100vh;
  overflow-x:  hidden;
}


/* ─────────────────────────────────────────────
   4. TEXTURE DE FOND
   Deux lumières ambiantes + grain SVG fractal.
   Animation très douce : ne distrait pas la
   lecture, donne vie au fond.
───────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%,  rgba(180, 120, 40, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%,  rgba(120,  40, 40, 0.09) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  animation: ambient-breathe 14s ease-in-out infinite alternate;
}

@keyframes ambient-breathe {
  from { opacity: 0.75; }
  to   { opacity: 1;    }
}


/* ─────────────────────────────────────────────
   5. NAVIGATION STICKY
   .visible ajoutée par nav.js après 80 px de
   scroll. Disparaît en remontant.
───────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  background: rgba(13, 13, 15, 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav.visible { transform: translateY(0); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 32px;
}

.nav-name {
  font-family: var(--f-display);
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--gold);
  text-transform: uppercase;
}

.nav-links { display: flex; gap: 24px; }

.nav-link {
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.nav-link:hover { color: var(--gold); }


/* ─────────────────────────────────────────────
   6. CONTENEUR DE PAGE
───────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}


/* ─────────────────────────────────────────────
   7. ENTÊTE (header)
   Styles de base partagés.
   L'image de fond (pages de projet) est dans
   project.css via la variable --page-cover.
───────────────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 10px;
}

/* Ligne ornementale ✦ ✦ ✦ */
.rune-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--gold-dim);
  font-size: 20px;
  letter-spacing: 6px;
  opacity: 0.6;
}

.rune-line::before,
.rune-line::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* Titre principal en dégradé or */
header h1 {
  font-family: var(--f-display);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.2;
  background: linear-gradient(135deg,
    var(--gold)        0%,
    var(--gold-bright) 40%,
    var(--gold)        60%,
    var(--gold-pale)   100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sous-titre de la page (index : tagline) */
.page-subtitle {
  margin-top: 16px;
  font-size: 18px;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 1px;
}

/* Sous-titre injecté (pages de projet) */
header p {
  margin-top: 16px;
  font-size: 18px;
  color: var(--beige);
  font-style: italic;
  letter-spacing: 1px;
}


/* ─────────────────────────────────────────────
   8. TITRES DE SECTION
───────────────────────────────────────────── */
.section-title {
  font-family: var(--f-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-top: var(--section-gap);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(184, 134, 11, 0.35), transparent);
}

/* Sous-titre centré avec filets (pages de projet) */
.section-subtitle {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--gold-muted);
  margin-top: 6px;
  margin-bottom: 14px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  display: flex;
  gap: 12px;
}

.section-subtitle::after {
  content: '';
  flex: 1;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, #8b6947, transparent);
}

.section-subtitle::before {
  content: '';
  flex: 1;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, transparent, #8b6947);
}


/* ─────────────────────────────────────────────
   9. CARTE GÉNÉRIQUE
   Utilisée en index (profil, stack) et en pages
   de projet (résumé).
───────────────────────────────────────────── */
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
}


/* ─────────────────────────────────────────────
   10. TAGS ET BADGES
   .tag/.badge : pill technologie ou catégorie.
   .tag-link   : variante cliquable (filtre/lien).
───────────────────────────────────────────── */
.tag,
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  text-decoration: none;
  white-space: nowrap;
}

.tag-link {
  cursor: pointer;
  transition: color var(--t-fast), transform var(--t-fast);
}

.tag-link:hover,
.tag-link:active {
  color: var(--text-link);
  transform: translateY(-1px);
}

.tag-link:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 4px;
}


/* ─────────────────────────────────────────────
   11. LIEN D'ACCENTUATION
   Utilisé partout (carte projet, nav, retour…).
───────────────────────────────────────────── */
.contact-link {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color var(--t-fast);
}

.contact-link:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}


/* ─────────────────────────────────────────────
   12. FOOTER
───────────────────────────────────────────── */
footer {
  text-align: center;
  padding-top: 32px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 1px;
}

footer span { color: var(--gold-dim); }


/* ─────────────────────────────────────────────
   13. IMAGES ET VIDÉOS
───────────────────────────────────────────── */
img {
  display: block;
  margin: auto;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  backface-visibility: hidden;
  transition: transform var(--t), opacity var(--t);
}

img:not(.nohover):hover { transform: scale(1.02); }

video {
  display: block;
  margin: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform var(--t);
}

video:not(.nohover):hover { transform: scale(1.02); }


/* ─────────────────────────────────────────────
   14. ORNEMENT DÉCORATIF ✦ ✦ ✦
───────────────────────────────────────────── */
.ornament {
  text-align: center;
  color: var(--gold-dim);
  font-size: 14px;
  letter-spacing: 8px;
  margin: 8px 0 32px;
  opacity: 0.4;
}


/* ─────────────────────────────────────────────
   15. LIENS INLINE (descriptions, résumés)
───────────────────────────────────────────── */
#project-short a,
.project-desc a,
.about-card a,
.container a,
.project-content a {
  color: var(--link-inline);
  text-decoration: none;
  border-bottom: 1px solid rgba(230, 213, 154, 0.08);
  transition: color var(--t-fast), border-color var(--t-fast);
}

#project-short a:hover,
.project-desc a:hover,
.about-card a:hover,
.container a:hover,
.project-content a:hover {
  color: var(--text-link);
  border-color: rgba(252, 211, 77, 0.28);
}

#project-short a[target="_blank"]::after {
  content: ' ↗';
  font-size: 0.9em;
  opacity: 0.75;
  margin-left: 2px;
}


/* ─────────────────────────────────────────────
   16. ANIMATIONS D'ENTRÉE
   .animate-in : fade + glissement vers le haut.
   --delay     : offset pour l'effet cascade.
───────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.animate-in {
  opacity: 0;
  animation: fadeSlideUp 0.55s ease forwards;
  animation-delay: var(--delay, 0ms);
}


/* ─────────────────────────────────────────────
   17. ANIMATIONS AU SCROLL
   nav.js observe les .reveal via
   IntersectionObserver et ajoute .in-view.
───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}


/* ─────────────────────────────────────────────
   18. UTILITAIRES TEXTE
───────────────────────────────────────────── */
.muted {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: justify;
}

.small {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--gold-muted);
}

.container {
  color: var(--text-muted);
  font-size: 14px;
  text-align: justify;
  margin-top: 8px;
  margin-left: 25px;
  margin-right: 25px;
}

.spacer-sm { height: 18px; }
.spacer-md { height: 32px; }


/* ─────────────────────────────────────────────
   19. RESPONSIVE — BASE
───────────────────────────────────────────── */
@media (max-width: 640px) {
  .page      { padding: 28px 16px 60px; }
  .nav-inner { padding: 10px 16px; }
  .nav-links { gap: 14px; }
  .nav-link  { font-size: 9px; }
}
