* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
    background-color: #0B3861;
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
}

.header {
    position: sticky;
    display: flex;
    height: 60px;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    top: 0;
    z-index: 10;
    background-color: rgba(11, 56, 97, 0.9);
    backdrop-filter: blur(4px);
    z-index: 3;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f0f0f0;
}

.nav ul {
    display: flex;
    list-style-type: none;
    color: #f0f0f0;
    font-size: 1em;
    gap: 1rem;
}

.nav ul li a {
    text-align: center;
    text-decoration: none;
    color: #f0f0f0;
    border-radius: 5px;
    padding: 0.5rem 1rem;   
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav ul li a:hover { /* tous liens lors du survol dans la balise nav */
    color: #f19c65; /* couleur de fond */
    transform: translateY(-2px);
}

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1; /* Derrière le contenu */
}

/* Un atome entier */
.atom {
  position: absolute;
}

/* Noyau */
.nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: #d3d3d3; /* gris clair */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Orbite */
.orbit {
  position: absolute;
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Électron */
.electron {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: rgba(255, 80, 80, 0.9); /* rouge doux */
  border-radius: 50%;
}

.container {
    max-width: 950px;
    margin: 3rem auto; /* Espace vertical */
    padding: 2.5rem 2.5rem; /* Respiration autour duu texte */
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease;
}

.container section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.container section:last-child {
    border-bottom: none;
}

.intro p {
    font-size: 1.2rem;
    line-height: 1.8;
}

/* Titres */
h1 {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    color: #003366;
}

h2 {
    font-size: 1.9rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #002e5b;
}

h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #1e3a8a;
}

h4 {
    font-size: 1rem;
    font-style: italic;
    color: #505053;
}

/* Paragraphes */
.container p {
    text-align: justify;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.code-section {
    background-color: rgba(240, 247, 255, 0.9);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.code-section h2 {
    margin-bottom: 0.5rem;
    color: #1a237e;
    font-size: 1.2rem;
}

.code-block {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem auto;
    font-size: 0.95em;
}

/* Bloc intro */
.intro {
    background: #f5f5f5;
    padding: 1.5em;
    border-left: 5px solid #337ab7;
    border-radius: 6px;
    margin-bottom: 2.5rem;
}

.intro p {
    font-size: 1.2rem;
    line-height: 1.8;
}

pre code {
    background: #eef3f9;
    color: #002b55;
    padding: 1rem 1.2rem;
    display: block;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1em auto;
    font-size: 0.95em;
    line-height: 1.6;
    text-align: left;
    max-width: 95%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

pre code span.keyword {
    color: #0055aa;
    font-weight: 600;
}

pre code span.string {
    color: #bb5500;
}

pre code span.comment {
    color: #668899;
    font-style: italic;
}

.code-block {
    text-align: center;
}

.image-block {
    text-align: center;
    margin: 1.5rem auto;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    max-width: 85%;
}

.image-block img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.image-block figcaption {
    margin-top: 4px;
    font-size: 0.85rem;
    font-style: italic;
    color: #333;
}

.result-section {
    background-color: #e0f7fa;
    padding: 1em;
    border-radius: 8px;
    font-family: monospace;
    text-align: center;
}

.button {
    border: none;
    border-radius: 5px;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.button-retour {
    text-align: center;
    margin-top: 2rem;
}

.button-retour a {
    display: inline-block;
    background-color: transparent;
    color: #004466;
    border: 1px solid #004466;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.button-retour a:hover {
    background-color: #004466;
    color: white;
}

.footer {
    height: 100%;
    margin: 0;
    display: flex;
    background-color: #0B3861;
    color: white;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    margin: 0 auto;
    text-align: center;
}

.footer a {
    color: white;
}

.footer a:hover {
    color: #ffcc70;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    margin: 0 10px;
    color: white;
    text-decoration: none;
}

.footer-links a:hover{
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        height: auto;
    }
    .container {
        padding: 2rem 1.2rem;
        margin: 1rem;
    }
    .content {
        padding: 0 0.5rem;
    }
    .title h1 {
        font-size: 1.9rem;  /* 28-30px */
    }
    .content h2 {
        font-size: 1.5rem; /* 22-24px */
    }
}