:root {
  --background-color: #ff4757;
  --link-hover: #ff3742;
  --link-heading: #ff6b7a;
  --galaxy-red: #ff1744;
  --deep-space: #0a0a0a;
  --crimson: #dc143c;
  --rose: #ff6b7a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: 'Inconsolata', sans-serif !important;
  -webkit-transition: all 200ms linear;
  -ms-transition: all 200ms linear;
  transition: all 200ms linear;
}

html {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  min-width: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 23, 68, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(220, 20, 60, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 107, 122, 0.2) 0%, transparent 50%),
    radial-gradient(2px 2px at 20px 30px, rgba(255, 55, 66, 0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 23, 68, 0.6), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(220, 20, 60, 0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 107, 122, 0.7), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 23, 68, 0.8), transparent),
    linear-gradient(135deg, #0a0a0a 0%, #1a0505 25%, #2d0a0f 50%, #1a0505 75%, #0a0a0a 100%);
  background-size: 
    100% 100%,
    100% 100%,
    100% 100%,
    200px 200px,
    300px 300px,
    250px 250px,
    400px 400px,
    350px 350px,
    100% 100%;
  animation: galaxyShift 20s ease-in-out infinite;
}

@media (scripting: enabled) {
  .preload * {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
  }
}

@supports (-webkit-touch-callout: none) {
  .preload * {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
  }
}

.wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 4rem;
  margin-top: -1rem;
}

.maincard {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.9) 0%, rgba(45, 10, 15, 0.85) 50%, rgba(10, 10, 10, 0.9) 100%);
  border: 2px solid rgba(255, 23, 68, 0.3);
  margin-top: 60px;
  margin-bottom: 30px;
  width: 700px;
  backdrop-filter: blur(15px);
  box-shadow: 
    0px 0px 50px rgba(255, 23, 68, 0.3),
    inset 0 1px 0 rgba(255, 107, 122, 0.1),
    0px 10px 30px rgba(0, 0, 0, 0.8);
  padding: 1rem;
  border-radius: 15px;
}

.content {
  display: flex;
  gap: 2rem;
}

.image {
  position: relative;
}

img {
  max-height: 680px;
  max-width: 400px;
  height: 680px;
  padding-left: 10px;
  width: 400px;
  padding-top: 15px;
  object-fit: cover;
  border-radius: 2.5rem;
  filter: brightness(1.25);
}

section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.links {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 1.5rem;
  width: 300px;
  margin-top: 1rem;
  padding-top: 5px;
  color: aliceblue;
  font-size: 20px;
  font-weight: 300;
  border-color: rgba(255, 255, 255, 0);
  border-style: solid;
  border-width: 2px;
}

