/* ================================
   Responsive Breakpoints
   - Desktop: > 1024px (default)
   - Tablet: 768px - 1024px
   - Mobile: < 768px
   - Small Mobile: < 480px
   ================================ */

/* ================================
   Large Desktop (> 1200px)
   ================================ */
@media (min-width: 1200px) {
  .hero-name {
    font-size: var(--fs-6xl);
  }
  
  .hero-image {
    width: 320px;
    height: 320px;
  }
}

/* ================================
   Tablet & Below (< 1024px)
   ================================ */
@media (max-width: 1024px) {
  :root {
    --container-padding: 1.5rem;
    --fs-6xl: 3.5rem;
    --fs-5xl: 2.5rem;
    --fs-4xl: 2rem;
  }
  
  /* Hero */
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-2xl);
  }
  
  .hero-image {
    width: 220px;
    height: 220px;
  }
  
  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .hero-description {
    max-width: 100%;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  /* Timeline */
  .timeline-line {
    left: 20px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: var(--space-3xl);
    padding-right: 0;
    text-align: left;
  }
  
  .timeline-item:nth-child(odd) {
    padding-right: 0;
    text-align: left;
  }
  
  .timeline-item:nth-child(even) {
    margin-left: 0;
    padding-left: var(--space-3xl);
  }
  
  .timeline-marker {
    left: 12px !important;
    right: auto !important;
  }
  
  .timeline-item:nth-child(odd) .timeline-header {
    flex-direction: row;
  }
  
  .timeline-item:nth-child(odd) .timeline-tech {
    justify-content: flex-start;
  }
  
  /* Experience */
  .experience-header {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .experience-date {
    align-self: flex-start;
  }
  
  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  /* Education */
  .education-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .education-details ul {
    justify-content: center;
  }
}

/* ================================
   Mobile & Below (< 768px)
   ================================ */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --fs-6xl: 2.5rem;
    --fs-5xl: 2rem;
    --fs-4xl: 1.75rem;
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.25rem;
    --nav-height: 70px;
    --space-5xl: 5rem;
    --space-4xl: 4rem;
    --space-3xl: 3rem;
  }
  
  /* Navigation */
  .nav-social {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: var(--color-bg-secondary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-2xl);
    border-left: 1px solid var(--color-border);
    transition: right var(--transition-base);
    z-index: 1000;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-link {
    font-size: var(--fs-lg);
  }
  
  .nav-cta {
    margin-top: var(--space-md);
  }
  
  /* Mobile menu overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 31, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 999;
  }
  
  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Hero */
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--space-3xl));
    padding-bottom: var(--space-4xl);
  }
  
  .hero-image {
    width: 180px;
    height: 180px;
  }
  
  .hero-title-wrapper {
    font-size: var(--fs-xl);
  }
  
  .hero-description {
    font-size: var(--fs-base);
  }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  
  .scroll-indicator {
    display: none;
  }
  
  /* Hero tech mobile */
  .hero-tech {
    bottom: 30px;
    gap: var(--space-lg);
    flex-wrap: wrap;
    max-width: 90%;
  }
  
  .hero-tech img {
    width: 28px;
    height: 28px;
  }
  
  /* Glow orbs reduced */
  .glow-orb-1 {
    width: 200px;
    height: 200px;
    opacity: 0.1;
  }
  
  .glow-orb-2 {
    width: 150px;
    height: 150px;
    opacity: 0.08;
  }
  
  /* Section titles */
  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
  }
  
  .section-title::after {
    width: 100%;
    max-width: 100%;
  }
  
  /* About */
  .about-block {
    padding: var(--space-lg);
  }
  
  /* Timeline */
  .timeline-line {
    left: 12px;
  }
  
  .timeline-item {
    padding-left: var(--space-2xl);
  }
  
  .timeline-item:nth-child(even) {
    padding-left: var(--space-2xl);
  }
  
  .timeline-marker {
    left: 4px !important;
    width: 14px;
    height: 14px;
  }
  
  .timeline-content {
    padding: var(--space-lg);
  }
  
  .timeline-company {
    font-size: var(--fs-lg);
  }
  
  .timeline-role {
    font-size: var(--fs-sm);
  }
  
  .timeline-achievements li {
    font-size: var(--fs-xs);
  }
  
  /* Experience */
  .experience-item {
    padding: var(--space-lg);
  }
  
  .experience-company h3 {
    font-size: var(--fs-lg);
  }
  
  .experience-bullets li {
    font-size: var(--fs-xs);
  }
  
  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-content {
    padding: var(--space-lg);
  }
  
  .project-title {
    font-size: var(--fs-lg);
  }
  
  /* Skills */
  .skills-row {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .skills-label {
    width: auto;
  }
  
  .skill-chip {
    font-size: var(--fs-xs);
    padding: var(--space-xs) var(--space-sm);
  }
  
  /* Education */
  .education-card {
    padding: var(--space-lg);
  }
  
  .education-icon {
    width: 60px;
    height: 60px;
  }
  
  .education-icon svg {
    width: 30px;
    height: 30px;
  }
  
  .education-school {
    font-size: var(--fs-xl);
  }
  
  .education-degree {
    font-size: var(--fs-base);
  }
  
  /* Contact */
  .contact-text p {
    font-size: var(--fs-base);
  }
  
  .form-group input,
  .form-group textarea {
    padding: var(--space-md);
  }
  
  .form-group label {
    left: var(--space-md);
  }
  
  .social-link {
    width: 44px;
    height: 44px;
  }
  
  .social-link svg {
    width: 20px;
    height: 20px;
  }
  
  /* Footer */
  .footer {
    padding: var(--space-xl) 0;
  }
}

