/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: rgba(0,0,0,0.6);
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== Loader ========== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #38CDD6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Site Wrapper ========== */
.site-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  
  background-size: cover;
}

/* ========== Background ========== */
.site-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 0;
  pointer-events: none;
}

/* ========== Sections ========== */
.section {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 1;
  overflow-y: auto;
  padding: 2rem;
}

.section.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.section-inner {
  max-width: 52rem;
  width: 100%;
  padding: 4rem;
  padding-bottom: 6rem;
  position: relative;
  margin: auto 0;
}

/* ========== Typography ========== */
.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.section-text {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

/* ========== Divider ========== */
.divider {
  width: 3rem;
  height: 3px;
  background: #38CDD6;
  margin-bottom: 2rem;
  border-radius: 2px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  border: none;
}

.btn:hover {
  transform: scale(1.025);
}

.btn-primary {
  background: #fff;
  color: #000;
}

.btn-primary:hover {
  background: #e0e0e0;
}

.btn-secondary {
  background: #424652;
  color: #fff;
}

.btn-secondary:hover {
  background: #52566a;
}

.btn-arrow {
  width: 1rem;
  height: 1rem;
}

.hero-buttons,
.about-buttons,
.project-buttons,
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ========== Back Button ========== */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-bottom: 2rem;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.btn-back svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ========== Social Icons ========== */
.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
}

.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.095);
}

.icon-link svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* ========== Education Cards ========== */
.edu-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: background 0.2s ease;
}

.edu-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.edu-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.edu-institution {
  font-size: 0.95rem;
  font-weight: 500;
  color: #38CDD6;
  margin-bottom: 0.75rem;
}

.edu-details {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
}

/* ========== Project Cards ========== */
.project-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: background 0.2s ease;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(56, 205, 214, 0.15);
  color: #38CDD6;
  border: 1px solid rgba(56, 205, 214, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
}

.project-category {
  font-size: 0.85rem;
  font-weight: 500;
  color: #38CDD6;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ========== Animations ========== */
.anim-fade-left,
.anim-fade-right,
.anim-fade-up {
  opacity: 0;
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.anim-fade-left {
  transform: translateX(-30px);
}

.anim-fade-right {
  transform: translateX(30px);
}

.anim-fade-up {
  transform: translateY(20px);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.225s; }
.stagger-3 { transition-delay: 0.35s; }
.stagger-4 { transition-delay: 0.475s; }
.stagger-5 { transition-delay: 0.6s; }

/* Active section triggers animations */
.section.active .anim-fade-left,
.section.active .anim-fade-right,
.section.active .anim-fade-up {
  opacity: 1;
  transform: translate(0, 0);
}

/* Reset animations when section is not active */
.section:not(.active) .anim-fade-left { transform: translateX(-30px); opacity: 0; }
.section:not(.active) .anim-fade-right { transform: translateX(30px); opacity: 0; }
.section:not(.active) .anim-fade-up { transform: translateY(20px); opacity: 0; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .section-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .section-inner {
    padding: 2.5rem 1.5rem;
    padding-bottom: max(8rem, calc(env(safe-area-inset-bottom) + 7rem));
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .hero-subtitle,
  .section-text {
    font-size: 0.95rem;
  }

  .hero-buttons,
  .about-buttons,
  .project-buttons,
  .contact-buttons {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

  .social-icons {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-inner {
    padding: 2rem 1rem;
    padding-bottom: max(8rem, calc(env(safe-area-inset-bottom) + 7rem));
  }

  .icon-link {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* ========== Scrollbar ========== */
.section::-webkit-scrollbar {
  width: 6px;
}

.section::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.6);
}

.section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #38CDD6;
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Selection ========== */
::selection {
  background: rgba(56, 205, 214, 0.3);
  color: #fff;
}
