/* Theme commun pour toutes les pages (hors index). */
:root {
    --bg: #0a0a0a;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #b7b7b7;
    --primary: #f1719b;
    --accent: #8ae5ff;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    /* Compatibilité avec les anciennes variables utilisées dans les pages projets */
    --bg-dark: #0a0a0a;
    --bg-light: #f8f8f8;
    --text-dark: #ffffff;
    --text-light: #0a0a0a;
    --primary-color: #f1719b;
    --secondary-color: #f6f6f7;
    --border-color: rgba(255, 255, 255, 0.12);
    --border-color-light: rgba(10, 10, 10, 0.1);
    --glass-effect: rgba(255, 255, 255, 0.05);
    --glass-effect-light: rgba(10, 10, 10, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-color-light: rgba(10, 10, 10, 0.1);
    --text-secondary: #b7b7b7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(241, 113, 155, 0.08), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(138, 229, 255, 0.08), transparent 20%),
                var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }

/* Barre supérieure commune */
nav, .nav, .header-ui {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.logo, .brand { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { color: var(--text); font-size: 14px; position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--primary); transition: width 0.25s ease; }
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions, .cta-container-nav { display: flex; align-items: center; gap: 10px; }
.btn-link, .cta-nav {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-link:hover, .cta-nav:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }

/* Hero générique */
.hero, .section-header-top {
    max-width: 1200px;
    margin: 60px auto 20px;
    padding: 0 24px;
}
.eyebrow { color: var(--primary); letter-spacing: 3px; font-weight: 600; font-size: 13px; text-transform: uppercase; }
h1 { font-family: 'Playfair Display', serif; font-size: clamp(34px, 5vw, 58px); letter-spacing: -1px; margin: 10px 0 12px; }
.lead { max-width: 850px; color: var(--muted); font-size: 17px; }

/* Sections et conteneurs */
.section, .project-container, .scroll-content { max-width: 1200px; margin: 0 auto; padding: 30px 24px 80px; }
.section-header, .project-header { text-align: center; margin-bottom: 60px; }
.section-header h2, .project-header h1 { font-size: clamp(32px, 5vw, 54px); background: linear-gradient(90deg, var(--text), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 16px; }
.section-header p, .project-header p, .project-meta { color: var(--muted); max-width: 800px; margin: 0 auto; font-size: 16px; }

/* Cartes */
.card, .glass-card, .info-card, .access-card, .tech-card, .step, .why-section, .section-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
}
.card:hover, .glass-card:hover, .info-card:hover, .access-card:hover, .tech-card:hover, .step:hover, .why-section:hover, .section-panel:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 25px 60px rgba(0,0,0,0.45);
}
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.period { color: var(--accent); font-weight: 600; font-size: 14px; }
.context { color: var(--muted); font-size: 15px; margin: 8px 0 14px; }

.grid, .projects-grid, .access-grid, .tech-grid, .project-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    width: 100%;
}
.project-content-grid { gap: 30px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.tag { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-strong); color: var(--text); font-size: 13px; font-weight: 600; }
.list-label { font-weight: 700; margin: 10px 0 6px; color: var(--text); }

/* Liens / boutons secondaires */
ul.links { list-style: none; display: grid; gap: 8px; padding: 0; }
.link-item, .link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s ease, transform 0.2s ease;
    color: var(--text);
}
.link-item:hover, .link:hover { border-color: var(--primary); transform: translateX(2px); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(138, 229, 255, 0.08); font-size: 13px; font-weight: 700; }
.back-button, #back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.back-button:hover, #back-to-top:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }

/* Tableaux, code, médias */
table, .certificate-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: rgba(241, 113, 155, 0.12); color: var(--primary); font-weight: 700; }
.code-block, pre, code {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    overflow-x: auto;
    color: #f6f7fb;
}
.video-container { position: relative; width: 100%; max-width: 900px; margin: 0 auto; aspect-ratio: 16/9; background: rgba(0,0,0,0.35); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.video-container iframe { width: 100%; height: 100%; border: none; }
.image-container img { max-width: 100%; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.image-caption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 8px; }

/* Chronologie */
.timeline { position: relative; margin: 30px 0; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--primary), rgba(241, 113, 155, 0.3)); }
.timeline-item { position: relative; margin-bottom: 24px; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -30px; top: 0; width: 12px; height: 12px; background: var(--primary); border-radius: 50%; border: 2px solid var(--bg); }
.timeline-date { font-size: 13px; color: var(--primary); font-weight: 700; margin-bottom: 6px; }

/* Grilles d'accès / cartes */
.access-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.access-card h3 { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; margin-bottom: 12px; }
.access-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; background: var(--text); color: var(--bg); border-radius: 999px; font-weight: 700; }
.access-link:hover { background: var(--primary); color: var(--bg); box-shadow: var(--shadow); }

/* Section protégée */
.protection-container {
    width: 90%;
    max-width: 520px;
    margin: 80px auto;
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 26px;
    text-align: center;
    box-shadow: var(--shadow);
}
#password-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(10,10,10,0.6); color: var(--text); font-size: 16px; text-align: center; margin-bottom: 16px; letter-spacing: 0.2em; }
.cta-button { width: 100%; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--text); color: var(--bg); font-weight: 700; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.cta-button:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); background: var(--primary); color: var(--bg); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 12px; }
#message { min-height: 24px; margin-top: 10px; font-family: 'Fira Code', monospace; }

/* Misc utilitaires */
.real-time-clock { position: fixed; bottom: 20px; left: 20px; z-index: 1100; font-family: 'Fira Code', monospace; font-size: 14px; color: var(--primary); background: var(--panel); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.loading-bar { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); z-index: 1200; transition: width 0.3s ease; }
footer { padding: 40px 24px 50px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); background: rgba(10,10,10,0.9); margin-top: 40px; }

/* Démo skill matrix */
.container.demo-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; color: var(--text); }
.demo { background: var(--panel-strong); border: 1px solid var(--border); box-shadow: var(--shadow); }

@media (max-width: 768px) {
    nav, .nav, .header-ui { padding: 14px 18px; flex-wrap: wrap; }
    .nav-links { gap: 14px; flex-wrap: wrap; }
    .project-content-grid, .tech-grid, .access-grid { grid-template-columns: 1fr; }
    .hero, .section, .project-container { padding: 24px 18px 60px; }
}
