/* Mobile First Responsive Design */

/* Extra Small devices (phones, 320px and up) */
@media (max-width: 480px) {
  :root {
    --font-size-4xl: 36px;
    --font-size-5xl: 42px;
    --spacing-4xl: 3rem;
    --spacing-5xl: 4rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .section-title {
    font-size: var(--font-size-2xl);
  }

  /* Navigation */
  .nav-container {
    padding: 0 var(--spacing-md);
  }

  .loghino {
    width: 130px;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--white);
    flex-direction: column;
    justify-content: start;
    padding-top: var(--spacing-2xl);
    transition: left var(--transition-base);
    box-shadow: var(--shadow-lg);
  }

  [data-theme="dark"] .nav-menu {
    background-color: var(--white);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-controls {
    gap: var(--spacing-sm);
  }

  /* Hero Section */
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    text-align: center;
  }

  .hero-text {
    order: 3;
    display: flex;
    flex-direction: column;
  }

  .certification-badge {
    order: 1;
  }

  .hero-title {
    order: 3;
  }

  .hero-subtitle {
    order: 4;
  }

  .hero-description {
    order: 5;
  }

  .hero-buttons {
    order: 6;
  }

  .hero-image {
    order: 2;
  }

  .developer-illustration {
    width: 280px;
    height: 280px;
  }

  .hero-photo {
    max-width: 280px;
  }

  .badge-image {
    width: 120px;
  }

  .certification-badge {
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
    gap: var(--spacing-md);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
  }

  /* About Section */
  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  /* Skills Section */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .skill-item {
    padding: var(--spacing-lg);
  }

  .skill-icon {
    font-size: var(--font-size-2xl);
  }

  /* Services Section */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  /* Super Offer Section */
  .offer-title {
    font-size: 1.8rem;
  }

  .offer-subtitle {
    font-size: var(--font-size-base);
  }

  .offer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .offer-card {
    padding: var(--spacing-xl);
  }

  .offer-card.payment {
    transform: scale(1);
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .benefit-icon {
    font-size: 2rem;
  }

  .cta-button {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-base);
    width: 100%;
  }

  .cta-note {
    font-size: var(--font-size-base);
  }

  /* Portfolio Section */
  .portfolio-hero {
    margin-top: 60px;
    padding: var(--spacing-3xl) 0 var(--spacing-2xl);
  }

  .portfolio-hero-title {
    font-size: var(--font-size-2xl);
  }

  .portfolio-hero-description {
    font-size: var(--font-size-base);
  }

  .portfolio-filters {
    gap: var(--spacing-sm);
  }

  .filter-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .portfolio-image {
    height: 200px;
  }

  .portfolio-content {
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
  }

  .portfolio-title {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
  }

  .portfolio-description {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
    -webkit-line-clamp: 2;
  }

  .portfolio-tech {
    gap: 6px;
    margin-bottom: var(--spacing-sm);
  }

  .tech-tag {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  .portfolio-links {
    padding-top: var(--spacing-sm);
  }

  .portfolio-link {
    padding: 9px 16px;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
  }

  .portfolio-cta {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-2xl);
  }

  .portfolio-cta .btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
  }

  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }
}

/* Small devices (landscape phones, 481px and up) */
@media (min-width: 481px) and (max-width: 767px) {
  .container {
    padding: 0 var(--spacing-lg);
  }

  /* Navigation */
  .loghino {
    width: 150px;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--white);
    flex-direction: column;
    justify-content: start;
    padding-top: var(--spacing-2xl);
    transition: left var(--transition-base);
    box-shadow: var(--shadow-lg);
  }

  [data-theme="dark"] .nav-menu {
    background-color: var(--white);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  /* Hero Section */
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-3xl);
    text-align: center;
  }

  .hero-text {
    display: flex;
    flex-direction: column;
  }

  .certification-badge {
    order: 1;
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-title {
    order: 3;
  }

  .hero-subtitle {
    order: 4;
  }

  .hero-description {
    order: 5;
  }

  .hero-buttons {
    order: 6;
  }

  .hero-image {
    order: 2;
  }

  .developer-illustration {
    width: 320px;
    height: 320px;
  }

  .hero-photo {
    max-width: 320px;
  }

  .badge-image {
    width: 140px;
  }

  /* Skills Section */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }

  /* Hero Section */
  .hero-content {
    gap: var(--spacing-3xl);
  }

  .developer-illustration {
    width: 350px;
    height: 350px;
  }

  .hero-photo {
    max-width: 400px;
  }

  .badge-image {
    width: 180px;
  }

  /* Skills Section */
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Services Section */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Super Offer Section */
  .offer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .offer-card.payment {
    grid-column: 1 / -1;
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Portfolio Section */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Certifications Section */
  .certifications-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large devices (desktops, 1025px and up) */
@media (min-width: 1025px) {
  /* Default styles already applied */
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
  }

  .hero-title {
    font-size: var(--font-size-5xl);
  }

  .section-title {
    font-size: var(--font-size-4xl);
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-3xl) 0;
  }

  .hero-content {
    gap: var(--spacing-2xl);
  }

  .developer-illustration {
    width: 250px;
    height: 250px;
  }

  .hero-photo {
    max-width: 250px;
  }

  section {
    padding: var(--spacing-3xl) 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  .developer-illustration {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark theme adjustments for mobile */
@media (max-width: 767px) {
  [data-theme="dark"] .nav-menu {
    background-color: var(--white);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Print styles */
@media print {
  .navbar,
  .hero-buttons,
  .contact-form,
  .footer {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  .hero,
  section {
    page-break-inside: avoid;
    padding: 1rem 0;
  }

  .section-title {
    page-break-after: avoid;
  }
}