/* 
   Premium 8-Bit Theme
   Palette:
   Cream: #FAF3E6
   Gold: #C19A6B
   Espresso: #2B1F1A
*/

:root {
    --bg-cream: #FAF3E6;
    --accent-gold: #C19A6B;
    --text-espresso: #2B1F1A;
    --shadow-espresso: rgba(43, 31, 26, 0.8);
    --border-size: 4px;
    --pixel-font: 'Press Start 2P', monospace;
    --body-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
    background-color: var(--bg-cream);
    color: var(--text-espresso);
    font-family: var(--body-font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: url('https://unpkg.com/rpgui@1.0.3/img/cursor/default.png'), auto;
}

/* 8-Bit Hover Cursor for interactables */
a,
button,
input[type="submit"],
input[type="button"],
.btn,
.li-credential-btn,
.li-show-all,
.hamburger,
.cert-card {
    cursor: url('https://unpkg.com/rpgui@1.0.3/img/cursor/point.png'), pointer !important;
}

/* Typography */
.pixel-heading {
    font-family: var(--pixel-font);
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0px var(--accent-gold);
}

.pixel-subheading {
    font-family: var(--pixel-font);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.pixel-font {
    font-family: var(--pixel-font);
    font-size: 0.8rem;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
}

.body-text {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.3px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--text-espresso);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 5rem;
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

header.navbar {
    background-color: var(--bg-cream);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: var(--border-size) solid var(--text-espresso);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    color: var(--text-espresso);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--pixel-font);
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--text-espresso);
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-gold);
}

/* 8-Bit UI Elements */
.pixel-border {
    border: var(--border-size) solid var(--text-espresso);
}

.pixel-card {
    background-color: #fff;
    border: var(--border-size) solid var(--text-espresso);
    padding: 1.5rem;
    box-shadow: 8px 8px 0 var(--shadow-espresso);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pixel-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--shadow-espresso);
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    cursor: pointer;
    border: var(--border-size) solid var(--text-espresso);
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: var(--text-espresso);
    box-shadow: 4px 4px 0 var(--text-espresso);
}

.btn-secondary {
    background-color: var(--bg-cream);
    color: var(--text-espresso);
    box-shadow: 4px 4px 0 var(--text-espresso);
}

.btn-small {
    font-size: 0.6rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-gold);
    color: var(--text-espresso);
    box-shadow: 2px 2px 0 var(--text-espresso);
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--text-espresso);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--text-espresso);
}

/* Hero Section */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-image-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}

.pixel-portrait {
    max-width: 100%;
    height: auto;
    border: var(--border-size) solid var(--text-espresso);
    box-shadow: 12px 12px 0 var(--accent-gold);
    image-rendering: pixelated;
    background-color: var(--accent-gold);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pixel-tag {
    background-color: var(--bg-cream);
    border: 2px solid var(--text-espresso);
    padding: 0.4rem 0.8rem;
    font-family: var(--pixel-font);
    font-size: 0.7rem;
    color: var(--text-espresso);
    line-height: 1.4;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Contact Form */
.contact-box {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
}

.pixel-input {
    font-family: var(--body-font);
    font-size: 1rem;
    padding: 0.8rem;
    border: var(--border-size) solid var(--text-espresso);
    background-color: #fff;
    color: var(--text-espresso);
}

.pixel-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.center-cta {
    text-align: center;
}

/* Footer */
.pixel-footer {
    background-color: var(--text-espresso);
    color: var(--bg-cream);
    padding: 2rem 0;
    margin-top: 5rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--accent-gold);
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    text-decoration: none;
}

.social-links a:hover {
    text-decoration: underline;
}

/* -------------------------------------
   3D Animated Background Elements
-------------------------------------- */
.cube-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.cube {
    position: absolute;
    width: 60px;
    height: 60px;
    background: transparent;
    border: 4px solid var(--accent-gold);
    animation: rotate3d 12s linear infinite;
    opacity: 0.3;
}

.cube2 {
    top: 20%;
    left: 10%;
    width: 40px;
    height: 40px;
    border-color: var(--text-espresso);
    animation-duration: 9s;
}

.cube3 {
    top: 70%;
    left: 80%;
    width: 80px;
    height: 80px;
    animation-duration: 15s;
}

.cube4 {
    top: 40%;
    left: 85%;
    width: 30px;
    height: 30px;
    border-color: var(--text-espresso);
    animation-duration: 8s;
}

@keyframes rotate3d {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

/* -------------------------------------
   Mobile Navigation
-------------------------------------- */
.hamburger {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-espresso);
    cursor: pointer;
}

/* -------------------------------------
   LinkedIn-Style List Sections
-------------------------------------- */
.li-section {
    background: var(--bg-cream);
    border: var(--border-size) solid var(--text-espresso);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 8px 8px 0 var(--shadow-espresso);
}

.li-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 4px solid var(--text-espresso);
    padding-bottom: 0.5rem;
}

