/* =======================
   Fonts
======================= */

@font-face {
  font-family: 'Whitebeard';
  src: url('personal-website-v3-assets/fonts/revisi-Regular.otf') format('opentype');
}

@font-face {
  font-family: 'CLAYO';
  src: url('personal-website-v3-assets/fonts/CLAYO.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* =======================
   Reset & Global Styles
======================= */

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


body {
  background-color: #ecede8;
  font-family: 'CLAYO', sans-serif;
  color: #A29B90;
  background-image: url('personal-website-v3-assets/images/bg_light.svg');
  background-repeat: repeat;
  background-size: 30%;
  animation: moveBackgroundVertical 60s linear infinite;

  /* Smooth transition for background and colors */
  transition: background-color 0.6s ease, color 0.6s ease, background-image 0.6s ease;
}

body.dark {
  background-color: #181f25;
  color: #ecede8;
  background-image: url('personal-website-v3-assets/images/bg_dark.svg');
}

/* Combine shared transition properties */
body, .wrapper, .link-stack a, footer {
  transition: background-color 0.6s ease, color 0.6s ease;
}

/* Combine dark mode styles for body and wrapper */
body.dark, body.dark .wrapper {
  background-color: #181f25;
  color: #ecede8;
}

/* =======================
   Keyframes
======================= */

@keyframes moveBackgroundVertical {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 1000px;
  }
}

/* =======================
   Layout Containers
======================= */

.wrapper {
  margin: 0 auto;
  min-height: 100vh;
  width: clamp(400px, 70vw, 1000px);
  padding: 1.5rem;
  background-color: rgba(236, 237, 232, 0.75);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  color: #000;
}

body.dark .wrapper {
  background-color: rgba(24, 31, 37, 0.85);
  color: #ecede8;
}

/* =======================
   Images
======================= */

img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.error-gif {
  max-height: 40vh;
  margin: 0 auto 3vw;
}

.portrait-pic {
  width: clamp(150px, 50vw, 300px);
  aspect-ratio: 1 / 1;
  margin: 1vw auto 2vw;
  object-fit: cover;
  object-position: top left;
  border-radius: 50%;
}

.word-mark {
  width: clamp(300px, 50vw, 390px);
}

/* =======================
   Typography
======================= */
.error-code {
  font-size: clamp(6rem, 10vw, 12rem);
  text-align: center;
  margin: 0 auto;
  font-family: 'Whitebeard', serif;
  color: inherit;
}

h3 {
  margin: 1.5vw auto;
  text-align: center;
  width: clamp(300px, 50vw, 390px);
  font: 100 clamp(1vw, 6vw, 2vw);
}

/* =======================
   Link Buttons
======================= */

/* Container for vertically stacked links */
.link-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  text-align: center;
  margin: 4vw auto 10vw;
}

.link-stack a {
  display: block;
  width: clamp(200px, 65vw, 500px);
  padding: 0.75rem 1.5rem;
  background-color: #6451b8;
  color: #ecede8;
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-family: 'Whitebeard';
  text-align: center;
  text-decoration: none;
  border-radius: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border: 2px solid transparent;
}

.link-stack a:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  border-color: #4B3b91;
  transition: transform 0.6s ease, box-shadow 0.6s ease, background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease;
  background-color: transparent;
  color: #4B3b91;
}

body.dark .link-stack a:hover {
  border-color: #ecede8;
  color: #ecede8;
}

/* =======================
   Footer
======================= */

footer {
  color: #181f25; /* Regular footer font color (very dark color) */
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem 0;
}

body.dark footer {
  color: #ecede8; /* Dark mode footer font color */
}

/* =======================
   Dark Mode Toggle Switch
======================= */


.toggle-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  justify-content: center;
  z-index: 9999; /* ensures it stays above everything else */
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #6451B8; /* Light mode color */
  transition: 0.4s;
  border-radius: 32px;
  border: 2px solid #ecede8;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  top: 2px;
  background-color: #ecede8;
  transition: 0.4s;
  border-radius: 50%;
}

/* Dark mode slider color */
body.dark .slider {
  background-color: #4B3b91; /* Dark mode color */
}

/* Toggle on state */
input:checked + .slider {
  background-color: #4B3b91; /* Dark mode active toggle */
}

input:checked + .slider:before {
  transform: translateX(28px);
}

/* =======================
   Animations
======================= */

.portrait-pic, .word-mark, h1, h3, .link-stack {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease; /* Slower animation */
}

.portrait-pic.loaded, .word-mark.loaded, h1, h3.loaded, .link-stack.loaded {
    opacity: 1;
    transform: translateY(0);
}