/* Reset & Variables */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #f4f7f6;
    --primary: #1a73e8;
    --dark: #202124;
    --text: #3c4043;
    --white: #ffffff;
        --shadow: 0 2px 10px rgba(0,0,0,0.1);
        --site-scale: 1.5; /* default desktop scale (restore previous appearance) */
}

body.dark-mode {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --white: #2d2d2d;
    --dark: #ffffff;
}

/* Scale the entire site so it looks like browser zoom 150% at 100% zoom
     - Browsers that support `zoom` (Chrome/Edge) will use it
     - Firefox falls back to `transform: scale(...)` and compensates width
     Adjust --site-scale in :root to change the effective scale. */
@supports (zoom:1) {
    html { zoom: var(--site-scale); }
}
@supports not (zoom:1) {
    html {
        transform: scale(var(--site-scale));
        transform-origin: 0 0;
        width: calc(100% / var(--site-scale));
    }
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: var(--white);
    padding: 50px 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode header {
    border-bottom-color: #444;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    top: 110px;
    right: 20px;
    z-index: 1000;
    background: var(--primary);
    border: none;
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

body.dark-mode .dark-mode-toggle {
    background: #ffb81c;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 999;
    background: var(--primary);
    border: none;
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    max-height: 70vh;
    background: transparent;
    padding: 15px;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.dark-mode .toc-sidebar {
    background: transparent;
}

.toc-sidebar.show {
    opacity: 1;
    visibility: visible;
}

.toc-sidebar h3 {
    font-size: 0.95rem;
    color: var(--dark);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .toc-sidebar h3 {
    color: #e0e0e0;
}

.toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar li {
    margin: 0;
    padding: 0;
}

.toc-link {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    margin: 4px 0;
}

body.dark-mode .toc-link {
    color: #b0b0b0;
}

.toc-link:hover {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(26, 115, 232, 0.1);
}

.toc-link.active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
    background: rgba(26, 115, 232, 0.15);
}

body.dark-mode .toc-link.active {
    background: rgba(26, 115, 232, 0.25);
}

.profile-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--primary);
}

.tagline {
    font-weight: 600;
    font-size: 1.1rem;
    color: #E8F0FE;
    margin: 10px 0;
    text-shadow: 0 3px 8px rgba(0,0,0,0.7);
}

body.dark-mode .tagline {
    color: #b0b0b0;
}

/* Make the profile name match the primary color for better contrast */
.profile-section h1 {
    color: #FFFFFF;
}

body.dark-mode .profile-section h1 {
    color: #b0b0b0;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1rem;
    flex-wrap: wrap;
}

.contact-link {
    color: #E8F0FE;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.dark-mode .contact-link {
    color: #b0b0b0;
}

.contact-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Sections */
.section-title {
    margin: 40px 0 20px;
    font-size: 1.8rem;
    color: var(--dark);
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 10px;
}

ul { margin-left: 20px; }

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.skill-item {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.skill-item img { width: 40px; }

/* Certifications */
.cert-grid {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    align-items: center;
    justify-items: center;
}

.cert-item {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-img {
    max-width: 140px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.cert-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 6px;
}

/* Profiles row inside certifications (separate first line) */
.cert-profiles {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.cert-profiles a { display: inline-block; max-width: 140px; }
.cert-profiles img { height: 44px; width: auto; object-fit: contain; display: block; }

/* Ensure anchors wrapping badges don't change their size */
.cert-item a {
    display: inline-block;
    max-width: 140px;
}
.cert-item a:hover { opacity: 0.95; }

/* Organization logos for experiences/formations */
.org-logo {
    max-width: 64px;
    width: 64px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Card header layout: logo left of text */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-header-text h3 { margin: 0; }
.card-header-text .subtitle { margin: 0; }

/* Keep anchors wrapping org logos constrained */
.card a .org-logo,
.card a > img.org-logo {
    max-width: 64px;
    width: 64px;
}

/* Compact missions list for experiences */
.missions {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text);
    display: grid;
    gap: 6px 14px;
}

.missions li {
    position: relative;
    padding-left: 20px;
    margin: 0;
}
.missions li::before {
    content: "\2022"; /* bullet */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    font-size: 1.2rem;
    line-height: 1;
}

/* two-column compact layout on wider screens */
.missions.compact {
    grid-template-columns: 1fr;
}
@media (min-width: 760px) {
    .missions.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Slightly smaller appearance for very compact cards */
.card .missions { font-size: 0.92rem; }

/* Loisirs */
.loisirs-flex {
    display: flex;
    gap: 30px;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding: 50px;
    background: #202124;
    color: white;
    margin-top: 50px;
    transition: background-color 0.3s ease;
}

body.dark-mode footer {
    background: #1a1a1a;
    border-top: 1px solid #444;
}

.socials a {
    color: white;
    font-size: 2rem;
    margin: 0 10px;
}

/* CV download button */
.download-cv-wrapper { text-align: center; margin: 18px 0; }
.download-btn {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.download-btn:hover { opacity: 0.95; transform: translateY(-2px); }

/* Consultation CTA inside experience cards */
.consult-cta { text-align: center; margin-top: 12px; }
.consult-btn {
    background: linear-gradient(180deg, var(--primary), #1760c8);
    color: var(--white);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(26,115,232,0.15);
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.consult-btn:hover { transform: translateY(-2px); opacity: 0.95; }

/* Responsive */
@media (max-width: 600px) {
    .contact-grid { flex-direction: column; gap: 5px; }
    .loisirs-flex { flex-wrap: wrap; }
    /* Force normal scale on small screens */
    :root { --site-scale: 1; }
    .dark-mode-toggle {
        top: 100px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .scroll-to-top {
        bottom: 25px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .toc-sidebar {
        display: none;
    }
}

/* HEADER IMAGE */
.hero-image {
    height: 380px;
    background: url("assets/banner.webp") center/cover no-repeat;
    position: relative;
    color: white;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Date */
.date {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 0.9rem;
  opacity: 0.9;
}
