/* TODO: Theme Game Boy n&b */
/* TODO: Theme Atari ST */
/* TODO: Theme switcher */
/* TODO: Plusieurs variantes de thème terminal (retro green, amber, catppuccin...) */

/* Catppuccin Mocha */
:root {
  --bg: #1e1e2e;
  --header-bg: #181825;
  --border: #313244;
  --surface: #45475a;
  --text: #cdd6f4;
  --text-dim: #a6adc8;
  --text-light: #bac2de;
  --accent: #cba6f7;   /* mauve */
  --accent2: #f9e2af;  /* yellow */
  --blue: #89b4fa;
  --green: #a6e3a1;
  --comment: #6c7086;
}

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

body {
  background: var(--bg);
  color: var(--green);
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.7;
  min-height: 100vh;
}

/* ---- DRACULA ---- */
body.theme-dracula {
  --bg: #282a36;
  --header-bg: #21222c;
  --border: #44475a;
  --surface: #44475a;
  --text: #f8f8f2;
  --text-dim: #6272a4;
  --text-light: #f8f8f2;
  --accent: #bd93f9;
  --accent2: #ffb86c;
  --blue: #8be9fd;
  --green: #50fa7b;
  --comment: #6272a4;
}

/* ---- SOLARIZED LIGHT ---- */
body.theme-solarized {
  --bg: #fdf6e3;
  --header-bg: #eee8d5;
  --border: #93a1a1;
  --surface: #839496;
  --text: #073642;
  --text-dim: #657b83;
  --text-light: #586e75;
  --accent: #6c71c4;
  --accent2: #b58900;
  --blue: #268bd2;
  --green: #073642;
  --comment: #93a1a1;
}

/* Language switch */
body.lang-fr .en { display: none; }
body.lang-en .fr { display: none; }

/* ---- HEADER ---- */
header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.nav-brand {
  color: var(--accent);
  font-size: 0.85em;
  letter-spacing: 1px;
  text-decoration: none;
}

.nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-right a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.8em;
  padding: 3px 10px;
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.nav-right a:hover,
.nav-right a.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.lang-btn {
  background: none;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  font-family: inherit;
  font-size: 0.8em;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: inherit;
}

.lang-btn:hover {
  background: var(--accent2);
  color: var(--bg);
}

.theme-btn {
  background: none;
  border: 1px solid var(--blue);
  color: var(--blue);
  font-family: inherit;
  font-size: 0.8em;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: inherit;
}

.theme-btn:hover {
  background: var(--blue);
  color: var(--bg);
}

/* ---- MAIN ---- */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---- TYPOGRAPHY ---- */
h1 {
  color: var(--accent);
  font-size: 2.4em;
  font-weight: normal;
}

h2 {
  color: var(--accent);
  font-size: 0.9em;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 44px 0 20px;
}

h2::before {
  content: '# ';
  color: var(--comment);
}

h3 {
  color: var(--blue);
  font-size: 0.95em;
  font-weight: bold;
}

p {
  font-size: 0.88em;
  margin-bottom: 10px;
  color: var(--text);
}

a { color: var(--blue); }
a:hover { color: var(--accent); }

ul { padding-left: 20px; }
li { font-size: 0.88em; margin-bottom: 4px; color: var(--text); }

/* ---- CURSOR ---- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor::after {
  content: '_';
  color: var(--accent2);
  animation: blink 1.2s step-end infinite;
}

/* ---- TAGS ---- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag {
  font-size: 0.72em;
  border: 1px solid var(--border);
  padding: 1px 8px;
  color: var(--text-dim);
}

/* ---- HOMEPAGE ---- */
.hero {
  padding: 60px 0 40px;
}

.hero-prompt {
  color: var(--accent2);
  font-size: 0.82em;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--text-dim);
  font-size: 1.1em;
  margin: 8px 0 32px;
}

.hero-bio {
  font-size: 0.88em;
  max-width: 660px;
  color: var(--text-light);
  border-left: 2px solid var(--surface);
  padding-left: 16px;
  line-height: 1.9;
  margin-bottom: 16px;
}