.li-header h2 {
    font-family: var(--pixel-font);
    font-size: 1rem;
    text-transform: uppercase;
}

.li-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 2px dashed var(--text-espresso);
}

.li-item:last-child {
    border-bottom: none;
}

.li-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 2px solid var(--text-espresso);
    background: #fff;
    image-rendering: pixelated;
}

.li-content {
    flex: 1;
}

.li-title {
    font-family: var(--pixel-font);
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-espresso);
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.li-subtitle {
    font-family: var(--pixel-font);
    font-size: 0.7rem;
    font-weight: normal;
    color: var(--accent-gold);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.li-date {
    font-family: var(--pixel-font);
    font-size: 0.65rem;
    font-weight: normal;
    color: var(--text-espresso);
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.li-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 500;
    color: var(--text-espresso);
    margin-bottom: 0.8rem;
}

.li-skills {
    font-family: var(--pixel-font);
    font-size: 0.65rem;
    font-weight: normal;
    line-height: 1.6;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-espresso);
}

.li-credential-btn {
    display: inline-block;
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid var(--text-espresso);
    background-color: var(--bg-cream);
    color: var(--text-espresso);
    box-shadow: 2px 2px 0 var(--text-espresso);
    margin-bottom: 0.8rem;
    transition: transform 0.1s, box-shadow 0.1s;
}

.li-credential-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--text-espresso);
}

.li-thumbnails {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.li-thumbnail {
    width: 120px;
    height: 70px;
    object-fit: cover;
    border: 2px solid var(--text-espresso);
    background-color: var(--accent-gold);
}

.li-show-all {
    display: block;
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    color: var(--text-espresso);
    text-decoration: none;
    cursor: pointer;
    background: var(--accent-gold);
    border: 2px solid var(--text-espresso);
    width: 100%;
    box-shadow: 4px 4px 0 var(--text-espresso);
    transition: transform 0.1s, box-shadow 0.1s;
}

.li-show-all:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--text-espresso);
}

.hidden-item {
    display: none;
}

/* Typing Cursor */
.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--accent-gold);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--bg-cream);
        border-bottom: var(--border-size) solid var(--text-espresso);
        padding: 1rem 0;
    }

    .nav-links.open {
        display: flex;
    }

    .pixel-heading {
        font-size: 1.5rem;
    }
}

/* -------------------------------------
   Premium Live Button Styling
-------------------------------------- */
.li-live-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid var(--accent-gold);
    background-color: var(--text-espresso);
    color: var(--accent-gold);
    box-shadow: 2px 2px 0 var(--accent-gold);
    margin-bottom: 0.8rem;
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s, color 0.2s;
}

.li-live-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--accent-gold);
    background-color: var(--accent-gold);
    color: var(--text-espresso);
}

/* -------------------------------------
   Universal Modal Popup
-------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 31, 26, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-cream);
    border: 4px solid var(--accent-gold);
    box-shadow: 12px 12px 0 #000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
}

.modal-close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: #E91E63;
    color: #fff;
    border: 4px solid #000;
    font-family: var(--pixel-font);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s;
}

.modal-close-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.modal-close-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0 #000;
}

#modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: none;
}

#modal-pdf {
    width: 80vw;
    height: 75vh;
    border: 2px solid var(--text-espresso);
    display: none;
}

@media (max-width: 768px) {
    .modal-content-wrapper {
        padding: 1rem;
    }

    #modal-pdf {
        width: 95vw;
        height: 80vh;
    }
}

/* ==== Blog Carousel ==== */
.blog-carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) transparent;
}

.blog-carousel-track::-webkit-scrollbar {
    height: 4px;
}

.blog-carousel-track::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 2px;
}

.blog-card {
    flex-shrink: 0;
    scroll-snap-align: start;
    width: 280px;
    border: 2px solid var(--accent-gold);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(193, 154, 107, 0.25);
}

