@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:wght@400;500;700&display=swap');

:root {
    --bg-color: #0b071a; /* Deep space dark purple/black */
    --text-main: #f8f8f8; /* Off-white for readability */
    --text-muted: #aaaaaa;
    
    /* Arcade Neons */
    --cyan: #00ffff;
    --magenta: #ff00ff;
    --yellow: #ffff00;
    --green: #39ff14;
    
    --border-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 18px;
    line-height: 1.8; /* Increased line-height for Khmer script */
    position: relative;
}

/* CRT Scanline Overlay */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    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));
    z-index: 9999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Kantumruy Pro', sans-serif;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-shadow: 2px 2px 0px #000;
}

h1 { font-size: 32px; color: var(--yellow); }
h2 { font-size: 26px; color: var(--cyan); }
h3 { font-size: 22px; color: var(--magenta); }

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--green);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--yellow);
    text-decoration: none;
    text-shadow: 0 0 8px var(--yellow);
    background-color: rgba(255, 255, 0, 0.15);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header & Navigation */
.navbar {
    padding: 2rem 0;
    margin-bottom: 3rem;
    border-bottom: 4px dashed var(--magenta);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--yellow);
    text-shadow: 3px 3px 0px var(--magenta);
}
.navbar-brand:hover {
    text-decoration: none;
    text-shadow: 3px 3px 0px var(--cyan);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-size: 16px;
    font-weight: 500;
    color: var(--cyan);
}
.nav-links a:hover {
    color: var(--magenta);
    text-decoration: none;
}
.nav-links a::before {
    content: ">";
    opacity: 0;
    margin-right: 5px;
    color: var(--yellow);
}
.nav-links a:hover::before {
    opacity: 1;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Pixel Border Content Block */
.content-block {
    background: #000;
    color: var(--text-main);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    
    /* Fake pixel border using box shadow */
    box-shadow: 
        inset -4px -4px 0px 0px rgba(255,255,255,0.2),
        inset 4px 4px 0px 0px rgba(255,255,255,0.2),
        0 0 0 4px var(--cyan);
    
    transition: all 0.2s;
}

.content-block:hover {
    box-shadow: 
        inset -4px -4px 0px 0px rgba(255,255,255,0.2),
        inset 4px 4px 0px 0px rgba(255,255,255,0.2),
        0 0 0 4px var(--yellow);
}

.content-block.magenta-border {
    box-shadow: inset -4px -4px 0px 0px rgba(255,255,255,0.2), inset 4px 4px 0px 0px rgba(255,255,255,0.2), 0 0 0 4px var(--magenta);
}

.content-block h3 {
    margin-bottom: 1rem;
    font-size: 18px;
}
.content-block h3 a {
    color: var(--cyan);
}
.content-block h3 a:hover {
    color: var(--yellow);
    text-decoration: none;
}

/* Tags */
.tag {
    display: inline-block;
    background: var(--magenta);
    color: #fff;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 0px #000;
}
.tag:hover {
    background: var(--yellow);
    color: #000;
    text-decoration: none;
}

.post-meta {
    font-size: 16px;
    color: var(--cyan);
    margin-bottom: 1rem;
}

/* Grids */
.grid {
    display: grid;
    gap: 2rem;
}
.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

footer {
    border-top: 4px dashed var(--cyan);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* Buttons */
.btn-arcade {
    display: inline-block;
    background: var(--yellow);
    color: #000;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 20px;
    box-shadow: 4px 4px 0px var(--magenta);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s;
    transform: translateZ(0); /* Hardware acceleration to prevent background glitches */
}
.btn-arcade:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: 6px 6px 0px var(--yellow);
    text-decoration: none;
}
.btn-arcade:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px transparent;
}
