/* --- CONFIGURATION GLOBALE --- */
:root {
    --atlas-bg: #070a08;
    --atlas-bg-soft: #0c120e;
    --atlas-surface: #121a15;
    --atlas-surface-raised: #18241d;
    --atlas-lichen: #2f5f45;
    --atlas-steel: #cad2c7;
    --atlas-amber: #c8a85f;
    --atlas-text: #eceee7;
    --atlas-text-dim: #b5baae;
    --atlas-text-faint: #808779;
    --atlas-border: rgba(47, 95, 69, 0.32);
    --atlas-border-strong: rgba(47, 95, 69, 0.58);
    --font-main: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    background:
        radial-gradient(circle at 18% 8%, rgba(47, 95, 69, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(199, 173, 114, 0.05), transparent 24rem),
        linear-gradient(180deg, #0d100d 0%, var(--atlas-bg) 36%, #090a09 100%);
    color: var(--atlas-text);
    font-family: var(--font-main);
    font-size: 16px;
    margin: 0;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

::selection {
    color: var(--atlas-bg);
    background: var(--atlas-lichen);
}

p {
    max-width: 70ch;
}

/* --- CHAPTER NAV --- */
.atlas-project-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px max(16px, calc((100vw - 1200px) / 2));
    overflow-x: auto;
    background: rgba(11, 13, 11, 0.88);
    border-top: 1px solid var(--atlas-border);
    border-bottom: 1px solid var(--atlas-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    scrollbar-width: none;
}

.atlas-project-nav::-webkit-scrollbar {
    display: none;
}

.atlas-project-nav a {
    flex: 0 0 auto;
    color: var(--atlas-text-dim);
    border: 1px solid var(--atlas-border);
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.3px;
    text-decoration: none;
    text-transform: uppercase;
    background: rgba(23, 27, 23, 0.42);
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.atlas-project-nav a:hover,
.atlas-project-nav a:focus-visible {
    color: var(--atlas-bg);
    border-color: var(--atlas-lichen);
    background: var(--atlas-lichen);
    transform: translateY(-1px);
    outline: none;
}

.atlas-project-nav .nav-home {
    color: var(--atlas-lichen);
    border-color: rgba(154, 170, 133, 0.32);
    margin-right: 8px;
}

/* --- COMPOSANT : BLUEPRINT HERO (MOBILE BASE) --- */
.atlas-hero {
    position: relative;
    min-height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    background:
        linear-gradient(180deg, rgba(11, 13, 11, 0.2), rgba(11, 13, 11, 0.95)),
        var(--atlas-bg);
    overflow: hidden;
}

.blueprint-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(var(--atlas-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--atlas-border) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(circle at center, black, transparent 85%);
    opacity: 0.3;
    pointer-events: none;
}

.hero-overlay {
    width: 100%;
    z-index: 2;
}

.blueprint-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--atlas-steel);
    margin-bottom: 30px;
    text-transform: uppercase;
}

.status-badge {
    align-self: flex-start;
    padding: 4px 9px;
    border: 1px solid var(--atlas-lichen);
    color: var(--atlas-lichen);
    background: rgba(154, 170, 133, 0.08);
}

/* --- VISUEL 3D --- */
.visual-core {
    position: relative;
    width: 100%;
    margin: 20px 0 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.atlas-render-3d {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 34px rgba(47, 95, 69, 0.2));
    transition: transform 0.4s ease;
}

.scanline {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--atlas-steel), var(--atlas-lichen), transparent);
    box-shadow: 0 0 14px rgba(47, 95, 69, 0.7);
    position: absolute;
    top: 0;
    z-index: 3;
    animation: scan 6s linear infinite;
}

.dimensions-overlay {
    margin-top: 20px;
    width: 100%;
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--atlas-steel);
}

.dim-line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--atlas-border-strong), transparent);
    margin: 0 10px;
    position: relative;
}

/* --- SPECS GRID --- */
.main-display {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.spec-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.spec-item label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--atlas-steel);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.spec-item .value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--atlas-text);
    overflow-wrap: anywhere;
}

.unit, .dim, .price {
    font-size: 0.85rem;
    color: var(--atlas-lichen);
    opacity: 0.7;
}

.build-title {
    margin: 8px 0 0;
    font-size: 4rem;
    line-height: 0.92;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--atlas-text);
}

/* --- DESKTOP ENHANCEMENTS (min-width: 992px) --- */
@media (min-width: 992px) {
    .atlas-hero {
        padding: 80px 40px;
        justify-content: center;
    }

    .blueprint-header {
        flex-direction: row;
        justify-content: space-between;
        font-size: 11px;
    }

    .main-display {
        display: grid;
        grid-template-columns: 220px 1fr 220px;
        align-items: center;
        gap: 60px;
    }

    .visual-core {
        margin: 0;
    }

    .atlas-render-3d {
        max-width: 650px;
    }

    .spec-column {
        display: block;
    }

    .spec-item {
        margin-bottom: 40px;
    }

    .spec-item .value {
        font-size: 1.55rem;
    }
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { top: 100%; opacity: 0; }
}