.blog-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.blog-card-body {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.blog-card-title {
    font-family: var(--pixel-font);
    font-size: 0.55rem;
    color: var(--text-espresso);
    line-height: 1.5;
}

.blog-card-excerpt {
    font-size: 0.78rem;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.4rem 0.9rem;
    font-family: var(--pixel-font);
    font-size: 0.45rem;
    color: var(--text-espresso);
    background: transparent;
    border: 2px solid var(--accent-gold);
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    width: fit-content;
}

.blog-card-btn:hover {
    background: var(--accent-gold);
    color: #fff;
}

/* ==== Responsive Design ==== */

/* Tablet & smaller */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-cream);
        border-bottom: var(--border-size) solid var(--text-espresso);
        padding: 1rem;
        gap: 0.8rem;
        z-index: 100;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        font-size: 0.65rem;
    }

    /* Hero */
    #hero {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
        min-height: auto !important;
    }

    .hero-content h2 {
        font-size: 1.3rem !important;
    }

    .hero-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
    }

    .hero-actions .btn {
        font-size: 0.6rem;
        padding: 0.6rem 1rem;
    }

    /* Email row — stack vertically on mobile */
    #btnCopy {
        flex-wrap: wrap !important;
        justify-content: center !important;
        font-size: 0.7rem !important;
    }

    #btnCopy span:not(#copyHint):not(#copyToast) {
        font-size: 0.65rem !important;
        word-break: break-all;
    }

    /* Sections */
    .li-section {
        padding: 1rem;
        box-shadow: 4px 4px 0 var(--shadow-espresso);
        overflow-x: hidden;
    }

    .li-item {
        flex-direction: column;
    }

    .li-logo {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    .li-title {
        font-size: 0.7rem;
    }

    .li-subtitle,
    .li-date,
    .li-skills {
        font-size: 0.55rem;
    }

    .li-desc {
        font-size: 0.85rem;
    }

    .li-thumbnails {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .li-thumbnail {
        width: 80px;
        height: 50px;
        max-width: none;
    }

    /* Inline-styled certificate card containers */
    .cert-card {
        width: 120px !important;
        height: 90px !important;
    }

    .cert-card img {
        height: 60px !important;
    }

    .cert-card div:last-child {
        font-size: 0.6rem !important;
        height: 28px !important;
        padding: 0.15rem 0.3rem !important;
    }

    .pixel-card {
        padding: 1rem;
        box-shadow: 4px 4px 0 var(--shadow-espresso);
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .li-header h2 {
        font-size: 0.8rem;
    }

    .contact-box {
        padding: 0 0.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .blog-carousel-track {
        gap: 1rem;
    }

    .blog-card {
        width: 240px;
    }

    .modal-content-wrapper {
        padding: 1rem;
    }

    #modal-pdf {
        width: 95vw;
        height: 80vh;
    }

    .pixel-footer {
        padding: 1.5rem 0;
    }

    .social-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Sections */
    .li-section {
        padding: 1rem;
        box-shadow: 4px 4px 0 var(--shadow-espresso);
        overflow-x: hidden;
        word-wrap: break-word;
        margin-left: 0;
        margin-right: 0;
    }

    /* Credential & live buttons */
    .li-credential-btn,
    .li-live-btn {
        font-size: 0.5rem !important;
        padding: 0.4rem 0.6rem !important;
    }
}

/* Phone */
@media (max-width: 480px) {
    .logo {
        font-size: 0.85rem !important;
    }

    #hero {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .hero-content h2 {
        font-size: 1rem !important;
    }

    .subtitle {
        font-size: 0.8rem !important;
    }

    /* Stack hero buttons vertically */
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        font-size: 0.55rem;
        text-align: center;
    }

    /* Email row wraps and centers */
    #btnCopy {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.3rem !important;
        text-align: center;
    }

    #copyHint {
        display: none !important;
    }

    /* Sections — keep styled on mobile, no negative margins */
    .li-section {
        margin-left: 0;
        margin-right: 0;
        border: var(--border-size) solid var(--text-espresso);
        box-shadow: 3px 3px 0 var(--shadow-espresso);
    }

    .li-title {
        font-size: 0.6rem;
    }

    .li-desc {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    /* Thumbnails — even smaller on phones */
    .li-thumbnail {
        width: 64px;
        height: 42px;
    }

    .cert-card {
        width: 100px !important;
        height: 78px !important;
    }

    .cert-card img {
        height: 50px !important;
    }

    .cert-card div:last-child {
        font-size: 0.5rem !important;
        height: 24px !important;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Blog cards */
    .blog-card {
        width: 220px;
    }

    .blog-card-img {
        height: 120px;
    }

    .blog-card-title {
        font-size: 0.5rem;
    }

    /* WhatsApp button smaller */
    #whatsapp-float {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
        bottom: 16px;
        right: 16px;
    }

    /* Footer */
    .footer-content {
        padding: 0 1rem;
    }

    .social-links {
        gap: 1rem !important;
    }

    .social-links a {
        font-size: 0.6rem !important;
    }

    /* Section headings */
    .pixel-heading {
        font-size: 1.2rem !important;
    }

    .section-title {
        font-size: 1rem !important;
    }

    /* Fix pixel card hover on mobile */
    .pixel-card:hover {
        transform: none;
        box-shadow: 4px 4px 0 var(--shadow-espresso);
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
        margin: 0 auto;
    }
}

