/* ===== VARIABLES (ULTRA MINIMAL) ===== */
:root {
    --bg: #FFFFFF;
    --text-main: #000000;
    --text-muted: #666666;
    --text-tertiary: #A0A0A0;
    --border-color: #F0F0F0;
    --accent: #000000;
    --surface: #F4F4F5;

    --gap: 32px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --overlay-bg: rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Enable View Transitions */
@view-transition {
    navigation: auto;
}

[data-theme="dark"] {
    --bg: #000000;
    --text-main: #FFFFFF;
    --text-muted: #A0A0A0;
    --text-tertiary: #555555;
    --border-color: #1A1A1A;
    --accent: #FFFFFF;
    --surface: #161616;

    --overlay-bg: rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    /* Stronger dark shadow */
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: scroll;
    /* Force scrollbar to prevent layout shift */
}

/* Custom Selection Style - Swiss */
::selection {
    background-color: var(--text-main);
    color: var(--bg);
}





body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    padding: 60px 24px 100px;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Swiss typography */
    /* letter-spacing: -0.01em; Reverted */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Noise Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Mobile Overrides */
@media (max-width: 480px) {
    body {
        padding: 40px 20px 80px;
        font-size: 14px;
    }

    .nav-links {
        gap: 16px;
    }

    .intro-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===== NAVIGATION ===== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.logo {
    font-family: 'Mansalva', cursive;
    font-size: 22px;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
.proj-title,
.dialog-title {
    font-weight: 500;
    /* Tighter Swiss tracking */
    color: var(--text-main);
}

p,
.proj-desc,
.bio-text,
.dialog-body,
.nav-link {
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

/* Premium Hover Effect - Subtle Dot */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 50%;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}


.theme-toggle:hover {
    color: var(--text-main);
}


/* Language Switcher - Segmented Control */
.lang-switcher {
    display: flex;
    align-items: center;
    background-color: var(--surface);
    padding: 3px;
    border-radius: 99px;
    /* Pill shape */
    gap: 0;
    margin-left: 4px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 99px;
    /* Inner pill */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    letter-spacing: 0.05em;
    position: relative;
    user-select: none;
    line-height: 1;
}

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

.lang-btn.active {
    background-color: var(--bg);
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    /* Floating pill effect */
}

/* Hide separators */
.lang-sep {
    display: none;
}



/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    /* Removed border-bottom for cleaner look */
}

.filter-btn {
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    /* Slightly squarer, matching tags */
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.filter-btn:hover {
    color: var(--text-main);
    background: var(--border-color);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--text-main);
    color: var(--bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* MOBILE NAV overrides */
@media (max-width: 480px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        margin-bottom: 60px;
    }


    .nav-links {
        width: 100%;
        gap: 24px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-right: 20px;
        padding-bottom: 12px;
        align-items: center;
        /* vertical align */

        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }

    .lang-switcher {
        margin-left: auto;
        /* Just in case */
        flex-shrink: 0;
        /* Prevent squashing */
        margin-right: 24px;
        /* Extra padding at end */
    }

    .nav-links::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }
}

/* ===== CONTENT ===== */
.intro {
    margin-bottom: 80px;
    /* More whitespace */
    opacity: 0;
    animation: slideIn 0.8s var(--ease-out) forwards;
}

/* Intro Headline - Punchy & Action Oriented */
.intro-headline {
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 32px;
    max-width: 600px;
}

/* Intro Description - Clean & Readable */
.intro-desc {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 600px;
}

.section-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* Slightly more tracking for uppercase */
    color: var(--text-tertiary);
    margin-top: 60px;
    /* Standardize spacing */
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-out) 0.1s forwards;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: block;
    width: 100%;
}

/* Alphabetical Index - Editorial Grid */
.letter-group {
    display: grid;
    grid-template-columns: 48px 1fr;
    /* Gutter | Content */
    gap: 0;
    margin-bottom: 24px;
}

.letter-header {
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 20px 0 0;
    margin: 0;
    position: sticky;
    top: 24px;
    height: fit-content;
    z-index: 10;
    opacity: 0.6;
}

.group-items {
    display: flex;
    flex-direction: column;
}

.letter-group.hidden {
    display: none;
}

/* List Layout - Tabular Style */
.project-list {
    display: flex;
    flex-direction: column;
}

/* Focus Mode Hover Effect */
.project-list:hover .project-item {
    opacity: 0.4;
    /* Dim all items when hovering container */
}

.project-list .project-item:hover {
    opacity: 1;
    transform: translateX(4px);
    /* Highlight the specific item */
}

