* {
    box-sizing: border-box;
}

@font-face {
    font-family: "NineByFiveNBP";
    src: url("../Ressources/Nine-By-Five-NBP/nine0.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --text-glow-color: 255, 255, 255;
    --text-glow-strength-soft: 1;
    --text-glow-strength-medium: 1;
    --text-glow-strength-strong: 1;

    --terminal-text: #f2f2f2;
    --terminal-accent: #2044dd;
    --text-glow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
    --text-glow-strong: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.3);
    --font-ascii: 'Courier New', monospace;

    /*Ajout avec le splash */
    --font-main: 'NineByFiveNBP', monospace;
    --font-ascii: 'CourierNew', monospace;
}

html,
body {
    margin: 0;
    min-height: 100%;
    width: 100%;
}

body {
    font-family: "NineByFiveNBP", "Bahnschrift SemiCondensed", "Arial Narrow", "Trebuchet MS", sans-serif;
    background: #06079d;
    color: #f2f2f2;
    letter-spacing: 0.2px;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.terminal-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1.8vw, 18px);
}

.terminal-shell {
    --shell-border: max(1px, 0.18%);
    --terminal-cut: polygon(
        1.6% 1.7%,
        10% 1.2%,
        22% 0.7%,
        36% 0.25%,
        50% 0%,
        64% 0.25%,
        78% 0.7%,
        90% 1.2%,
        98.4% 1.7%,
        99% 8%,
        99.4% 16%,
        99.7% 25%,
        100% 35%,
        100.15% 50%,
        100% 65%,
        99.7% 75%,
        99.4% 84%,
        99% 92%,
        98.4% 98.3%,
        90% 98.8%,
        78% 99.3%,
        64% 99.75%,
        50% 100%,
        36% 99.75%,
        22% 99.3%,
        10% 98.8%,
        1.6% 98.3%,
        1% 92%,
        0.6% 84%,
        0.3% 75%,
        0% 65%,
        -0.15% 50%,
        0% 35%,
        0.3% 25%,
        0.6% 16%,
        1% 8%
    );
    width: min(900px, 96vw);
    aspect-ratio: 4 / 3;
    /* clip-path: var(--terminal-cut); */
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.55) 0%, rgba(6, 6, 6, 0.78) 100%);
    padding: var(--shell-border);
    box-shadow: 0 0 26px rgba(255, 255, 255, 0.11);
    position: relative;
    transform: none;
}

.terminal-frame {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    /* clip-path: var(--terminal-cut); */
    background: #2044dd;
    box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-rows: 54px 1fr 54px;
    overflow: hidden;
    position: relative;
}

.terminal-frame > * {
    position: relative;
    z-index: 2;
}

/*
Initial CRT pseudo-overlays disabled at user request.
.terminal-frame::before,
.terminal-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.terminal-frame::before {
    z-index: 3;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(130, 255, 120, 0.04) 0px,
            rgba(130, 255, 120, 0.04) 1px,
            rgba(0, 0, 0, 0.27) 2px,
            rgba(0, 0, 0, 0.27) 4px
        ),
        radial-gradient(circle at center, rgba(0, 0, 0, 0) 36%, rgba(0, 0, 0, 0.36) 74%, rgba(0, 0, 0, 0.7) 100%);
}

.terminal-frame::after {
    z-index: 4;
    opacity: 0.14;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.2) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.2) 0 1px, transparent 2px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.16) 0 1px, transparent 2px),
        rgba(150, 255, 135, 0.05);
    background-size: 16px 16px, 21px 21px, 27px 27px, auto;
    mix-blend-mode: screen;
    animation: terminalCrtFlicker 120ms steps(2, end) infinite, terminalCrtGrain 180ms steps(4, end) infinite;
}
*/

.filter-codepen-barrel .terminal-frame {
    isolation: isolate;
    background: #06079d;
}

@keyframes terminalCrtGrain {
    0% { transform: translate(0, 0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0, 0); }
}

@keyframes terminalCrtFlicker {
    0% { opacity: 0.12; }
    50% { opacity: 0.03; }
    100% { opacity: 0.14; }
}

.terminal-topbar {
    position: relative;
    border-bottom: 0;
}

.terminal-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 14px;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    /* border-radius: 999px 999px 0 0 / 34px 34px 0 0; */
    pointer-events: none;
}

