:root {
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
    --bg-panel: #ffffff;
    --bg-hover: #f9f9f9;
    --bg-main: #ffffff;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease-out;
}

html[data-theme="dark"] {
    --shadow-soft: rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
    --bg-panel: #1a1a1a;
    --bg-hover: #252525;
    --bg-main: #121212;
}

/* --- Homepage Redesign (Full Width) --- */
.home-wrapper {
    max-width: 1400px !important;
    padding: 0 4rem;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
    opacity: 1 !important;
}

body#post header.hero {
    opacity: 1;
    margin: 0 auto 2em;
    max-width: 100%;
}

.hero-text {
    width: 100%;
}

.hero h1 {
    font-family: serif;
    font-size: 3rem;
    margin: 0 0 15px 0;
    color: var(--text-main);
    line-height: 1;
    font-weight: 700;
}

.hero-intro {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.4;
    margin: 0 auto;
}

.hero-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 40px;
    border: 5px solid var(--bg-main, #fff);
    box-shadow:
        0 15px 30px var(--shadow-soft),
        0 8px 15px rgba(0, 87, 255, 0.06);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    display: block;
    margin: 20px auto 0;
    animation: hero-breathe 4s ease-in-out infinite;
}

@keyframes hero-breathe {

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

    50% {
        transform: scale(1.015);
    }
}

.hero-img:hover {
    transform: rotate(3deg) scale(1.05);
    box-shadow:
        0 20px 40px var(--shadow-soft),
        0 12px 20px rgba(0, 87, 255, 0.1);
    animation-play-state: paused;
}

/* Sections General */
.home-section {
    margin-bottom: 30px;
}

.home-section h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-blue);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    color: var(--text-main);
}

/* Split Rows */
.home-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: stretch;
}

.section-latest-blog,
.section-latest-thoughts {
    display: flex;
    flex-direction: column;
}

/* Latest Tables (Simplified) */
.latest-table {
    width: 100%;
    border-collapse: collapse;
    flex-grow: 1;
}

.latest-table td {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.95rem;
}

.latest-table tr:first-child td {
    border-top: 1px solid var(--border-color);
}

.latest-table tr:hover .latest-title {
    text-decoration: underline;
    color: var(--primary-blue);
}

.latest-table a {
    text-decoration: none;
    color: var(--text-main);
    display: block;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.3;
}

.view-all-link {
    margin-top: 10px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
}

/* Projects Table */
.projects-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.projects-table tr {
    transition: background-color var(--transition-fast);
}

.projects-table tr:hover {
    background-color: var(--bg-hover);
}

.projects-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-main);
}

.projects-table tr:last-child td {
    border-bottom: none;
}

.projects-table td:first-child {
    width: 120px;
    background: var(--bg-hover);
    font-weight: 700;
    color: var(--primary-blue);
    border-right: 1px solid var(--border-color);
}

.projects-table td:last-child {
    width: 80px;
    text-align: right;
    font-size: 0.9rem;
}

.projects-table a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.projects-table a:hover {
    text-decoration: underline;
    color: var(--primary-blue-dark);
}

/* Gallery Scroll */
.gallery-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-scroll-container::before,
.gallery-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 2;
}

.gallery-scroll-container::before {
    left: 32px;
    background: linear-gradient(to right, var(--bg-main, #fff), transparent);
}

.gallery-scroll-container::after {
    right: 32px;
    background: linear-gradient(to left, var(--bg-main, #fff), transparent);
}

.gallery-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 5px 5px;
    width: 100%;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-thumb-link {
    flex-shrink: 0;
}

.gallery-thumb {
    height: 150px;
    width: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: block;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

.scroll-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-main);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
    z-index: 3;
}

.scroll-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-hover);
    transform: scale(1.1);
}

/* Likes Table */
.likes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.likes-table tr {
    transition: background-color var(--transition-fast);
}

.likes-table tr:hover {
    background-color: var(--bg-hover);
}

.likes-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-main);
}

.likes-table tr:last-child td {
    border-bottom: none;
}

.likes-table td:first-child {
    width: 140px;
    background: var(--bg-hover);
    font-weight: 700;
    color: var(--primary-blue);
    border-right: 1px solid var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 1100px) {
    .home-wrapper {
        padding: 0 2rem;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero-img {
        width: 350px;
        height: 350px;
        margin: 0 auto;
    }

    .home-grid-row {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

@media (max-width: 600px) {
    .home-wrapper {
        padding: 0 0.5rem;
    }

    .hero {
        margin-top: 10px;
        margin-bottom: 15px;
        padding-bottom: 10px;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    .hero-text {
        text-align: center;
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .hero-img {
        width: 180px;
        height: 180px;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 30px;
        margin: 15px auto 0;
    }

    .hero-intro {
        font-size: 1rem;
        max-width: 100%;
    }

    .home-section {
        margin-bottom: 20px;
    }

    .home-section h2 {
        margin-bottom: 10px;
        font-size: 1rem;
    }

    .home-grid-row {
        gap: 15px;
        margin-bottom: 20px;
    }

    /* Stack Tables on Mobile */
    .projects-table td,
    .likes-table td {
        display: block;
        width: auto !important;
        border: none;
        padding: 4px 5px;
    }

    .projects-table td:first-child,
    .likes-table td:first-child {
        background: transparent;
        padding-bottom: 0;
        color: var(--primary-blue);
        font-size: 1rem;
    }

    .projects-table td:last-child {
        text-align: left;
        padding-top: 2px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
    }

    .likes-table td:last-child {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
    }

    .projects-table tr:last-child td:last-child,
    .likes-table tr:last-child td:last-child {
        border-bottom: none;
    }

    .gallery-thumb {
        height: 120px;
    }
}