:root {
  --bg-color: #111;
  --text-color: #fff;
  --accent-color: #00aaff;
  --card-bg: #1a1a1a;
  --sec-color: #333;
  --sec-transp-color: rgba(51, 51, 51, 0.8);
  --font: 'Helvetica Neue', sans-serif;
}

body.light {
  --bg-color: #fff;
  --text-color: #111;
  --accent-color: #007aff;
  --card-bg: #f5f5f5;
  --sec-color: #eee;
  --sec-transp-color: rgba(238, 238, 238, 0.8);
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background 0.4s ease, color 0.4s ease;
}

body {
  font-family: var(--font);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#content {
  position: relative;
  z-index: 1;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  z-index: 999;
  border-bottom: 1px solid var(--accent-color);
}

.navbar .logo {
  font-size: 1.4rem;
  color: var(--accent-color);
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    right: 25px;
    background: var(--bg-color);
    flex-direction: column;
    padding: 10px 15px;
    border-radius: 8px;
    display: none;
  }

  .nav-links.show {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
  }

  .menu-toggle {
    display: block;
  }
}

header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding: 100px 20px 20px;
  animation: fadeIn 1.2s ease;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.2rem;
  color: var(--text-color);
}

.btn {
  margin-top: 20px;
  padding: 10px 20px;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn:hover {
  background: var(--accent-color);
  color: #fff;
}

section {
  padding: 80px 20px;
  max-width: 900px;
  margin: auto;
  animation: fadeInUp 1s ease;
  scroll-margin-top: 80px;
}

.social-bar {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 1.5rem;
}

.social-bar a {
  color: var(--accent-color);
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-bar a:hover {
  color: var(--text-color);
  transform: scale(1.2);
}

#about {
  text-align: justify;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  display: block;
  height: auto;
}

.project-card .project-content {
  padding: 20px;
}

.flat-href-btn {
  background: var(--sec-color);
  border: 1px solid var(--sec-color);
  border-radius: 5px;
  color: var(--text-color);
  font-weight: bold;
  cursor: pointer;
  padding: 1px 3px;
  transition: color 0.3s ease;
}

.flat-href-btn:hover {
  color: var(--accent-color);
}

.flat-contact-btn {
  background: var(--sec-transp-color);
  border: 1px solid var(--sec-transp-color);
  border-radius: 50px 5px;
  padding: 5px 10px;
}

footer {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
  font-size: 0.9rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 12px 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s ease, visibility 0.4s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  transform: scale(1.1);
  background-color: var(--text-color);
  color: var(--accent-color);
}

.privacy-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  color: var(--text-color);
  border-top: 1px solid var(--accent-color);
  padding: 12px 16px;
  z-index: 9999;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.4);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.privacy-content {
  flex: 1 1 250px;
  text-align: left;
  line-height: 1.5;
}

.privacy-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.privacy-popup.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.privacy-popup .btn {
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 0.85rem;
  margin-top: 0;
  background: transparent;
  color: var(--accent-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.privacy-popup .btn:hover {
  background: var(--accent-color);
  color: #fff;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--accent-color);
}

@media (max-width: 400px) {
  .privacy-popup {
    font-size: 0.75rem;
    padding: 10px 12px;
  }

  .privacy-popup .btn {
    font-size: 0.75rem;
  }
}