.clock {
    position: absolute;
    right: 34px;
    top: 9px;
    font-size: clamp(24px, 3.3vw, 44px);
    font-weight: 300;
    line-height: 1;
    color: #fafafa;
    text-shadow: 0 0 8px rgba(var(--text-glow-color), var(--text-glow-strength-strong));
}

.terminal-grid {
    display: grid;
    grid-template-columns: 22.4% 1fr;
    position: relative;
}

.terminal-grid.has-children {
    grid-template-columns: 22.4% 22% 1fr;
}

.sidebar {
    border-right: 0;
    padding: 14px 10px 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -7px;
    width: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 100' preserveAspectRatio='none'%3E%3Cpath d='M11 0 Q1 50 11 100' stroke='%23ffffff' stroke-opacity='0.82' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.children-panel {
    border-right: 0;
    padding: 16px 10px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.children-panel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -7px;
    width: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 100' preserveAspectRatio='none'%3E%3Cpath d='M11 0 Q1 50 11 100' stroke='%23ffffff' stroke-opacity='0.82' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.sidebar-files {
    margin: 0;
    padding: 0;
    color: #f5f5f5;
    text-shadow: 0 0 6px rgba(var(--text-glow-color), var(--text-glow-strength-medium));
}

.sidebar-files p {
    margin: 0 0 7px;
    font-size: clamp(10px, 1.34vw, 28px);
    line-height: 1.1;
}

.sidebar-entry {
    display: block;
    margin: 0 0 7px;
    font-size: clamp(10px, 1.34vw, 28px);
    line-height: 1.1;
    color: inherit;
    text-decoration: none;
    text-shadow: inherit;
}

.sidebar-entry:hover,
.sidebar-entry:focus-visible {
    text-decoration: underline;
    outline: none;
}

.child-entry,
.child-empty {
    margin: 0;
    display: block;
    font-size: clamp(12px, 1.8vw, 34px);
    line-height: 1.05;
    color: #f6f6f6;
    text-shadow: 0 0 8px rgba(var(--text-glow-color), var(--text-glow-strength-medium));
    text-decoration: none;
    padding: 3px 0;
}

.child-empty {
    opacity: 0.8;
}

.child-entry.is-active {
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
}

.child-entry:hover,
.child-entry:focus-visible {
    text-decoration: underline;
    outline: none;
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
}

.menu-item.is-kb-focus,
.child-entry.is-kb-focus {
    text-decoration: underline;
}

.sidebar-entry:hover{
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
}


.menu-item.is-kb-focus:not(.is-active),
.child-entry.is-kb-focus:not(.is-active) {
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
}


.menu {
    display: flex;
    flex-direction: column;
    margin-top: 2px;
}

.menu-item {
    display: block;
    position: relative;
    z-index: 3;
    color: #f8f8f8;
    text-decoration: none;
    font-size: clamp(10px, 1.6vw, 30px);
    line-height: 1.02;
    padding: 5px 0;
    text-shadow: 0 0 9px rgba(var(--text-glow-color), var(--text-glow-strength-medium));
    font-weight: 400;
}

.menu-item.is-active {
    margin-left: -14px;
    padding-left: 14px;
}

.menu-item:hover {
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
}

.menu-item.is-active::before {
    content: "";
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: 0;
    right: 0;
    background: rgba(188, 28, 28, 0.86);
    box-shadow: 0 0 10px rgba(199, 36, 36, 0.4);
    z-index: -1;
}

.content {
    padding: 16px 20px;
    position: relative;
}

.reader-stage {
    height: 100%;
    padding: 14px 18px 0;
}

.file-reader {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    position: relative;
}

.reader-close {
    width: 36px;
    height: 48px;
    border: 2px solid rgba(255, 68, 68, 0.9);
    border-radius: 4px;
    color: #ff5f5f;
    text-decoration: none;
    font-size: 38px;
    line-height: 42px;
    text-align: center;
    text-shadow: 0 0 8px rgba(255, 120, 120, 0.8);
}

.reader-head {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 44% 1fr 18px;
    gap: 14px;
    align-items: start;
}

.reader-copy h2,
.reader-copy p,
.reader-body p,
.reader-footer-path {
    margin: 0;
    color: #f2f2f2;
    text-shadow: 0 0 8px rgba(var(--text-glow-color), var(--text-glow-strength-medium));
}

