/* ============================
   RESPONSIVE DESIGN
   Media Queries for All Breakpoints
   ============================ */

:root {
  --bg-deep-charcoal: #0D1117;
  --text-pale-green: #B9FFB9;
  --accent-matrix-green: #00FF41;
  --glow-color: rgba(0, 255, 65, 0.4);
  --border-color: rgba(0, 255, 65, 0.2);
}

/* ============================
   TABLET (1024px and down)
   ============================ */

@media (max-width: 1024px) {
  .content {
    padding: 0 20px;
  }

  nav {
    padding: 0.8rem 20px;
    gap: 1.5rem;
  }

  .logo img {
    height: 65px;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .card-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* ============================
   MOBILE LANDSCAPE/TABLET (768px and down)
   ============================ */

@media (max-width: 768px) {
  .page-container {
    margin-top: 70px;
  }

  .content {
    margin-top: 80px;
    padding: 0 15px;
  }

  nav {
    padding: 0.8rem 15px;
    gap: 1rem;
  }

  .logo img {
    height: 65px;
  }

  .nav-links {
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  /* Grid Adjustments */
  .hero-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 8rem 0 9rem 0;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-image {
    height: 300px;
    order: -1;
  }

  .contact-container-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-intro-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .blog-card {
    margin-bottom: 1rem;
  }

  .blog-image {
    height: 150px;
  }

  .blog-title {
    font-size: 1.1rem;
  }

  .blog-excerpt {
    font-size: 0.9rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-category {
    padding: 1.5rem;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.2rem;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-item {
    padding: 1rem;
    gap: 1rem;
  }

  .contact-item h3 {
    font-size: 1rem;
  }

  .contact-icon {
    font-size: 1.5rem;
    min-width: 40px;
  }

  /* Chat Modal Mobile */
  .chat-modal {
    position: fixed;
    bottom: 80px;
    right: 10px;
    width: calc(100% - 20px);
    max-width: 350px;
    height: 450px;
  }

  .floating-buttons {
    padding: 0 15px;
    bottom: 20px;
    gap: 1rem;
    flex-direction: column;
    align-items: flex-end;
  }

  .floating-button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  /* Footer Mobile */
  footer {
    padding: 1.5rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-links a {
    display: block;
  }

  .social {
    text-align: center;
  }

  .social i {
    margin: 0 0.5rem;
  }

  .copy {
    margin-top: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .footer-logo {
    width: 150px;
  }

  .footer-brand,
  .footer-column,
  .footer-bottom {
    text-align: center;
    align-items: center;
  }
}

/* ============================
   SMALL MOBILE (600px and down)
   ============================ */

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .page-container {
    margin-top: 60px;
  }

  .content {
    margin-top: 70px;
    padding: 0 12px;
  }

  nav {
    padding: 0.6rem 12px;
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .logo {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .logo img {
    height: 50px;
  }

  .nav-links {
    gap: 0.8rem;
    width: 100%;
    justify-content: center;
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  /* Typography Mobile */
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  /* Hero Section Small Mobile */
  .hero-section {
    gap: 1.5rem;
    margin: 8rem 0 1.5rem 0;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  .hero-image {
    height: 250px;
  }

  /* Blog Cards Small Mobile */
  .blog-card {
    border-radius: 8px;
  }

  .blog-image {
    height: 120px;
  }

  .blog-content {
    padding: 1rem;
  }

  .blog-date {
    font-size: 0.8rem;
  }

  .blog-title {
    font-size: 1rem;
  }

  .blog-excerpt {
    font-size: 0.85rem;
  }

  .read-more {
    font-size: 0.9rem;
  }

  /* Skills Small Mobile */
  .skill-category {
    padding: 1.2rem;
  }

  .skill-category h4 {
    font-size: 1rem;
  }

  .skill-items {
    gap: 0.4rem;
  }

  .skill-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Contact Small Mobile */
  .contact-item {
    padding: 0.8rem;
    flex-direction: column;
    text-align: center;
  }

  .contact-item h3 {
    font-size: 0.95rem;
  }

  .contact-item a {
    font-size: 0.9rem;
  }

  .contact-icon {
    font-size: 1.3rem;
  }

  /* About Small Mobile */
  .about-intro-grid {
    grid-template-columns: 1fr;
  }

  /* Chat Modal Small Mobile */
  .chat-modal {
    bottom: 70px;
    right: 5px;
    left: 5px;
    width: auto;
    height: 400px;
  }

  .floating-buttons {
    padding: 0 10px;
    bottom: 15px;
  }

  .floating-button {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  /* Forms Small Mobile */
  input, textarea {
    padding: 0.8rem 1rem;
    font-size: 16px;
    border-radius: 8px;
  }

  textarea {
    min-height: 100px;
  }

  .btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
  }

  /* Card Small Mobile */
  .card {
    padding: 1rem;
  }

  .card h3 {
    font-size: 1rem;
  }

  /* Footer Small Mobile */
  footer {
    padding: 1rem;
  }

  .footer-content {
    font-size: 0.85rem;
  }

  .footer-large {
    gap: 1.2rem;
  }

  .footer-logo {
    width: 130px;
  }
}

/* ============================
   EXTRA SMALL MOBILE (400px and down)
   ============================ */

@media (max-width: 400px) {
  .content {
    padding: 0 10px;
  }

  nav {
    padding: 0.5rem 10px;
  }

  .logo img {
    height: 45px;
  }

  .nav-links a {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .hero-content h1 {
    font-size: 1.3rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .hero-image {
    height: 200px;
  }

  .blog-image {
    height: 100px;
  }

  .floating-buttons {
    padding: 0 5px;
    bottom: 10px;
  }

  .floating-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .chat-modal {
    height: 350px;
    right: 2px;
    left: 2px;
  }

  .card {
    padding: 0.8rem;
  }
}

/* ============================
   BACKGROUND ELEMENTS - MOBILE OPTIMIZATION
   ============================ */

/* Hide code snippets on tablets and smaller */
@media (max-width: 1024px) {
  .code-snippets {
    display: none;
  }
  
  .left-image {
    width: 200px;
    opacity: 0.15;
  }
}

/* Reduce background intensity on mobile */
@media (max-width: 768px) {
  #binary-canvas {
    opacity: 0.1;
  }
  
  .code-background {
    opacity: 0.5;
  }
  
  .left-image {
    display: none;
  }
}

/* Minimal backgrounds on small mobile */
@media (max-width: 600px) {
  #binary-canvas {
    opacity: 0.05;
  }
  
  .code-background {
    display: none;
  }
}

/* Remove all decorative backgrounds on extra small screens */
@media (max-width: 400px) {
  #binary-canvas {
    display: none;
  }
}

/* ============================
   MOBILE MENU DROPDOWN
   ============================ */

@media (max-width: 768px) {
  nav {
    position: relative;
    align-items: center;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(13, 17, 23, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    z-index: 1100;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
  }

  .nav-links a:hover {
    background: rgba(0, 255, 65, 0.08);
  }

  .content {
    margin-top: 90px;
  }
}

@media (max-width: 600px) {
  .logo {
    width: auto;
    margin-bottom: 0;
  }

  .logo img {
    height: 52px;
  }

  nav {
    flex-wrap: nowrap;
  }

  .nav-links {
    width: 100%;
  }
}
