:root {
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --accent: #22d3ee;
  --accent2: #a78bfa;
  --accent3: #34d399;
  --bg: #09090b;
  --card-bg: #18181b;
  --border: #27272a;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
  --radius: 8px;
}

html[data-theme="light"] {
  --text: #1c1917;
  --text-dim: #57534e;
  --accent: #0891b2;
  --accent2: #7c3aed;
  --accent3: #059669;
  --bg: #f5f5f4;
  --card-bg: #ffffff;
  --border: #d6d3d1;
}
html[data-theme="light"] ::selection { background: rgba(8, 145, 178, 0.15); }
html[data-theme="light"] .achievement.legendary { border-color: rgba(180, 130, 0, 0.35); }
html[data-theme="light"] .achievement.legendary:hover { border-color: rgba(180, 130, 0, 0.6); }
html[data-theme="light"] .achievement.epic { border-color: rgba(124, 58, 237, 0.3); }
html[data-theme="light"] .achievement.epic:hover { border-color: rgba(124, 58, 237, 0.55); }
html[data-theme="light"] .node-circle { fill: #ffffff !important; }
html[data-theme="light"] .konami-toast { background: #ffffff; }

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

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}

::selection { background: rgba(34, 211, 238, 0.2); }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

/* ── Lang toggle ── */
.lang-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-dim);
  z-index: 10;
  transition: all 0.2s;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Hero ── */
.hero { margin-bottom: 4rem; }

.hero-prompt {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
.hero-prompt .path { color: var(--accent3); }
.hero-prompt .chevron { color: var(--accent); }

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.hero h1 .dot { color: var(--accent); }

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hero-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.05);
}

/* ── Sections ── */
section { margin-bottom: 3.5rem; }

.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent2);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── About ── */
.about p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 600px;
}
.about .highlight {
  color: var(--text);
  font-weight: 500;
}

/* (timeline removed — replaced by achievements) */

/* ── Exploration Minimap ── */
.minimap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid rgba(100, 220, 255, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
}
html[data-theme="light"] .minimap {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(0, 80, 120, 0.2);
}
html[data-theme="light"] .mm-region { opacity: 0.12; }
html[data-theme="light"] .mm-label { opacity: 0.6; }
html[data-theme="light"] .mm-label[data-zone="code"]    { color: #0e7490; }
html[data-theme="light"] .mm-label[data-zone="spatial"] { color: #6d28d9; }
html[data-theme="light"] .mm-label[data-zone="atelier"] { color: #047857; }
html[data-theme="light"] .mm-label[data-zone="famille"] { color: #a16207; }
/* grid overlay */
.minimap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100, 220, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 220, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
html[data-theme="light"] .minimap::before {
  background-image:
    linear-gradient(rgba(0, 60, 100, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 60, 100, 0.06) 1px, transparent 1px);
}
/* scan line animation */
.minimap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(100, 220, 255, 0.03) 50%, transparent 100%);
  height: 30%;
  animation: scanline 4s linear infinite;
  pointer-events: none;
}
html[data-theme="light"] .minimap::after {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 80, 140, 0.04) 50%, transparent 100%);
}
@keyframes scanline { 0% { top: -30%; } 100% { top: 100%; } }