/* --- LOGBOOK SECTION --- */
.atlas-logbook {
    padding: 80px 20px;
    border-top: 1px solid var(--atlas-border);
}

.log-container {
    max-width: 850px;
    margin: 0 auto;
}

.log-header {
    text-align: center;
    margin-bottom: 60px;
}

.log-badge {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--atlas-steel);
    border: 1px solid var(--atlas-border-strong);
    padding: 4px 10px;
    font-size: 11px;
    margin-bottom: 15px;
}

.log-main-title {
    font-size: 2.2rem;
    line-height: 1.04;
    font-weight: 700;
    margin: 0;
}

.log-timeline {
    position: relative;
    padding-left: 25px;
    border-left: 1px solid var(--atlas-border-strong);
}

.timeline-step {
    position: relative;
    margin-bottom: 60px;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 5px;
    width: 7px;
    height: 7px;
    background: var(--atlas-steel);
    box-shadow: 0 0 0 4px rgba(47, 95, 69, 0.16);
    border-radius: 50%;
}

.step-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--atlas-steel);
    margin-bottom: 12px;
    letter-spacing: 0.7px;
}

.step-content p {
    font-size: 16px;
    line-height: 1.75;
}

.log-quote {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--atlas-text);
    margin: 25px 0;
    padding-left: 15px;
    border-left: 2px solid var(--atlas-amber);
}

.tech-checklist {
    list-style: none;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 14px;
}

.tech-checklist li span {
    color: var(--atlas-steel);
    margin-right: 10px;
}

.log-card {
    background: var(--atlas-surface-raised);
    padding: 20px;
    border: 1px solid var(--atlas-border);
    margin-top: 20px;
}

.next-step-tag {
    display: inline-block;
    margin-top: 15px;
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--atlas-amber);
    color: var(--atlas-bg);
    padding: 4px 8px;
    font-weight: 700;
}


/* --- BOUTONS VIDÉO --- */

.log-watch-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    padding: 8px 16px;
    border: 1px solid var(--atlas-border-strong);
    color: var(--atlas-text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
}

.log-watch-link:hover {
    background: var(--atlas-steel);
    color: var(--atlas-bg);
    box-shadow: 0 0 18px rgba(47, 95, 69, 0.44);
}

.log-video-cta {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--atlas-border);
}

.log-video-cta p {
    font-size: 14px;
    color: var(--atlas-text-dim);
    margin-bottom: 15px;
}

.yt-button {
    display: inline-block;
    color: var(--atlas-text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    border-bottom: 2px solid var(--atlas-lichen);
    padding-bottom: 2px;
}

.yt-button:hover {
    color: var(--atlas-steel);
}



/* --- ATLAS BUILD SECTION --- */
.atlas-build {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.build-header {
    margin-bottom: 60px;
    border-left: 3px solid var(--atlas-steel);
    padding-left: 30px;
}

.build-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--atlas-steel);
    letter-spacing: 0.8px;
}

.build-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.b-stat span { color: var(--atlas-steel); margin-right: 5px; }

/* Grille de Modules */
.build-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 30px;
}

.build-module {
    background:
        linear-gradient(180deg, rgba(32, 38, 31, 0.88), rgba(18, 22, 18, 0.98));
    border: 1px solid var(--atlas-border);
    transition: all 0.3s ease;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.build-module:hover {
    border-color: var(--atlas-border-strong);
    transform: translateY(-5px);
}

.module-img {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.78; }

.missing-visual {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--atlas-lichen);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-align: center;
    background:
        linear-gradient(135deg, transparent 0 48%, rgba(143, 163, 130, 0.22) 48% 52%, transparent 52%),
        repeating-linear-gradient(45deg, rgba(143, 163, 130, 0.08), rgba(143, 163, 130, 0.08) 8px, transparent 8px, transparent 16px);
}

.module-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--atlas-steel);
    color: var(--atlas-bg);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    font-weight: 700;
}

.module-info { padding: 25px; }

.module-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.module-info p {
    font-size: 15px;
    color: var(--atlas-text-dim);
    line-height: 1.5;
}

/* Inventaire style "Liste de chargement" */
.gear-inventory {
    margin-top: 80px;
    border: 1px solid var(--atlas-border-strong);
    padding: 30px;
    background: rgba(16, 20, 16, 0.62);
}

.inventory-header {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--atlas-steel);
    margin-bottom: 20px;
    text-align: center;
}

.inventory-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.gear-item {
    padding: 10px 20px;
    border: 1px dashed var(--atlas-border);
    font-family: var(--font-mono);
    font-size: 12px;
    transition: 0.3s;
}

.gear-item:hover {
    border-color: var(--atlas-steel);
    color: var(--atlas-steel);
}

/* --- ENERGY & TERRACE VISUALS --- */
.circuit-view, .palette-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--atlas-steel);
}

.node {
    border: 1px solid var(--atlas-steel);
    padding: 10px;
    background: rgba(47, 95, 69, 0.16);
    position: relative;
}

.node::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 1px;
    height: 10px;
    background: var(--atlas-border);
}

