:root {
  --bg: #07111f;
  --surface: #0d1929;
  --surface-soft: #111f31;
  --border: rgba(148, 163, 184, 0.16);

  --text: #e8eef7;
  --muted: #94a3b8;

  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.1);

  --success: #4ade80;

  --radius: 16px;
  --max-width: 1180px;

  --danger: #f87171;
  --warning: #fbbf24;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(
      circle at 15% 0%,
      rgba(37, 99, 235, 0.13),
      transparent 32rem
    ),
    var(--bg);

  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

/* =========================
           PAGE
           ========================= */

.cv {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 40px auto;
}

/* =========================
           HERO
           ========================= */

.cv-hero {
  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;

  padding: 42px;

  background: linear-gradient(
    135deg,
    rgba(17, 31, 49, 0.96),
    rgba(8, 19, 34, 0.96)
  );

  border: 1px solid var(--border);
  border-radius: 22px;
}

.cv-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 3px;

  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.cv-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 16px;

  color: var(--muted);
  font-family: monospace;
  font-size: 0.85rem;
}

.cv-status::before {
  content: "";
  width: 8px;
  height: 8px;

  border-radius: 50%;

  border-radius: 50%;
}

/* Disponible */
.cv-status.is-available::before {
  background: var(--success);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
}

/* Indisponible */
.cv-status.is-unavailable::before {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.55);
}

/* Valeur inconnue */
.cv-status.is-unknown::before {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.cv-name {
  margin: 0;

  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.cv-name span {
  color: var(--accent);
}

.cv-role {
  margin: 12px 0 18px;

  color: #cbd5e1;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
}

.cv-summary {
  max-width: 750px;
  margin: 0;

  color: var(--muted);
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 24px;
}

.cv-contact a,
.cv-contact span {
  display: inline-flex;
  align-items: center;

  padding: 8px 12px;

  background: var(--accent-soft);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: 8px;

  color: #cfe6ff;
  text-decoration: none;

  font-size: 0.88rem;
}

.cv-contact a:hover {
  border-color: var(--accent);
}

.cv-photo {
  width: 180px;
  aspect-ratio: 1;

  padding: 5px;

  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.025);
}

.cv-photo img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  border-radius: 15px;
}

/* =========================
           MAIN GRID
           ========================= */

.cv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 22px;

  margin-top: 22px;
}