/* zone regions — positioned absolutely */
.mm-region {
  position: absolute;
  border-radius: 50%;
  filter: blur(25px);
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.4s;
}
.mm-region[data-zone="code"]    { background: #22d3ee; width: 45%; height: 70%; top: 10%; left: 3%; }
.mm-region[data-zone="spatial"] { background: #a78bfa; width: 40%; height: 60%; top: 5%;  left: 55%; }
.mm-region[data-zone="atelier"] { background: #34d399; width: 35%; height: 55%; top: 40%; left: 55%; }
.mm-region[data-zone="famille"] { background: #eab308; width: 30%; height: 50%; top: 45%; left: 8%; }

/* zone labels */
.mm-label {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.35;
  pointer-events: none;
}
.mm-label[data-zone="code"]    { color: #22d3ee; top: 8%;  left: 12%; }
.mm-label[data-zone="spatial"] { color: #a78bfa; top: 8%;  left: 68%; }
.mm-label[data-zone="atelier"] { color: #34d399; top: 62%; left: 68%; }
.mm-label[data-zone="famille"] { color: #eab308; top: 62%; left: 12%; }

/* POI dots */
.mm-poi {
  position: absolute;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 10px;
}
.mm-poi .mm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mm-poi .mm-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  animation: poi-ping 2.5s ease-out infinite;
}
@keyframes poi-ping {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}
.mm-poi:hover .mm-dot { transform: scale(1.5); }
.mm-poi.active .mm-dot { transform: scale(1.8); }
.mm-poi .mm-tip {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  background: rgba(10, 12, 18, 0.7);
  padding: 2px 6px;
  border-radius: 3px;
}
html[data-theme="light"] .mm-poi .mm-tip {
  background: rgba(255, 255, 255, 0.85);
}
.mm-poi:hover .mm-tip { opacity: 1; }
.mm-poi.placeholder .mm-dot { opacity: 0.25; }
.mm-poi.placeholder .mm-dot::after { display: none; }

@media (max-width: 580px) {
  .minimap { aspect-ratio: 4 / 5; }
  .mm-tip { display: none; }
}

/* Detail panel */
.map-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease-out;
}
.map-detail.show {
  max-height: 500px;
  opacity: 1;
}
.map-detail .detail-zone {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.map-detail .detail-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.map-detail .detail-ctx {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.map-detail .detail-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.map-detail .detail-img {
  margin-top: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: none;
}
.map-detail .detail-img.show { display: block; }
.map-detail a {
  color: var(--accent);
  text-decoration: none;
}
.map-detail a:hover { text-decoration: underline; }

/* ── Skill Tree ── */
.skill-tree-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  padding: 1rem 0;
}
.skill-tree-svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.skill-tree-svg .edge {
  stroke-dasharray: 6 4;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.8s ease-out, opacity 0.6s;
  opacity: 0;
}
.skill-tree-svg.revealed .edge {
  stroke-dashoffset: 0;
  opacity: 1;
}
.skill-tree-svg .node-circle {
  transition: r 0.2s, filter 0.2s;
  cursor: pointer;
}
.skill-tree-svg .node-circle:hover {
  r: 22;
  filter: drop-shadow(0 0 12px currentColor);
}
.skill-tree-svg .node-icon {
  pointer-events: none;
  font-size: 14px;
  transition: font-size 0.2s;
}
.skill-tree-svg .node-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--text-dim);
  transition: fill 0.2s;
  pointer-events: none;
}
.skill-tree-svg .node-group:hover .node-label { fill: var(--text); }
.skill-tree-svg .node-group {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.skill-tree-svg.revealed .node-group {
  opacity: 1;
  transform: scale(1);
}
/* staggered reveal */
.skill-tree-svg.revealed .node-group.d0 { transition-delay: 0s; }
.skill-tree-svg.revealed .node-group.d1 { transition-delay: 0.15s; }
.skill-tree-svg.revealed .node-group.d2 { transition-delay: 0.3s; }
.skill-tree-svg.revealed .node-group.d3 { transition-delay: 0.45s; }
.skill-tree-svg.revealed .edge.d0 { transition-delay: 0.05s; }
.skill-tree-svg.revealed .edge.d1 { transition-delay: 0.2s; }
.skill-tree-svg.revealed .edge.d2 { transition-delay: 0.35s; }

/* Tooltip */
.tree-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px;
}
.tree-tooltip.show { opacity: 1; }
.tree-tooltip .tt-name { font-weight: 600; margin-bottom: 2px; }
.tree-tooltip .tt-desc { color: var(--text-dim); font-size: 0.7rem; }

/* ── Achievements ── */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.achievement {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 3.2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(8px);
}
.achievement.revealed {
  opacity: 1;
  transform: translateY(0);
}
.achievement:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.achievement::before {
  content: attr(data-icon);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  width: 1.8rem;
  text-align: center;
}
.achievement .ach-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 2px;
}
.achievement .ach-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.achievement .ach-year {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  margin-top: 4px;
}
.achievement.legendary { border-color: rgba(234, 179, 8, 0.3); }
.achievement.legendary:hover { border-color: rgba(234, 179, 8, 0.6); box-shadow: 0 0 20px rgba(234, 179, 8, 0.08); }
.achievement.legendary .ach-year { color: #eab308; }
.achievement.epic { border-color: rgba(167, 139, 250, 0.3); }
.achievement.epic:hover { border-color: rgba(167, 139, 250, 0.6); }
.achievement.epic .ach-year { color: var(--accent2); }

@media (max-width: 580px) {
  .achievements-grid { grid-template-columns: 1fr; }
}

/* (education merged into achievements) */

/* ── Footer ── */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--border);
}

/* ── Responsive ── */
@media (max-width: 580px) {
  .container { padding: 3rem 1rem 2rem; }
  .hero h1 { font-size: 1.8rem; }
  .map-svg { min-height: 280px; }
}

/* ── Bilingual ── */
[data-lang="en"] { display: none; }
html[lang="en"] [data-lang="en"] { display: revert; }
html[lang="en"] [data-lang="fr"] { display: none; }

/* ── Canvas BG ── */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.container { position: relative; z-index: 1; }
.lang-toggle { z-index: 10; }

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-dim);
  z-index: 10;
  transition: all 0.3s;
  line-height: 1;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Easter eggs ── */
.hero h1 .dot {
  cursor: default;
  transition: all 0.3s;
}
.hero h1 .dot:hover {
  text-shadow: 0 0 12px var(--accent);
}
.secret-msg {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease-out;
  margin-top: 0.5rem;
}
.secret-msg.show {
  opacity: 1;
  max-height: 3rem;
}

/* Konami mode */
.konami-active {
  animation: konamiFlash 0.3s;
}
@keyframes konamiFlash {
  0%, 100% { filter: none; }
  50% { filter: hue-rotate(90deg) saturate(2); }
}
.konami-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-bg);
  border: 1px solid #eab308;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #eab308;
  z-index: 100;
  opacity: 0;
  transition: all 0.4s ease-out;
  pointer-events: none;
  white-space: nowrap;
}
.konami-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Stars easter egg tooltip */
.stars-hint {
  cursor: help;
  border-bottom: 1px dotted rgba(167, 139, 250, 0.3);
  transition: border-color 0.2s;
}
.stars-hint:hover {
  border-color: var(--accent2);
}

/* ── Focus styles (a11y) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Subtle animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero, section, footer {
  animation: fadeUp 0.5s ease-out both;
}
section:nth-child(2) { animation-delay: 0.05s; }
section:nth-child(3) { animation-delay: 0.1s; }
section:nth-child(4) { animation-delay: 0.15s; }
section:nth-child(5) { animation-delay: 0.2s; }
section:nth-child(6) { animation-delay: 0.25s; }
footer { animation-delay: 0.3s; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #bg { display: none; }
}
