/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@300;400;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
    --bg: #FAFAFA;
    --text: #111111;
    --text-meta: #777777;
    --accent: #E52E00; /* Sharp High-Contrast Red - NO PURPLE  */
    --border: #E5E5E5;
    --code-bg: #F0F0F0;
    --selection-bg: #111111;
    --selection-text: #FAFAFA;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A0A0A;
        --text: #F4F4F4;
        --text-meta: #A0A0A0;
        --accent: #FF451A; /* Vibrant Acid-leaning Red */
        --border: #222222;
        --code-bg: #111111;
        --selection-bg: #F4F4F4;
        --selection-text: #050505;
    }
}

::selection {
    background-color: var(--selection-bg);
    color: var(--selection-text);
}

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

body {
    font-family: 'Crimson Pro', serif;
    background-color: var(--bg);
    color: var(--text);
    padding: 2rem 1.5rem;
    line-height: 1.6;
    font-size: 1.15rem;
    display: flex;
    justify-content: center;
    transition: background-color 0.4s ease, color 0.4s ease;
}

main {
    width: 100%;
    max-width: 650px;
}

/* Animations */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-enter {
    opacity: 0; 
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Typography Headings */
h1, h2, h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 2.8rem;
    letter-spacing: -0.02em;
}

/* Site Header — Split Top Bar */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.site-header h1 {
    margin: 0 0 0.3rem 0;
    font-size: 2rem;
}
.header-left .social-row {
    margin-bottom: 0;
}
.header-nav {
    display: flex;
    gap: 1.2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    padding-top: 0.6rem;
}
.header-nav a {
    color: var(--text-meta);
    border-bottom-color: transparent;
}
.header-nav a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}
@media (max-width: 500px) {
    .site-header {
        flex-direction: column;
        gap: 1rem;
    }
    .header-nav {
        padding-top: 0;
    }
}

/* Section Header — inline with link */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0;
}
.section-header h2 {
    margin-bottom: 1.2rem;
}

/* Writing Page Entries */
.writing-entry {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.writing-entry:last-child {
    border-bottom: none;
}
.writing-title {
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: none;
}
.writing-title:hover {
    color: var(--accent);
}
.writing-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-meta);
    margin-top: 0.3rem;
    display: flex;
    gap: 1.5rem;
}
.writing-desc {
    margin-top: 0.5rem;
    margin-bottom: 0;
    color: var(--text-meta);
    font-size: 1rem;
}
.writing-tags {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.writing-tags .tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-meta);
}

h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--text);
    padding-bottom: 0.5rem;
    display: inline-block; 
}

h3 {
    font-size: 1.3rem;
}

p, ul, ol, blockquote {
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    margin-left: 1.5rem;
}

/* Link Interaction */
a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

/* Title link — no underline */
h1 a {
    border-bottom: none;
}
h1 a:hover {
    color: var(--accent);
}

/* Utilities */
.meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-meta);
    margin-top: -0.5rem;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tags { margin-bottom: 2.5rem; }

.tags span {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    background: var(--text);
    color: var(--bg);
    margin-right: 0.5rem;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    border-radius: 0; 
}

/* Code */
code {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--code-bg);
    padding: 0.1em 0.3em;
    font-size: 0.85em;
}

pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    overflow-x: auto;
    border-left: 5px solid var(--accent);
    margin-bottom: 1.5rem;
}

/* Portfolio List */
.portfolio-list li {
    margin-bottom: 1.8rem;
}
.portfolio-list a {
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.portfolio-list a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.portfolio-list a::after {
    display: none;
}

/* Regular Post list */
.post-list {
    list-style: none;
    margin-left: 0;
}

.post-list li {
    margin-bottom: 2rem;
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

@media (min-width: 600px) {
    .post-list li {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }
}

.post-list:not(.portfolio-list) a {
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: none;
    position: relative;
    max-width: 80%;
    transform: none;
    box-shadow: none;
    background-color: transparent;
    color: var(--text);
}

.post-list:not(.portfolio-list) a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-list:not(.portfolio-list) a:hover {
    background-color: transparent;
    color: var(--accent);
}

.post-list:not(.portfolio-list) a:hover::after {
    width: 100%;
}

.post-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-meta);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

@media (min-width: 600px) {
    .post-date {
        margin-left: 1rem;
        margin-top: 0;
    }
}

/* Keyboard Navigation Highlight */
.post-list li.kb-active {
    background-color: var(--code-bg);
    border-left: 3px solid var(--accent);
    padding-left: 0.8rem;
    transition: all 0.15s ease;
}


/* Nav & Footer */
nav, footer {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
}

nav {
    margin-top: 0;
    margin-bottom: 3rem;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding-top: 0;
    padding-bottom: 1.5rem;
}

blockquote {
    border-left: 4px solid var(--text);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-meta);
}

