/* --- CYBERPUNK AESTHETICS --- */
body {
    background-color: #050505;
    /* Creates a futuristic glowing wireframe grid */
    background-image:
        linear-gradient(transparent 95%, rgba(0, 255, 255, 0.2) 95%),
        linear-gradient(90deg, transparent 95%, rgba(0, 255, 255, 0.2) 95%);
    background-size: 30px 30px;
    color: #00ffff; /* Neon Cyan */
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='cyan' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4l16 6-7 2-2 7-7-15z'/%3E%3C/svg%3E") 4 4, auto;
}

body:active {
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='magenta' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4l16 6-7 2-2 7-7-15z'/%3E%3C/svg%3E") 4 4, auto;
}

/* Main Container with a glowing border */
.system-container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.85); /* Slightly transparent black */
    border: 2px solid #ff00ff; /* Neon Magenta */
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5), inset 0 0 15px rgba(255, 0, 255, 0.2);
    padding: 20px;
    /* Angled corners for that sci-fi UI look */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

/* Header Area */
header {
    border-bottom: 2px dashed #00ffff;
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
}

h1 {
    color: #fcee0a; /* Cyberpunk Yellow */
    font-size: 2.5em;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px #ff0000;
    letter-spacing: -2px;
}

.system-status {
    color: #00ff00; /* Hacker Green */
    font-size: 0.9em;
    text-shadow: 0 0 5px #00ff00;
}

/* Navigation Buttons */
nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.nav-btn {
    background-color: #000;
    color: #00ffff;
    border: 1px solid #00ffff;
    padding: 8px 15px;
    font-family: inherit;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.2s;
}

.nav-btn:hover {
    background-color: #00ffff;
    color: #000;
    box-shadow: 0 0 10px #00ffff;
}

/* Split Layout */
.layout-grid {
    display: flex;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.widget {
    border: 1px solid #ff00ff;
    padding: 15px;
    margin-bottom: 20px;
    background: #111;
}

.widget h3 {
    color: #ff00ff;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-size: 1em;
}

.widget ul {
    list-style-type: square;
    padding-left: 15px;
    color: #fcee0a;
}

.widget a {
    color: #c0c0c0;
    text-decoration: none;
}

.widget a:hover {
    color: #fff;
    background: #ff00ff;
}

/* Main Content / Terminal Screen */
.feed {
    flex-grow: 1;
    min-width: 0;
}

.post {
    border-left: 4px solid #fcee0a;
    padding-left: 15px;
    margin-bottom: 40px;
    background: linear-gradient(90deg, rgba(252, 238, 10, 0.1) 0%, transparent 100%);
    padding-top: 5px;
    padding-bottom: 5px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.post-title {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
    text-transform: uppercase;
}

.post-date {
    color: #ff00ff;
    font-size: 0.8em;
}

.post-body {
    color: #e0e0e0;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #fcee0a;
    text-decoration: none;
    border-bottom: 1px dotted #fcee0a;
}

.read-more:hover {
    background: #fcee0a;
    color: #000;
}

/* Images scale down to fit smaller screens */
img {
    max-width: 100%;
    height: auto;
}

/* Footer */
footer {
    margin-top: 40px;
    border-top: 2px dashed #00ffff;
    padding-top: 15px;
    text-align: center;
    font-size: 0.8em;
    color: #555;
}

/* Mobile Adjustments */
@media (max-width: 700px) {
    .layout-grid { flex-direction: column; }
    .sidebar { width: auto; }
    header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* CRT SCANLINE OVERLAY */
.crt-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

/* Show a pointer on clickable elements, overriding the body cursor */
button,
.nav-btn,
a,
.read-more,
.widget a {
    cursor: pointer;
}

/* --- SETTINGS CLASSES (applied to <body> by script.js) --- */

/* Scanline strength */
body.scan-low .crt-overlay { opacity: 0.35; }
body.scan-medium .crt-overlay { opacity: 0.7; }
body.scan-high .crt-overlay { opacity: 1; }

/* Neon glow off */
body.no-glow .system-container,
body.no-glow header,
body.no-glow h1,
body.no-glow .system-status,
body.no-glow .nav-btn,
body.no-glow .nav-btn:hover,
body.no-glow .widget,
body.no-glow .post,
body.no-glow .post-title,
body.no-glow .read-more {
    text-shadow: none;
    box-shadow: none;
}

/* Background grid off */
body.no-grid {
    background-image: none;
}

/* Large text */
body.large-text {
    font-size: 19px;
}

/* High contrast */
body.high-contrast,
body.high-contrast .post-body,
body.high-contrast .post-title,
body.high-contrast .widget ul {
    color: #fff;
}
body.high-contrast .system-container {
    border-color: #fff;
}

/* Reduced motion */
body.reduce-motion a,
body.reduce-motion button,
body.reduce-motion .nav-btn,
body.reduce-motion .nav-btn:hover,
body.reduce-motion .read-more,
body.reduce-motion .widget a {
    transition: none;
    animation: none;
}

/* Hide sidebar */
.hide-sidebar .sidebar {
    display: none;
}

/* Settings gear in the header */
.settings-gear {
    position: absolute;
    top: -8px;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    padding: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    z-index: 1;
}

.settings-gear:hover {
    color: #fcee0a;
    border-color: #fcee0a;
    box-shadow: 0 0 10px #fcee0a;
}

/* Hide the page until script.js reveals it. If script.js fails, CSS shows it after 3 seconds anyway. */
body:not(.site-ready) {
    visibility: hidden;
    animation: site-fallback-reveal 0s 0.05s forwards;
}

@keyframes site-fallback-reveal {
    to {
        visibility: visible;
    }
}


/* Default link colors across the site */
a {
    color: #00ffff;
}

a:hover {
    color: #fcee0a;
}

nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.nav-btn {
  flex-shrink: 0;
}
nav::-webkit-scrollbar {
  display: none;
}