/* ================================
   Small Mobile (< 480px)
   ================================ */
@media (max-width: 480px) {
  :root {
    --fs-6xl: 2rem;
    --fs-5xl: 1.75rem;
    --fs-4xl: 1.5rem;
    --fs-3xl: 1.25rem;
    --space-5xl: 4rem;
    --space-4xl: 3rem;
  }
  
  /* Hero */
  .hero-image {
    width: 150px;
    height: 150px;
  }
  
  .hero-greeting {
    font-size: var(--fs-base);
  }
  
  .hero-title-wrapper {
    font-size: var(--fs-lg);
  }
  
  .hero-image-glow {
    filter: blur(15px);
  }
  
  /* About */
  .about-block {
    padding: var(--space-lg);
  }
  
  /* Timeline */
  .timeline-content {
    padding: var(--space-md);
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-item:nth-child(odd) .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-tech {
    margin-top: var(--space-sm);
  }
  
  /* Project cards */
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .project-links {
    width: 100%;
    justify-content: flex-start;
  }
  
  .project-link {
    width: 36px;
    height: 36px;
  }
  
  .project-link svg {
    width: 18px;
    height: 18px;
  }
  
  /* Skills */
  .skills-row {
    padding: var(--space-md);
  }
  
  .skills-chips {
    gap: var(--space-xs);
  }
  
  .skill-chip {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  
  /* Education */
  .education-details ul {
    gap: var(--space-xs);
  }
  
  .education-details li {
    font-size: 0.7rem;
  }
  
  /* Contact */
  .contact-social {
    gap: var(--space-md);
  }
  
  .btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--fs-sm);
  }
}

/* ================================
   Landscape Mobile
   ================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--space-lg)) var(--container-padding) var(--space-lg);
  }
  
  .hero-content {
    flex-direction: row;
    gap: var(--space-xl);
  }
  
  .hero-image {
    width: 120px;
    height: 120px;
  }
  
  .hero-text {
    align-items: flex-start;
    text-align: left;
  }
  
  .hero-cta {
    flex-direction: row;
  }
  
  .hero-cta .btn {
    width: auto;
  }
  
  .scroll-indicator {
    display: none;
  }
}

/* ================================
   Touch Device Optimizations
   ================================ */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects that don't work well on touch */
  .btn-primary:hover::before {
    transform: translateX(-100%);
  }
  
  .project-card:hover {
    transform: translateY(0);
  }
  
  .stat-card:hover {
    transform: translateY(0);
  }
  
  .skill-chip:hover {
    transform: translateY(0);
  }
  
  .social-link:hover {
    transform: translateY(0);
  }
  
  /* Increase touch targets */
  .nav-link {
    padding: var(--space-md) var(--space-sm);
  }
  
  .project-link {
    width: 48px;
    height: 48px;
  }
  
  .social-link {
    width: 52px;
    height: 52px;
  }
}

/* ================================
   High DPI / Retina Displays
   ================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-image {
    image-rendering: -webkit-optimize-contrast;
  }
  
  .project-image img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ================================
   Print Styles
   ================================ */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .navbar,
  .scroll-indicator,
  .glow-orb,
  .grid-overlay,
  .hero-background {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
  
  .hero {
    min-height: auto;
    padding: 2rem 0;
  }
  
  .hero-image {
    width: 100px;
    height: 100px;
    border: 2px solid #000;
  }
}
