html, body {
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

* { box-sizing: border-box; }

@font-face {
    font-family: 'DepartureMono';
    src: local('DepartureMono'),
        url('DepartureMono-Regular.woff2') format('woff2'),
        url('DepartureMono-Regular.woff') format('woff'),
        url('DepartureMono-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Antilag';
    src: local('Antilag'),
        url('Antilag.woff2') format('woff2');
        url('Antilag.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'RetroByte';
    src: local('RetroByte'),
        url('RetroByte.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ── Global ── */
body {
    background: #000;
    color: #F5F5F5;
    font-family: 'DepartureMono', monospace;
    font-size: clamp(12px, 2.2vw, 17px);
    overflow-x: auto;
}

strong {
    -webkit-text-stroke: .5px currentColor;
    text-shadow: 0 0 0.5px currentColor;
}

a {
    color: #F5F5F5;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.4);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
a:hover {
    text-decoration-color: #F5F5F5;
}
a.folder, a.file {
    text-decoration: none;
}

.fuzzcontainer {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.fuzzy-overlay {
    position: fixed;
    inset: -250%;
    background-image: url("noise.png");
    opacity: 15%;
    z-index: 1;
    pointer-events: none;
    animation: shift 0.2s linear infinite both;
}
@keyframes shift {
    0% { transform: translateX(10%) translateY(10%); }
    100% { transform: translateX(-10%) translateY(-10%); }
}

.content {
    position: relative;
    z-index: 5;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Header ── */
header {
    text-align: center;
    margin-bottom: 30px;
}
header h1 {
    font-family: 'Antilag';
    font-size: clamp(40px, 5vw, 72px);
    margin: 10px 0 0;
    letter-spacing: -0.03em;
}
header h3 {
    font-family: 'RetroByte';
    font-weight: 500;
    font-size: clamp(18px, 2vw, 28px);
    margin: 0 0 10px;
    color: #aaa;
}
.headersymbol {
    height: 150px;
    width: auto;
    margin-top: 10px;
}

/* ── Tree Layout ── */
.tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.root-node {
    border: 5px solid #FFCE55;
    background: rgba(255, 206, 85, 0.1);
    padding: 12px 30px;
    font-family: 'RetroByte';
    font-size: clamp(24px, 2.8vw, 42px);
    text-decoration: none;
    color: #FFCE55;
    text-transform: uppercase;
    transition: background 0.2s;
}
.root-node:hover { background: rgba(255, 206, 85, 0.25); }

.vline {
    width: 3px;
    height: 30px;
    background: #555;
}

.section-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: clamp(145px, 14vw, 250px);
    flex: 1;
}

.drop {
    width: 3px;
    height: 25px;
    background: #555;
}

.section-node {
    display: block;
    border: 5px solid;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    color: #F5F5F5;
    font-family: 'RetroByte';
    font-size: clamp(20px, 2.2vw, 32px);
    text-transform: uppercase;
    min-width: clamp(140px, 14vw, 240px);
    width: max-content;
    transition: background 0.2s, transform 0.2s;
    line-height: 1.2;
}
.section-node:hover {
    transform: scale(1.05);
}
.section-node .numeral {
    display: block;
    font-family: 'DepartureMono';
    font-size: clamp(12px, 1.2vw, 18px);
    opacity: 0.5;
    margin-bottom: 3px;
}

.subs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 0;
}
.sub-vline {
    width: 2px;
    height: 12px;
    background: #444;
}
.sub-node {
    display: block;
    padding: 4px 12px;
    text-align: center;
    text-decoration: none;
    color: #bbb;
    font-size: clamp(16px, 1.8vw, 26px);
    text-transform: uppercase;
    min-width: clamp(138px, 14vw, 238px);
    width: max-content;
    border: 2px solid #333;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.2;
}
.sub-node:hover {
    color: #F5F5F5;
    border-color: #888;
}

/* ── Section Colors ── */
.c-start    { border-color: #FFFFFF; }
.c-start:hover { background: rgba(255,255,255,0.15); }
.c-core     { border-color: #5B4CFF; }
.c-core:hover { background: rgba(91,76,255,0.15); }
.c-aff      { border-color: #D4A0A0; }
.c-aff:hover { background: rgba(212,160,160,0.15); }
.c-agd      { border-color: #00DDFF; }
.c-agd:hover { background: rgba(0,221,255,0.15); }
.c-ags      { border-color: #FFE000; }
.c-ags:hover { background: rgba(255,224,0,0.15); }
.c-agsu     { border-color: #ACDE70; }
.c-agsu:hover { background: rgba(172,222,112,0.15); }
.c-ugd      { border-color: #CC1100; }
.c-ugd:hover { background: rgba(204,17,0,0.15); }
.c-ugs      { border-color: #BF00FF; }
.c-ugs:hover { background: rgba(191,0,255,0.15); }
.c-ugsu     { border-color: #FF6600; }
.c-ugsu:hover { background: rgba(255,102,0,0.15); }
.c-tools    { border-color: #383838; }
.c-tools:hover { background: rgba(56,56,56,0.15); }

/* ── Group labels (accordion) ── */
.group-label {
    font-family: 'RetroByte', sans-serif;
    font-size: clamp(24px, 2.5vw, 40px);
    text-align: center;
    padding: 8px 24px;
    margin: 0 auto;
    color: #F5F5F5;
    text-transform: uppercase;
    letter-spacing: 4px;
    border: 2px solid #555;
    display: block;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    user-select: none;
    position: relative;
    text-decoration: none;
}
.group-label:hover {
    border-color: #888;
    background: rgba(255,255,255,0.03);
}
.group-label.active {
    border-color: #aaa;
    background: rgba(255,255,255,0.05);
}

.group-label::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'DepartureMono', monospace;
    font-size: clamp(16px, 1.8vw, 26px);
    opacity: 0.4;
    transition: opacity 0.3s;
}
.group-label.active::after {
    content: '\2212';
    opacity: 0.6;
}

/* ── Collapsible groups ── */
.tier {
    display: flex;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.group-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.group.expanded .group-body {
    max-height: 2000px;
    opacity: 1;
}

.group-connector {
    width: 3px;
    height: 30px;
    background: #555;
}

.tools-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
}

/* ── Bottom folder grid ── */
.bottomfolder {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}
.folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #F5F5F5;
    transition: transform 0.2s ease;
}
.folder:hover {
    transform: scale(1.03);
}
.folder span {
    text-align: center;
    text-transform: uppercase;
    margin-top: 8px;
}
.bottomicon {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bottomicon img {
    max-height: 70px;
    width: auto;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .section-node { min-width: 100px; width: max-content; font-size: 12px; padding: 6px; }
    .sub-node { min-width: 98px; width: max-content; font-size: 9px; }
    .section-col { min-width: 105px; }
}
@media (max-width: 800px) {
    .tier {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .section-col {
        min-width: 0;
        width: 100%;
        max-width: 300px;
    }

    .section-node {
        min-width: 0;
        width: 100%;
        font-size: clamp(18px, 4.5vw, 28px);
        padding: 10px;
    }
    .sub-node {
        min-width: 0;
        width: 100%;
        font-size: clamp(14px, 3.5vw, 20px);
    }
    .drop {
        height: 15px;
    }

    .bottomfolder {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        font-size: 20px;
    }
    .bottomicon {
        height: auto;
    }

    .fuzzy-overlay {
        display: none;
    }
}
