/* 🌗 THEME VARIABLES */
:root {
  --bg: #fafafa;
  --text: #111;
  --accent: #000;
  --header-bg: rgba(255, 255, 255, 0.9);
  --card-bg: #fff;
}

body.dark {
  --bg: #111;
  --text: #f2f2f2;
  --accent: #fff;
  --header-bg: rgba(17, 17, 17, 0.9);
  --card-bg: #1b1b1b;
}

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

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 1rem;
}

/* Logo */
header .logo img {
  height: 80px;
  width: auto;
}

/* Nav */
nav {
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}


/* Theme Toggle */
.theme-toggle {
  width: 50px;
  height: 26px;
  border-radius: 13px;
  background: #ccc;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
}

.theme-toggle::after {
  content: "☀"; /* sun symbol */
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff; /* keeps the small circle */
  text-align: center;
  line-height: 22px;
  font-size: 14px;
  transition: transform 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body.dark .theme-toggle::after {
  transform: translateX(24px);
  content: "☾"; /* moon symbol */
}

body.dark .theme-toggle {
  background: #666;
}


/* Main Content */
main {
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.page {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

/* Fade Animations */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.grid img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.grid img:hover {
  transform: scale(1.03);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg);
  color: var(--text);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  header {
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
  }

  .logo img {
    max-height: 50px;
    width: auto;
    height: auto;
  }

  nav {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
  }

  nav a {
    font-size: 0.9rem;
  }

  .theme-toggle {
    flex: 0 0 auto;
    margin-left: 0.5rem;
  }
}
