/* === FONT-FACE === */
@font-face {
    font-family: 'Arcade Rounded';
    src: url('/fonts/ArcadeRounded.woff2') format('woff2'),
         url('/fonts/ArcadeRounded.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Arcade Interlaced';
    src: url('/fonts/ArcadeInterlaced.woff2') format('woff2'),
         url('/fonts/ArcadeInterlaced.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Arcade Normal';
    src: url('/fonts/ArcadeNormal.woff2') format('woff2'),
         url('/fonts/ArcadeNormal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Press Start';
    src: url('/fonts/PressStartReg.woff2') format('woff2'),
         url('/fonts/PressStartReg.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Press Start K';
    src: url('/fonts/PressStartK.woff2') format('woff2'),
         url('/fonts/PressStartK.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === COMMON === */
:root {
    --bg: #222;
    --accent: #00cc66;
    --fg: #121212;
    --text: #e0e0e0;
    --bg-card: #2a2a2a;
    --scanline-color: #00cc6677;
}

/* === LIGHT THEME === */
body.light-theme {
    --bg: #efefef;
    --accent: #0077cc;
    --fg: #111;
    --text: #222;
    --bg-card: #f4f4f4;
    --scanline-color: #0077cc;
}

/* === HIGH CONTRAST === */
body.high-contrast {
    --bg: #000 !important;
    --fg: #fff !important;
    --accent: #c1c100 !important;
    --text: #fff !important;
    --bg-card: #111 !important;
    --scanline-color: #c1c100 !important;
    font-family: Arial, Helvetica, sans-serif !important;
}
body.high-contrast, body.high-contrast * {
    letter-spacing: 0.03em;
    line-height: 1.8;
}
body.high-contrast a {
    color: #00ffff !important;
    background: #222 !important;
    text-decoration: underline !important;
    border-bottom: 2px dotted #c1c100;
}
body.high-contrast h1, 
body.high-contrast h2, 
body.high-contrast h3, 
body.high-contrast h4, 
body.high-contrast h5, 
body.high-contrast h6 {
    color: #c1c100 !important;
    background: #000 !important;
}
body.high-contrast .post-summary,
body.high-contrast .post-content {
    background: #111 !important;
    color: #fff !important;
    border: 2px solid #c1c100 !important;
    box-shadow: none !important;
}
body.high-contrast img,
body.high-contrast .summary-thumb,
body.high-contrast .post-thumb {
    filter: none !important;
    border: 3px solid #c1c100 !important;
    background: #000 !important;
}
body.high-contrast.crt::after,
body.high-contrast::after {
    background: none !important;
}

/* === CRT OVERLAY === */
.crt-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}
body.crt .crt-bg {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.18) 0px,
            rgba(0,0,0,0.18) 2px,
            transparent 2px,
            transparent 6px
        ),
        radial-gradient(
            ellipse at center,
            rgba(0,0,0,0) 40%,
            rgba(0,0,0,0.7) 100%
        );
    mix-blend-mode: multiply;
}
body.light-theme.crt .crt-bg {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255,221,0,0.18) 0px,
            rgba(255,221,0,0.18) 2px,
            transparent 2px,
            transparent 6px
        ),
        radial-gradient(
            ellipse at center,
            rgba(255,255,255,0) 40%,
            rgba(255,221,0,0.10) 100%
        );
    mix-blend-mode: multiply;
}
body.high-contrast.crt .crt-bg,
body.high-contrast .crt-bg {
    background: none !important;
}

/* === BODY, HEADER, NAV, FOOTER === */
body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    font-family: 'Space Mono';
}
h1, h2, h3, h4, h5, h6 {
    color: var(--accent);
    font-family: inherit;
}
h1 {
    font-family: "Arcade Rounded"
}