.reader-copy h2 {
    font-size: clamp(15px, 2.2vw, 44px);
    margin-top: 8px;
    margin-bottom: 6px;
}

.reader-subtitle,
.reader-intro-line,
.reader-body p {
    font-size: clamp(13px, 1.6vw, 34px);
    line-height: 1.23;
}

.reader-intro-line {
    margin-top: 4px;
}

.reader-map {
    margin-top: 10px;
    min-height: 180px;
    border: 2px solid rgba(244, 244, 244, 0.9);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03)),
        radial-gradient(circle at 25% 30%, rgba(255, 0, 0, 0.16) 0 12px, transparent 13px),
        radial-gradient(circle at 64% 22%, rgba(255, 0, 0, 0.16) 0 10px, transparent 11px),
        radial-gradient(circle at 74% 70%, rgba(255, 0, 0, 0.16) 0 12px, transparent 13px),
        #d6d6d6;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.reader-map span {
    color: #1e1e1e;
    font-size: clamp(10px, 1vw, 14px);
    text-shadow: none;
    font-weight: 700;
}

.reader-scroll {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.reader-scroll span {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.5);
}

.reader-scroll span:first-child {
    height: 170px;
    background: rgba(255, 255, 255, 0.9);
}

.reader-body {
    margin-top: 14px;
}

.reader-body p {
    margin-bottom: 4px;
}

.reader-actions {
    margin-top: 10px;
    border-top: 2px solid rgba(255, 255, 255, 0.82);
    border-bottom: 2px solid rgba(255, 255, 255, 0.82);
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 78px;
}

.reader-arrow {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 4px;
    color: #f8f8f8;
    text-decoration: none;
    font-size: 38px;
    line-height: 33px;
    text-align: center;
    text-shadow: 0 0 7px rgba(var(--text-glow-color), var(--text-glow-strength-strong));
}

.reader-arrow.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.reader-footer-path {
    min-height: 42px;
    display: flex;
    align-items: center;
    font-size: clamp(14px, 2vw, 30px);
}

.content-path,
.content-description,
.content-cta {
    margin: 0;
    font-size: clamp(13px, 1.84vw, 34px);
    color: #f2f2f2;
    text-shadow: 0 0 7px rgba(var(--text-glow-color), var(--text-glow-strength-soft));
    line-height: 1.18;
}

.content-description {
    margin-top: 8px;
}

.content-cta {
    margin-top: 52px;
    display: inline-block;
    text-decoration: none;
    color: #f5f5f5;
}

.terminal-footer {
    border-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-size: clamp(17px, 2.5vw, 44px);
    color: #f9f9f9;
    text-shadow: 0 0 8px rgba(var(--text-glow-color), var(--text-glow-strength-medium));
    position: relative;
}

.terminal-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.82);
    /* border-radius: 0 0 999px 999px / 0 0 34px 34px; */
    pointer-events: none;
}


/*Ajout des éléments du splash screen */
    .splash-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        padding: 1rem;
        box-sizing: border-box;
        opacity: 1;
        transition: opacity 1s ease-out;
    }

    .splash-container.fade-out {
        opacity: 0;
    }

    .ascii-logo {
        position: absolute;
        top: 20%;
        left: 50%;
        transform: translateX(-50%);
        font-family: var(--font-ascii);
        white-space: pre;
        line-height: 1.0;
        color: #f2f2f2;
        font-size: 1rem;
        text-align: center;
        text-shadow: 0 0 8px rgba(255, 255, 255, 1);
        min-height: auto;
    }

    .ascii-line {
        visibility: hidden;
        display: block;
    }

    .ascii-line.visible {
        visibility: visible;
    }

    .loading-section {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        width: 70%;
        max-width: 400px;
        margin-top: 180px;
    }

    .loading-section.active {
        display: flex;
    }

    .progress-bar {
        display: flex;
        gap: 2px;
        justify-content: center;
        font-size: 1.2rem;
        line-height: 1;
    }

    .progress-char {
        color: rgba(255, 255, 255, 0.2);
        transition: color 0.08s ease-out, text-shadow 0.08s ease-out;
    }

    .progress-char.filled {
        color: #2044dd;
        text-shadow: 0 0 8px rgba(255, 255, 255, 1);
    }

    .progress-percentage {
        font-size: 1.5rem;
        color: #f2f2f2;
        text-shadow: 0 0 8px rgba(255, 255, 255, 1);
    }

    .loading-text {
        font-size: 1.5rem;
        color: var(--terminal-text);
        min-height: 1.2rem;
        text-transform: lowercase;
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
    }

    .partners-section {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        max-width: 500px;
        margin-top: 180px;
    }

    .partners-section.active {
        display: flex;
    }

    .partner-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        opacity: 0;
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    }

    .partner-section.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .partner-label {
        font-size: 2rem;
        color: var(--terminal-text);
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
        text-transform: lowercase;
        margin-bottom: 0.25rem;
    }

    .partner-logos {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5rem;
        flex-wrap: wrap;
    }

    .partner-logo {
        max-width: 150px;
        height: auto;
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    }

    .single-logo {
        max-width: 250px;
    }

    .two-logos {
        display: flex;
        gap: 2rem;
        align-items: center;
    }

