/* Responsive Navigation Styles */

/* Tablet and below */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 var(--spacing-lg);
  }
  
  .nav-menu {
    gap: var(--spacing-lg);
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-menu li {
    width: 100%;
  }
  
  .nav-menu a {
    display: block;
    padding: var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--gray-light);
    font-size: var(--font-size-lg);
  }
  
  .nav-menu a:last-child {
    border-bottom: none;
  }
  
  .nav-menu a.active::after {
    display: none;
  }
  
  .nav-menu a.active {
    background-color: var(--accent-blue);
  }
}

/* Small mobile styles */
@media (max-width: 480px) {
  .nav-container {
    padding: 0 var(--spacing-md);
    height: 60px;
  }
  
  body {
    padding-top: 60px;
  }
  
  .nav-menu {
    top: 60px;
  }
  
  .nav-logo a {
    font-size: var(--font-size-lg);
  }
}

/* Hero Section Responsive Styles */

/* Tablet and below */
@media (max-width: 1024px) {
  .hero-container {
    max-width: 700px;
    padding: 0 var(--spacing-lg);
  }
  
  .hero-name {
    font-size: 3rem; /* Slightly smaller than 4xl */
  }
  
  .hero-title {
    font-size: var(--font-size-xl);
  }
  
  .hero-tagline {
    font-size: var(--font-size-base);
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .hero {
    min-height: calc(100vh - 70px); /* Account for fixed header */
    padding: var(--spacing-2xl) 0;
  }
  
  .hero-container {
    max-width: 100%;
    padding: 0 var(--spacing-md);
  }
  
  .hero-image {
    margin-bottom: var(--spacing-xl);
  }
  
  .headshot {
    width: 150px;
    height: 150px;
  }
  
  .hero-name {
    font-size: 2.5rem; /* Between 2xl and 3xl */
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-tagline {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xl);
    padding: 0 var(--spacing-sm);
  }
  
  .hero-cta {
    padding: var(--spacing-sm) var(--spacing-xl);
    font-size: var(--font-size-base);
  }
}

/* Small mobile styles */
@media (max-width: 480px) {
  .hero {
    min-height: calc(100vh - 60px); /* Account for smaller header */
    padding: var(--spacing-xl) 0;
  }
  
  .headshot {
    width: 120px;
    height: 120px;
  }
  
  .hero-name {
    font-size: 2rem; /* 2xl size */
  }
  
  .hero-title {
    font-size: var(--font-size-base);
  }
  
  .hero-tagline {
    font-size: var(--font-size-sm);
    padding: 0;
  }
  
  .hero-cta {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
  }
}

/* Section Component Responsive Styles */

/* Tablet and below */
@media (max-width: 1024px) {
  .section {
    padding: var(--spacing-3xl) 0;
  }
  
  .section-header {
    margin-bottom: var(--spacing-2xl);
  }
  
  .section-icon {
    width: 40px;
    height: 40px;
  }
  
  .section-title {
    font-size: 2.5rem; /* Between 2xl and 3xl */
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  .section-header {
    flex-direction: column;
    margin-bottom: var(--spacing-xl);
  }
  
  .section-icon {
    width: 36px;
    height: 36px;
    margin-right: 0;
    margin-bottom: var(--spacing-md);
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
  }
  
  /* About Me responsive */
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }
  
  .about-highlights {
    padding: var(--spacing-lg);
  }
  
  /* Experience responsive */
  .experience-timeline::before {
    left: 20px;
  }
  
  .experience-item {
    margin-left: var(--spacing-2xl);
    padding: var(--spacing-lg);
  }
  
  .experience-item::before {
    left: -37px;
    top: var(--spacing-lg);
    width: 12px;
    height: 12px;
  }
  
  /* Education responsive */
  .education-item {
    padding: var(--spacing-lg);
  }
}

/* Small mobile styles */
@media (max-width: 480px) {
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .section-header {
    margin-bottom: var(--spacing-lg);
  }
  
  .section-icon {
    width: 32px;
    height: 32px;
  }
  
  .section-title {
    font-size: var(--font-size-xl);
  }
  
  .section-title::after {
    width: 40px;
    height: 2px;
  }
  
  /* About Me small mobile */
  .about-text {
    font-size: var(--font-size-base);
  }
  
  .about-highlights {
    padding: var(--spacing-md);
  }
  
  /* Experience small mobile */
  .experience-timeline::before {
    left: 15px;
  }
  
  .experience-item {
    margin-left: var(--spacing-lg);
    padding: var(--spacing-md);
  }
  
  .experience-item::before {
    left: -32px;
    top: var(--spacing-md);
    width: 10px;
    height: 10px;
  }
  
  .experience-role {
    font-size: var(--font-size-lg);
  }
  
  .experience-company {
    font-size: var(--font-size-base);
  }
  
  /* Education small mobile */
  .education-item {
    padding: var(--spacing-md);
  }
  
  .education-degree {
    font-size: var(--font-size-lg);
  }
  
  .education-institution {
    font-size: var(--font-size-base);
  }
}

/* Additional comprehensive responsive styles for better mobile experience */

/* Large tablet styles (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
  .container {
    max-width: 1000px;
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet landscape styles (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 900px;
    padding: 0 var(--spacing-lg);
  }
  
  /* Hero adjustments for tablet */
  .hero-container {
    max-width: 600px;
  }
  
  .headshot {
    width: 180px;
    height: 180px;
  }
  
  /* Projects grid for tablet */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
  
  /* Skills grid for tablet */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
  
  /* Contact layout for tablet */
  .contact-content {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-2xl);
  }
}

