/* ════════════════════════════════════════════
   CV Terminal — Guillaume HENRY
   cv.css — feuille de styles partagée
   ════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

/* ── Variables globales (indépendantes du thème) ── */
:root {
  --cyan:      #00e5ff;
  --white:     #ffffff;
  --red-close: #ff6666;
  --purple:    #AE92DC;
}

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

/* ── Base ── */
body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}

/* ── Effets CRT ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: var(--scanline);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 999;
}

/* ── Navigation switch ── */
.cv-switch {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 2000;
  display: flex;
  align-items: center;
  border-radius: 4px;
  overflow: hidden;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border);
  box-shadow: 0 0 20px var(--glow-soft);
}

.cv-switch a,
.cv-switch .active {
  padding: 7px 14px;
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
}

.cv-switch .active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  cursor: default;
}

.cv-switch .inactive {
  background: var(--bg3);
  color: var(--text-dim);
}

.cv-switch .inactive:hover {
  background: var(--glow-soft);
  color: var(--accent);
}

.cv-switch .sep {
  background: var(--border);
  color: var(--text-dim);
  padding: 7px 6px;
  font-size: 10px;
}

/* ── Layout ── */
.terminal {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

/* ── Fenêtre ── */
.window {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 40px var(--glow-soft), 0 0 0 1px var(--glow-faint);
}

.titlebar {
  background: var(--bg3);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.tab-title {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  flex: 1;
  text-align: center;
}

/* ── Boutons Linux ── */
.dots {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.dot {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  background: var(--dot-bg);
  border: 1px solid var(--dot-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.dot svg {
  width: 10px;
  height: 10px;
  display: block;
  transition: opacity 0.15s;
}

.dot:hover svg        { opacity: 1; }
.dot.minimize:hover   { background: var(--dot-hover); color: #ffb347; }
.dot.maximize:hover   { background: var(--dot-hover); color: var(--accent); }
.dot.close:hover      { background: #3e1e1e; color: var(--red-close); }

/* ── Barre de statut ── */
.statusbar {
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.05em;
}

.statusbar a {
  color: var(--bg);
  text-decoration: none;
}

/* ── Corps de fenêtre ── */
.window-body {
  background: var(--bg);
  padding: 28px 32px 40px;
}

/* ── Prompt bash ── */
.prompt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-dim);
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.prompt .user { color: var(--accent); font-weight: 700; }
.prompt .host { color: var(--cyan); }
.prompt .path { color: var(--purple); }
.prompt .sym  { color: var(--accent); }
.cmd          { color: var(--white); font-weight: 500; }

/* ── Hero ── */
.hero {
  margin-bottom: 36px;
  animation: fadeIn 0.6s ease forwards;
}

/* Avatar sur le côté, contenu à droite */
.hero-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  margin-top: 14px;
}

.hero-avatar {
  flex-shrink: 0;
}

.ascii-avatar {
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow-soft);
  font-size: 3.5px;
  line-height: 1.0;
  white-space: pre;
  letter-spacing: 0em;
  display: block;
  opacity: 0.9;
}

.hero-content {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.ascii-name {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow-med);
  font-size: 8px;
  line-height: 1.2;
  white-space: pre;
  width: max-content;
  margin-bottom: 10px;
}

.tagline {
  color: var(--tagline-color);
  font-size: 14px;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.meta-line {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 4px;
}

.meta-line a {
  color: var(--cyan);
  text-decoration: none;
}

.meta-line a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Bio courte ── */
.hero-bio {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-width: 520px;
}

.hero-bio .bio-highlight {
  color: var(--accent);
  font-weight: 600;
}

/* ── Lien téléchargement ── */
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid var(--glow-border);
  background: var(--glow-tag-bg);
  color: var(--accent);
  transition: opacity 0.2s;
}

.download-link::before { content: '▼'; font-size: 8px; }
.download-link:hover   { opacity: 0.8; }

/* ── Sections ── */
.section {
  margin-bottom: 34px;
  animation: fadeIn 0.5s ease both;
}

.section:nth-child(1) { animation-delay: 0.05s; }
.section:nth-child(2) { animation-delay: 0.12s; }
.section:nth-child(3) { animation-delay: 0.20s; }
.section:nth-child(4) { animation-delay: 0.28s; }
.section:nth-child(5) { animation-delay: 0.36s; }
.section:nth-child(6) { animation-delay: 0.44s; }
.section:nth-child(7) { animation-delay: 0.52s; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.section-num   { color: var(--text-dim); font-size: 11px; }
.section-title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Intro de section ── */
.section-intro {
  color: var(--text-dim);
  font-size: 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Entrées ── */
.entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 4px 16px;
  margin-bottom: 10px;
  padding: 7px 6px 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: padding 0.15s, background 0.15s;
}

.entry:hover      { background: var(--entry-hover); padding-left: 6px; }
.entry-date       { color: var(--text-dim); font-size: 11px; padding-top: 1px; }
.entry-content    { display: flex; flex-direction: column; gap: 2px; }
.entry-org        { color: var(--org-color); font-weight: 500; font-size: 12px; }
.entry-org .location { color: var(--text-dim); font-weight: 400; }
.entry-role       { color: var(--accent); font-size: 12px; }
.entry-desc       { color: var(--text-dim); font-size: 11px; margin-top: 2px; line-height: 1.5; }

/* ── Badge niveau (diplômes) ── */
.tag-inline {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid var(--glow-border);
  background: var(--glow-tag-bg);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Compétences ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.skill-block {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.skill-block:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 12px var(--glow-soft);
}

.skill-block-title {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.skill-block-title::before { content: '▶ '; font-size: 8px; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--text);
  white-space: nowrap;
}

.tag.hot {
  background: var(--glow-tag-bg);
  border-color: var(--glow-border);
  color: var(--accent);
  font-weight: 600;
}

/* ── Loisirs ── */
.interests           { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.interest            { color: var(--text-dim); font-size: 12px; }
.interest::before    { content: '~ '; color: var(--accent); }

/* ── Tag langue ── */
.tag-langue {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid var(--glow-border);
  background: var(--glow-tag-bg);
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
}

/* ── Curseur ── */
.cursor {
  display: inline-block;
  width: 9px;
  height: 14px;
  background: var(--accent);
  vertical-align: bottom;
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}

/* ── Prompt footer ── */
.prompt-footer { margin-top: 28px; }

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Impression / Export PDF — Accent thème sur fond blanc ── */
@media print {
  @page { margin: 14mm 16mm; }

  /* ── Palette print : fond blanc + couleurs accent du thème ── */
  :root {
    --p-bg:          #ffffff;
    --p-border:      #e0e0e0;
    --p-text:        #1a1a1a;
    --p-muted:       #6b6b6b;
    --p-accent:      var(--accent);       /* vert ou bleu selon le CV */
    --p-org:         var(--org-color);    /* vert ou violet selon le CV */
    --p-tag-bg:      rgba(0,0,0,0.04);
    --p-tag-hot-bg:  rgba(0,0,0,0.06);
    --p-header-bg:   #f5f5f5;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    animation: none !important;
    transition: none !important;
  }

  body {
    background: var(--p-bg) !important;
    color: var(--p-text) !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
  }

  body::before,
  body::after { display: none !important; }

  .cv-switch,
  .download-link,
  .cursor,
  .prompt-footer { display: none !important; }

  /* ── Fenêtre ── */
  .terminal { padding: 0 !important; max-width: 100% !important; }

  .window {
    border: 1px solid var(--p-border) !important;
    box-shadow: none !important;
    border-radius: 4px !important;
  }

  .titlebar {
    background: var(--p-header-bg) !important;
    border-bottom: 1px solid var(--p-border) !important;
  }

  .tab-title { color: var(--p-muted) !important; }

  .dot {
    background: var(--p-bg) !important;
    border-color: var(--p-border) !important;
    color: var(--p-muted) !important;
  }

  /* ── Barre de statut ── */
  .statusbar {
    background: var(--p-accent) !important;
    color: var(--p-bg) !important;
  }

  .statusbar a { color: var(--p-bg) !important; }

  /* ── Corps ── */
  .window-body {
    background: var(--p-bg) !important;
    padding: 20px 24px 28px !important;
  }

  /* ── Hero ── */
  .hero-layout { gap: 16px !important; }

  .ascii-avatar {
    color: var(--p-accent) !important;
    text-shadow: none !important;
    opacity: 0.5 !important;
    font-size: 3px !important;
    line-height: 1.0 !important;
  }

  .ascii-name {
    color: var(--p-accent) !important;
    text-shadow: none !important;
    font-size: 7px !important;
  }

  .tagline  { color: var(--p-org) !important; }
  .meta-line { color: var(--p-muted) !important; }
  .meta-line a { color: var(--p-accent) !important; }
  .hero-bio { color: var(--p-muted) !important; border-color: var(--p-border) !important; }
  .hero-bio .bio-highlight { color: var(--p-accent) !important; }

  /* ── Prompt ── */
  .prompt           { color: var(--p-muted) !important; }
  .prompt .user     { color: var(--p-accent) !important; font-weight: 700 !important; }
  .prompt .host     { color: var(--p-text) !important; }
  .prompt .path     { color: var(--p-org) !important; }
  .prompt .sym      { color: var(--p-accent) !important; }
  .cmd              { color: var(--p-text) !important; font-weight: 600 !important; }

  /* ── Sections ── */
  .section-header   { border-bottom: 1px solid var(--p-border) !important; }
  .section-title    { color: var(--p-accent) !important; }
  .section-num      { color: var(--p-muted) !important; }

  /* ── Entrées ── */
  .entry            { border-bottom-color: var(--p-border) !important; }
  .entry:hover      { background: none !important; padding-left: 0 !important; }
  .entry-date       { color: var(--p-muted) !important; }
  .entry-org        { color: var(--p-org) !important; }
  .entry-org .location { color: var(--p-muted) !important; }
  .entry-role       { color: var(--p-accent) !important; }
  .entry-desc       { color: var(--p-muted) !important; }
  .section-intro    { color: var(--p-muted) !important; }

  .tag-inline {
    background: var(--p-tag-bg) !important;
    border-color: var(--p-border) !important;
    color: var(--p-accent) !important;
  }

  /* ── Compétences ── */
  .skill-block {
    background: var(--p-header-bg) !important;
    border-color: var(--p-border) !important;
    box-shadow: none !important;
  }

  .skill-block-title { color: var(--p-accent) !important; }

  .tag {
    background: var(--p-tag-bg) !important;
    border-color: var(--p-border) !important;
    color: var(--p-text) !important;
  }

  .tag.hot {
    background: var(--p-tag-hot-bg) !important;
    border-color: var(--p-accent) !important;
    color: var(--p-accent) !important;
    font-weight: 700 !important;
  }

  /* ── Loisirs & Langue ── */
  .interest         { color: var(--p-muted) !important; }
  .interest::before { color: var(--p-accent) !important; }

  .tag-langue {
    background: var(--p-tag-hot-bg) !important;
    border-color: var(--p-accent) !important;
    color: var(--p-accent) !important;
    font-weight: 700 !important;
  }

  /* ── Pagination ── */
  .window, .section, .entry, .skill-block { break-inside: avoid; }
  .section { margin-bottom: 18px !important; }
}

/* ── Avatar responsive ── */
.hero-avatar {
  flex-shrink: 0;
  max-width: 30%;
}

.ascii-avatar {
  font-size: clamp(2px, 1.5vw, 3.5px);
  line-height: 1.0;
  white-space: pre;
  letter-spacing: 0em;
  display: block;
  opacity: 0.9;
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow-soft);
  overflow: hidden;
  max-width: 100%;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ascii-avatar { font-size: clamp(2px, 1.2vw, 3px); }
  .ascii-name   { font-size: 8px; }
}

@media (max-width: 700px) {
  .window-body  { padding: 16px; }
  .ascii-name   { font-size: 5px; }

  .hero-layout {
    flex-direction: column;
    align-items: center;
  }

  .hero-avatar {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ascii-avatar {
    font-size: clamp(2px, 2.5vw, 4px);
    margin: 0 auto;
    display: table; /* shrink-wrap au contenu puis centré par margin auto */
  }

  .hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ascii-name   { text-align: left; margin: 0 auto; display: table; }
  .tagline      { text-align: center; }
  .meta-line    { text-align: center; }
  .download-link { align-self: center; }
  .skill-tags   { justify-content: center; }
  .interests    { justify-content: center; }

  .entry        { grid-template-columns: 1fr; }
  .skills-grid  { grid-template-columns: 1fr 1fr; }
  .cv-switch    { top: 8px; right: 8px; }
}