.links ul {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.links h3 {
  color: var(--link-heading);
  font-weight: 600;
  align-items: center;
  display: flex;
  text-decoration: underline;
}

a:hover {
  color: var(--link-hover);
  font-weight: 500;
}

a {
  padding: 0px;
  text-decoration: none;
  color: aliceblue;
}

h1 a,
h3 a {
    color: var(--link-hover);
}

h1 a:hover,
h3 a:hover {
    font-weight: 900;
}

h1 {
  font-size: 2.25rem;
  color: hsla(0, 100%, 50%, 1);
  display: flex;
  margin: 1rem;
  margin-bottom: .5rem;
}

.search {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
  margin-left: 1rem;
}

.bg {
  height: 780px;
  position: fixed;
  width: 700px;
  margin-left: -5rem;
  margin-top: -2rem;
  background: 
    radial-gradient(ellipse at center, rgba(255, 23, 68, 0.4) 0%, rgba(220, 20, 60, 0.3) 30%, transparent 70%),
    linear-gradient(45deg, rgba(255, 23, 68, 0.2) 0%, rgba(139, 0, 0, 0.3) 50%, rgba(255, 23, 68, 0.2) 100%);
  box-shadow: 
    0px 0px 80px rgba(255, 23, 68, 0.4), 
    0px 0px 150px rgba(220, 20, 60, 0.3),
    inset 0px 0px 50px rgba(255, 107, 122, 0.1);
  z-index: -1;
  border-radius: 20px;
  animation: pulseGalaxy 8s ease-in-out infinite;
}

ul {
  list-style-type: none;

}

ul>li {
  text-indent: -5px;
}

ul>li:before {
  content: "> ";
  text-indent: -5px;
  color: hsla(0, 100%, 50%, 1);
  font-weight: 100;
}

sup {
  color: hsla(0, 100%, 50%, 1);
  font-size: 12px;
  margin: 4px;
}

.nounderline {
  text-decoration: none !important;
  font-size: 21px;
}

/* Mobile Responsiveness - Tablets */
@media screen and (max-width: 768px) {
  .wrapper {
    margin-left: 0;
    margin-top: 0;
    padding: 1rem;
  }

  .maincard {
    width: 95vw !important;
    margin: 20px auto;
    padding: 1.5rem !important;
    box-shadow: 
      0px 0px 30px rgba(255, 23, 68, 0.4),
      0px 5px 20px rgba(0, 0, 0, 0.8);
  }

  .content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .bg {
    width: 100vw !important;
    height: 100vh !important;
    margin-left: -50vw;
    margin-top: -50vh;
    left: 50%;
    top: 50%;
  }

  .links {
    width: 100%;
    padding: 20px;
    gap: 1rem;
  }

  img {
    max-width: 100%;
    width: 300px;
    height: 400px;
    margin: 0 auto;
    display: block;
  }
}

/* Mobile Responsiveness - Phones */
@media screen and (max-width: 480px) {
  html {
    background-size: 
      100% 100%,
      100% 100%,
      100% 100%,
      150px 150px,
      200px 200px,
      180px 180px,
      250px 250px,
      220px 220px,
      100% 100%;
  }

  .wrapper {
    padding: 0.5rem;
  }

  .maincard {
    width: 98vw !important;
    margin: 10px auto;
    padding: 1rem !important;
    border-radius: 10px;
  }

  .content {
    gap: 1rem;
  }

  .links {
    padding: 15px;
    font-size: 18px;
    gap: 0.8rem;
    border-width: 1px;
  }

  img {
    width: 250px;
    height: 350px;
    border-width: 2px;
  }

  h1 {
    font-size: 1.8rem;
    margin: 0.5rem;
    text-align: center;
  }

  .bg {
    border-radius: 0;
  }

  /* Optimize star animations for mobile performance */
  html::before {
    background-size: 200px 200px, 250px 250px, 300px 300px, 350px 350px, 400px 400px;
    animation-duration: 20s;
  }
}

/* Small phones and landscape orientation */
@media screen and (max-width: 360px) {
  .maincard {
    width: 100vw !important;
    margin: 5px auto;
    padding: 0.8rem !important;
    border-radius: 5px;
  }

  .links {
    padding: 10px;
    font-size: 16px;
  }

  img {
    width: 200px;
    height: 280px;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Landscape phone orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .maincard {
    margin: 10px auto;
  }

  .content {
    flex-direction: row;
    gap: 1rem;
  }

  img {
    width: 200px;
    height: 300px;
  }

  .links {
    font-size: 16px;
    gap: 0.5rem;
  }

  .bg {
    height: 120vh;
  }
}

/* Red Galaxy Animation */
@keyframes galaxyShift {
  0% {
    background-position: 0% 0%, 100% 100%, 50% 50%, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0% 0%;
  }
  25% {
    background-position: 25% 25%, 75% 25%, 75% 25%, 50px 50px, 100px 100px, 75px 75px, 200px 200px, 175px 175px, 25% 25%;
  }
  50% {
    background-position: 50% 50%, 50% 75%, 25% 75%, 100px 100px, 200px 200px, 150px 150px, 400px 400px, 350px 350px, 50% 50%;
  }
  75% {
    background-position: 75% 75%, 25% 50%, 75% 25%, 150px 150px, 300px 300px, 225px 225px, 600px 600px, 525px 525px, 75% 75%;
  }
  100% {
    background-position: 100% 100%, 0% 0%, 50% 50%, 200px 200px, 400px 400px, 300px 300px, 800px 800px, 700px 700px, 100% 100%;
  }
}

/* Additional twinkling stars */
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 25px 25px, rgba(255, 23, 68, 0.9), transparent),
    radial-gradient(1px 1px at 75px 75px, rgba(220, 20, 60, 0.8), transparent),
    radial-gradient(2px 2px at 125px 125px, rgba(255, 107, 122, 0.7), transparent),
    radial-gradient(1px 1px at 175px 175px, rgba(255, 55, 66, 0.9), transparent),
    radial-gradient(2px 2px at 225px 225px, rgba(255, 23, 68, 0.6), transparent);
  background-size: 300px 300px, 400px 400px, 500px 500px, 600px 600px, 700px 700px;
  animation: twinkle 15s linear infinite;
  pointer-events: none;
  z-index: -10;
}

@keyframes twinkle {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
}

@keyframes pulseGalaxy {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Mobile-optimized animations */
@media (max-width: 768px) {
  @keyframes galaxyShift {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50% { background-position: 50% 50%, 50% 50%, 75% 25%; }
    100% { background-position: 100% 100%, 0% 0%, 50% 50%; }
  }

  @keyframes twinkle {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
  }

  @keyframes pulseGalaxy {
    0% { opacity: 0.6; }
    50% { opacity: 0.4; }
    100% { opacity: 0.6; }
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html,
  html::before,
  .bg {
    animation: none !important;
  }
}
