/* Responsive Styles */

/* Tablets */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: var(--space-10); }
  .hero-content { align-items: center; }
  .hero p { max-width: 100%; }
  .hero-card { max-width: 450px; margin: 0 auto; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-2);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.active { display: flex; }
  .nav-links .nav-link {
    padding: var(--space-3);
    text-align: center;
    font-size: 15px;
    border-radius: var(--radius);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-link::after, .nav-link::before { display: none; }
  .nav-cta { margin-top: var(--space-2); padding: var(--space-3) var(--space-6); text-align: center; min-height: 44px; }
  .menu-btn { display: flex; }
  .skills-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .projects-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  section { padding: var(--space-12) 0; }
  .section-header { margin-bottom: var(--space-8); }
  .section-title { font-size: clamp(26px, 6vw, 34px); }
  .eyebrow::before, .eyebrow::after { display: none; }
  .footer-inner { flex-direction: column; text-align: center; gap: var(--space-4); align-items: center; }
  .visitor-counter { margin: var(--space-2) 0; }
  .form-row { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 280px; gap: var(--space-3); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .ambient-orb:nth-child(1) { width: 250px; height: 250px; opacity: 0.3; }
  .ambient-orb:nth-child(2) { width: 200px; height: 200px; opacity: 0.25; }
  .ambient-orb:nth-child(3), .morph-3, .noise-overlay, .floating-elements { display: none; }
  .cursor-trail { display: none !important; }
  .morph-1, .morph-2 { width: 180px; height: 180px; opacity: 0.2; }
  .grid-pattern { opacity: 0.3; }
  .scroll-top { width: 44px; height: 44px; bottom: var(--space-4); right: var(--space-4); }
  .about-hero-content { grid-template-columns: 1fr; gap: var(--space-8); text-align: center; }
  .about-hero-text { align-items: center; }
  .about-profile-card { max-width: 380px; margin: 0 auto; }
  .story-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .story-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .facts-card, .tech-card { flex: 1; min-width: 280px; }
  .contact-wrapper { grid-template-columns: 1fr; }
  .social-links { flex-direction: column; }
  .info-item { flex-direction: column; text-align: center; }
  .info-icon { margin: 0 auto; }
  .info-content { align-items: center; }
  .back-link { font-size: 13px; margin-bottom: var(--space-6); }
  .about-subtitle { font-size: 14px; max-width: 100%; }
}

/* Small Phones */
@media (max-width: 480px) {
  :root { --space-24: 48px; --space-16: 40px; --space-12: 32px; }
  .container { padding: 0 var(--space-4); }
  .navbar-inner { height: 65px; }
  .page { padding-top: 65px; }
  .nav-links { top: 65px; }
  .brand-mark { width: 38px; height: 38px; font-size: 15px; }
  .brand-text { font-size: 13px; }
  .brand-sub { font-size: 10px; }
  .hero h1 { font-size: clamp(28px, 9vw, 40px); line-height: 1.2; margin-bottom: var(--space-3); }
  .hero h2 { font-size: 14px; line-height: 1.5; margin-bottom: var(--space-4); }
  .hero p { font-size: 13px; line-height: 1.7; margin-bottom: var(--space-5); }
  .hero-actions { margin-bottom: var(--space-5); }
  .hero-note { margin-bottom: var(--space-8); }
  .hero-card { padding: var(--space-4); margin-top: var(--space-4); }
  .code { font-size: 10px; padding: var(--space-3); line-height: 1.8; }
  .btn { padding: var(--space-3) var(--space-5); font-size: 13px; }
  .pill { font-size: 11px; padding: 5px 10px; margin-bottom: var(--space-3); }
  .section-title { font-size: clamp(24px, 7vw, 32px); line-height: 1.3; margin-bottom: var(--space-3); }
  .section-desc { font-size: 13px; line-height: 1.7; }
  .skill-card { padding: var(--space-4); }
  .skill-icon { font-size: 32px; margin-bottom: var(--space-2); }
  .skill-name { font-size: 15px; line-height: 1.4; margin-bottom: var(--space-2); }
  .skill-desc { font-size: 12px; line-height: 1.6; margin-bottom: var(--space-2); }
  .project-thumb { height: 140px; }
  .project-body { padding: var(--space-4); }
  .project-title { font-size: 16px; line-height: 1.4; margin-bottom: var(--space-2); }
  .project-text { font-size: 12px; line-height: 1.6; margin-bottom: var(--space-3); }
  .project-actions { flex-direction: column; gap: var(--space-2); }
  .toast { left: var(--space-3); right: var(--space-3); transform: translateX(0) translateY(100px); }
  .toast.show { transform: translateX(0) translateY(0); }
  .ambient-orb:nth-child(1) { width: 200px; height: 200px; }
  .ambient-orb:nth-child(2) { width: 150px; height: 150px; }
  .morph-1, .morph-2 { width: 150px; height: 150px; }
  .grid-pattern { display: none; }
  .about-title { font-size: clamp(32px, 8vw, 48px); line-height: 1.2; }
  .about-subtitle { line-height: 1.7; margin-top: var(--space-3); }
  .story-block { padding: var(--space-5); }
  .story-block h3 { font-size: 17px; line-height: 1.4; margin-bottom: var(--space-2); }
  .story-block p { font-size: 13px; line-height: 1.7; }
  .story-number { font-size: 36px; margin-bottom: var(--space-2); }
  .contact-form-card { padding: var(--space-6); }
  .profile-avatar { width: 70px; height: 70px; font-size: 28px; }
  .profile-link { width: 40px; height: 40px; font-size: 16px; }
  .about-hero { padding: var(--space-8) 0 var(--space-12); }
  .about-profile-card { padding: var(--space-6); }
  .profile-info h2 { font-size: 18px; line-height: 1.4; }
  .profile-info p { line-height: 1.5; margin-bottom: var(--space-2); }
  .profile-status { font-size: 11px; padding: 6px 12px; }
  .facts-card, .tech-card { padding: var(--space-5); min-width: 100%; }
  .facts-card h4, .tech-card h4 { margin-bottom: var(--space-3); }
  .fact-item { margin-bottom: var(--space-2); }
  .fact-icon { font-size: 18px; }
  .fact-label { line-height: 1.4; }
  .fact-value { font-size: 13px; line-height: 1.4; }
  .tech-tag { font-size: 12px; padding: 6px 10px; }
  .info-icon { width: 40px; height: 40px; font-size: 16px; }
  .info-label { line-height: 1.4; margin-bottom: 2px; }
  .info-value { line-height: 1.4; }
  .social-link { padding: var(--space-3); font-size: 12px; }
}

/* Very Small Phones */
@media (max-width: 360px) {
  .container { padding: 0 var(--space-3); }
  .brand-text, .brand-sub { display: none; }
  .hero h1 { font-size: 26px; }
  .hero-card { padding: var(--space-3); }
  .code { font-size: 9px; }
  .section-title { font-size: 22px; }
}

/* Touch Devices */
@media (hover: none) {
  .skill-card:hover, .project-card:hover, .hero-card:hover { transform: translateZ(0); }
  .btn-primary:hover::before { transform: scaleX(0); }
  
  .skill-card:active, .project-card:active {
    transform: scale(0.98) translateZ(0);
  }
}

/* Mobile-Only Animations */
@media (max-width: 768px) {
  /* Fade up animation for cards */
  .skill-card, .project-card, .story-block, .facts-card, .tech-card, .contact-form-card, .contact-info-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  
  .skill-card.visible, .project-card.visible, .story-block.visible, 
  .facts-card.visible, .tech-card.visible, .contact-form-card.visible, 
  .contact-info-card.visible, .reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Stagger animation for skill cards */
  .skill-card:nth-child(1) { transition-delay: 0.05s; }
  .skill-card:nth-child(2) { transition-delay: 0.1s; }
  .skill-card:nth-child(3) { transition-delay: 0.15s; }
  .skill-card:nth-child(4) { transition-delay: 0.2s; }
  .skill-card:nth-child(5) { transition-delay: 0.25s; }
  .skill-card:nth-child(6) { transition-delay: 0.3s; }
  
  /* Hero entrance animation */
  .hero-content {
    animation: mobileSlideUp 0.6s ease forwards;
  }
  
  .hero-card {
    animation: mobileSlideUp 0.6s ease 0.2s forwards;
    opacity: 0;
  }
  
  @keyframes mobileSlideUp {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Pulse effect on tap for buttons */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* Profile card float animation */
  .about-profile-card {
    animation: mobileFloat 4s ease-in-out infinite;
  }
  
  @keyframes mobileFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }
  
  /* Glow pulse for pill */
  .pill {
    animation: mobilePillGlow 2s ease-in-out infinite;
  }
  
  @keyframes mobilePillGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
  }
  
  /* Tech tags wave animation */
  .tech-tag {
    animation: mobileTagPop 0.3s ease forwards;
    opacity: 0;
  }
  
  .tech-card.visible .tech-tag:nth-child(1) { animation-delay: 0.1s; }
  .tech-card.visible .tech-tag:nth-child(2) { animation-delay: 0.15s; }
  .tech-card.visible .tech-tag:nth-child(3) { animation-delay: 0.2s; }
  .tech-card.visible .tech-tag:nth-child(4) { animation-delay: 0.25s; }
  .tech-card.visible .tech-tag:nth-child(5) { animation-delay: 0.3s; }
  .tech-card.visible .tech-tag:nth-child(6) { animation-delay: 0.35s; }
  
  @keyframes mobileTagPop {
    from {
      opacity: 0;
      transform: scale(0.8);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  /* Scroll indicator bounce */
  .scroll-top.show {
    animation: mobileBounce 2s ease-in-out infinite;
  }
  
  @keyframes mobileBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }
  
  /* Section header slide in */
  .section-header {
    animation: mobileFadeIn 0.5s ease forwards;
  }
  
  @keyframes mobileFadeIn {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  /* Social links stagger */
  .social-link {
    opacity: 0;
    animation: mobileSlideUp 0.4s ease forwards;
  }
  
  .social-links .social-link:nth-child(1) { animation-delay: 0.1s; }
  .social-links .social-link:nth-child(2) { animation-delay: 0.2s; }
  .social-links .social-link:nth-child(3) { animation-delay: 0.3s; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { 
    animation-duration: 0.01ms !important; 
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; 
  }
  .ambient-orb, .morphing-shapes, .cursor-trail, #particles, .floating-elements { display: none; }
}

/* High Refresh Rate Optimization */
@media (min-resolution: 2dppx) {
  .hero-card, .skill-card, .project-card {
    will-change: transform;
  }
}
