/* Base Styles */
:root {
  /* Light Mode Colors */
  --primary-color: #35404a;
  --secondary-color: #ffffff;
  --accent-color: #ffffff;
  --text-color: #2d334a;
  --background-color: #f7f9fc;
  --card-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Sizes and Spacing */
  --border-radius: 20px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 48px;
}

.dark-mode {
  --primary-color: #ffffff;
  --secondary-color: #35404a;
  --accent-color: #35404a;
  --text-color: #e4e6f1;
  --background-color: #1a1c2a;
  --card-color: #2d334a;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  width: 100%;
}

@font-face {
  font-family: "MyFont";
  src: url("fonts/NewYork PERSONAL USE.otf") format("woff");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "MyFont", sans-serif;
  color: var(--text-color);
  background-color: #707070;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

h1,
h2,
h3 {
  font-family: "MyFont", sans-serif;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* Background Styles */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background-option {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.background-option.active {
  opacity: 1;
}

.bg-option-1 {
  background-image: url("img/arkaplan.jpeg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-option-2 {
  background-image: url("assets/bg-2.png");
}

.bg-option-3 {
  background-image: url("assets/bg-3.png");
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.logo img {
  position: fixed;
  top: -80px;
  left: -15px;
  height: 250px;
  z-index: 999;
}

.header-controls {
  display: flex;
  gap: var(--spacing-md);
}

.control-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 55px;
  height: 75px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: transform 0.3s ease;
}

.control-btn:hover {
  transform: translateY(-3px);
}

.grid-icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 35px;
  height: 35px;
}

.grid-dot {
  width: 4px;
  height: 4px;
  background-color: var(--text-color);
  border-radius: 50%;
}

#theme-toggle svg {
  width: 27px;
  height: 27px;
}

/* Navigation Styles */
#main-nav {
  position: fixed;
  top: 80px;
  right: var(--spacing-lg);
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 99;
}

#main-nav.visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#main-nav.hidden {
  pointer-events: none;
}

#main-nav ul {
  list-style: none;
}

#main-nav li {
  margin-bottom: var(--spacing-md);
}

#main-nav a {
  font-family: "MyFont", sans-serif;
  font-size: 1.5rem;
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  color: white;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-mode #main-nav a {
  color: var(--primary-color);
}

body.dark-mode #main-nav a {
  color: white;
}

#main-nav a:hover {
  background-color: var(--accent-color);
  color: var(--text-color);
}

/* Section Styles */
.section {
  height: 100vh;
  padding: var(--spacing-xl) var(--spacing-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
  text-align: center;
  color: var(--primary-color);
  text-shadow: 3px 3px 0 var(--accent-color);
}

/* Home Section */
.home-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: relative;
  gap: var(--spacing-xl);
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

.intro-text {
  flex: 1;
  padding-right: var(--spacing-xl);
  z-index: 2;
  text-align: center;
  align-self: center;
  max-width: 600px;
}

.big-text {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin-bottom: var(--spacing-md);
  color: transparent;
  -webkit-text-stroke: 2px var(--primary-color);
  font-weight: bold;
}

.sub-text {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.direction-arrows {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
  opacity: 1;
  flex-wrap: wrap;
}

.arrow-link {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "MyFont", sans-serif;
  font-size: 1.5rem;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius);
  white-space: nowrap;
}

.arrow-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--shadow-color);
}

.arrow {
  font-size: 1.5rem;
  margin: 0 var(--spacing-sm);
}

.character-container {
  position: absolute;
  right: -10%;
  top: 55%;
  transform: translateY(-50%);
  z-index: 1;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character {
  width: 950px;
  height: 1000px;
  animation: slideUp 1s ease forwards, float 2s ease-in-out infinite;
  max-width: 100%;
  max-height: 100vh;
}

.character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 100vh;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: var(--spacing-md);
  z-index: 10;
}

footer p {
  color: var(--text-color);
  font-size: 0.9rem;
}

/* Animations */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100vh);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Page Transitions */
body {
  animation: fadeIn 0.5s ease forwards;
}

.typewrite {
  border-right: 2px solid var(--primary-color);
  font-family: inherit;
  font-size: inherit;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* Enhanced Responsive Styles */
/* Large Desktop */
@media (min-width: 1601px) {
  .character {
    width: 950px;
    height: 1000px;
  }

}

/* Desktop */
@media (max-width: 1600px) {
  .character {
    width: 800px;
    height: 850px;
  }

  .character-container {
    right: -5%;
  }

}

/* Small Desktop / Large Tablet */
@media (max-width: 1200px) {
  .character {
    width: 650px;
    height: 700px;
  }

  .character-container {
    right: 0;
  }

  .intro-text {
    padding-right: var(--spacing-md);
  }

}

/* Tablet */
@media (max-width: 992px) {
  .home-content {
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding-top: 60px;
  }

  .intro-text {
    padding-right: 0;
    text-align: center;
    order: 2;
  }

  .character-container {
    position: relative;
    right: 0;
    top: 0;
    transform: none;
    order: 1;
    margin-top: 60px;
  }

  .character {
    width: 450px;
    height: 450px;
    animation: float 2s ease-in-out infinite;
  }

  .logo img {
    height: 180px;
    top: -50px;
  }

  .direction-arrows {
    gap: var(--spacing-lg);
  }
}

/* Large Mobile */
@media (max-width: 768px) {
  .section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .direction-arrows {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
  }

  .character {
    width: 350px;
    height: 350px;
  }

  .logo img {
    height: 150px;
    top: -40px;
    left: -10px;
  }

  #main-nav {
    width: 80%;
    right: 10%;
    text-align: center;
  }

  .control-btn {
    width: 45px;
    height: 45px;
  }

  #theme-toggle svg {
    width: 22px;
    height: 22px;
  }

  .grid-icon {
    width: 25px;
    height: 25px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {

  .character {
    width: 280px;
    height: 280px;
  }

  .logo img {
    height: 120px;
    top: -30px;
    left: -5px;
  }

  .arrow-link {
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  footer p {
    font-size: 0.8rem;
  }

  .control-btn {
    width: 40px;
    height: 40px;
  }
}

/* Very Small Mobile / Landscape Mode */
@media (max-width: 380px) or (max-height: 500px) {

  .character {
    width: 220px;
    height: 220px;
  }

  .logo img {
    height: 100px;
    top: -25px;
  }

  .home-content {
    gap: 10px;
  }

  .direction-arrows {
    margin-top: var(--spacing-md);
  }

  .arrow-link {
    padding: 6px 12px;
  }
}

/* Handle Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .home-content {
    flex-direction: row;
    align-items: center;
    padding-top: 70px;
  }

  .character-container {
    order: 2;
    margin-top: 0;
  }

  .intro-text {
    order: 1;
  }

  .character {
    width: 200px;
    height: 200px;
  }

  .logo img {
    height: 90px;
    top: -20px;
  }

  .direction-arrows {
    margin-top: 10px;
    flex-direction: row;
  }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
  .section,
  .home-content {
    height: -webkit-fill-available;
  }
}