.palette-view {
    width: 80px;
    height: 80px;
    border: 2px solid var(--atlas-steel);
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(47, 95, 69, 0.16) 5px, rgba(47, 95, 69, 0.16) 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* --- BUDGET --- */
.atlas-budget,
.atlas-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
}

.section-kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--atlas-steel);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.budget-heading,
.gallery-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: end;
    margin-bottom: 42px;
}

.budget-heading p,
.gallery-heading p {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--atlas-text-dim);
    font-size: 15px;
    line-height: 1.7;
}

.budget-total {
    min-width: 180px;
    padding: 18px;
    border: 1px solid var(--atlas-border-strong);
    background:
        linear-gradient(180deg, rgba(32, 38, 31, 0.9), rgba(14, 17, 14, 0.96));
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.budget-total span {
    display: block;
    margin-bottom: 6px;
    color: var(--atlas-text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.budget-total strong {
    display: block;
    color: var(--atlas-amber);
    font-size: 2rem;
    line-height: 1;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.budget-item {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--atlas-border);
    background:
        linear-gradient(180deg, rgba(32, 38, 31, 0.82), rgba(17, 20, 17, 0.96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.budget-item.highlight {
    border-color: rgba(213, 184, 106, 0.4);
}

.budget-status {
    align-self: flex-start;
    margin-bottom: 28px;
    padding: 3px 8px;
    border: 1px solid var(--atlas-border);
    color: var(--atlas-text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.4px;
}

.budget-status.done {
    color: var(--atlas-steel);
    border-color: var(--atlas-border-strong);
}

.budget-status.partial {
    color: #d7c27b;
    border-color: rgba(215, 194, 123, 0.4);
}

.budget-item h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.budget-item p {
    margin: 0 0 24px;
    color: var(--atlas-text-dim);
    font-size: 15px;
    line-height: 1.55;
}

.budget-item strong {
    margin-top: auto;
    color: var(--atlas-text);
    font-size: 2rem;
    line-height: 1;
}

/* --- GALLERY --- */
.atlas-gallery {
    padding-top: 48px;
}

.gallery-heading {
    grid-template-columns: 1fr;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.gallery-item {
    position: relative;
    min-width: 0;
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--atlas-border);
    background: #000;
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.18);
}

.gallery-item.feature {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0.82;
    transition: opacity 0.25s ease, transform 0.35s ease;
}

.gallery-item:hover img {
    opacity: 1;
    transform: scale(1.03);
}

.gallery-item figcaption {
    position: absolute;
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    padding: 5px 8px;
    color: var(--atlas-text);
    background: rgba(11, 13, 11, 0.74);
    border: 1px solid rgba(225, 229, 220, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.gallery-empty {
    border: 1px dashed var(--atlas-border-strong);
    background: rgba(18, 26, 21, 0.58);
    padding: 34px;
}

.gallery-empty p {
    margin: 0;
    color: var(--atlas-text-dim);
    font-size: 15px;
}

.gallery-empty strong {
    color: var(--atlas-text);
    font-family: var(--font-mono);
    font-weight: 500;
}

@media (max-width: 900px) {
    .build-title {
        font-size: 3rem;
        line-height: 0.98;
    }

    .budget-heading {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .budget-total {
        width: 100%;
        text-align: left;
    }

    .budget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .log-main-title {
        font-size: 1.85rem;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    html {
        scroll-padding-top: 72px;
    }

    .atlas-hero {
        min-height: auto;
        padding: 28px 16px 36px;
    }

    .blueprint-header {
        margin-bottom: 18px;
    }

    .main-display {
        gap: 20px;
    }

    .visual-core {
        order: -1;
        margin: 4px 0 22px;
    }

    .atlas-render-3d {
        max-width: 360px;
    }

    .scanline {
        width: 70%;
    }

    .dimensions-overlay {
        margin-top: 10px;
        font-size: 8px;
    }

    .atlas-project-nav {
        padding: 10px 16px;
    }

    .atlas-project-nav a {
        padding: 8px 10px;
        font-size: 10px;
    }

    .spec-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .spec-item {
        min-width: 0;
        padding: 11px;
        border: 1px solid var(--atlas-border);
        background: rgba(17, 21, 17, 0.72);
    }

    .spec-item label {
        font-size: 9px;
        letter-spacing: 0.2px;
    }

    .spec-item .value {
        font-size: 1rem;
        line-height: 1.15;
    }

    .build-header {
        padding-left: 18px;
        margin-bottom: 42px;
    }

    .build-title {
        font-size: 2rem;
        line-height: 1.1;
    }

    .log-main-title {
        font-size: 1.55rem;
    }

    .budget-heading p,
    .gallery-heading p {
        font-size: 15px;
        line-height: 1.6;
    }

    .build-stats {
        gap: 12px;
    }

    .atlas-build {
        padding: 72px 16px;
    }

    .atlas-budget,
    .atlas-gallery {
        padding: 72px 16px;
    }

    .budget-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .budget-item {
        min-height: 0;
        padding: 20px;
    }

    .gallery-item.feature {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-item figcaption {
        left: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 380px) {
    .spec-column {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
