:root {
    /* Background images */
    --body-bg-image: url('/images/bluespace.gif');

    /* Space color palette (light → dark) */
    --space0: #bfc9e7;  /* lightest */
    --space1: #4a70e2;
    --space2: #0137d9;
    --space3: #1b388f;
    --space4: #042178;
    --space5: #001248;
    --space6: #010a28;
    --space7: #00071b;  /* darkest */
}

/* ────────────────────────────────── FONTS ────────────────────────────────── */
@font-face {
    font-family: "Arcade";
    src: url('/style/fonts/JMH Cthulhumbus Arcade.otf') format("opentype");
}
@font-face {
    font-family: "Dos";
    src: url('/style/fonts/Perfect DOS VGA 437.ttf') format("truetype");
}

.marquee-container {
  width: 100%; /* Or a specific pixel value */
  overflow: hidden; /* Hides the content outside the container */
  white-space: nowrap; /* Prevents text from wrapping */
  box-sizing: border-box;
  padding: 10px;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%; /* Starts the content off-screen to the right */
  animation: marqueeAnimation 25s linear infinite; /* Apply the animation */
}

/* Define the animation */
@keyframes marqueeAnimation {
  0% {
    transform: translateX(0%); /* Starting position */
  }
  100% {
    transform: translateX(-100%); /* Ending position (moves fully off-screen to the left) */
  }
}

/* ─────────────────────────────── GLOBAL RESET ────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Dos', monospace;
    font-size: 1.25rem;
    background: var(--space7) var(--body-bg-image) repeat;
    color: white;
}

/* ─────────────────────────────── LAYOUT CONTAINER ─────────────────────────────── */
#container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ────────────────────────────────── LINKS ────────────────────────────────── */
#container a {
    color: var(--space0);
    font-weight: bold;
    text-decoration: none;
}
#container a:hover {
    color: var(--space2);
    text-decoration: underline;
}

/* ────────────────────────────────── HEADER ────────────────────────────────── */
#headerArea {
    background: var(--space6);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
}

#header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
}

#header img {
    height: 120px;
    transition: all 0.4s ease;
}

#header a strong {
    font-size: 2rem;
    color: white;
}

/* Spinning logo on hover */
#header img:hover {
    animation: spin 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    /* border: 2px solid var(--space1); */
    /* border-radius: 24px; */
}
@media (prefers-reduced-motion: reduce) {
    #header img:hover { animation: none; }
    .marquee-content { animation: none; padding-left: 0; }
    .blink, [class*="blink"] { animation: none; opacity: 1; }
}

@keyframes spin {
    from { 
        transform: rotate(0deg);
        /* box-shadow: 0 0 5px var(--space0), 0 0 10px var(--space2), 0 0 18px var(--space0); */
    }
    to { 
        transform: rotate(360deg);
        /* box-shadow: 0 0 5px var(--space0), 0 0 10px var(--space2), 0 0 18px var(--space0); */
    }
}

/* ─────────────────────────────── MAIN FLEX LAYOUT ───────────────────────────── */
#flex {
    display: flex;
    flex: 1;
    gap: 15px;
}

/* ───────────────────────────────── SIDEBAR ───────────────────────────────── */
sideBar {
    width: 25%;
    max-width: 300px;
}

.navbox {
    background: var(--space7);
    border: 2px solid var(--space1);
    border-radius: 8px;
    padding: 15px;
    position: sticky;
    top: 15px;
}

#navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#navbar li {
    margin: 10px 0;
}

#navbar a {
    color: var(--space0);
    font-weight: bold;
    text-decoration: none;
}

#navbar a:hover {
    color: var(--space1);
    text-decoration: underline;
    text-shadow: 0 0 5px var(--space3), 0 0 10px var(--space2);
}

/* Prime ticker */
#prime-ticker {
    font-family: 'Dos', monospace;
    color: var(--space0);
    margin-top: 15px;
    text-align: center;
}

#prime-number {
    color: var(--space2);
    font-weight: bold;
}

/* ───────────────────────────────── MAIN CONTENT ───────────────────────────────── */
main {
    flex: 1;
    min-width: 0;
    background: var(--space5);
    padding: 20px;
    border-radius: 8px;
}

/* ───────────────────── BLOG LANDING ───────────────────── */
.blog-landing .hero {
    background:
        radial-gradient(circle at 20% 20%, rgba(74, 112, 226, 0.35), transparent 55%),
        radial-gradient(circle at 80% 10%, rgba(1, 55, 217, 0.28), transparent 60%),
        linear-gradient(135deg, rgba(1, 10, 40, 0.8), rgba(0, 18, 72, 0.95));
    border: 1px solid var(--space1);
    box-shadow: 0 0 15px rgba(74, 112, 226, 0.35);
    margin-bottom: 18px;
}