/* Social Links Row - Compact */
.social-row {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.social-row a {
    color: var(--text-meta);
    border-bottom-color: transparent;
}
.social-row a:hover {
    border-bottom-color: currentColor;
}
.social-row a.social-linkedin:hover { color: #0077b5; }
.social-row a.social-github:hover { color: var(--text); }
.social-row a.social-twitter:hover { color: var(--text); }
.social-row a.social-youtube:hover { color: #FF0000; }

/* Home Blocks Grid */
.home-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}
@media (min-width: 600px) {
    .home-blocks {
        grid-template-columns: 1fr 1fr;
    }
}

/* Home Card */
.home-card {
    border: 1px solid var(--border);
    padding: 1.5rem;
    position: relative;
}
.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-meta);
    display: block;
    margin-bottom: 1rem;
}

/* Quote Card */
.quote-card blockquote {
    font-size: 1.15rem;
    line-height: 1.5;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 0 0 0.8rem 0;
    font-style: italic;
    color: var(--text);
}
.quote-card cite {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-meta);
    display: block;
    margin-bottom: 1rem;
}
.card-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    border-bottom: none;
}
.card-link:hover {
    border-bottom: 1px solid var(--accent);
}

/* Checklist Card */
.checklist {
    list-style: none;
    margin: 0;
}
.checklist li {
    margin: 0 0 0.8rem 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.4;
}
.checklist li.checked {
    color: var(--text-meta);
    text-decoration: line-through;
}
.check-box {
    flex-shrink: 0;
    color: var(--accent);
    font-size: 0.9rem;
}


/* Immersive Quotes for Philosophy Page */
.immersive-quotes blockquote {
    font-size: 1.8rem;
    line-height: 1.4;
    border-left: 6px solid var(--accent);
    padding-left: 2rem;
    margin: 3rem 0 1rem 0;
    font-weight: 300;
    color: var(--text);
}
.immersive-quotes .quote-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-meta);
    margin-left: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.immersive-quotes .quote-note:last-child {
    border-bottom: none;
}

/* Reading Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--accent);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    background: none;
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
    font-family: 'IBM Plex Mono', monospace;
    border-radius: 0;
}
.theme-toggle:hover {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Manual Theme Override */
[data-theme="dark"] {
    --bg: #0A0A0A;
    --text: #F4F4F4;
    --text-meta: #A0A0A0;
    --accent: #FF451A;
    --border: #222222;
    --code-bg: #111111;
    --selection-bg: #F4F4F4;
    --selection-text: #050505;
}
[data-theme="light"] {
    --bg: #FAFAFA;
    --text: #111111;
    --text-meta: #777777;
    --accent: #E52E00;
    --border: #E5E5E5;
    --code-bg: #F0F0F0;
    --selection-bg: #111111;
    --selection-text: #FAFAFA;
}

/* Post with TOC Layout */
.post-with-toc {
    position: relative;
}

.toc {
    display: none;
}

@media (min-width: 1100px) {
    .toc {
        display: block;
        position: fixed;
        left: max(1rem, calc((100vw - 650px) / 2 - 260px));
        top: 6rem;
        width: 200px;
        font-family: 'IBM Plex Mono', monospace;
        font-size: 0.75rem;
    }
    .toc strong {
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text-meta);
        margin-bottom: 1rem;
        font-size: 0.7rem;
    }
    .toc a {
        display: block;
        color: var(--text-meta);
        border-bottom: none;
        padding: 0.35rem 0;
        transition: color 0.2s ease, border-left 0.2s ease;
        border-left: 2px solid transparent;
        padding-left: 0.8rem;
        transform: none;
        box-shadow: none;
    }
    .toc a:hover {
        color: var(--text);
        background: transparent;
        transform: none;
        box-shadow: none;
    }
    .toc a.active {
        color: var(--accent);
        border-left-color: var(--accent);
    }
    .toc a.toc-h3 {
        padding-left: 1.6rem;
        font-size: 0.7rem;
    }
}

/* SOPs List Styling */
.sops-list h2 {
    border-bottom: 2px solid var(--accent);
    margin-top: 3rem;
}
.sops-list li {
    margin-bottom: 1.2rem;
    line-height: 1.5;
}
.sops-list li em {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-meta);
    margin-top: 0.2rem;
}

/* Post Images - Fixed Size & Clickable */
.content {
    overflow: hidden;
}
.content img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: opacity 0.3s ease;
    object-fit: contain;
}
.content img:hover {
    opacity: 0.85;
}

/* Lightbox Overlay */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}
.lightbox-overlay img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border: none;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1);
}
.lightbox-overlay img.zoomed {
    transform: scale(1.8);
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: 2px solid rgba(255,255,255,0.4);
    color: #fff;
    font-size: 1.6rem;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'IBM Plex Mono', monospace;
    z-index: 100000;
}
.lightbox-close:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

