@font-face {
    font-family: "Univers";
    src: url("/resources/fonts/UniversRegular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "OCR-B";
    src: url("/resources/fonts/OCR-B.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "TexGyre";
    src: url("/resources/fonts/tg-adventor-bold.otf") format("opentype");
    font-weight: bold;
    font-style: normal;
}

html {
    scrollbar-gutter: stable;
}

body {
    background: black;
    color: white;
    font-family: "Univers";
    margin: 20px;
    padding: 0;
    line-height: 1.4;
}

.wrapper, .container {
    width: 100%;
    max-width: 930px;
    margin: 0 auto;
    box-sizing: border-box;
}

.wrapper {
    display: block;
    position: relative;
}

.container {
    border: 3px solid white;
    padding: 20px;
    background: black;
}

.header, .sidebar p.small, .footer .small, p:last-child {
    margin: 0;
}

.logo {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

hr {
    border: none;
    border-top: 2px dotted #444;
    margin: 20px 0;
}

h1 {
    font-family: "TexGyre";
    letter-spacing: 0.8px;
    font-size: 2rem;
    margin: 0 0 3px 0;
    line-height: 1;
    font-weight: bold;
}

h2 {
    font-family: "Univers";
    font-size: 1.15rem;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    display: inline-block;
    font-weight: normal;
    letter-spacing: normal;
    word-spacing: normal;
}

h3 {
    margin: 35px 0 5px 0;
}

#menu-deck h3:first-child {
    margin-top: 0;
}

p {
    margin: 0 0 15px 0;
}

.small {
    font-size: 0.7rem;
    color: #999;
}

.bullet {
    margin: 0;
    flex-shrink: 0;
}

a {
    color: white;
    text-decoration: underline;
}

a:hover, .nav a:hover, .tooltip.active, .track-row:hover, .bpm-fields-vertical button:hover, #toggle-menu-btn:hover {
    background: white;
    color: black;
}

.nav {
    margin: 20px 0;
    padding: 10px 0;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    text-align: center;
}

.nav a {
    color: white;
    text-decoration: none;
    margin: 0 32px 0 0;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.nav a:last-child {
    margin: 0;
}

.sticky {
    position: sticky;
    top: 0;
    background: black;
    z-index: 100;
    margin: 0 -20px;
    padding: 0 20px;
}

.main {
    display: block;
    margin: 5px 0;
    overflow: visible;
}

.main::after {
    content: "";
    display: table;
    clear: both;
}

.content {
    width: 100%;
}

.content p:first-of-type {
    margin: -8px 0 15px 0;
}

.sidebar {
    float: right;
    width: 314px;
    margin: 10px 0 20px 20px;
    background: #111;
    padding: 5px;
    border: 2px solid white;
    box-sizing: border-box;
    overflow: hidden;
    display: none;
}

.sidebar.active {
    display: block;
}

.sidebar iframe {
    display: block;
    margin: 0 0 10px 0;
}

.footer {
    border-top: 2px solid white;
    margin: 0;
    padding: 20px 0 0 0;
    font-size: 0.7rem;
    text-align: center;
    color: #999;
}

.tooltip {
    cursor: pointer;
    border-bottom: 1px dotted #AAAAAA;
    position: relative;
}

.tooltip-popup {
    position: absolute;
    background: #222222;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    padding: 15px 30px 15px 15px;
    z-index: 1000;
    font-size: 0.85rem;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5);
    font-family: monospace;
    letter-spacing: normal;
}

.tooltip-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 5px;
    color: #CCCCCC;
}

.tooltip-close:hover {
    color: #FFFFFF;
}

.tooltip.active {
    border-bottom-style: solid;
}

.logo-mobile, .scroll-indicator, .dot {
    display: none;
}

.nounderline {
    text-decoration: none;
}

#archive-workspace {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
    margin: 0 0 20px 0;
    position: relative;
}

#archive-workspace::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 145px;
    width: 2px;
    background-color: white;
}

#menu-deck {
    flex: 0 0 125px;
    padding: 2px 0 0 0;
    border-right: none;
    transition: all 0.2s ease;
    position: sticky;
    top: 60px;
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 90;
    direction: rtl; /* Forces the native scrollbar to the left side */
}

/* Keeps all text, links, and layout content inside flowing normally left-to-right */
#menu-deck * {
    direction: ltr;
    text-align: left;
}

#menu-deck.hidden {
    display: none;
}

