html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100vw;
}
html {
  background: #2f4c7e;
}
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: transparent;
  font-family: sans-serif;
  color: white;
  user-select: none;
}
#rippleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-color: #2f4c7e; /* fallback background */
}
button, .minimal-nav-btn, .btn, #toggleRandomWavesBtn {
  background: rgba(0,170,255,0.18) !important;
  color: #fff !important;
  box-shadow: 0 0 10px #0af2;
  border: none;
  border-radius: 6px;
  transition: background 0.3s, box-shadow 0.3s, transform 0.15s cubic-bezier(.4,2,.6,1);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 8px 16px;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
button:hover, .minimal-nav-btn:hover, .btn:hover, #toggleRandomWavesBtn:hover, #toggleRandomWavesBtn:focus {
  background: rgba(0,136,204,0.28) !important;
  box-shadow: 0 0 15px #08c5;
  color: #fff !important;
}
button:active, .minimal-nav-btn:active, .btn:active, #toggleRandomWavesBtn:active {
  background: rgba(0,170,255,0.28) !important;
  transform: scale(0.94);
  box-shadow: 0 0 4px #0af, 0 2px 16px #0af44a;
}
.minimal-nav-btn {
  /* For nav buttons, animate on click */
  transition: color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s cubic-bezier(.4,2,.6,1);
}
.minimal-nav-btn:active {
  transform: scale(0.93) rotate(-1deg);
  background: rgba(0,170,255,0.28) !important;
  color: #fff !important;
  box-shadow: 0 0 8px #0af, 0 2px 24px #0af44a;
}
#portfolioContent {
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  transition: min-height 0.2s, height 0.4s cubic-bezier(.4,1.6,.6,1), max-height 0.4s cubic-bezier(.4,1.6,.6,1);
  will-change: height, min-height, max-height;
}
#portfolioContent h2 {
  min-height: 2.5em; /* Reserve space for section titles */
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
}
#portfolioContent .carousel-inner {
  min-height: 220px; /* Increased to match tallest card + controls */
  display: flex;
  align-items: stretch;
}
#portfolioContent .carousel-item {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
#portfolioContent .card {
  min-width: 280px;
  max-width: 340px;
  min-height: 180px;
  max-height: 220px;
  width: 100%;
  margin: 0 auto;
  background: #181c22cc; /* semi-transparent dark */
  box-shadow: 0 2px 16px #0af2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#toggleRandomWavesBtn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  padding: 10px 22px;
  font-size: 1.08rem;
  font-weight: 600;
  background: linear-gradient(90deg, #0af8 0%, #181c22cc 100%) !important;
  color: #fff !important;
  border: 1.5px solid #0af6;
  border-radius: 8px;
  box-shadow: 0 2px 16px #0af3, 0 1.5px 8px #0008;
  letter-spacing: 0.01em;
  transition: background 0.25s, border 0.2s, color 0.2s, box-shadow 0.2s, transform 0.13s cubic-bezier(.4,2,.6,1);
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
#toggleRandomWavesBtn:hover, #toggleRandomWavesBtn:focus {
  background: linear-gradient(90deg, #0afc 0%, #181c22ee 100%) !important;
  border: 1.5px solid #0af;
  color: #fff !important;
  box-shadow: 0 4px 32px #0af6, 0 2px 12px #000a;
}
#toggleRandomWavesBtn:active {
  background: linear-gradient(90deg, #0af 0%, #181c22 100%) !important;
  transform: scale(0.96);
  box-shadow: 0 0 8px #0af2;
}
#toggleRandomWavesBtn.btn-off {
  background: rgba(68,68,68,0.18) !important;
  color: #fff !important;
  border: none;
  box-shadow: 0 0 8px #0006;
}
#toggleRandomWavesBtn.btn-off:hover, #toggleRandomWavesBtn.btn-off:focus {
  background: rgba(102,102,102,0.28) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px #000a;
}
#toggleRandomWavesBtn.btn-off:active {
  background: rgba(34,34,34,0.28) !important;
  box-shadow: 0 0 4px #0004;
}
/* Make carousel project cards show pointer cursor */
.project-card {
  cursor: pointer;
}

/* Hover effect for project cards */
.project-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

}

/* Swiper carousel card styling */
#projectsSwiper .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: auto;
}
#projectsSwiper .card.project-card {
  min-width: 260px;
  max-width: 340px;
  min-height: 180px;
  max-height: 240px;
  width: 100%;
  margin: 0 auto;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, rgba(24,28,34,0.92) 70%, rgba(0,170,255,0.13) 100%);
  box-shadow: none;
  border-radius: 18px;
  border: 1.5px solid #0af4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  transition: transform 0.22s cubic-bezier(.4,2,.6,1), box-shadow 0.22s, border 0.18s, background 0.25s;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(2.5px);
}
#projectsSwiper .card.project-card:hover {
  transform: scale(1.045) translateY(-3px);
  box-shadow: none;
  border-color: #0af;
  background: linear-gradient(135deg, rgba(24,28,34,0.98) 60%, rgba(0,170,255,0.18) 100%);
}
#projectsSwiper .card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #0af;
  margin-bottom: 0.5em;
  letter-spacing: 0.01em;
}
#projectsSwiper .card-text {
  color: #e0e6ef;
  font-size: 1.01rem;
  margin-bottom: 0.5em;
}
#projectsSwiper .card-body {
  padding: 1.6rem 1.3rem 1.5rem 1.3rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Enable click-through on non-interactive UI areas */
main.container {
  pointer-events: none !important;
}
main.container * {
  pointer-events: auto !important;
}

/* Only wrap the main content, not the entire main.container */
main.container {
  background-color: #2f4c7e;
  background: none;
  padding: 0;
  border-radius: 0;
  max-width: unset;
  box-shadow: none;
}
.main-content-box {
  background-color: rgba(0, 0, 0, 0.6);
  padding: 2rem;
  border-radius: 16px;
  width: fit-content;
  max-width: calc(100vw - 2rem);
  margin: 4vh auto;
  box-shadow: 0 6px 32px #000a;
  position: relative;
}

/* Override text colors to white */
body {
  color: #fff !important;
}
.text-info {
  color: #fff !important;
}
#projectsSwiper .card-title,
#projectsSwiper .card-text {
  color: #fff !important;
}

/* Settings panel styling */
#settingsPanel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  z-index: 20;
  display: none;
}
#settingsPanel h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
#settingsPanel label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
#settingsPanel input[type=range],
#settingsPanel input[type=number] {
  width: 100%;
  margin-bottom: 1rem;
}

/* Settings Panel */
.settings-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0.5rem;
  background: #181c22cc;
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: none;
  z-index: 5;
  width: fit-content;
  max-width: calc(100vw - 2rem);
}
.settings-panel div {
  margin-bottom: 1rem;
}
.settings-panel label {
  display: block;
  margin-bottom: 0.25rem;
}
.settings-panel input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive layout: nav buttons wrap into two rows on small screens */
@media (max-width: 768px) {
  .main-content-box nav {
    flex-wrap: wrap !important;
    justify-content: center;
  }
  .main-content-box nav > button {
    flex: 1 1 45% !important;
    margin-bottom: 0.5rem !important;
  }
}
@media (max-width: 400px) {
  .main-content-box nav > button {
    flex: 1 1 100% !important;
  }
}
