/**
 * Responsive Styles
 * Media queries for different screen sizes
 */

/* ===== Large Screens (max-width: 1200px) ===== */
@media (max-width: 1200px) {
    :root {
        --text-5xl: 2.7rem;
    }
    
    .hero-content {
        gap: var(--space-8);
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Tablets (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .section {
        padding: var(--space-20) 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }
    
    .hero-text {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-badges {
        justify-content: center;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .status-badge {
        margin: 0 auto var(--space-4);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-links {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .contact-decoration {
        display: none;
    }
}

/* ===== Mobile Landscape (max-width: 768px) ===== */
@media (max-width: 768px) {
    :root {
        --text-5xl: 2.1rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
        --text-xl: 1.0625rem;
        --container-padding: 1rem;
        --nav-height: 58px;
        --space-24: 4.25rem;
        --space-16: 2.75rem;
        --space-12: 2.2rem;
    }

    .section {
        padding: var(--space-16) 0;
    }

    .navbar {
        padding: 0 var(--container-padding);
        gap: var(--space-3);
    }

    .nav-logo {
        font-size: var(--text-base);
    }

    .nav-actions {
        gap: var(--space-2);
    }

    .nav-download {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
    
    /* Mobile Navigation */
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-bg-primary);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: var(--space-5) var(--container-padding) var(--space-6);
        gap: var(--space-4);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        transition: all var(--transition-base);
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        display: block;
        padding: var(--space-2) 0;
        font-size: var(--text-base);
    }

    .lang-toggle {
        font-size: var(--text-sm);
        margin-left: 0;
        padding: var(--space-2) var(--space-3);
    }

    .nav-actions .btn {
        width: auto;
        max-width: none;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-height) + var(--space-8));
        padding-bottom: var(--space-6);
    }

    .hero-content {
        gap: var(--space-8);
    }

    .hero-title {
        line-height: 1.05;
    }

    .hero-description {
        margin-bottom: var(--space-5);
    }
    
    /* Hamburger Animation */
    .nav-toggle[aria-expanded="true"] .hamburger {
        background: transparent;
    }
    
    .nav-toggle[aria-expanded="true"] .hamburger::before {
        top: 0;
        transform: rotate(45deg);
    }
    
    .nav-toggle[aria-expanded="true"] .hamburger::after {
        bottom: 0;
        transform: rotate(-45deg);
    }
    
    /* Skills Grid */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    /* Timeline */
    .timeline {
        padding-left: var(--space-5);
    }
    
    .timeline-dot {
        left: calc(-1 * var(--space-5) - 6px);
    }

    .timeline-item {
        padding-bottom: var(--space-8);
    }

    .timeline-content {
        padding: var(--space-4);
    }

    .timeline-title {
        font-size: var(--text-lg);
    }

    .timeline-company {
        font-size: var(--text-base);
    }

    .education-grid {
        gap: var(--space-4);
    }

    .education-card {
        padding: var(--space-5);
    }

    .certifications-row {
        gap: var(--space-3);
    }

    .cert-badge {
        width: 100%;
        justify-content: center;
    }
    
    /* Pipeline */
    .pipeline {
        --pipeline-node-size: 38px;
        --pipeline-track-start: 10%;
        --pipeline-track-top: calc(var(--space-2) + (var(--pipeline-node-size) / 2));
        padding: var(--space-2) 0 var(--space-8);
        margin-bottom: var(--space-8);
    }

    .pipeline-stages {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: flex-start;
        gap: var(--space-2);
        padding-top: var(--space-2);
        padding-left: 0;
    }

    .pipeline-track {
        display: block;
        height: 2px;
    }
    
    .pipeline-stage {
        flex-direction: column;
        gap: var(--space-2);
        flex: 1 1 0;
        min-width: 0;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
    }
    
    .stage-node {
        width: 38px;
        height: 38px;
        font-size: var(--text-base);
        border-width: 2px;
        border-radius: var(--radius-md);
        background: var(--color-bg-primary);
    }

    .stage-label {
        font-size: var(--text-xs);
        line-height: 1.4;
        max-width: 100%;
        text-align: center;
        word-break: break-word;
    }
    
    /* Section Headers */
    .section-header {
        flex-wrap: wrap;
        gap: var(--space-3);
        margin-bottom: var(--space-8);
    }

    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-line {
        width: 100%;
        order: 3;
        margin-top: var(--space-2);
    }

    .subsection-header {
        margin-top: var(--space-12);
        margin-bottom: var(--space-6);
    }

    .project-image {
        max-height: 220px;
    }

    .project-header,
    .project-body,
    .project-metrics,
    .project-links {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .project-header {
        gap: var(--space-3);
        align-items: flex-start;
        padding-top: var(--space-3);
        padding-bottom: var(--space-3);
    }

    .project-title {
        font-size: var(--text-base);
    }

    .project-description {
        font-size: var(--text-xs);
        margin-bottom: var(--space-3);
        line-height: 1.65;
    }

    .project-metrics {
        gap: var(--space-2);
    }
    
    /* Project Metrics */
    .project-metrics {
        flex-wrap: wrap;
    }
    
    .metric {
        flex: 1;
        min-width: 64px;
    }

    .metric-value {
        font-size: var(--text-base);
    }

    .metric-label {
        font-size: 0.6875rem;
        line-height: 1.3;
    }

    .project-links {
        gap: var(--space-3);
    }

    .project-link {
        flex-basis: 100%;
        font-size: var(--text-xs);
    }

    .project-link-icon {
        width: 0.95rem;
        height: 0.95rem;
    }

    .contact-grid {
        gap: var(--space-6);
    }

    .contact-info {
        text-align: left;
    }

    .contact-info h3 {
        font-size: var(--text-2xl);
    }

    .contact-info > p {
        max-width: none;
        margin-bottom: var(--space-6);
        text-align: left;
    }

    .contact-links {
        gap: var(--space-3);
        max-width: none;
        margin: 0;
    }

    .contact-link {
        gap: var(--space-3);
        padding: var(--space-3);
    }

    .contact-link-icon {
        width: 32px;
        height: 32px;
        font-size: var(--text-base);
    }

    .contact-link-url {
        word-break: break-word;
        font-size: var(--text-xs);
    }
    
    /* Hero CTA */
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .footer {
        padding: var(--space-4) 0;
    }

    .footer-content {
        gap: var(--space-2);
    }
}

/* ===== Mobile Portrait (max-width: 480px) ===== */
@media (max-width: 480px) {
    :root {
        --text-5xl: 1.7rem;
        --text-3xl: 1.25rem;
        --text-2xl: 1.05rem;
        --container-padding: 0.75rem;
        --nav-height: 54px;
        --space-24: 3.5rem;
        --space-20: 3rem;
    }

    .section {
        padding: var(--space-12) 0;
    }

    .navbar {
        gap: var(--space-2);
    }

    .nav-logo {
        font-size: var(--text-sm);
    }

    .nav-download {
        max-width: 3rem;
        min-width: 3rem;
        padding-left: var(--space-2);
        padding-right: var(--space-2);
        font-size: 0;
    }

    .nav-download::before {
        content: 'CV';
        font-size: var(--text-xs);
    }

    .lang-toggle {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    .hero {
        padding-top: calc(var(--nav-height) + var(--space-6));
    }

    .hero-tagline {
        font-size: var(--text-lg);
    }

    .hero-subtitle,
    .hero-description {
        font-size: var(--text-sm);
    }

    .hero-badges {
        justify-content: center;
    }
    
    .terminal {
        margin: 0;
        border-radius: var(--radius-lg);
    }

    .terminal-header {
        padding: var(--space-2) var(--space-3);
    }
    
    .terminal-body {
        min-height: 180px;
        max-height: 240px;
        padding: var(--space-3);
        font-size: var(--text-xs);
    }
    
    .terminal-input-wrapper {
        padding: 0 var(--space-3) var(--space-3);
        flex-wrap: wrap;
    }
    
    .terminal-prompt {
        font-size: var(--text-xs);
    }
    
    .terminal-input {
        width: 100%;
        font-size: var(--text-xs);
    }

    .timeline-content,
    .education-card,
    .skill-card,
    .project-body,
    .project-metrics,
    .project-links {
        padding: var(--space-4);
    }

    .timeline-meta {
        gap: var(--space-1);
        font-size: var(--text-xs);
    }

    .timeline-meta-row {
        grid-template-columns: 0.9rem minmax(0, 1fr);
    }

    .project-header {
        padding: var(--space-3) var(--space-4);
    }

    .project-image {
        max-height: 190px;
    }
    
    .project-links {
        flex-direction: column;
        gap: var(--space-2);
    }

    .project-link {
        justify-content: flex-start;
    }
    
    .contact-link {
        padding: var(--space-3) var(--space-4);
        align-items: flex-start;
    }

    .pipeline {
        --pipeline-node-size: 34px;
        margin-bottom: var(--space-6);
    }

    .pipeline-stages {
        gap: var(--space-1);
    }

    .pipeline-track {
        --pipeline-track-top: calc(var(--space-2) + (var(--pipeline-node-size) / 2));
    }

    .stage-node {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .stage-label {
        font-size: 0.6875rem;
        line-height: 1.3;
    }
    
    .contact-link:hover {
        transform: none;
    }

    .footer {
        font-size: var(--text-xs);
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-badges {
        gap: var(--space-2);
    }
    
    .lang-badge {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-2);
    }
    
    .certifications-row {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal,
    .reveal-left {
        opacity: 1;
        transform: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .bg-grid,
    .terminal,
    .nav-toggle,
    .pipeline,
    .ascii-art {
        display: none !important;
    }
    
    .navbar {
        position: static;
        background: none;
        border: none;
    }
    
    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }
    
    body {
        background: white;
        color: black;
    }
}
