/* ===============================
   RESPONSIVE DESIGN
   =============================== */

/* ===============================
   MOBILE FIRST - SMALL DEVICES
   =============================== */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
  :root {
    --font-6xl: 2rem;
    --font-5xl: 1.75rem;
    --font-4xl: 1.5rem;
    --font-3xl: 1.25rem;
    --font-2xl: 1.125rem;
    --font-xl: 1rem;
    --spacing-4xl: 2rem;
    --spacing-3xl: 1.5rem;
    --spacing-2xl: 1.25rem;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .section {
    padding: var(--spacing-3xl) 0;
  }
  
  .section-header {
    margin-bottom: var(--spacing-2xl);
  }
  
  .section-title {
    font-size: var(--font-4xl);
  }
  
  .section-subtitle {
    font-size: var(--font-base);
  }
  
  /* Navigation - Mobile First */
  .navbar {
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.1);
  }
  
  .nav-container {
    padding: 0 var(--spacing-base);
    height: 70px;
  }
  
  .nav-brand {
    font-size: var(--font-xl);
    font-weight: 900;
  }
  
  .nav-brand i {
    font-size: 1.5rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-2xl) 0;
    transition: left 0.3s ease;
    z-index: 999;
    border-left: 3px solid rgba(0, 255, 255, 0.3);
  }
  
  .nav-menu.active {
    left: 0;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
  }
  
  .nav-item {
    margin: 0;
    width: 90%;
  }
  
  .nav-link {
    font-size: var(--font-lg);
    padding: var(--spacing-lg) var(--spacing-base);
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
  }
  
  .nav-link:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateX(5px);
  }
  
  .nav-toggle {
    display: flex;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
  }
  
  .nav-toggle:hover {
    background: rgba(0, 212, 255, 0.1);
  }
  
  .nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* Hero Section */
  .hero {
    min-height: 100vh;
    padding: var(--spacing-2xl) 0;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    text-align: center;
  }
  
  .hero-title {
    font-size: var(--font-4xl);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: var(--font-base);
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 250px;
    justify-content: center;
  }
  
  .code-preview {
    transform: none;
    width: 100%;
    max-width: 300px;
  }
  
  /* Technology Grid */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-base);
  }
  
  .tech-card {
    padding: var(--spacing-base);
  }
  
  .tech-icon {
    font-size: var(--font-4xl);
  }
  
  /* Portfolio Grid */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-base);
  }
  
  .portfolio-card {
    margin: 0 var(--spacing-sm);
  }
  
  .portfolio-image {
    height: 150px;
  }
  
  .portfolio-content {
    padding: var(--spacing-base);
  }
  
  .tech-stack {
    gap: var(--spacing-xs);
  }
  
  .tech-tag {
    font-size: var(--font-xs);
    padding: var(--spacing-xs);
  }
  
  /* Team Grid */
  .team-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-base);
  }
  
  .team-card {
    padding: var(--spacing-base);
    margin: 0 var(--spacing-sm);
  }
  
  .team-avatar {
    width: 80px;
    height: 80px;
  }
  
  .avatar-ring {
    width: 90px;
    height: 90px;
  }
  
  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }
  
  .contact-info {
    order: 2;
  }
  
  .contact-form {
    order: 1;
    padding: var(--spacing-base);
  }
  
  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-sm);
  }
  
  .contact-icon {
    width: 40px;
    height: 40px;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-base);
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--spacing-base);
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .back-to-top {
    bottom: var(--spacing-base);
    right: var(--spacing-base);
    width: 40px;
    height: 40px;
  }
}

/* ===============================
   MEDIUM DEVICES - TABLETS
   =============================== */

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  :root {
    --font-6xl: 2.5rem;
    --font-5xl: 2rem;
    --font-4xl: 1.75rem;
    --spacing-4xl: 3rem;
    --spacing-3xl: 2rem;
  }
  
  .container {
    padding: 0 var(--spacing-base);
  }
  
  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-2xl) 0;
    transition: left var(--transition-base);
    z-index: var(--z-fixed);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .hamburger {
    display: flex;
  }
  
  /* Hero Section */
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-3xl);
    text-align: center;
  }
  
  .hero-title {
    font-size: var(--font-5xl);
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  /* Technology Grid */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  /* Portfolio Grid */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  /* Team Grid */
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-3xl);
  }
  
  .contact-info {
    order: 2;
  }
  
  .contact-form {
    order: 1;
  }
}

/* ===============================
   MEDIUM-LARGE DEVICES
   =============================== */