.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.link-item {
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.8em;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: center;
}

.link-item:hover {
  background: var(--blue);
  color: var(--bg);
  border-color: var(--blue);
  text-decoration: none;
}

.link-item.highlight {
  border-color: var(--accent);
  color: var(--accent);
}

.link-item.highlight:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---- CV ---- */
.job-entry {
  border-left: 2px solid var(--surface);
  padding-left: 18px;
  margin-bottom: 36px;
}

.job-title { color: var(--accent); font-size: 0.95em; margin-bottom: 2px; }
.job-company { color: var(--text-dim); font-size: 0.85em; }
.job-date {
  color: var(--green);
  font-size: 0.78em;
  font-style: italic;
  margin-bottom: 8px;
}

.job-stack {
  font-size: 0.75em;
  color: var(--accent2);
  border: 1px solid var(--border);
  background: var(--header-bg);
  padding: 6px 12px;
  margin: 10px 0;
  line-height: 1.7;
}

.job-entry p { color: var(--text-light); }
.job-entry li { color: var(--text-light); }

.job-section-title {
  color: var(--green);
  font-weight: bold;
  font-size: 0.85em;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.skill-block {
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
}

.skill-block-title {
  color: var(--accent2);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.skill-block-content {
  font-size: 0.82em;
  color: var(--text-light);
  line-height: 1.6;
}

.conf-entry, .edu-entry {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  font-size: 0.85em;
}

.conf-entry:last-child, .edu-entry:last-child { border-bottom: none; }

.conf-title { color: var(--blue); margin-bottom: 4px; }
.conf-desc { color: var(--text-dim); }

.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.training-block {
  border: 1px solid var(--border);
  background: var(--header-bg);
  padding: 10px 14px;
}

.training-year {
  color: var(--accent2);
  font-size: 0.78em;
  display: block;
  margin-bottom: 4px;
}

.training-content {
  color: var(--text-light);
  font-size: 0.78em;
  line-height: 1.6;
}

.lang-list { margin-top: 4px; }
.lang-item { font-size: 0.85em; margin-bottom: 6px; }
.lang-name { color: var(--accent); }
.lang-level { color: var(--text-dim); }

/* ---- PROJECTS ---- */
.projects-grid {
  display: grid;
  gap: 28px;
}

.project-card {
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  overflow: hidden;
  min-width: 0;
}

.project-card:hover { border-color: var(--accent); }

.placeholder-img {
  background: var(--header-bg);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--comment);
  font-size: 0.8em;
  border-bottom: 1px solid var(--border);
  letter-spacing: 3px;
}

.project-img {
  width: 100%;
  display: block;
  border-bottom: 1px solid var(--border);
}

.code-preview {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  height: 240px;
  padding: 24px 28px;
  font-size: 0.78em;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.code-preview .code-title {
  color: var(--comment);
  margin-bottom: 12px;
  font-size: 0.85em;
  letter-spacing: 1px;
}

.code-preview pre {
  margin: 0;
  color: var(--text);
}

.code-preview code {
  color: var(--green);
}

.project-body { padding: 20px; }

.project-name {
  color: var(--accent);
  font-size: 0.95em;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.project-link {
  font-size: 0.78em;
  border: 1px solid var(--border);
  padding: 4px 14px;
  text-decoration: none;
  color: var(--blue);
  transition: all 0.15s;
}

.project-link:hover {
  background: var(--blue);
  color: var(--bg);
  border-color: var(--blue);
  text-decoration: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 16px;
  }

  .nav-right {
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
  }

  .nav-right a,
  .nav-right .lang-btn,
  .nav-right .theme-btn {
    font-size: 0.58em;
    padding: 2px 5px;
    margin-left: 0;
    white-space: nowrap;
    text-align: center;
  }

  h1 { font-size: 1.7em; }

  .skill-grid { grid-template-columns: 1fr; }
  .training-grid { grid-template-columns: 1fr 1fr; }
}
