/* ============================================================
   TOKENS
   ============================================================ */

:root {
    --accent:       #61dafb;
    --dark:         #282c34;
    --bg:           #f5f5f5;
    --white:        #ffffff;
    --text:         #333;
    --text-muted:   #666;
    --text-light:   #999;
    --border:       #ddd;
    --danger:       #c0392b;
    --low:          #2980b9;
    --font:         'C059', Georgia, 'Times New Roman', serif;
    --font-mono:    'Courier New', Courier, monospace;
}

/* ============================================================
   FONT
   ============================================================ */

@font-face {
    font-family: 'C059';
    src: url('fonts/C059-Roman.woff2') format('woff2'),
         url('fonts/C059-Roman.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================================
   BASE
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

html {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2 {
    font-family: var(--font-mono);
    font-weight: 600;
}

h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 600;
}

h1, .nav-item { font-size: 1rem; }
h2             { font-size: 2rem; text-align: center; }
h3             { font-size: 1.65rem; }
h4             { font-size: 1.5rem; }
h5             { font-size: 1.25rem; }

.a-link {
    color: black;
    font-family: var(--font-mono);
    text-decoration: none;
}

.a-link:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ============================================================
   HEADER
   ============================================================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark);
    padding: 15px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 20px;
    cursor: pointer;
    font-size: 1.125rem;
    color: white;
    font-family: var(--font-mono);
    position: relative;
}

nav ul li:hover,
nav ul li.active {
    color: var(--accent);
}

.nav-item.courier-font a {
    color: white;
    text-decoration: none;
}

.nav-item.courier-font a:hover {
    color: var(--accent);
    text-decoration: none;
}

.dropdown {
    display: none;
    position: absolute;
    background-color: var(--dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: max-content;
    padding: 0.5rem 0;
    list-style: none;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
}

nav ul li:hover > .dropdown { display: block; }

.dropdown li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: color 0.2s;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.dropdown li:hover { color: var(--accent); }

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    text-align: center;
    padding: 0 10px;
    background-color: var(--dark);
    color: white;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 77px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content { width: 100%; }
.footer-column   { display: flex; justify-content: center; }
.social-links    { display: flex; align-items: center; padding-top: 5px; }

.footer-content p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.social-link,
.has-popover {
    display: inline-block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    padding: 10px;
}

.icon-fa {
    font-size: 1.8rem;
    color: white;
    transition: color 0.3s ease;
    line-height: 1;
}

.social-link:hover .icon-fa,
.has-popover:hover .icon-fa { color: var(--accent); }

.has-popover { position: relative; }

.popover-text {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.popover-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.has-popover:hover .popover-text { visibility: visible; opacity: 1; bottom: 130%; }

/* ============================================================
   RESPONSIVE — MOBILE NAV
   ============================================================ */

@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--dark);
        padding: 0 0 1rem;
        max-height: calc(100vh - var(--header-height, 60px) - var(--footer-height, 77px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 999;
    }

    nav ul.active { display: flex; }

    nav ul li {
        margin: 0;
        padding: 0.5rem 1rem;
        text-align: center;
        font-size: 1.2rem;
    }

    nav ul li.nav-item { padding: 0; }

    .nav-item.courier-font a {
        display: block;
        padding: 0.5rem 1rem;
        text-align: center;
    }

    .dropdown {
        position: static;
        display: block !important;
        width: 100%;
        box-shadow: none;
        padding: 0;
        background-color: transparent;
    }

    .dropdown li {
        padding: 0.3rem 1rem;
        text-align: center;
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.75);
    }
}

@media (min-width: 769px) {
    .mobile-nav-toggle { display: none; }
}