a {
    color: var(--accent);
    text-decoration: underline;
}
a:focus, a:hover {
    outline: 2px solid var(--accent);
    background: var(--accent);
    color: var(--fg);
}
.container, .page-wrapper {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding-left: 1rem;
    padding-right: 1rem;
    background: var(--bg);
    position: relative;
    z-index: 1;
}
.page-wrapper {
    border-left: 4px solid var(--accent);
    border-right: 4px solid var(--accent);
    min-height: 100vh;
    padding-bottom: 2em;
    padding-top: 40px;
}
.site-header {
    text-align: center;
    padding: 0 0 1em 0;
    border-bottom: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
}
.logo-text {
    font-family: 'Press Start', monospace;
    font-size: 2.5em;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 2px 2px 0 #000, 0 0 8px var(--accent);
    text-decoration: none;
}
.site-header .scanline {
    position: absolute;
    top: -10px; left: 0;
    width: 100%; height: 6px;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        var(--scanline-color, #00ff00) 50%,
        rgba(255,255,255,0) 100%
    );
    pointer-events: none;
    z-index: 2;
    animation: scanline-move 5s linear infinite;
    mix-blend-mode: lighten;
    opacity: 0.85;
    border-radius: 3px;
    filter: blur(0.5px) brightness(1.2) saturate(1.2);
    box-shadow: 0 0 8px var(--scanline-color, #00ff00);
}
body.light-theme .scanline {
    mix-blend-mode: darken;
    opacity: 0.95;
}
body.high-contrast .scanline {
    display: none !important;
}
@keyframes scanline-move {
    0% { top: -10px; }
    100% { top: 100%; }
}
.main-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}
.main-nav a {
    color: var(--accent);
    text-decoration: underline;
    font-family: 'Arcade Interlaced', 'Courier New', monospace;
    font-size: 1.1em;
    padding: 0 0.3em;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
}
.main-nav a:hover, .main-nav a:focus {
    color: var(--fg);
    background: var(--accent);
    text-decoration: none;
}
.site-footer {
    text-align: center;
    color: var(--text);
    padding: 2em 0 1em 0;
    border-top: 2px solid var(--accent);
    font-size: 0.9em;
    margin-top: 20px;
    background: var(--bg-card);
}
.site-footer a {
    color: var(--accent);
    text-decoration: underline;
}

/* === CONTENT LIST, POST, GRID === */
.content-list ul {
    list-style: none;
    padding: 0;
}
.content-list li {
    margin: 1em 0;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted var(--accent);
    padding-bottom: 0.5em;
}
.content-list a {
    color: var(--accent);
    text-decoration: none;
}
.content-list a:hover {
    text-decoration: underline;
}
.content-single h1 {
    color: var(--accent);
    font-size: 1.5em;
    margin-top: 0.5em;
}
.meta {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 1em;
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    margin: 25px 0;
}
.post-summary {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    padding: 1.5em;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: var(--text);
}
.post-summary:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}
.summary-thumb {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    display: block;
    margin-bottom: 0.5em;
    background: #222;
}
.post-thumb {
    margin-top: 20px;
}
article img, .post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2em auto;
    box-sizing: border-box;
    border-radius: 6px;
    box-shadow: 0 2px 8px #0002;
}



/* === RESPONSIVE === */
@media (max-width: 700px) {
    .page-wrapper {
        border: none;
        padding: 0 1em;
        padding-top: 40px;
    }
    .logo-text {
        font-size: 1.3em;
        max-width: 100%;
        white-space: normal;
    }
    .main-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    .posts-grid {
        display: block;
    }
    .post-summary {
        margin-bottom: 1.5em;
    }


    #typewriter-title {
        text-align:center;
        margin:1rem 0;
        font-size: 90%;
    }
}

a:hover, a:focus,
.main-nav a:hover, .main-nav a:focus,
.site-footer a:hover, .site-footer a:focus,
.content-list a:hover, .content-list a:focus
{
    color: var(--fg) !important;
    background: var(--accent) !important;
    outline: 2px solid var(--accent);
    text-decoration: underline;
}


/* === THEME PICKER === */  
.theme-picker {
  font-family: 'Arcade Interlaced', 'Courier New', monospace;
  font-size: 1em;
  padding: 0.35em 1em;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--accent);
  margin-left: 0.3em;
  box-shadow: 0 1px 2px #0003;
  transition: border 0.2s, background 0.2s, color 0.2s;
  word-break: break-all;
  white-space: normal;
}
.theme-picker:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
  background: var(--bg);
  color: var(--fg);
}
body.light-theme .theme-picker {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}
body.high-contrast .theme-picker {
  background: #000 !important;
  color: #c1c100 !important;
  border-color: #c1c100 !important;
}

.logo-text {
  display: inline-block;
  border-right: .15em solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: .12em;
  min-height: 1em;
}
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent); }
}
.logo-text.typing-done {
  border-right: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block; 
  margin: 0 auto;
}

.social-icons {
    display: flex;
       gap: 1em;
}