.project-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px 0;
    /* Slightly tighter to keep them grouping nicely without lines */
    /* border-bottom: 1px solid var(--border-color); <-- REMOVED */
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    opacity: 0;
    animation: slideIn 0.8s var(--ease-out) forwards;
    align-items: baseline;
    cursor: pointer;
}

/* Mobile specific layout adjust */
@media (max-width: 480px) {
    .project-item {
        display: block;
        padding: 24px 0;
    }

    .proj-meta {
        display: flex;
        justify-content: flex-start;
        text-align: left;
        margin-top: 8px;
        opacity: 0.6;
        width: 100%;
        flex-wrap: wrap;
    }
}

.project-item:first-child {
    border-top: none;
    /* Cleaner look without top border on list */
}

.project-item.hidden {
    display: none !important;
}

.proj-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proj-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-title {
    font-size: 15px;
    font-weight: 500;
}

.year-label {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 13px;
    margin-left: 4px;
}

.arrow {
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px) translateY(1px);
    transition: all 0.2s var(--ease-out);
    color: var(--text-tertiary);
}

.project-item:hover .arrow {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.proj-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.proj-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Stagger delays */
.project-item:nth-child(1) {
    animation-delay: 0.1s;
}

.project-item:nth-child(2) {
    animation-delay: 0.15s;
}

.project-item:nth-child(3) {
    animation-delay: 0.2s;
}

.project-item:nth-child(4) {
    animation-delay: 0.25s;
}

.project-item:nth-child(5) {
    animation-delay: 0.3s;
}

.project-item:nth-child(6) {
    animation-delay: 0.35s;
}

.project-item:nth-child(7) {
    animation-delay: 0.4s;
}

.project-item:nth-child(8) {
    animation-delay: 0.45s;
}

.project-item:nth-child(9) {
    animation-delay: 0.5s;
}

.project-item:nth-child(10) {
    animation-delay: 0.55s;
}

.project-item:nth-child(11) {
    animation-delay: 0.6s;
}

.project-item:nth-child(12) {
    animation-delay: 0.65s;
}

.project-item:nth-child(13) {
    animation-delay: 0.7s;
}

.project-item:nth-child(14) {
    animation-delay: 0.75s;
}

.project-item:nth-child(15) {
    animation-delay: 0.8s;
}

.project-item:nth-child(16) {
    animation-delay: 0.85s;
}

.project-item:nth-child(17) {
    animation-delay: 0.9s;
}

.project-item:nth-child(18) {
    animation-delay: 0.95s;
}

.project-item:nth-child(19) {
    animation-delay: 1.0s;
}

.project-item:nth-child(20) {
    animation-delay: 1.05s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER */
footer {
    margin-top: 120px;
    /* More breathing room */
    padding-top: 24px;
    display: flex;
    gap: 24px;
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-out) 0.6s forwards;
    flex-wrap: wrap;
    border-top: 1px dotted var(--border-color);
    /* Subtle separation */
}

@media (max-width: 480px) {
    footer {
        flex-direction: column;
        gap: 16px;
        margin-top: 80px;
    }
}

.footer-link {
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s, opacity 0.2s;
}

footer:hover .footer-link {
    opacity: 0.4;
}

.footer-link:hover {
    color: var(--text-main);
    opacity: 1 !important;
}

/* DIALOG (From products.html) */
dialog {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 600px;
    width: 100%;
    margin: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    transition: all 0.2s var(--ease-out);
    overflow: visible;
    cursor: auto;
}

dialog * {
    cursor: auto;
}

dialog[open] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.dialog-content {
    background: var(--bg);
    padding: 40px;
    position: relative;
    border: 1px solid var(--text-tertiary);
}

.dialog-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    font-size: 24px;
    line-height: 1;
}

.dialog-close:hover {
    color: var(--text-main);
}

.dialog-header {
    margin-bottom: 24px;
}

.dialog-chip {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    display: block;
}

.dialog-title {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    margin: 0;
    line-height: 1.1;
}

.dialog-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 40px;
}



.profile-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.5);
    /* Glass base */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 32px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .profile-trigger {
    background: rgba(255, 255, 255, 0.05);
}

.profile-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--text-tertiary);
}

.profile-trigger:active {
    transform: translateY(0) scale(0.98);
}

/* Ice Cube Animation */
.profile-trigger span:first-child {
    font-size: 18px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-trigger:hover span:first-child {
    transform: rotate(15deg) scale(1.2);
}

/* Shine Effect */
.profile-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-20deg);
    transition: left 0.5s;
    pointer-events: none;
}

[data-theme="dark"] .profile-trigger::after {
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
}

