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

:root {
  --bg:        #15151a;
  --bg-alt:    #1c1c23;
  --surface:   #22222b;
  --border:    #2e2e3a;
  --text:      #ddddd5;
  --text-dim:  #666672;
  --text-mute: #44444f;
  --green:     #7fff00;
  --magenta:   #ff2d78;
  --cyan:      #00e5cc;
  --orange:    #ff8c00;
  --purple:    #b388ff;
  --mono:      'JetBrains Mono', monospace;
  --display:   'Syne', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  cursor: none;
  overflow-x: hidden;
}

/* ── CUSTOM CURSOR ────────────────────────────────────────── */
#cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--green);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  transition: transform 0.08s ease, opacity 0.2s;
}

#cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--green);
  pointer-events: none;
  z-index: 9998;
  opacity: 0.4;
  transition: transform 0.18s ease, width 0.2s, height 0.2s, opacity 0.2s;
}

/* ── SCANLINE OVERLAY ─────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 9000;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 21, 26, 0.9);
  backdrop-filter: blur(8px);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-logo span { color: var(--text-dim); }

/* index */
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  transition: color 0.15s;
  position: relative;
}

.nav-links a::before {
  content: '//';
  color: var(--magenta);
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::before { opacity: 1; }

/* pages projets */
.nav-back {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-back::before { content: '←'; color: var(--magenta); }
.nav-back:hover { color: var(--text); }

/* ── SCROLL REVEAL ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── THEME TOGGLE ─────────────────────────────────────────── */
.nav-theme-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0;
  line-height: 1;
  cursor: none;
  transition: color 0.15s;
  flex-shrink: 0;
}

.nav-theme-toggle:hover { color: var(--text); }

/* ── LIGHT MODE ───────────────────────────────────────────── */
[data-theme="light"] {
  /* Neutres — teinte ambrée H=38, parchemin */
  --bg:        #f5eedb;
  --bg-alt:    #ece4ca;
  --surface:   #e1d8b8;
  --border:    #c9bca0;
  /* Textes — encre chaude */
  --text:      #1e1a0c;
  --text-dim:  #5a5040;
  --text-mute: #8a7a62;
  /* Accents recalibrés pour le fond parchemin */
  --green:     #3a7000;   /* chartreuse assombri — ratio ~4.8:1 sur --bg */
  --magenta:   #c80054;   /* fuchsia profond     — ratio ~5.1:1 sur --bg */
  --cyan:      #006b5e;   /* teal chaud          — ratio ~5.6:1 sur --bg */
  --orange:    #b85400;   /* orangé brûlé        — ratio ~4.6:1 sur --bg */
  --purple:    #6a3a9e;   /* violet              — ratio ~5.0:1 sur --bg */
}

[data-theme="light"] nav {
  background: rgba(245, 238, 219, 0.92);
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
}

[data-theme="light"] #cursor {
  mix-blend-mode: multiply;
}

[data-theme="light"] #cursor-ring {
  mix-blend-mode: multiply;
}

/* ── RESPONSIVE NAV ───────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 16px 24px; }
}