/* Medium-Large devices (landscape tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Navigation */
  .nav-menu {
    gap: var(--spacing-lg);
  }
  
  /* Hero Section */
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
  }
  
  .hero-title {
    font-size: var(--font-5xl);
  }
  
  /* Technology Grid */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  /* Portfolio Grid */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  /* Team Grid */
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr 1.5fr;
  }
}

/* ===============================
   LARGE DEVICES - DESKTOPS
   =============================== */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .container {
    max-width: 960px;
  }
  
  /* Navigation */
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    position: static;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    height: auto;
    width: auto;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  
  .nav-item {
    margin: 0 0 0 30px;
    width: auto;
  }
  
  .nav-link {
    padding: 8px 0;
    border: none;
    background: transparent;
    transform: none;
    font-size: var(--font-base);
  }
  
  /* Hero Section */
  .hero-title {
    font-size: var(--font-6xl);
  }
  
  /* Technology Grid */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  /* Portfolio Grid */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  
  /* Team Grid */
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* ===============================
   EXTRA LARGE DEVICES
   =============================== */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  /* Navigation */
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    position: static;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    height: auto;
    width: auto;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  
  .nav-item {
    margin: 0 0 0 30px;
    width: auto;
  }
  
  .nav-link {
    padding: 8px 0;
    border: none;
    background: transparent;
    transform: none;
    font-size: var(--font-base);
  }
  
  /* Technology Grid */
  .tech-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Portfolio Grid */
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Team Grid */
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===============================
   XXLARGE DEVICES
   =============================== */

/* Extra extra large devices (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  :root {
    --font-6xl: 4rem;
    --font-5xl: 3.5rem;
  }
  
  .hero-title {
    font-size: var(--font-6xl);
  }
  
  .section-title {
    font-size: var(--font-5xl);
  }
}

/* ===============================
   ORIENTATION SPECIFIC
   =============================== */

/* Landscape orientation for mobile devices */
@media (max-width: 767.98px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: var(--spacing-xl) 0;
  }
  
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }
  
  .hero-title {
    font-size: var(--font-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-sm);
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .nav-menu {
    height: calc(100vh - 70px);
    padding: var(--spacing-xl) 0;
  }
}

/* ===============================
   HIGH DENSITY DISPLAYS
   =============================== */

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  .hero-visual {
    image-rendering: -webkit-optimize-contrast;
  }
  
  .tech-icon,
  .contact-icon {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ===============================
   REDUCED MOTION
   =============================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-indicator {
    animation: none;
  }
}

/* ===============================
   PRINT STYLES
   =============================== */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .navbar,
  .hamburger,
  .back-to-top,
  .scroll-indicator,
  .contact-form {
    display: none !important;
  }
  
  .hero,
  .section {
    page-break-inside: avoid;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  .portfolio-card,
  .tech-card,
  .team-card {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }
  
  a {
    text-decoration: underline;
  }
  
  .btn {
    border: 1px solid #ccc !important;
    background: transparent !important;
    color: black !important;
  }
}

/* ===============================
   ACCESSIBILITY ENHANCEMENTS
   =============================== */

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .nav-link:focus,
  .btn:focus,
  .social-link:focus,
  .back-to-top:focus {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-accent: #00ffff;
    --neon-blue: #00ffff;
    --neon-pink: #ff00ff;
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #222222;
  }
  
  .tech-card,
  .portfolio-card,
  .team-card,
  .contact-form {
    border: 2px solid var(--neon-blue);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* ===============================
   CONTAINER QUERIES (FUTURE)
   =============================== */

/* Container queries for component-based responsive design */
@container (max-width: 400px) {
  .tech-card {
    padding: var(--spacing-sm);
  }
  
  .portfolio-card {
    padding: var(--spacing-sm);
  }
  
  .team-card {
    padding: var(--spacing-sm);
  }
}

/* ===============================
   UTILITIES FOR RESPONSIVE
   =============================== */

/* Show/hide utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

/* Responsive display utilities */
@media (max-width: 575.98px) {
  .d-xs-none { display: none !important; }
  .d-xs-block { display: block !important; }
  .d-xs-inline { display: inline !important; }
  .d-xs-inline-block { display: inline-block !important; }
  .d-xs-flex { display: flex !important; }
  .d-xs-inline-flex { display: inline-flex !important; }
  .d-xs-grid { display: grid !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
  .d-sm-grid { display: grid !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-inline-flex { display: inline-flex !important; }
  .d-md-grid { display: grid !important; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
  .d-lg-grid { display: grid !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
  .d-xl-grid { display: grid !important; }
}
