/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: Inter, Arial, sans-serif; }
html { scroll-behavior: smooth; }

/* Theme variables */
:root {
  --color-bg: #fafafa;
  --color-text: #0F172A;
  --color-muted: #6B7280;
  --color-accent: #7C4DFF;
  --color-primary: #7C4DFF;
  --matrix-bg-light: rgba(248, 250, 252, 0.05); /* light mode fade */
  --matrix-bg-dark: rgba(0, 0, 0, 0.05);       /* dark mode fade */
  --matrix-color: #7C4DFF;                     /* binary color */
}
body.dark {
  --color-bg: #071020;
  --color-text: #E6EEF8;
  --color-muted: #94A3B8;
  --matrix-bg: var(--matrix-bg-dark);  /* dark mode */
  --matrix-color: rgba(124,77,255,0.95); /* brighter purple */;
}
body:not(.dark) {
  --matrix-bg: var(--matrix-bg-light);
}

/* Background */
.background-layer {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: -3; 
}

/* Matrix */
#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2; 
  pointer-events: none;
}

/* Overlay for spotlight effect */
#matrix-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: var(--color-bg);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}
/* Dark mode → reveal spotlight */
body.dark #matrix-overlay {
  mask-image: radial-gradient(circle 150px at center, transparent 60%, black 100%);
  -webkit-mask-image: radial-gradient(circle 150px at center, transparent 60%, black 100%);
}
/* Light mode → hide spotlight */
body:not(.dark) #matrix-overlay {
  mask-image: radial-gradient(circle 150px at center, black 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle 150px at center, black 60%, transparent 100%);
}


/* Content */
.site-layer {
  position: relative;
  z-index: 2;
  color: var(--color-text);
  min-height: 100%;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
  transition: background 0.6s ease, backdrop-filter 0.6s ease; 
}
.site-header.transparent {
  background: transparent;
}
.site-header.scrolled {
  background: rgba(7, 16, 32, 0.7); 
  backdrop-filter: blur(6px);
}
body:not(.dark) .site-header.scrolled {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 10px rgba(124, 77, 255, 0.3); 
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--color-text);
}
/* Nav links hover */
.nav-links a {
  position: relative;
  margin: 0 1rem;
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px; 
  width: 0;
  height: 2px; 
  background: var(--color-accent);
  transition: width 0.2s ease; 
}
.nav-links a:hover::after {
  width: 100%;
}
/* Hamburger hidden on desktop */
.hamburger {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}
/* Mobile menu styles */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    right: 1rem;
    background: var(--color-bg);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 2rem;
    gap: 1rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    z-index: 1000;
  }
  .nav-links.open {
    display: flex;
  }
}
#themeToggle {
  background: none;
  border: 2px solid var(--color-text);
  color: var(--color-text);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
#themeToggle:hover { opacity: 0.8; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 70px; 
  overflow: hidden;
  z-index: 1; 
  /*background: url("img/header_bg.jpg") center/cover no-repeat;*/
}
.hero-content {
  position: relative;
  z-index: 1; 
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
}
.hero p {
  margin-top: 1rem;
  color: var(--color-muted);
}

/* Buttons */
.buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}
.btn.primary {
  background: var(--color-primary);
  color: #fff;
}
.btn.secondary {
  border: 2px solid var(--color-primary);
  color: var(--color-text);
}
.btn:hover {
  opacity: 1;
  transform: translateY(-4px);
  box-shadow: 0 0 15px var(--color-primary);
}

