/* style.css */

:root {
  --bg: #f0f0f0;
  --text: #333;
  --card: #fbfbfb;
  --accent: #0077b5;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  background: var(--card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 100;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  padding: 1rem 2rem;
  margin: auto;
  position: relative;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem 1rem;
}

.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(to right, #9cf3ff, #f9ffb4);
  border-radius: 8px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.hero p {
  font-size: 1.2rem;
  color: #333;
}

.projects h2,
.about h2,
.contact h2 {
  text-align: center;
  margin-top: 3rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.project-tile {
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-container {
  height: 140px;
  overflow: hidden;
  position: relative;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  transition: opacity 0.3s ease;
}

.thumbnail {
  opacity: 1;
}

.hover-gif {
  opacity: 0;
}

.project-tile:hover .thumbnail {
  opacity: 0;
}

.project-tile:hover .hover-gif {
  opacity: 1;
}

.project-tile h3 {
  text-align: center;
  padding: 0.75rem;
  font-size: 1rem;
}

.about p,
.contact p {
  text-align: center;
  max-width: 640px;
  margin: 0.5rem auto;
  line-height: 1.6;
  color: var(--text);
}

.contact a {
  display: block;
  text-align: center;
  margin: 0.5rem auto;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.contact-icons i {
  font-size: 2.2rem;
  transition: opacity 0.2s;
  color: var(--text);
}

.contact-icons i:hover {
  opacity: 0.7;
}

.site-footer {
  text-align: center;
  background: var(--card);
  padding: 1.rem;
  font-size: 0.9rem;
  color: #777;
  border-top: 1px solid #ddd;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 960px;
  margin: auto;
  padding: 0.5rem 1rem;
  gap: 1rem;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  margin-left: 1rem;
}

#theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 1s;
}

#theme-toggle.dark svg {
  transform: rotate(720deg);
}

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .nav-logo {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-start;
  }

  #theme-toggle {
    position: absolute;
    right: 1rem;
    top: 1rem;
    transform: none;
    margin: 0;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-icons {
    flex-wrap: wrap;
    gap: 1rem;
  }
    .hover-gif.mobile-visible {
    opacity: 1 !important;
  }

  .thumbnail {
    opacity: 0 !important;
  }
}