.profile-trigger:hover::after {
    left: 150%;
    transition: left 0.7s ease-in-out;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg);
    padding: 32px 24px;
    border-radius: 24px;
    width: 90%;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.puzzle-row {
    margin: 24px 0;
    font-size: 24px;
    color: var(--text-main);
}

#puzzle-input {
    width: 60%;
    padding: 12px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    margin-bottom: 32px;
    background: var(--surface);
    color: var(--text-main);
    outline: none;
    transition: box-shadow 0.2s;
}

#puzzle-input:focus {
    box-shadow: 0 0 0 2px var(--text-main);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: stretch;
    width: 100%;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, opacity 0.2s;
}



.btn-primary {
    background: var(--text-main);
    color: var(--bg) !important;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
}


.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.95);
}

/* Video Modal Specifics */
/* Video Modal (Cinematic) */
.video-content {
    max-width: 900px;
    width: 95%;
    padding: 0;
    overflow: hidden;
    background: transparent;
    position: relative;
    border: none;
    box-shadow: none;
    /* Shadow handled by overlay */
    aspect-ratio: 16/9;
    /* Ensure container has size for overlay */
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container-crt {
    width: 100%;
    overflow: hidden;
    /* CRT OFF State (Initial) */
    opacity: 0;
    transform: scale(1, 0.01);
}

/* 
   CRT "Turn On" Animation 
   1. Thin horizontal white line expands width
   2. Line expands height to full picture
*/
.video-container-crt.animate-on {
    animation: turnOn 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes turnOn {
    0% {
        transform: scale(1, 0.01);
        opacity: 0;
        filter: brightness(3);
    }

    30% {
        transform: scale(1, 0.01);
        opacity: 1;
        filter: brightness(3);
    }

    60% {
        transform: scale(1, 1);
        opacity: 1;
        filter: brightness(1);
    }

    100% {
        transform: scale(1, 1);
        opacity: 1;
    }
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    /* Glow */
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 10;
}

.video-placeholder-msg {
    position: absolute;
    color: #555;
    font-size: 14px;
    z-index: 0;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: auto;
    height: auto;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    font-weight: 200;
    z-index: 300;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
    background: transparent;
}

/* Post Categorization */
.post-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 99px;
    /* Default (Monochrome) */
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid transparent;
    line-height: 1;
}

/* Color Themes (Subtle/Pastel) */
.post-category.community {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
}

.post-category.engineering {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.post-category.design {
    background: rgba(175, 82, 222, 0.1);
    color: #AF52DE;
}

.post-category.product {
    background: rgba(52, 199, 89, 0.1);
    color: #28CD41;
}

.post-category.thoughts {
    background: rgba(255, 45, 85, 0.1);
    color: #FF2D55;
}

.post-category.tutorial {
    background: rgba(48, 176, 199, 0.1);
    color: #30B0C7;
}

.post-category.news {
    background: rgba(88, 86, 214, 0.1);
    color: #5856D6;
}

.post-category.business {
    background: rgba(142, 142, 147, 0.1);
    color: #8E8E93;
}

.post-category.technology {
    background: rgba(0, 199, 190, 0.1);
    color: #00C7BE;
}

.post-category.travel {
    background: rgba(255, 204, 0, 0.1);
    color: #FFCC00;
}

.post-category.africa {
    background: rgba(162, 132, 94, 0.1);
    color: #A2845E;
}

.post-category.lifestyle {
    background: rgba(50, 173, 230, 0.1);
    color: #32ADE6;
}

/* Dark Mode Adjustments provided automatically by opacity */

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

pre {
    position: relative;
    /* Ensure button is positioned relative to code block */
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text-main);
    border-color: var(--text-tertiary);
}

.copy-btn.copied {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}

/* Custom Scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 6px;
    border: 3px solid var(--bg);
    /* Padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-tertiary);
}

/* --- POST IMAGE GRID --- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 40px 0;
}

.image-grid img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 0 !important;
}

/* --- LIGHTBOX (ZOOM) --- */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lightbox-container.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s var(--ease-out);
    object-fit: contain;
}

.lightbox-container.active .lightbox-img {
    transform: scale(1);
}

.image-grid img {
    cursor: zoom-in;
    transition: filter 0.2s;
}

.image-grid img:hover {
    filter: brightness(0.95);
}

/* --- GOODREADS CARD (Redesigned) --- */
.goodreads-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    padding: 16px 0;
    /* Match project text vertical padding */
    border-radius: 0;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    margin: 0;
    border: none;
    /* Remove box styling to match list */
    position: relative;
    width: 100%;
}