/* About Section */
.about-section {
  padding: 6rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.about-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.1); /* Glass effect */
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}
body.dark .about-container {
  background: rgba(7, 16, 32, 0.3);
  box-shadow: 0 8px 30px rgba(124,77,255,0.2);
}
.about-image, .about-content {
  flex: 1;
  min-width: 280px;
  padding: 2rem;
}
.about-image {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}
.about-image img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  object-fit: cover;
}
.about-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}
.about-content p {
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
/* Lazy scroll animation */
.about-container.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Responsive */
@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
  }
  .about-image img {
    width: 180px;
    height: 180px;
  }
}
/* About Section Buttons */
.about-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-start; 
}
.about-buttons .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.about-buttons .btn.primary {
  background: var(--color-primary);
  color: #fff;
}
.about-buttons .btn.primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px var(--color-primary);
}
/* Thumbs Sticker */
.thumb-sticker {
  position: absolute;
  font-size: 2rem;
  pointer-events: none;
  animation: thumbs-pop 0.9s ease forwards;
  z-index: 9999;
}
.thumb-label {
  display: block;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 2px;
  color: #fff;
}
/* Glitch Stamp */
.glitch-stamp {
  position: absolute;
  font-weight: bold;
  font-size: 1.5rem;
  color: #7C4DFF;
  pointer-events: none;
  animation: glitch-effect 0.6s linear forwards;
  z-index: 9999;
}
/* Animations */
@keyframes thumbs-pop {
  0%   { transform: scale(0.5) translateY(0); opacity: 0; }
  50%  { transform: scale(1.2) translateY(-10px); opacity: 1; }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}
@keyframes glitch-effect {
  0% {
    transform: translate(0,0) skew(0deg,0deg);
    opacity: 1;
    text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9;
  }
  10% { transform: translate(-2px, -2px) skew(-2deg, 2deg); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  20% { transform: translate(2px, 1px) skew(2deg, -1deg); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  30% { transform: translate(-1px, 2px) skew(-1deg, 1deg); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  40% { transform: translate(1px, -1px) skew(1deg, -1deg); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  50% { transform: translate(0,0) skew(0deg,0deg); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  60% { transform: translate(-1px, 1px) skew(-1deg, 1deg); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  70% { transform: translate(1px, -2px) skew(1deg, -2deg); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  80% { transform: translate(-2px, 2px) skew(-2deg, 2deg); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  90% { transform: translate(2px, -1px) skew(2deg, -1deg); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  100% { transform: translate(0,0) skew(0deg,0deg); opacity: 0; text-shadow: none; }
}

/* Sections */
section { padding: 4rem 2rem; }
section h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

/* Projects Section */
.projects-section {
  padding: 6rem 2rem;
  background: transparent;
}
.project-card {
  --team-color: var(--color-accent); 
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto;
  padding: 2.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease, transform 1s ease, background 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer; 
  overflow: hidden;
  border: 1px solid transparent;
}
.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.project-card:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px var(--team-color);
  border: 1px solid var(--team-color);
}
body.dark .project-card:hover {
  background: color-mix(in srgb, var(--team-color) 20%, transparent);
  box-shadow: 0 12px 30px var(--team-color);
}
.project-card.left {
  flex-direction: row;
  transform: translateX(-30px);
}
.project-card.right {
  flex-direction: row-reverse;
  transform: translateX(30px); 
}
.project-image {
  width: 130px;
  height: 130px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--team-color);
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}
.project-card:hover .project-image {
  transform: scale(1.07);
}
.project-content {
  text-align: left;
}
.project-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}
.project-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.project-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-muted);
}
/* Responsive */
@media (max-width: 992px) {
  .project-card {
    max-width: 90%;
    flex-direction: column !important; 
    padding: 2rem;
    gap: 1.5rem;
    text-align: center;
    transform: none; 
    align-items: center; 
  }
  .project-image {
    width: 150px; 
    height: 150px;
    margin-bottom: 1rem;
  }
  .project-content {
    text-align: center;  
    width: 100%;          
  }
  .project-description {
    text-align: justify;  
  }
}
.project-card[data-team="red"]    { 
  --team-color: rgba(255, 0, 0, 0.7);
 }
.project-card[data-team="blue"]   { 
  --team-color: rgba(0, 153, 255, 0.7); 
}
.project-card[data-team="purple"] { 
  --team-color: rgba(155, 89, 182, 0.7);
}

/* Certifications Section */
.cert-simple {
  padding: 4rem 2rem;
  text-align: center;
}
.cert-simple__title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--color-text);
}
.cert-simple__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.cert-simple__card {
  background: rgba(255, 255, 255, 0.08); /* semi-transparent glass */
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1rem;
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
}
body.dark .cert-simple__card {
  background: rgba(7,16,32,0.3);
  border: 1px solid rgba(124,77,255,0.2);
}
.cert-simple__card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.8rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: contain;
}
.cert-simple__card:hover img {
  transform: scale(1.05);
}
.cert-simple__card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}
/* Glow border */
.cert-simple__card:hover {
  box-shadow: 0 0 20px var(--color-accent);
  border: 1px solid var(--color-accent);
}
/* Modal */
.cert-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cert-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.cert-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  z-index: 10;
}
.cert-modal-content img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: 16px;
  display: block;
}
.cert-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  font-size: 2rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 20;
}

