/* Variables */
:root {
  --primary: #2a2a2a;
  --secondary: #f8f8f8;
  --accent: #ec407a;
  --text: #333333;
  --light-text: #777777;
  --card-bg: #ffffff;
  --section-bg: #f8f8f8;
  --nav-bg: rgba(248, 248, 248, 0.95);
  --footer-bg: #2a2a2a;
  --footer-text: #ffffff;
  --footer-light-text: rgba(255, 255, 255, 0.7);
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

.dark-mode {
  --primary: #f8f8f8;
  --secondary: #121212;
  --accent: #9575cd;
  --accent_pjt: #3a8de0;
  --text: #e0e0e0;
  --light-text: #a0a0a0;
  --card-bg: #1e1e1e;
  --section-bg: #121212;
  --nav-bg: rgba(18, 18, 18, 0.95);
  --footer-bg: #0a0a0a;
  --footer-text: #ffffff;
  --footer-light-text: rgba(255, 255, 255, 0.5);
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background-color: var(--section-bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary);
}

h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.5rem;
  position: relative;
  display: inline-block;
  margin-bottom: 2.5rem;
}

h2:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--accent);
  transition: var(--transition);
}

p {
  margin-bottom: 1.5rem;
  color: var(--light-text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

/* Layout */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 5rem 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  background-color: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

nav.scrolled {
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2rem;
}

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

.nav-links a:after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.nav-links a:hover:after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: 2rem;
  transition: var(--transition);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

/* Hero */
.hero {
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards 0.5s;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards 0.8s;
}

.hero-cta {
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards 1.1s;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--accent);
  color: white;
  border-radius: 50px;
  font-weight: 500;
  transition: var(--transition);
  border: 2px solid var(--accent);
}

.btn:hover {
  background-color: transparent;
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 102, 204, 0.2);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  margin-left: 1rem;
}

.btn-outline:hover {
  background-color: var(--accent);
  color: white;
}

/* About */
.about {
  background-color: var(--section-bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-content h2 {
  margin-bottom: 1.5rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background-color: var(--card-bg);
  border-radius: 50px;
  margin-right: 0.8rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--light-text);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

/* Project */
.projects {
  background-color: var(--section-bg);
}

.projects-grid {
  display: flex;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-img {
  height: 200px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-text);
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.project-tech {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-links {
  display: flex;
  margin-top: 1.5rem;
}

.project-links a {
  color: var(--accent_pjt);
  margin-right: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.project-links i {
  margin-right: 0.5rem;
}

/* Project Detail View */
.project-detail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.project-detail.active {
  opacity: 1;
  visibility: visible;
}

.detail-content {
  background-color: var(--card-bg);
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: 10px;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  transform: scale(0.9);
  transition: var(--transition);
}

.project-detail.active .detail-content {
  transform: scale(1);
}

.close-detail {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.close-detail:hover {
  color: var(--accent);
}

.detail-header {
  margin-bottom: 2rem;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  height: 150px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Contact */
.contact {
  background-color: var(--section-bg);
  text-align: center;
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  margin: 0 1.5rem;
  padding: 1rem;
  border-radius: 10px;
  transition: var(--transition);
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
}

.contact-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-link i {
  font-size: 1.5rem;
  margin-right: 0.8rem;
  color: var(--accent);
}

/* Foota */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0;
  text-align: center;
  transition: var(--transition);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--footer-text);
}

.footer-links {
  color: var(--accent_pjt);
  display: flex;
  list-style: none;
  margin-bottom: 2rem;
}

.footer-links li {
  margin: 0 1rem;
}

.footer-links a {
  color: var(--footer-light-text);
}

.footer-links a:hover {
  color: var(--footer-text);
}

.copyright {
  color: var(--accent_pjt);
  font-size: 0.9rem;
}

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

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 4rem 0;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--nav-bg);
    padding: 1rem 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    margin: 0;
    text-align: center;
    padding: 1rem 0;
  }

  .hero-cta {
    display: flex;
    flex-direction: column;
  }

  .btn {
    margin-bottom: 1rem;
  }

  .btn-outline {
    margin-left: 0;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-link {
    margin: 0.5rem 0;
    width: 100%;
    max-width: 250px;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

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

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.lightbox-close:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .nav-right {
    gap: 1rem;
  }

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

@media (max-width: 480px) {
  p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  p {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .hero-cta .btn {
    width: 100%;
    max-width: 250px;
    margin: 0.5rem auto;
  }
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.project-card {
  flex: 1 1 300px;
  max-width: 100%;
}

@media (max-width: 600px) {
  .detail-content {
    width: 95%;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .footer-links {
    flex-direction: column;
    align-items: center;
  }

  .footer-links li {
    margin: 0.5rem 0;
  }
}