/* Custom hover specifically for this item if needed, 
   but it will inherit project-item styling if we add that class, 
   OR we style it independently to look 'special' but aligned.
   Let's make it a hybrid: clearer 'button' feel but minimal.
*/

.goodreads-card {
    /* Re-adding border for Widget Feel but minimal */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    background: var(--bg);
}

.goodreads-card:hover {
    border-color: var(--text-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.gr-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--surface);
    border-radius: 8px;
    /* Standardize radius */
    color: var(--text-main);
}

.gr-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-grow: 1;
}

.gr-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.gr-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.gr-arrow {
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
}

.goodreads-card:hover .gr-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.project-list-container .section-label:first-child {
    margin-top: 0;
}

/* --- INTRO ACTIONS --- */
.intro-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.intro-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 99px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.intro-action-btn:hover {
    background: var(--bg);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 8px 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.show-more-btn:hover {
    color: var(--text-main);
}

.show-more-btn span {
    display: inline-block;
}

.intro-action-btn span {
    display: inline-block;
}

.intro-action-btn .icon {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* --- TOOLBOX --- */
.toolbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: default;
}

.tool-chip:hover {
    color: var(--text-main);
    background: var(--bg);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tool-chip img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.8;
}

/* --- POST CONTENT IMAGES --- */
.post-img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 800px;
    margin: 24px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* --- POST VIDEOS --- */
.post-video {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 800px;
    margin: 24px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* --- VIDEO GRID --- */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 40px 0;
}

.video-grid .post-video {
    margin: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* --- VIDEOS IN TABLES/GRIDS --- */
/* Reset margins when inside a table (markdown grid) */
td .post-video,
th .post-video {
    margin: 0;
    width: 100%;
    height: auto;
    box-shadow: none;
    /* simpler look in grid */
}

/* Ensure tables fit */
.post-content table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 24px 0;
}

.post-content td {
    padding: 8px;
    vertical-align: middle;
}

/* --- TYPOGRAPHY POLISH --- */
.post-content h2 {
    margin-top: 48px;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.post-content p {
    margin-bottom: 24px;
    line-height: 1.7;
    font-size: 16px;
}

.post-content a {
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--text-tertiary);
    transition: all 0.2s;
}

.post-content a:hover {
    text-decoration-color: var(--text-main);
    background: var(--surface);
    border-radius: 4px;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 17px;
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 48px 0;
    width: 100%;
}

/* ===== SKILLS PAGE ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 0.6s var(--ease-out) forwards;
}

.skill-card {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.25s var(--ease-out);
}

.skill-card:hover {
    background: var(--bg);
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.skill-level {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-tertiary);
}

.skill-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
}

/* Philosophy Section */
.philosophy-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeIn 0.6s var(--ease-out) 0.2s forwards;
}

.philosophy-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.25s var(--ease-out);
}

.philosophy-item:hover {
    background: var(--bg);
    border-color: var(--border-color);
}

.philosophy-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.philosophy-item p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Mobile Skills Grid */
@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .skill-card {
        padding: 14px;
    }

    .skill-name {
        font-size: 13px;
    }

    .skill-level {
        font-size: 8px;
    }

    .philosophy-item {
        padding: 16px;
    }
}

/* --- POST FOOTER (Share & Subscribe) --- */
.post-footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px dashed var(--border-color);
}

.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-right: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none !important;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.share-btn:hover {
    background: var(--bg);
    border-color: var(--border-color);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.share-btn.copied {
    background: var(--text-main);
    color: var(--bg);
}

.subscribe-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.subscribe-box:hover {
    border-color: var(--border-color);
}

.sub-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.sub-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.sub-btn {
    display: inline-block;
    background: var(--text-main);
    color: var(--bg) !important;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: opacity 0.2s, transform 0.2s;
}

.sub-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* --- RELATED POSTS --- */
.related-section {
    margin-top: 64px;
    padding-top: 32px;
}

.related-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 600px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    display: block;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.related-card:hover {
    background: var(--bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.related-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

.related-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Section Headers with See More */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    margin-top: 60px;
    border-bottom: 1px solid var(--border-color);
    /* Underline the whole header */
    padding-bottom: 12px;
}

.section-header .section-label {
    margin-top: 0;
    margin-bottom: 0;
    width: auto;
    border-bottom: none;
    /* Remove individual label underline */
    padding-bottom: 0;
}

.see-more-link {
    color: var(--text-muted);
    /* Slightly darker than tertiary */
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.see-more-link::after {
    content: "→";
    transition: transform 0.2s ease;
}

.see-more-link:hover {
    color: var(--text-main);
    background-color: var(--surface);
}


/* Live Dot Indicator */
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    /* Green for 'online/active' */
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}