:root {
    /* Latte Palette */
    --bg-color: #fdfaf3;      
    --card-bg: #f5ede0;       
    --text-primary: #5d4037;  
    --text-secondary: #8d6e63; 
    --accent: #a1887f;        
    --white: #3e2723;
    
    --font-headers: 'Press Start 2P', cursive;
    --font-body: 'VT323', monospace;
}

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

img {
    max-width: 100%;
    height: auto;
}

html { 
    scroll-behavior: smooth; 
    zoom: 1.25;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--accent); border: 1px solid var(--bg-color); }
::-webkit-scrollbar-thumb:hover { background: var(--text-primary); }

body {
    background-color: var(--bg-color);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 20px;
    line-height: 1.4;
    overflow-x: hidden;
}

/* --- Glitch Overlay --- */
.glitch-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--text-primary);
    opacity: 0;
    z-index: 2000; pointer-events: none;
    mix-blend-mode: color-dodge;
}
.glitch-overlay.active {
    animation: glitch-anim 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite; opacity: 0.1;
}
@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); background: var(--accent); opacity: 0.2; }
    40% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); background: var(--text-secondary); opacity: 0.2; }
    80% { transform: translate(5px, -5px); }
    100% { transform: translate(0); }
}

/* --- Backgrounds --- */
#pixel-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.25; }
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%);
    background-size: 100% 4px; z-index: 1000; pointer-events: none; opacity: 0.15;
}

/* --- Nav --- */
.pixel-nav {
    position: fixed; top: 0; width: 100%; z-index: 999; padding: 10px 20px;
    background: var(--bg-color); opacity: 0.95; border-bottom: 4px solid var(--text-primary);
    display: flex; justify-content: space-between; align-items: center;
    backdrop-filter: blur(5px);
}
.nav-brand { font-family: var(--font-headers); font-size: 14px; color: var(--text-primary); text-shadow: 2px 2px var(--accent); }
.nav-links a {
    font-family: var(--font-headers); font-size: 10px; color: var(--white);
    text-decoration: none; margin-left: 20px; padding: 5px 10px; transition: 0.2s;
    position: relative;
}
.nav-links a:hover { color: var(--text-primary); text-shadow: 0 0 5px var(--text-primary); }
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: var(--text-primary); transition: 0.3s; transform: translateX(-50%);
}
.nav-links a:hover::after { width: 80%; }

/* --- Mobile Menu --- */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.close-mobile-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-headers);
    font-size: 16px;
    cursor: pointer;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.mobile-nav-links a {
    font-family: var(--font-headers);
    font-size: 20px;
    color: var(--white);
    text-decoration: none;
    transition: 0.2s;
}

.mobile-nav-links a:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* --- Hero --- */
.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 30px; /* Increased default padding */
}

main {
    padding: 40px 0; /* Breathing room at top/bottom */
}

section { 
    padding: 100px 0; 
    border-bottom: 2px dashed var(--text-secondary); 
    overflow: hidden; /* Prevent child clipping */
}

.hero-box {
    background: var(--card-bg);
    border: 4px solid var(--text-primary);
    padding: 40px;
    box-shadow: 8px 8px 0px var(--accent);
    position: relative;
    overflow: hidden;
}
/* Shine effect for hero */
.hero-box::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: rotate(45deg); animation: shine 6s infinite;
}
@keyframes shine { 0% { left: -100%; } 20% { left: 100%; } 100% { left: 100%; } }

.hero-box h1 {
    font-family: var(--font-headers); font-size: clamp(24px, 5vw, 48px);
    margin-bottom: 20px; color: var(--white); text-shadow: 4px 4px 0px var(--text-secondary);
    
    /* Typing Animation Setup */
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 4px solid var(--text-primary);
    width: 0;
    animation: 
        typing 2s steps(9, end) forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 9ch; } /* 'Arvindhan' is 9 chars */
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--text-primary); }
}

.hero-tag { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 10px; font-weight: bold; }
.hero-desc { 
    font-size: 1.2rem; 
    color: var(--white); 
    max-width: fit-content; 
    margin-bottom: 30px; 
    background: var(--bg-color);
    padding: 10px 20px;
    border-left: 4px solid var(--text-primary);
    box-shadow: 4px 4px 0px var(--accent);
    opacity: 0.9;
}