@media (max-width: 1200px) {
    .terminal-shell {
        width: min(94vw, 900px);
    }
}

@media (max-width: 900px), (max-height: 700px) {
    .terminal-screen {
        align-items: stretch;
        padding: 8px;
    }

    .terminal-shell {
        width: 100%;
        aspect-ratio: auto;
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        min-height: calc(100vh - 16px);
        min-height: calc(100dvh - 16px);
        transform: none;
        box-shadow: none;
    }

    .terminal-frame {
        grid-template-rows: 46px 1fr 40px;
    }

    .terminal-topbar::after,
    .terminal-footer::before {
        height: 10px;
    }

    .clock {
        right: 16px;
        top: 9px;
        font-size: clamp(18px, 5vw, 30px);
    }

    .terminal-grid {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 2px solid rgba(255, 255, 255, 0.8);
        padding: 12px 12px 10px;
    }

    .sidebar::after {
        display: none;
    }

    .children-panel {
        border-right: 0;
        border-bottom: 2px solid rgba(255, 255, 255, 0.8);
        padding: 12px;
    }

    .children-panel::after {
        display: none;
    }

    .menu-item.is-active {
        margin-right: 0;
    }

    .menu-item.is-active::before {
        left: 0;
        right: 0;
    }

    .sidebar-files p,
    .sidebar-entry,
    .menu-item,
    .child-entry,
    .child-empty,
    .content-path,
    .content-description,
    .content-cta,
    .reader-subtitle,
    .reader-intro-line,
    .reader-body p,
    .reader-footer-path {
        font-size: clamp(15px, 3.6vw, 22px);
        line-height: 1.25;
    }

    .content {
        padding: 14px 14px 18px;
    }

    .content-cta {
        margin-top: 18px;
    }

    .reader-stage {
        padding: 10px 12px 0;
    }

    .reader-close {
        width: 34px;
        height: 42px;
        font-size: 32px;
        line-height: 36px;
    }

    .reader-head {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .reader-copy h2 {
        font-size: clamp(20px, 5vw, 34px);
    }

    .reader-map {
        min-height: 140px;
    }

    .reader-scroll {
        display: none;
    }

    .reader-actions {
        gap: 28px;
    }

    .reader-arrow {
        width: 36px;
        height: 36px;
        font-size: 32px;
        line-height: 29px;
    }

    .terminal-footer {
        padding: 0 10px;
        font-size: clamp(15px, 4vw, 24px);
    }

    .reader-body {
        overflow-wrap: anywhere;
    }

}

@media (max-width: 640px) {
    .terminal-screen {
        padding: 0;
    }

    .terminal-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        width: 100%;
    }

    .terminal-frame {
        grid-template-rows: 42px 1fr 38px;
    }

    .sidebar,
    .children-panel,
    .content,
    .reader-stage {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar-files p,
    .sidebar-entry,
    .menu-item,
    .child-entry,
    .child-empty,
    .content-path,
    .content-description,
    .content-cta,
    .reader-subtitle,
    .reader-intro-line,
    .reader-body p,
    .reader-footer-path {
        font-size: 16px;
    }

    .reader-copy h2 {
        font-size: clamp(18px, 6vw, 28px);
    }

    .reader-map {
        min-height: 120px;
    }

    .reader-actions {
        min-height: 46px;
        gap: 18px;
    }

    .clock {
        right: 12px;
        top: 7px;
    }

}