#menu-deck.hidden + #discovery-deck {
    margin: 0;
}

#menu-deck ul {
    padding: 0;
    margin: 0;
}

#menu-deck ul li {
    list-style: none;
    margin: 0 0 4px 0;
    line-height: 1;
}

#menu-deck ul li a {
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 0;
    line-height: 1;
}

#landing-page {
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

#discovery-deck {
    flex: 1;
    min-width: 0;
    padding: 0 0 0 20px;
    max-width: 600px;
    margin: 0;
}

#discovery-deck > :first-child {
    margin: 0;
}

#discovery-deck h1 {
    margin: 0 0 5px 0;
    line-height: 1;
}

#discovery-deck h2 {
    font-weight: normal;
    margin: 0 0 5px 0;
}

#toggle-menu-btn {
    background: black;
    border: 1px solid white;
    color: white;
    padding: 4px 8px;
    font-family: "OCR-B", monospace;
    font-size: 0.7rem;
    cursor: pointer;
    margin: 0 0 10px 0;
    display: inline-block;
}

.track-row {
    display: block;
    padding: 5px 8px;
    border-bottom: 1px dotted #333;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}

.track-row strong {
    font-weight: bold;
}

.bpm-fields-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 110px;
    margin: 0 0 10px 0;
}

.bpm-fields-vertical input {
    background: black;
    border: 1px solid white;
    color: white;
    padding: 4px;
    font-family: inherit;
    font-size: 0.75rem;
}

.bpm-fields-vertical button {
    background: black;
    border: 1px solid white;
    color: white;
    padding: 5px;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.back-menu-btn {
    display: block;
    margin: 15px 0 0 0;
    font-size: 0.7rem;
    color: #999;
    text-decoration: none;
    text-transform: uppercase;
}

.meta-badge {
    display: inline-block;
    border: 1px solid white;
    padding: 2px 6px;
    font-size: 0.65rem;
    margin: 0 4px 5px 0;
    text-transform: uppercase;
}

.timestamp-link {
    color: black;
    background: white;
    padding: 0 3px;
    text-decoration: none;
    font-size: 0.75rem;
}

#media-frame-wrapper iframe {
    border: 1px solid white;
    background: #000;
}

@media (max-width: 768px) {
    html, body {
        margin: 0;
        padding: 0;
    }
    .wrapper {
        padding: 0;
    }
    .container {
        border: none;
        padding: 15px;
        max-width: 100%;
    }
    .main {
        margin: 5px 0 0 0;
    }
    .logo {
        display: none;
    }
    .logo-mobile {
        display: block;
        max-width: 85%;
        height: auto;
        margin: 0 auto 15px auto;
    }
    h1 {
        font-size: 1.5rem;
    }
    .nav {
        display: flex;
        align-items: center;
        gap: 24px;
        overflow-x: auto;
        white-space: nowrap;
        z-index: 101;
        padding: 5px 0;
        border: 1px solid white;
        margin: 0 0 8px 0;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .nav br, .nav span:not(.dot) {
        display: none;
    }
    .nav a {
        display: inline-block;
        font-size: 0.9rem;
        margin: 0;
        flex-shrink: 0;
    }
    .sticky {
        position: sticky;
        top: 0;
        background: black;
        z-index: 100;
        margin: 0 -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
        box-sizing: border-box;
    }
    #archive-workspace {
        flex-direction: column;
        gap: 15px;
    }
    #archive-workspace::before {
        display: none;
    }

    #menu-deck {
        flex: 0 0 125px;
        padding: 2px 0 0 0;
        border-right: none;
        z-index: 90;
    }

    #landing-page {
        padding: 0;
    }
    #discovery-deck {
        padding: 0;
    }
    .footer {
        font-size: 0.6rem;
    }
    .dot {
        display: inline-block;
        margin: 0;
        flex-shrink: 0;
    }
    .scroll-indicator {
        display: block;
        text-align: right;
        font-size: 0.7rem;
        color: #666;
        margin: 5px 0 0 0;
        line-height: 1;
        white-space: nowrap;
    }
}

/* Global thin scrollbars (Firefox) */
* {
    scrollbar-width: thin;
    scrollbar-color: #444 black;
}

/* Global thin scrollbars (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: black;
}

*::-webkit-scrollbar-thumb {
    background: #444;
}

*::-webkit-scrollbar-thumb:hover {
    background: #666;
}