/* ============================================================
   VISUAL POLISH ENHANCEMENTS
   ============================================================ */

/* 1. Subtle cream texture + diagonal stripes */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(135deg, rgba(193, 154, 107, 0.03) 0 6px, rgba(255, 255, 255, 0) 6px 12px),
        radial-gradient(circle at 10% 10%, rgba(0, 0, 0, 0.02), transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.01), transparent 30%);
    mix-blend-mode: multiply;
    z-index: -2;
    image-rendering: auto;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64'><filter id='g'><feTurbulence baseFrequency='0.9' stitchTiles='stitch' numOctaves='1' seed='2'/><feColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.94 0 0 0 0 0.92 0 0 0 0.02 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)' opacity='0.03'/></svg>");
    opacity: 0.45;
    mix-blend-mode: overlay;
    z-index: -1;
    pointer-events: none;
}

/* 2. Card tilt + inner shine */
.pixel-card {
    position: relative;
    transition: transform 0.25s cubic-bezier(.2, .9, .3, 1), box-shadow 0.2s;
    transform-origin: center;
    will-change: transform;
}

.pixel-card:hover {
    transform: translateY(-8px) rotateX(3deg) rotateY(-2deg);
    box-shadow: 18px 18px 0 rgba(43, 31, 26, 0.95);
}

.pixel-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 40%);
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.25s;
    border-radius: 2px;
}

.pixel-card:hover::after {
    opacity: 1;
}

.pixel-card:focus-within {
    outline: 3px dashed rgba(193, 154, 107, 0.35);
}

/* 3. Skill badge tooltips */
.skill-badge {
    position: relative;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 2px solid var(--text-espresso);
    background: var(--bg-cream);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.skill-badge:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 var(--shadow-espresso);
}

.skill-badge:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-espresso);
    color: var(--bg-cream);
    padding: 0.35rem 0.6rem;
    font-size: 0.6rem;
    font-family: var(--pixel-font);
    border-radius: 4px;
    white-space: nowrap;
    z-index: 30;
}

/* 6. Skip-to-content link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    background: var(--text-espresso);
    color: var(--bg-cream);
    padding: 0.4rem 0.6rem;
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    z-index: 1000;
    text-decoration: none;
}

/* ============================================================
   STORY CAROUSEL IMAGE STYLES
   ============================================================ */
.story-img {
    width: 100%;
    max-width: 280px;
    height: 160px;
    object-fit: cover;
    border: 3px solid var(--accent-gold);
    border-radius: 6px;
    image-rendering: pixelated;
    box-shadow: 4px 4px 0 rgba(43, 31, 26, 0.4);
}

/* Pixel mosaic reveal animation */
.story-img.pixel-reveal {
    animation: pixelMosaicIn 0.8s cubic-bezier(.25, .46, .45, .94) forwards;
}

@keyframes pixelMosaicIn {
    0% {
        opacity: 0;
        filter: blur(12px) contrast(1.5) saturate(0.5);
        transform: scale(1.15);
        image-rendering: pixelated;
    }

    25% {
        opacity: 0.6;
        filter: blur(8px) contrast(1.3) saturate(0.7);
        transform: scale(1.1);
    }

    50% {
        opacity: 0.8;
        filter: blur(4px) contrast(1.15) saturate(0.85);
        transform: scale(1.05);
    }

    75% {
        opacity: 0.95;
        filter: blur(1px) contrast(1.05) saturate(0.95);
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        filter: blur(0) contrast(1) saturate(1);
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .story-img {
        max-width: 200px;
        height: 120px;
    }
}

/* Global overflow protection for mobile */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}