/* Contact Section */
.contact-section {
  padding: 100px 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent; /* no main glass */
  max-width: 1200px;
  margin: 0 auto;
  width: 90%;
}
/* Section Title */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
  color: var(--color-text);
}
/* Cards container */
.contact-items {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 2rem;
}
/* Individual Card */
.contact-item {
  width: 80%;
  max-width: 350px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0px 0px 30px 0 rgba(124, 77, 255, 0.3);
  color: var(--color-text);
  cursor: pointer;
  transition: opacity 0.6s ease, transform 0.6s ease; 
  opacity: 0;
  transform: translateY(50px);
}
/* Lazy reveal visible */
.contact-item.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Hover effect: highlight with border & lift */
.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0px 0px 40px 0 rgba(124, 77, 255, 0.45);
  border: 1px solid rgba(124, 77, 255, 0.6);
}
/* Icon */
.contact-item .icon {
  width: 70px;
  margin-bottom: 15px;
}
.contact-item .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Info Text */
.contact-item .contact-info h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--color-text);
}
.contact-item .contact-info p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-muted);
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Glitch animation */
@keyframes glitch-copy {
  0% { transform: translate(0,0); opacity: 1; text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  20% { transform: translate(-1px,1px); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  40% { transform: translate(1px,-1px); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  60% { transform: translate(-1px,1px); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
  80% { transform: translate(1px,-1px); text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; }
  100% { transform: translate(0,0); opacity: 1; text-shadow: none; }
}
/* Dark Mode */
body.dark .contact-item {
  background: rgba(7,16,32,0.4);
  box-shadow: 0 0 30px 0 rgba(124,77,255,0.2);
}
body.dark .contact-item:hover {
  box-shadow: 0px 0px 40px 0 rgba(124,77,255,0.45);
  border: 1px solid rgba(124,77,255,0.6);
}
/* Responsive */
@media (max-width: 992px) {
  .contact-item {
    width: 80%;
    padding: 20px;
  }
}
@media (max-width: 768px) {
  .contact-items {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .contact-item {
    width: 90%;
  }
}

/* Footer */
.footer-section {
  background: rgba(7, 16, 32, 0.6);
  backdrop-filter: blur(6px);
  padding: 60px 2rem 30px 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.footer-section .footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  width: 90%;
}
/* Light mode footer */
#footer {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
}
/* Dark mode footer */
body.dark #footer {
  background: rgba(7, 16, 32, 0);  
  backdrop-filter: blur(5px);
}
/* Brand */
.footer-section .brand h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}
/* Subtitle */
.footer-section h2 {
  color: var(--color-text);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.05rem;
  margin-bottom: 20px;
}
/* Social Icons */
.footer-section .social-icons {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}
.footer-section .social-item {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.footer-section .social-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: 0.3s ease filter;
}
.footer-section .social-item:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--color-accent);
}
.footer-section .social-item:hover img {
  filter: grayscale(0);
}
/* Footer Text */
.footer-section p {
  color: var(--color-muted);
  font-size: 1.2rem;
  text-align: center;
  max-width: 600px;
}
/* Responsive */
@media (max-width: 768px) {
  .footer-section h2 {
    font-size: 1.4rem;
  }
  .footer-section .social-icons {
    gap: 10px;
  }
  .footer-section .social-item {
    width: 45px;
    height: 45px;
  }
  .footer-section p {
    font-size: 1rem;
  }
}