.btn-pixel {
    display: inline-block; font-family: var(--font-headers); font-size: 12px;
    padding: 15px 30px; color: var(--bg-color); background: var(--text-primary);
    text-decoration: none; box-shadow: inset -4px -4px 0 rgba(0,0,0,0.3), 4px 4px 0 var(--accent);
    transition: transform 0.1s; margin-right: 20px;
    border: none;
    cursor: pointer;
}
.btn-pixel:hover { 
    transform: translate(2px, 2px); 
    background: var(--white); 
    color: var(--bg-color); 
    box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3), 2px 2px 0 var(--text-primary); 
}
.btn-ghost { 
    background: transparent; 
    color: var(--text-primary); 
    box-shadow: inset 0 0 0 4px var(--text-primary); 
}
.btn-ghost:hover { 
    background: var(--text-primary); 
    color: var(--bg-color); 
    box-shadow: none;
}

.detailed-bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.bio-block {
    background: var(--bg-color);
    opacity: 0.8;
    border-left: 2px solid var(--accent);
    padding: 15px;
    transition: 0.3s;
}

.bio-block:hover {
    background: var(--card-bg);
    border-left-color: var(--text-primary);
}

.bio-block-header {
    display: block;
    font-family: var(--font-headers);
    font-size: 10px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.bio-block-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--white);
    opacity: 0.8;
    margin: 0;
}

@media (max-width: 768px) {
    .detailed-bio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- Profile Img --- */
.profile-container { margin-bottom: 30px; }
.profile-img-rounded {
    width: 120px; height: 120px;
    border-radius: 50%; border: 4px solid var(--text-primary);
    object-fit: cover; box-shadow: 4px 4px 0px var(--accent);
    transition: 0.3s;
}
.profile-img-rounded:hover { transform: scale(1.05); box-shadow: 0 0 20px var(--text-primary); }

/* --- About & Timeline --- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.bio-text { font-size: 0.9rem; margin-bottom: 20px; color: var(--white); }
.bio-sub { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 30px; border-left: 4px solid var(--accent); padding-left: 15px; }

.stats-row { display: flex; gap: 30px; margin-top: 20px; }
.stat-val { display: block; font-family: var(--font-headers); color: var(--text-primary); font-size: 20px; }
.stat-lbl { font-size: 14px; color: var(--text-secondary); }

.timeline-header { 
    display: flex; justify-content: space-between; align-items: center; 
    cursor: var(--pixel-cursor) !important; margin-bottom: 20px; border: none; border-bottom: 2px solid var(--text-primary); padding-bottom: 5px;
    background: none; width: 100%; text-align: left;
}
.timeline-header h3 { font-family: var(--font-headers); font-size: 14px; color: var(--white); margin: 0; }
.toggle-icon { font-family: var(--font-headers); font-size: 12px; color: var(--text-primary); }

.timeline-content {
    max-height: 1000px; overflow: hidden; transition: max-height 0.5s ease-out;
}
.timeline-content.collapsed { max-height: 0; }

.timeline-entry { margin-bottom: 25px; padding-left: 15px; border-left: 2px solid var(--text-primary); }
.time-year { font-family: var(--font-headers); font-size: 10px; color: var(--text-primary); display: block; margin-bottom: 5px; }
.time-title { font-weight: bold; color: var(--white); font-size: 1.1rem; display: block; }
.time-desc { font-size: 1rem; color: var(--white); opacity: 0.7; margin: 5px 0 0 0; }

/* --- Unified Subheading --- */
.sub-heading, .card-header-complex h3, .timeline-header h3, .skill-col h3, .ally-alert {
    font-family: var(--font-headers);
    font-size: 14px;
    color: var(--white);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

/* Specific Adjustments */
.timeline-header h3 { font-size: 16px; color: var(--text-primary); }
.ally-alert { color: var(--text-primary); animation: blink 2s infinite; margin-bottom: 20px; font-size: 12px; }

/* --- Projects --- */
.pixel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }
.pixel-card {
    background: var(--card-bg); border: 4px solid var(--text-primary);
    padding: 20px; transition: transform 0.2s; position: relative;
    overflow: hidden;
}
.pixel-card p { font-size: 0.9rem; line-height: 1.5; color: var(--white); opacity: 0.8; }
.pixel-card:hover { transform: translateY(-10px); border-color: var(--white); box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.pixel-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
    transform: translateY(-100%); transition: 0.5s; pointer-events: none;
}
.pixel-card:hover::before { transform: translateY(100%); }

.card-header { border-bottom: 4px solid var(--text-secondary); padding-bottom: 15px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 5px; }
.card-cat { 
    display: inline-block; background: var(--accent); color: #fff; 
    font-family: var(--font-headers); font-size: 8px; 
    padding: 4px 8px; text-transform: uppercase; margin-bottom: 8px;
}
.card-title { font-family: var(--font-headers); font-size: 16px; color: var(--text-primary); line-height: 1.4; display: block; }
.badge { background: var(--text-secondary); color: #fff; padding: 4px 8px; font-size: 10px; font-family: var(--font-headers); align-self: flex-start; }

.tech-stack span {
    display: inline-block; background: var(--bg-color); color: var(--text-primary);
    padding: 4px 8px; margin: 4px 4px 0 0; border: 1px solid var(--text-secondary); font-size: 0.9rem;
}

/* --- Skills Upgraded --- */
.section-title {
    font-family: var(--font-headers);
    color: var(--text-primary);
    margin-bottom: 40px;
    font-size: 24px;
    text-shadow: 3px 3px 0px var(--accent);
}

.skills-grid-complex {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.skill-card-complex {
    background: var(--card-bg);
    border: 2px solid var(--text-primary);
    padding: 30px;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 10px 10px 0px var(--accent);
    overflow: hidden;
}

.skill-card-complex:hover {
    transform: translate(-5px, -5px);
    box-shadow: 15px 15px 0px var(--accent);
}

.skill-card-complex.full-width {
    grid-column: 1 / -1;
}

/* Card Edges (Corner Accents) */
.card-edge {
    position: absolute;
    width: 15px;
    height: 15px;
    border: 3px solid var(--white);
    z-index: 5;
    transition: 0.3s;
}
.skill-card-complex:hover .card-edge { border-color: var(--text-primary); }
.top-left { top: -5px; left: -5px; border-right: none; border-bottom: none; }
.top-right { top: -5px; right: -5px; border-left: none; border-bottom: none; }
.bottom-left { bottom: -5px; left: -5px; border-right: none; border-top: none; }
.bottom-right { bottom: -5px; right: -5px; border-left: none; border-top: none; }

.card-header-complex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--text-secondary);
    padding-bottom: 10px;
}

.status-ok {
    font-family: var(--font-headers);
    font-size: 10px;
    color: var(--text-primary);
    animation: blink 1.5s infinite;
}

/* --- Tech Stack Tabs (Clean) --- */
.tech-stack-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Back to original auto-fill */
    gap: 20px;
    background: var(--bg-color);
    opacity: 0.9;
    border: 1px solid var(--text-secondary);
    padding: 20px;
}