/* Mobile landscape styles (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
  
  /* Hero for mobile landscape */
  .hero-container {
    max-width: 500px;
  }
  
  .headshot {
    width: 140px;
    height: 140px;
  }
  
  .hero-name {
    font-size: 2.25rem;
  }
  
  /* About section mobile landscape */
  .about-content {
    gap: var(--spacing-xl);
  }
  
  .about-highlights {
    padding: var(--spacing-xl);
  }
  
  /* Experience mobile landscape */
  .experience-item {
    padding: var(--spacing-xl);
  }
  
  /* Education mobile landscape */
  .education-item {
    padding: var(--spacing-xl);
  }
  
  /* Projects single column for mobile landscape */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  /* Skills single column for mobile landscape */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  /* Contact single column for mobile landscape */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
}

/* Extra small mobile styles (320px - 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  /* Typography adjustments for small screens */
  .hero-name {
    font-size: 1.875rem; /* Smaller for very small screens */
    line-height: 1.2;
  }
  
  .hero-title {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-tagline {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    margin-bottom: var(--spacing-lg);
  }
  
  /* Form improvements for small screens */
  .contact-form {
    gap: var(--spacing-md);
  }
  
  .form-group input,
  .form-group textarea {
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
  }
  
  .submit-btn {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
  }
  
  /* Social links stack vertically on very small screens */
  .social-links {
    gap: var(--spacing-sm);
  }
  
  .social-link {
    padding: var(--spacing-sm);
    font-size: var(--font-size-sm);
  }
  
  /* Project cards padding adjustment */
  .project-content {
    padding: var(--spacing-md);
  }
  
  .project-title {
    font-size: var(--font-size-lg);
  }
  
  .project-description {
    font-size: var(--font-size-sm);
    line-height: 1.5;
  }
  
  /* Tech tags smaller on mobile */
  .tech-tag {
    font-size: 0.6875rem; /* 11px */
    padding: 0.125rem 0.375rem; /* 2px 6px */
  }
  
  /* Skill tags smaller spacing */
  .skill-tags {
    gap: 0.25rem;
  }
  
  .skill-tag {
    font-size: 0.6875rem; /* 11px */
    padding: 0.25rem 0.5rem; /* 4px 8px */
  }
}

/* Ultra small screens (below 320px) */
@media (max-width: 320px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .hero-name {
    font-size: 1.5rem;
  }
  
  .hero-title {
    font-size: var(--font-size-sm);
  }
  
  .hero-tagline {
    font-size: var(--font-size-xs);
  }
  
  .section-title {
    font-size: var(--font-size-lg);
  }
  
  .headshot {
    width: 100px;
    height: 100px;
  }
  
  /* Ensure minimum touch targets */
  .nav-menu a,
  .hero-cta,
  .project-link,
  .social-link,
  .submit-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* High DPI / Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp borders and shadows on high DPI displays */
  .project-card,
  .skill-category,
  .about-highlights,
  .contact-form-container,
  .contact-info,
  .experience-item,
  .education-item {
    border-width: 0.5px;
  }
  
  /* Optimize icon rendering */
  .section-icon svg,
  .social-icon svg {
    shape-rendering: geometricPrecision;
  }
}

/* Print styles for better printing experience */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .header,
  .nav-toggle,
  .hero-cta,
  .contact-form,
  .footer {
    display: none !important;
  }
  
  .hero {
    background: white !important;
    color: black !important;
    min-height: auto !important;
    padding: var(--spacing-lg) 0 !important;
  }
  
  .section {
    page-break-inside: avoid;
    padding: var(--spacing-md) 0 !important;
  }
  
  .project-card,
  .experience-item,
  .education-item {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  a[href^="#"]:after {
    content: "";
  }
}

/* Landscape orientation specific adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: 100vh;
    padding: var(--spacing-lg) 0;
  }
  
  .hero-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xl);
    text-align: left;
  }
  
  .hero-image {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .headshot {
    width: 120px;
    height: 120px;
  }
  
  .hero-content {
    flex: 1;
  }
  
  .hero-name {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-tagline {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
  }
}