.blog-landing .hero-top {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-landing .hero-subtitle {
    font-family: 'Arcade', sans-serif;
    color: var(--space0);
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(191, 201, 231, 0.5);
}

.blog-landing .hero-intro {
    margin: 10px 0 0;
    color: var(--space0);
}

.blog-landing .featured-card {
    background: linear-gradient(145deg, rgba(0, 7, 27, 0.9), rgba(4, 33, 120, 0.6));
    border: 2px solid var(--space1);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 0 20px rgba(74, 112, 226, 0.35);
    margin-bottom: 18px;
    display: block;
    color: inherit;
}

.blog-landing .featured-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.blog-landing .latest-badge {
    font-family: 'Arcade', sans-serif;
    background: var(--space2);
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    box-shadow: 0 0 10px rgba(1, 55, 217, 0.6);
}

.blog-landing .date-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--space1);
    color: var(--space0);
    font-size: 0.9rem;
    background: rgba(1, 10, 40, 0.7);
}

.blog-landing .featured-card h2 {
    margin: 6px 0 8px;
}

.blog-landing .featured-card:hover {
    border-color: var(--space0);
    box-shadow: 0 0 24px rgba(74, 112, 226, 0.5);
}

.blog-landing .featured-teaser {
    margin: 0;
    color: var(--space0);
}

.blog-landing .post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.blog-landing .post-card {
    background: rgba(0, 7, 27, 0.85);
    border: 1px solid var(--space1);
    border-radius: 10px;
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: block;
    color: inherit;
}

.blog-landing .post-card:hover {
    transform: translateY(-4px);
    border-color: var(--space0);
    box-shadow: 0 0 14px rgba(74, 112, 226, 0.45);
}

.blog-landing .post-card h3 {
    margin: 8px 0;
}

.blog-landing .post-card:hover h3,
.blog-landing .featured-card:hover h2 {
    color: var(--space0);
    text-shadow: 0 0 8px rgba(191, 201, 231, 0.5);
}

.blog-landing .card-link {
    text-decoration: none;
}

.blog-landing .post-teaser {
    margin: 0;
    color: var(--space0);
}

/* ───────────────────────────────── FOOTER ───────────────────────────────── */
footer {
    background: var(--space6);
    padding: 15px;
    margin-top: 10px;
    text-align: center;
    border-radius: 8px;
}

footer marquee {
    font-family: 'Arcade', sans-serif;
    font-size: 1rem;
}

.social-planets {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.planet {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--space4);
    transition: transform 0.3s;
}

.planet:hover {
    transform: rotate(360deg) scale(1.2);
}

.github   { background: var(--space3) url('/images/ball.png') center/cover; }
.twitter  { background: var(--space2) url('/images/twitter-icon.png') center/cover; }

/* ───────────────────────────────── HEADINGS ───────────────────────────────── */
h1 {
    font-family: 'Arcade', sans-serif;
    color: white;
    font-size: 2.5rem;
}

h2, h3 {
    font-family: 'Arcade', sans-serif;
    color: var(--space1);
}

strong {
    color: var(--space1);
}

/* ─────────────────────────────── UTILITY CLASSES ────────────────────────────── */
.box {
    min-width: 0;
    background: var(--space7);
    border: 1px solid var(--space1);
    padding: 15px;
    border-radius: 8px;
}

.zoom {
    display: block;
    margin: 0 auto;
    transition: transform 0.2s;
}

.zoom:hover {
    transform: scale(2);
}

button {
    background: var(--space6);
    color: white;
    font-family: 'Arcade', sans-serif;
    padding: 8px 16px;
    border: 1px solid var(--space1);
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: var(--space3);
}

/* ─────────────────── BLOG POST PROSE (readable long-form) ─────────────────── */
/* The DOS VGA face is great for chrome but tough for long reading, so blog post
   body copy uses a legible monospace. Pages opt in with <body class="blog-post">.
   Headings, nav, footer, and the rest of the site stay in the retro fonts. */
.blog-post main p,
.blog-post main li,
.blog-post main dd,
.blog-post main blockquote,
.blog-post main td {
    font-family: ui-monospace, 'Cascadia Code', 'Cascadia Mono', 'SFMono-Regular',
                 Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 1rem;
    line-height: 1.7;
}

/* ─────────────────────────────── MOBILE LAYOUT ────────────────────────────── */
@media (max-width: 1000px) {
    #container { width: 100%; }

    #flex {
        flex-direction: column;
        gap: 10px;
    }

    main    { order: 2; }
    sideBar { 
        width: 100%;
        max-width: none;
        order: 0;
    }

    .navbox { position: static; }

    /* Collapsible nav. site.js adds .nav-js + .nav-collapsed for a tap-to-open
       menu; without JS the nav stays fully visible (graceful fallback). */
    .navbox.nav-js .nav-head {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        user-select: none;
    }
    .navbox.nav-js .nav-chevron::before {
        content: "\25BE"; /* down-pointing triangle when open */
        display: inline-block;
        font-size: 0.8em;
        transition: transform 0.2s ease;
    }
    .navbox.nav-js.nav-collapsed .nav-chevron::before {
        transform: rotate(-90deg); /* points right when collapsed */
    }
    .navbox.nav-js.nav-collapsed #navbar { display: none; }

    #navbar ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        text-align: center;
    }

    #navbar ul ul { display: none; }

    #header {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    #header img { height: 80px; }
}

@media (max-width: 700px) {
    .blog-landing .post-grid {
        grid-template-columns: 1fr;
    }
}
