:root {
    --bg-color: #080808;
    --text-color: #f0f0f0;
    --accent-color: #ffffff;
    --dim-color: #444444;
    --border-color: #f0f0f0;
    --highlight-color: #00ff88;
    --code-bg: #1a1a1a;
    --font-main: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    width: 100%;
}

/* --- GRAIN / NOISE (Canvas) --- */
#grain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
    opacity: 0.15;
    image-rendering: pixelated;
}

/* --- LAYOUT --- */
.interface-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr auto;
    min-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* -- HEADER -- */
.top-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    gap: 2rem;
}

.status-box {
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.status-box .value {
    font-weight: bold;
}

.id-box h1 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dim-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-color);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.decorative-lines {
    flex-grow: 1;
    height: 4px;
    background: repeating-linear-gradient(90deg,
            var(--border-color) 0px,
            var(--border-color) 2px,
            transparent 2px,
            transparent 8px);
}

/* -- MAIN -- */
.main-display {
    grid-column: 1 / 2;
    position: relative;
    border: 1px solid var(--dim-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.content-frame {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.frame-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    color: var(--dim-color);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.right-sidebar {
    grid-column: 2 / 3;
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-left: 1px solid var(--dim-color);
    padding-left: 1rem;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.sidebar-data {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--dim-color);
}

/* -- FOOTER -- */
.bottom-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-top: 1px solid var(--dim-color);
    padding-top: 1rem;
}

.loader-bar {
    height: 10px;
    width: 100%;
    background: repeating-linear-gradient(45deg,
            var(--dim-color) 0px,
            var(--dim-color) 1px,
            transparent 1px,
            transparent 10px);
}

.grow {
    flex-grow: 1;
}

.blink {
    animation: blink-animation 2s infinite;
}

@keyframes blink-animation {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- BLOG SPECIFIC STYLES --- */
article {
    max-width: 900px;
    margin: 0 auto;
}

.blog-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--dim-color);
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--text-color);
}

/* Subtitle styling */
.blog-subtitle,
article p:first-of-type {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 2rem;
    font-weight: 400;
    line-height: 1.5;
}

.blog-hero {
    width: 100%;
    aspect-ratio: 16/9;
    background: #222;
    margin-bottom: 3rem;
    border: 1px solid var(--dim-color);
    position: relative;
    z-index: 10000;
    overflow: hidden;
}

.blog-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Standardized Headers */
article h2,
.blog-content h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    color: var(--highlight-color);
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

article h3,
.blog-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    font-family: var(--font-mono);
}

article h4,
.blog-content h4 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
}

/* Text Content */
article p,
.blog-content p {
    font-family: var(--font-mono);
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

article ul,
.blog-content ul,
article ol,
.blog-content ol {
    font-family: var(--font-mono);
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

article li,
.blog-content li {
    margin-bottom: 0.5rem;
}

strong,
.highlight-text {
    color: var(--highlight-color);
    font-weight: 700;
}

/* Code & Tech Elements */
code,
.blog-content code {
    background: #1a1a1a;
    padding: 0.2rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--highlight-color);
    border: 1px solid var(--dim-color);
}

pre,
.blog-content pre,
.code-block {
    background: var(--code-bg);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--dim-color);
    position: relative;
    z-index: 10000;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    white-space: pre-wrap;
}

pre code,
.blog-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--highlight-color);
    display: block;
}

/* Math Formulas */
.math-formula {
    background: var(--code-bg);
    border-left: 3px solid var(--highlight-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-align: center;
    position: relative;
    z-index: 10000;
}

/* Info Boxes */
.info-box,
.example-box,
.warning-box {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--text-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
}

.info-box.warning,
.warning-box {
    border-left-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.info-box.tip,
.example-box {
    border-left-color: var(--highlight-color);
    background: rgba(0, 255, 136, 0.05);
}

.info-box.note {
    border-left-color: #339af0;
}

.info-box-title,
.example-box h4,
.warning-box h4 {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.example-box h4 {
    color: var(--highlight-color);
}

/* Table of Contents */
.toc {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--dim-color);
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-transform: uppercase;
}

.toc ul {
    list-style: none;
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--dim-color);
    text-decoration: none;
    transition: color 0.3s;
}

.toc a:hover {
    color: var(--text-color);
}

/* Images in content */
.blog-content img,
article img {
    width: 100%;
    height: auto;
    margin: 0;
    border: none;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.image-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.image-grid img {
    width: 100%;
    height: auto;
    border: 1px solid var(--dim-color);
    display: block;
}

/* Figure & Figcaption */
figure {
    margin: 2rem 0;
}

figcaption {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--dim-color);
    margin-top: 0.5rem;
    text-align: center;
}

/* Blog Meta Items */
.blog-meta-item {
    color: var(--dim-color);
}

/* Blog Tags */
.blog-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.blog-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--dim-color);
    border: 1px solid var(--dim-color);
    padding: 0.25rem 0.75rem;
    transition: color 0.2s, border-color 0.2s;
}

.blog-tag:hover {
    color: var(--highlight-color);
    border-color: var(--highlight-color);
}

/* Footer segments */
.footer-segment {
    display: flex;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .interface-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .right-sidebar {
        display: none;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .main-nav {
        flex-wrap: wrap;
        margin-left: 0;
    }

    .blog-title {
        font-size: 2.5rem;
    }
}

/* =============================================
   LANGUAGE SWITCHING — CSS-based i18n
   html[lang="en"] (default) shows EN, hides ES.
   html[lang="es"] shows ES, hides EN.
   ============================================= */

/* Full content blocks */
.lang-block[data-lang="es"] {
    display: none;
}

.lang-block[data-lang="en"] {
    display: block;
}

html[lang="es"] .lang-block[data-lang="en"] {
    display: none;
}

html[lang="es"] .lang-block[data-lang="es"] {
    display: block;
}

/* Inline text spans */
.lang-es {
    display: none;
}

.lang-en {
    display: inline;
}

html[lang="es"] .lang-en {
    display: none;
}

html[lang="es"] .lang-es {
    display: inline;
}

/* Language Toggle Button Group */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dim-color);
}

.lang-btn {
    background: none;
    border: 1px solid var(--dim-color);
    color: var(--dim-color);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    letter-spacing: 1px;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1;
}

.lang-btn:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}

/* Active lang button highlighted */
.lang-btn.active,
html:not([lang="es"]) .lang-btn[data-lang="en"],
html[lang="es"] .lang-btn[data-lang="es"] {
    border-color: var(--highlight-color);
    color: var(--highlight-color);
}


/* --- HOME PAGE HERO --- */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.hero-title {
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 0.9;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--highlight-color);
    letter-spacing: 4px;
    margin-bottom: 2rem;
}

.tech-specs {
    font-family: var(--font-mono);
    color: var(--dim-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- ABOUT PAGE --- */
.about-container {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.about-photo-column {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-content-column {
    flex: 1;
}

@media (max-width: 900px) {
    .about-container {
        flex-direction: column;
        gap: 2rem;
    }

    .about-photo-column {
        flex: 1;
        width: 100%;
        align-items: center;
    }

    .hero-title {
        font-size: 5rem;
    }
}