/* Responsive - Mobile First Approach */
@media (max-width: 600px) {
    body {
        padding: 32px 16px;
        font-size: 16px;
    }

    .container {
        max-width: 100%;
    }

    /* Typography */
    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Hero Section */
    .hero {
        margin-top: 0;
        margin-bottom: 0;
    }

    .profile-header {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        margin-bottom: 28px;
    }

    .avatar-container {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
    }

    .profile-info h1 {
        font-size: 1.3rem;
        line-height: 1.4;
    }

    .knight-svg {
        width: 20px;
        height: 20px;
    }

    .tagline {
        font-size: 0.95em;
    }

    .bio {
        margin-bottom: 0;
    }

    .bio p {
        font-size: 1em;
        line-height: 1.5;
        letter-spacing: -0.03em;
    }

    .bio p br {
        display: none;
    }

    /* Social Links */
    .social-links-inline {
        margin-top: 24px;
        margin-bottom: 32px;
        gap: 10px;
    }

    .social-link-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .social-link-icon i {
        font-size: 1.3rem;
    }

    /* Sections */
    section {
        margin-bottom: 48px;
    }

    /* Separators */
    .separator {
        margin: 32px 0;
    }

    .double-separator {
        margin: 32px 0;
    }

    /* Projects */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-card {
        border-width: 1px;
    }

    .project-image {
        height: 160px;
    }

    .project-content {
        padding: 24px 20px 20px;
        gap: 0;
    }

    .project-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .project-title-wrapper {
        gap: 10px;
    }

    .project-title-wrapper-cnr {
        gap: 7px;
    }

    .project-logo {
        width: 24px;
        height: 24px;
    }

    .project-logo-cnr {
        width: 28px;
        height: 28px;
    }

    .project-title {
        font-size: 1.05em;
    }

    .project-title-cnr,
    .project-title-datatask {
        font-size: 1.1em;
    }

    .project-role {
        font-size: 0.65rem;
        padding-left: 10px;
        margin-top: 2px;
    }

    .project-role::before {
        height: 10px;
    }

    .project-card:hover .project-role::before {
        height: 12px;
    }

    .project-desc {
        font-size: 0.9em;
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .project-links {
        gap: 8px;
        padding-top: 14px;
    }

    .project-link-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-height: 32px;
        gap: 5px;
    }

    .project-link-btn i {
        font-size: 0.7rem;
    }

    /* Technologies */
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tech-item {
        padding: 16px;
        gap: 12px;
    }

    .tech-icon-box {
        width: 40px;
        height: 40px;
    }

    .tech-icon-box img {
        width: 28px;
        height: 28px;
    }

    .tech-name {
        font-size: 1em;
    }

    .tech-type {
        font-size: 0.85em;
    }

    /* Footer */
    footer {
        padding-top: 16px;
        font-size: 0.8rem;
    }

    /* Chess Modal */
    .chess-modal {
        padding: 16px;
    }

    .chess-modal-content {
        padding: 24px 20px;
        max-width: 100%;
    }

    .chess-header {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .chess-header h3 {
        font-size: 1.2rem;
    }

    .chess-close {
        width: 36px;
        height: 36px;
        font-size: 1.8rem;
        min-width: 36px;
        min-height: 36px;
    }

    .chess-modal-content {
        padding: 24px 20px;
    }

    .chess-header {
        margin-bottom: 20px;
        justify-content: flex-end;
    }

    .chess-status {
        margin-bottom: 16px;
        font-size: 0.8rem;
    }

    .chess-player-compact {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .chess-bot-tooltip {
        top: 50px;
        right: 20px;
        max-width: 280px;
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .chess-board {
        max-width: 100%;
    }

    .chess-square {
        font-size: 1.8rem;
    }

    .chess-actions {
        margin-top: 20px;
    }

    .chess-reset {
        padding: 12px 20px;
        font-size: 0.85em;
        min-height: 44px;
    }

    /* Knight tooltip - hide on mobile to avoid clutter */
    .knight-icon::after,
    .knight-icon::before {
        display: none;
    }

    /* Back to top button */
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 44px;
        height: 44px;
    }
}

/* Small mobile devices */
@media (max-width: 400px) {
    body {
        padding: 24px 12px;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .profile-info h1 {
        font-size: 1.2rem;
    }

    .avatar-container {
        width: 56px;
        height: 56px;
    }

    .project-image {
        height: 150px;
    }

    .project-content {
        padding: 22px 16px 16px;
    }

    .project-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .project-title-wrapper {
        gap: 8px;
    }

    .project-logo {
        width: 22px;
        height: 22px;
    }

    .project-logo-cnr {
        width: 26px;
        height: 26px;
    }

    .project-title {
        font-size: 1.05em;
    }

    .project-title-cnr,
    .project-title-datatask {
        font-size: 1.08em;
    }

    .project-role {
        font-size: 0.62rem;
        padding-left: 10px;
    }

    .project-desc {
        font-size: 0.86em;
        margin-bottom: 16px;
    }

    .chess-square {
        font-size: 1.6rem;
    }

    .chess-player-compact {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .chess-bot-tooltip {
        max-width: 240px;
        font-size: 0.75rem;
        padding: 8px 10px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    body {
        padding: 20px 16px;
    }

    .hero {
        margin-bottom: 0;
    }

    .profile-header {
        margin-bottom: 20px;
    }

    .bio {
        margin-bottom: 0;
    }

    section {
        margin-bottom: 32px;
    }

    .separator {
        margin: 24px 0;
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        padding: 20px;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
    }
    
    .knight-icon,
    .chess-modal,
    .social-links-inline,
    .project-links,
    .separator,
    .double-separator {
        display: none !important;
    }
    
    .project-card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .project-image {
        height: 100px;
    }
    
    a {
        text-decoration: underline;
        color: #000 !important;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
    
    footer {
        margin-top: 40px;
        padding-top: 20px;
        border-top: 1px solid #ccc;
    }
}

