:root {
    --color-bg: #080808;       
    --color-terminal: #cccccc; 
    --color-accent: #ffffff;   
    --color-dim: #222222;      
    --color-border: #333333;
    --color-hover-bg: #111111;
    --scanline-opacity: 0.4;
    --avatar-bg: #0a0a0a;
    
    --font-main: "Inter", "Roboto", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.light-mode {
    --color-bg: #ffffff;       
    --color-terminal: #333333; 
    --color-accent: #000000;   
    --color-dim: #d4d4d4;      
    --color-border: #999999;
    --color-hover-bg: #ffffff;
    --scanline-opacity: 0.15; 
    --avatar-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--color-bg);
    color: var(--color-terminal);
    font-family: var(--font-main);
    font-size: 1.25rem;
    overflow-x: hidden;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
    opacity: var(--scanline-opacity);
    transition: opacity 0.3s;
}

.crt-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 70%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    border-bottom: 1px solid var(--color-dim);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
    position: relative;
    padding-right: 180px; /* espaço para o botão no topo direito */
}

.theme-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid var(--color-terminal);
    color: var(--color-terminal);
    font-family: var(--font-main);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
}

.light-mode .crt-overlay {
    display: none;
}

.theme-toggle-btn:hover {
    background: var(--color-terminal);
    color: var(--color-bg);
}

h1 {
    font-size: 2.8rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    min-height: 3.2rem;
    font-weight: normal;
    color: var(--color-accent);
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
}

.cursor {
    display: inline-block;
    width: 0.4ch;
    height: 0.9em;
    background-color: var(--color-accent);
    vertical-align: baseline;
    animation: blink 1s step-end infinite;
}

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

.subtitle {
    color: var(--color-terminal);
    opacity: 0.7;
    font-size: 1.4rem;
    margin-top: 1rem;
}

.section-title {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--color-terminal);
    margin-bottom: 2rem;
    display: inline-block;
    padding-right: 20px;
    color: var(--color-accent);
}

.about-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 4rem;
}

.avatar-container {
    width: 160px;
    height: 160px;
    border: 1px solid var(--color-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--avatar-bg); 
    position: relative;
    overflow: hidden;
}

#neural-net-canvas {
    width: 100%;
    height: 100%;
}

.bio-data p {
    margin-bottom: 0.8rem;
}

.highlight {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.articles-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 4rem;
}

.file-block {
    border: 1px solid var(--color-dim);
    padding: 1.2rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(128, 128, 128, 0.05);
    display: flex;
    flex-direction: column;
}

.file-block:hover {
    border-color: var(--color-accent);
    background-color: var(--color-hover-bg);
    transform: translateX(5px);
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--color-terminal);
    opacity: 0.7;
    font-size: 0.9rem;
}

.file-block h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-terminal);
}

.file-block:hover h3 {
    color: var(--color-accent);
    text-decoration: underline;
}

.file-preview {
    font-size: 1.1rem;
    color: var(--color-terminal);
    opacity: 0.8;
    margin-top: 0.5rem;
}

.post-view-section {
    border-top: 1px solid var(--color-dim);
    padding-top: 2rem;
    margin-top: 1rem;
    display: none;
}

.post-view-section.active {
    display: block;
}

.post-view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: transparent;
    border: 1px solid var(--color-terminal);
    color: var(--color-terminal);
    font-family: var(--font-main);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    text-decoration: none;
}

.back-btn:hover {
    background-color: var(--color-terminal);
    color: var(--color-bg);
}

.back-btn:link,
.back-btn:visited,
.back-btn:hover,
.back-btn:active,
.back-btn:focus {
    color: var(--color-terminal);
    text-decoration: none;
}

.post-heading {
    flex: 1;
}

.post-meta {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-top: 0.4rem;
}

.post-page-heading {
    margin-bottom: 1.5rem;
}

.post-page-title {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
    color: var(--color-accent);
    border: none;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
    color: var(--color-accent);
}

.post-content p,
.post-content ul,
.post-content ol {
    margin-bottom: 0.9rem;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
}

.post-content code {
    background: rgba(128, 128, 128, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.95em;
}

.post-content pre {
    background: rgba(128, 128, 128, 0.15);
    padding: 0.8rem;
    overflow-x: auto;
    border-radius: 4px;
    margin-bottom: 1.2rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2rem auto;
    border: 1px solid var(--color-dim);
}

.contact-section {
    margin-top: 2rem;
    border-top: 1px solid var(--color-dim);
    padding-top: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--color-terminal);
    color: var(--color-terminal);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-main);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 140px;
    justify-content: center;
}

.social-btn:hover {
    background-color: var(--color-terminal);
    color: var(--color-bg); 
    border-color: var(--color-terminal);
}

.icon-svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.6;
    padding-bottom: 2rem;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-family: monospace;
}

@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .avatar-container { margin: 0 auto 2rem auto; }
    .social-links { justify-content: center; }
    .theme-toggle-btn { position: relative; display: block; margin: 0 auto 1rem auto; }
    .post-view-header { flex-direction: column-reverse; align-items: flex-start; }
}