.cv-panel {
  padding: 28px;

  background: rgba(13, 25, 41, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cv-panel + .cv-panel {
  margin-top: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;

  margin: 0 0 24px;

  font-size: 0.82rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;

  color: var(--accent);
}

.section-title::before {
  content: "";
  width: 22px;
  height: 2px;

  background: var(--accent);
}

/* =========================
           EXPERIENCE
           ========================= */

.timeline {
  position: relative;
  margin-left: 5px;
}

.timeline::before {
  content: "";

  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;

  width: 1px;

  background: rgba(88, 166, 255, 0.25);
}

.job {
  position: relative;
  padding: 0 0 30px 32px;
}

.job:last-child {
  padding-bottom: 0;
}

.job::before {
  content: "";

  position: absolute;
  top: 7px;
  left: 0;

  width: 9px;
  height: 9px;

  border: 2px solid var(--accent);
  border-radius: 50%;

  background: var(--bg);
}

.job-date {
  color: var(--accent);

  font-family: "SFMono-Regular", Consolas, monospace;

  font-size: 0.78rem;
}

.job h3 {
  margin: 4px 0 2px;
  font-size: 1.05rem;
}

.job-company {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.job ul {
  margin: 0;
  padding-left: 18px;

  color: #c2ccda;
  font-size: 0.92rem;
}

.job li + li {
  margin-top: 5px;
}

/* =========================
           SKILLS
           ========================= */

.skill-group + .skill-group {
  margin-top: 24px;
}

.skill-group h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

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

.tag {
  padding: 5px 9px;

  border: 1px solid var(--border);
  border-radius: 6px;

  background: rgba(255, 255, 255, 0.025);

  color: #b9c6d8;
  font-family: monospace;
  font-size: 0.77rem;
}

/* =========================
           FORMATION
           ========================= */

.education {
  padding-left: 15px;
  border-left: 2px solid rgba(88, 166, 255, 0.25);
}

.education + .education {
  margin-top: 20px;
}

.education strong {
  display: block;
  font-size: 0.93rem;
}

.education span {
  display: block;

  margin-top: 3px;

  color: var(--muted);
  font-size: 0.84rem;
}

/* =========================
           TERMINAL
           ========================= */

.terminal {
  margin-top: 22px;
  padding: 18px 22px;

  background: #050c15;
  border: 1px solid var(--border);
  border-radius: 12px;

  font-family: monospace;
  font-size: 0.84rem;
}

.terminal-command {
  color: var(--accent);
}

.terminal-output {
  margin-top: 5px;
  color: var(--muted);
}

/* =========================
           FOOTER
           ========================= */

.cv-footer {
  margin: 25px 0;
  text-align: center;

  color: #64748b;
  font-size: 0.78rem;
}

/* =========================
           RESPONSIVE
           ========================= */

@media (max-width: 850px) {
  .cv {
    margin-top: 16px;
  }

  .cv-hero {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .cv-photo {
    grid-row: 1;
    width: 115px;
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .cv {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .cv-hero,
  .cv-panel {
    padding: 22px;
  }

  .cv-name {
    font-size: 2rem;
  }

  .cv-contact {
    flex-direction: column;
  }

  .cv-contact a,
  .cv-contact span {
    width: 100%;
  }
}

/* =========================================
   PDF / IMPRESSION
   ========================================= */

@page {
    size: A4;
    margin: 8mm;
}

@media print {

    html,
    body {
        width: 210mm;
        min-height: 297mm;

        margin: 0;
        padding: 0;

        background: #fff !important;
        color: #111827 !important;

        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* -------------------------
       PAGE CV
       ------------------------- */

    .cv {
        width: 100%;
        max-width: none;

        margin: 0;
        padding: 0;
    }

    /* -------------------------
       HERO
       ------------------------- */

    .cv-hero {
        grid-template-columns: 1fr 105px;
        gap: 20px;

        padding: 16px 18px;

        background: #f8fafc !important;

        border: 1px solid #dbe3ec;
        border-radius: 10px;

        break-inside: avoid;
    }

    .cv-hero::before {
        height: 2px;
    }

    .cv-name {
        font-size: 25px;
        color: #111827;
    }

    .cv-role {
        margin: 5px 0 8px;

        font-size: 14px;
        color: #334155;
    }

    .cv-summary {
        font-size: 10px;
        line-height: 1.4;

        color: #475569;
    }

    .cv-photo {
        width: 95px;

        padding: 3px;

        border-radius: 10px;
    }

    .cv-photo img {
        border-radius: 7px;
    }

    /* -------------------------
       CONTACT
       ------------------------- */

    .cv-contact {
        gap: 5px;
        margin-top: 10px;
    }

    .cv-contact a,
    .cv-contact span {
        padding: 3px 6px;

        color: #334155;

        background: #eef6ff !important;
        border-color: #dbeafe;

        font-size: 8px;
    }

    /* -------------------------
       CONTENU
       ------------------------- */

    .cv-grid {
        grid-template-columns: 1.55fr .8fr;

        gap: 10px;
        margin-top: 10px;
    }

    .cv-panel {
        padding: 12px;

        background: #fff !important;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }

    .cv-panel + .cv-panel {
        margin-top: 10px;
    }

    .section-title {
        margin-bottom: 10px;

        font-size: 9px;
    }

    /* -------------------------
       EXPERIENCE
       ------------------------- */

    .job {
        padding: 0 0 12px 20px;

        break-inside: avoid;
    }

    .job-date {
        font-size: 7.5px;
    }

    .job h3 {
        margin: 2px 0;

        font-size: 10px;
        color: #111827;
    }

    .job-company {
        margin-bottom: 4px;

        font-size: 8px;
        color: #64748b;
    }

    .job ul {
        padding-left: 13px;

        font-size: 8px;
        line-height: 1.35;

        color: #334155;
    }

    .job li + li {
        margin-top: 2px;
    }

    /* -------------------------
       COMPETENCES
       ------------------------- */

    .skill-group + .skill-group {
        margin-top: 10px;
    }

    .skill-group h3 {
        margin-bottom: 5px;

        font-size: 9px;
        color: #111827;
    }

    .tags {
        gap: 4px;
    }

    .tag {
        padding: 2px 4px;

        background: #f8fafc !important;
        border-color: #e2e8f0;

        color: #334155;

        font-size: 7px;
    }

    /* -------------------------
       FORMATION
       ------------------------- */

    .education + .education {
        margin-top: 10px;
    }

    .education strong {
        font-size: 8.5px;
        color: #111827;
    }

    .education span {
        font-size: 7.5px;
        color: #64748b;
    }

    /* -------------------------
       TERMINAL
       ------------------------- */

    .terminal {
        margin-top: 10px;
        padding: 7px 10px;

        background: #f8fafc !important;
        border-color: #e2e8f0;

        font-size: 7.5px;

        break-inside: avoid;
    }

    .terminal-command {
        color: #2563eb;
    }

    .terminal-output {
        color: #475569;
    }

    /* -------------------------
       ELEMENTS WEB UNIQUEMENT
       ------------------------- */

    .cv-download,
    .cv-footer {
        display: none !important;
    }
}