.grid-3x3 {
    grid-template-columns: repeat(3, 1fr) !important; /* Specific 3x3 override */
}

.tech-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--text-secondary);
    padding: 15px;
    transition: 0.2s;
    cursor: default;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
    width: 100%;
}

.tech-tab-main {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.tech-tab:hover {
    background: var(--accent);
    border-color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.tech-tab-cat {
    font-size: 8px;
    color: var(--text-secondary);
    margin-right: 10px;
    font-family: var(--font-headers);
    text-transform: uppercase;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
}

.tech-tab-name {
    font-family: var(--font-headers);
    font-size: 12px;
    color: var(--white);
    flex-grow: 1;
}

.tech-tab-desc {
    font-size: 0.9rem;
    color: var(--white);
    opacity: 0.7;
    line-height: 1.4;
    margin: 0;
    border-top: 1px solid var(--text-secondary);
    padding-top: 8px;
    width: 100%;
}

.tech-tab:hover .tech-tab-name { color: var(--text-primary); }
.tech-tab:hover .tech-tab-desc { color: var(--white); opacity: 1; }

/* Certifications & List Styles */
.cert-list-complex {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cert-item-complex {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-color);
    padding: 15px;
    border-left: 4px solid var(--text-primary);
    transition: 0.3s;
}
.cert-item-complex:hover { background: var(--card-bg); padding-left: 20px; }

.cert-icon {
    font-size: 24px;
    color: var(--text-primary);
}

.cert-info {
    flex-grow: 1;
}

.cert-name {
    display: block;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--white);
}

.cert-desc {
    font-size: 0.9rem;
    color: var(--white);
    opacity: 0.7;
}

.cert-status {
    font-family: var(--font-headers);
    font-size: 8px;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    padding: 5px;
}

/* --- Revolving Library --- */
.mini-console {
    background: var(--bg-color);
    border: 1px solid var(--text-secondary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.console-header-small {
    font-family: var(--font-headers);
    font-size: 8px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--text-secondary);
    padding-bottom: 5px;
}

.revolving-container {
    width: 100%;
    overflow: hidden;
}

.revolving-track {
    display: flex;
    gap: 50px;
    width: max-content;
    animation: scroll 40s linear infinite;
}



.revolving-item {
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 400px;
}

.rev-title {
    font-family: var(--font-headers);
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.rev-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-style: italic;
}

.rev-brief {
    font-size: 0.85rem;
    color: var(--white);
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
    .revolving-item {
        min-width: 250px;
    }
}

/* --- Contact Grid --- */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 60px; align-items: start; }
.contact-main h2 { margin-bottom: 20px; font-family: var(--font-headers); font-size: 24px; color: var(--white); }

.status-indicator {
    font-family: var(--font-headers); font-size: 12px; color: var(--text-primary);
    margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.status-dot {
    width: 10px; height: 10px; background: var(--text-primary);
    border-radius: 50%; display: inline-block;
    box-shadow: 0 0 10px var(--text-primary);
    animation: blink 1.5s infinite;
}

.contact-intro { font-size: 1.2rem; color: var(--white); opacity: 0.9; margin-bottom: 40px; }
.contact-data-box { background: var(--bg-color); border: 2px solid var(--text-primary); padding: 20px; margin-bottom: 40px; }
.contact-row { margin-bottom: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.contact-row .label { font-family: var(--font-headers); font-size: 10px; color: var(--text-secondary); width: 80px; }
.contact-link { font-size: 1.2rem; color: var(--white); text-decoration: none; border-bottom: 1px dotted var(--text-secondary); }
.contact-link:hover { color: var(--text-primary); border-bottom-style: solid; }

.action-row { display: flex; align-items: center; gap: 30px; }
.social-icons a { font-size: 24px; color: var(--white); margin-right: 15px; transition: 0.2s; }
.social-icons a:hover { color: var(--text-primary); transform: scale(1.2); }

/* Ally Box */
.ally-card { border-color: var(--accent); padding: 30px; text-align: center; box-shadow: 8px 8px 0px rgba(158, 169, 63, 0.2); }
.ally-alert { color: var(--text-primary); font-family: var(--font-headers); font-size: 10px; margin-bottom: 20px; animation: blink 2s infinite; }
.ally-name { display: block; font-family: var(--font-headers); font-size: 16px; margin-bottom: 5px; color: var(--white); }
.ally-role { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- Footer --- */
footer { padding: 50px 0; text-align: center; border-top: 4px solid var(--text-primary); background: var(--bg-color); margin-top: 50px; }


/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-color);
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 4px 4px 0px var(--accent);
    transition: 0.3s;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    background: var(--text-primary);
    color: var(--bg-color);
}

/* ================= MOBILE OPTIMIZATIONS ================= */
@media (max-width: 1077px), (max-height: 500px) and (orientation: landscape) {
    .container { padding: 0 15px; }
    section { padding: 40px 0; }
    
    .section-title { 
        text-align: center; 
        font-size: clamp(16px, 6vw, 22px);
        width: 100%;
        overflow-wrap: break-word;
    }

    main { padding: 10px 0 60px 0; }

    body { 
        font-size: 16px; 
        width: 100%;
        overflow-x: hidden;
    }

    /* Mobile Nav */
    .pixel-nav { 
        display: flex !important; 
        padding: 10px 15px;
    }
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }

    /* Hero Box mobile adjustments */
    .hero-box {
        padding: 20px;
        border-width: 3px;
    }
    .hero-box h1 {
        white-space: normal;
        width: auto;
        animation: none;
        border-right: none;
        display: block;
        text-align: center;
        font-size: clamp(22px, 8vw, 36px);
    }
    .hero-desc { font-size: 1rem; }
    .btn-pixel { margin-right: 10px; margin-bottom: 10px; padding: 12px 20px; }

    /* Fix Library Clipping */
    .revolving-track {
        width: max-content !important;
    }

    /* Skills.dat optimization */
    .skills-grid-complex {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
    }
    .skill-card-complex {
        padding: 20px;
        box-shadow: 6px 6px 0px var(--accent);
        width: 100%;
        box-sizing: border-box;
    }
    .card-header-complex {
        margin-bottom: 20px;
        justify-content: center; /* Center header text */
        flex-direction: column;
        gap: 10px;
    }
    .card-header-complex h3 {
        font-size: clamp(10px, 4vw, 14px);
        text-align: center;
        width: 100%;
        overflow-wrap: break-word;
    }

    /* Fix about grid to stack and order correctly */
    .about-grid {
        display: flex;
        flex-direction: column;
        gap: 40px;
        text-align: center; /* Center bio text */
    }
    .bio-box { order: 1; }
    .bio-sub { border-left: none; border-top: 2px solid var(--accent); padding: 15px 0 0 0; }
    
    .stats-row { justify-content: center; }

    .timeline-box { 
        order: 2; 
        margin-top: 20px; 
        border-top: 2px dashed var(--text-secondary);
        padding-top: 30px;
        text-align: left; /* Keep log left-aligned for readability */
    }

    .bio-text { font-size: 1.1rem; }
    .stats-row { flex-wrap: wrap; gap: 20px; }

    /* Center detailed bio headers */
    .bio-block { text-align: center; border-left: none; border-top: 2px solid var(--accent); }

.tech-icon-main {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-right: 10px;
}

.tech-tab:hover .tech-icon-main { color: var(--white); }

/* ... exist ... */

    /* Better touch targets for tech tabs */
    .tech-stack-tabs {
        grid-template-columns: 1fr !important;
        padding: 15px;
    }

    .grid-3x3 {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)) !important;
        gap: 12px;
    }

    .tech-square-mobile {
        aspect-ratio: 1 / 1.1; /* Slightly taller for text */
        justify-content: center;
        padding: 10px !important;
        align-items: center;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
    }

    .tech-square-mobile .tech-tab-desc, 
    .tech-square-mobile .tech-tab-cat {
        display: none !important;
    }

    .tech-square-mobile .tech-tab-main {
        flex-direction: column;
        gap: 5px;
        margin: 0;
        justify-content: center;
    }

    .tech-square-mobile .tech-icon-main {
        font-size: 1.4rem;
        margin: 0;
    }

    .tech-square-mobile .tech-tab-name {
        font-size: 9px;
        text-align: center;
        word-break: break-all;
    }

    .tech-tab {
        padding: 12px;
        font-size: 11px;
        align-items: center; /* Center content in tab */
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Ensure clip-path works correctly but content wraps */
    }
    .tech-tab-name, .tech-tab-desc {
        width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }
    .tech-tab-main { justify-content: center; width: 100%; }

    /* Fix project grid flow */
    .pixel-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .pixel-card { text-align: center; }
    .badge { align-self: center; } /* Center achievement badges */
    .tech-stack { justify-content: center; display: flex; flex-wrap: wrap; }

    .timeline-entry { padding-left: 10px; margin-bottom: 20px; }
    .time-title { font-size: 1rem; }
    .time-desc { font-size: 0.9rem; }

    /* Up Button position */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .contact-main h2 {
        font-size: clamp(16px, 6vw, 24px); /* Dynamically scale based on viewport width */
        width: 100%;
        overflow-wrap: break-word;
    }
    .profile-container { display: flex; justify-content: center; }
    .status-indicator { justify-content: center; }
    .contact-data-box {
        padding: 20px; /* Match mini-console padding */
        width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Prevent overflow like mini-console */
    }
    .contact-row { 
        justify-content: center; 
        flex-direction: column; 
        gap: 5px;
        width: 100%;
    }
    .contact-row .label {
        width: 100%; /* Full width label */
        margin: 0;
        text-align: center;
    }
    .contact-link {
        font-size: clamp(12px, 4vw, 16px); /* Scale link text as well */
        word-break: break-all;
        display: block;
        width: 100%;
    }
    .action-row { justify-content: center; flex-direction: column; gap: 20px; }
    .social-icons { justify-content: center; display: flex; width: 100%; margin-top: 10px; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; } /* Ensure consistent container padding */
    
    .hero-box { padding: 15px; }
    .hero-box h1 { font-size: 28px; }
    
    .skill-card-complex { padding: 15px; }
    .tech-stack-tabs { padding: 10px; }
    
    .grid-3x3 {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)) !important;
        gap: 8px;
    }
    
    .contact-data-box { 
        padding: 15px; 
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .contact-link { 
        font-size: 0.9rem; /* Slightly smaller to fit */
        word-break: break-all;
    }
    .contact-main h2 {
        font-size: 18px;
    }
}
