/* Responsive Design Media Queries */

/* Tablet and smaller desktop responsive styles */
@media (max-width: 768px) {
  .site-title {
    font-size: 36px !important;
    left: 35% !important;
    transform: translateX(-50%) !important;
    top: 20px !important;
    letter-spacing: 1px !important;
  }
  
  .nav-section {
    font-size: 16px;
    padding: 8px 16px;
    min-width: 100px;
    max-width: 160px;
    -webkit-text-stroke: 1.5px #3b3b77;
    text-stroke: 1.5px #3b3b77;
    letter-spacing: 0.5px;
  }
  
  /* Adjust positioning to prevent overlap */
  #contact { top: 20px; right: 15px; }
  #bio { top: 90px; right: 15px; } /* Increased spacing */
  #writings { bottom: 60px; left: 15px; }
  #experiments { bottom: 60px; right: 15px; }
}

/* Medium screens - fix the 593px width issue */
@media (max-width: 650px) {
  .site-title {
    font-size: 32px !important;
    left: 35% !important;
    transform: translateX(-50%) !important;
    top: 15px !important;
  }
  
  .nav-section {
    font-size: 15px;
    padding: 7px 14px;
    min-width: 90px;
  }
  
  /* Keep corner layout on medium screens */
  #contact { top: 15px; right: 12px; }
  #bio { top: 85px; right: 12px; } /* Ensure no overlap */
  #writings { bottom: 70px; left: 12px; }
  #experiments { bottom: 70px; right: 12px; } /* Same height as writings, on right side */
}

@media (max-width: 480px) {
  .site-title {
    font-size: 28px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-text-stroke: 1.5px #3b3b77;
    text-stroke: 1.5px #3b3b77;
    letter-spacing: 0.5px;
  }
  
  .nav-section {
    font-size: 14px;
    padding: 6px 12px;
    min-width: 80px;
    max-width: 140px;
    -webkit-text-stroke: 1.5px #3b3b77;
    text-stroke: 1.5px #3b3b77;
    letter-spacing: 1px;
  }
  
  /* Keep buttons in corners on small screens */
  #contact { top: 15px; right: 10px; }
  #bio { top: 75px; right: 10px; } /* Increased spacing */
  #writings { bottom: 162px; left: 10px; }
  #experiments { bottom: 162px; right: 10px; } /* Same height as writings, on right side */
}

/* Extra small screens - alternative layout */
@media (max-width: 360px) {
  .site-title {
    font-size: 24px;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
  }
  
  .nav-section {
    font-size: 12px;
    padding: 5px 10px;
    min-width: 70px;
    max-width: 120px;
    letter-spacing: 0.5px;
  }
  
  /* Keep buttons in corners even on smallest screens */
  #contact { top: 10px; right: 5px; }
  #bio { top: 60px; right: 5px; }
  #writings { bottom: 144px; left: 5px; }
  #experiments { bottom: 144px; right: 5px; } /* Same height as writings, on right side */
}

/* Height-based media queries for tall viewports */
@media (min-height: 1200px) {
  .site-title {
    top: 60px; /* More space from top on tall screens */
  }
  
  #bio {
    top: 140px; /* Push BIO button further down to avoid title overlap */
  }
}

/* Comprehensive responsive breakpoints for canvas container */
/* Extra Large Desktops (1441px+) */
@media (min-width: 1441px) {
  #canvas-container {
    width: 75vw;
    height: 60vh;
    max-width: 1400px;
    max-height: 800px;
  }
}

/* Large Desktops (1281px - 1440px) */
@media (max-width: 1440px) {
  #canvas-container {
    width: 78vw;
    height: 58vh;
    max-width: 1200px;
    max-height: 700px;
  }
}

/* Standard Desktops (1025px - 1280px) */
@media (max-width: 1280px) {
  #canvas-container {
    width: 82vw;
    height: 56vh;
    min-width: 700px;
    min-height: 380px;
  }
}

/* Large Tablets Landscape (769px - 1024px) */
@media (max-width: 1024px) {
  #canvas-container {
    width: 85vw;
    height: 55vh;
    min-width: 600px;
    min-height: 350px;
  }
}

/* Small Tablets & Large Mobile Landscape (601px - 768px) */
@media (max-width: 768px) {
  #canvas-container {
    width: 90vw;
    height: calc(90vw * 0.6); /* Switch to aspect ratio based */
    min-width: 300px;
    min-height: 200px;
  }
}

/* Large Mobile Landscape (481px - 600px) */
@media (max-width: 600px) {
  #canvas-container {
    width: 92vw;
    height: calc(92vw * 0.6);
    min-width: 280px;
    min-height: 180px;
  }
}

/* Small Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
  #canvas-container {
    width: 94vw;
    height: calc(94vw * 0.6);
    min-width: 260px;
    min-height: 160px;
  }
}

/* Extra Small Mobile (below 320px) */
@media (max-width: 320px) {
  #canvas-container {
    width: 96vw;
    height: calc(96vw * 0.6);
    min-width: 240px;
    min-height: 150px;
  }
}

/* Portrait orientation adjustments */
@media (orientation: portrait) and (max-height: 800px) {
  #canvas-container {
    height: 45vh; /* Reduce height on short portrait screens */
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  #canvas-container {
    height: 70vh; /* Maximize height on short landscape screens */
  }
}

@media (min-height: 1400px) {
  .site-title {
    top: 80px; /* Even more space on very tall screens */
  }
  
  #bio {
    top: 160px; /* More separation for very tall viewports */
  }
}
