* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ramabhadra-regular {
  font-family: "Ramabhadra", sans-serif;
  font-weight: 400;
  font-style: normal;
}

body {
  background-color: #000000;
  color: #ffffff;
  font-family: "Ramabhadra", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  position: relative;
}

#ascii-wave-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  cursor: crosshair;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -moz-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.mobile-header {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  width: 250px;
  background-color: rgba(6, 6, 6, 0.9);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  position: fixed;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar h1 {
  margin-bottom: 6px;
  margin-left: 20px;
  margin-right: 20px;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar h1 .logo-svg {
  max-width: 110px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0 16px;
}

.sidebar-nav h3 {
  color: #ffffff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ffffff;
  font-family: "Ramabhadra", sans-serif;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 8px 12px;
  display: block;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: "Ramabhadra", sans-serif;
  margin-bottom: 6px;
  font-size: 13px;
}

.sidebar-nav a:hover {
  background-color: #ffffff;
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  color: #000000;
}

.sidebar-nav a.active {
  background-color: #ffffff;
  color: #020202;
  font-weight: 400;
}

.sidebar-footer {
  padding: 0 16px 24px 16px;
}

.sidebar-footer h3 {
  color: #ffffff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ffffff;
  font-family: "Ramabhadra", sans-serif;
}

.sidebar-footer ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: rgba(17, 17, 17, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-weight: 400;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: "Ramabhadra", sans-serif;
  font-size: 13px;
}

.sidebar-footer a:last-child {
  margin-bottom: 0;
}

.sidebar-footer a:hover {
  background-color: #ffffffe3;
  color: #000000;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform: translateX(4px);
}

.main-content {
  margin-left: 250px;
  padding: 32px 20px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(100% - 250px);
}

.card {
  background-color: rgba(17, 17, 17, 0.3);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 32px 40px;
  margin-bottom: 40px;
}

.card:last-of-type {
  margin-bottom: 80px;
}

.card h2 {
  color: #ffffff;
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ffffff;
  font-family: "Ramabhadra", sans-serif;
}

.card.socials > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: 0;
  padding: 10px 12px;
  background-color: rgba(17, 17, 17, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #ffffff;
  font-family: "Ramabhadra", sans-serif;
  font-size: 14px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.card.socials a:hover {
  background-color: #ffffff;
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-2px);
}

a {
  text-decoration: none;
}

.spinning-emoji {
  display: inline-block;
  animation: spin 2s linear infinite;
  margin-right: 8px;
  filter: drop-shadow(0 0 8px #ffffff3b);
  transform-origin: 50% 50%;
  vertical-align: middle;
  line-height: 1;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.special-link {
  color: #cccccc;
  transition: all 0.8s ease;
}

.special-link:hover {
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 60px;
    padding: 0 16px;
    background-color: rgba(6, 6, 6, 0.95);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .mobile-logo .logo-svg {
    height: 24px;
    width: auto;
  }

  .menu-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    outline: none;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 950;
  }

  .sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
  }

  .sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    padding: 0;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-nav {
    flex: 1;
    padding: 16px;
  }

  .sidebar-footer {
    padding: 16px 24px 24px 16px;
    margin-top: 0;
  }

  .main-content {
    margin-left: 0;
    flex: 1;
    padding: 16px;
    width: 100%;
    min-height: calc(100vh - 200px);
    padding-top: 80px;
  }

  .card {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .card:last-of-type {
    margin-bottom: 40px;
  }
  
  .card.socials > div {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card.socials a {
    min-height: 50px;
    padding: 8px 10px;
    font-size: 13px;
    letter-spacing: 0.5px;
  }

  .external-search-box {
    flex-direction: column;
    gap: 12px;
  }

  .external-search-box input,
  .external-search-box select,
  .external-search-box button {
    width: 100%;
    margin: 0;
    font-size: 16px;
  }

  #siteSelector,
  .search-button {
    height: 48px;
    padding: 12px 16px;
  }

  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  body {
    font-size: 16px;
    line-height: 1.5;
  }

  .sidebar,
  .main-content {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 12px;
  }

  .main-content {
    padding: 12px;
  }

  .external-search-box {
    gap: 10px;
  }
}
