/* ==========================================================================
   Main CSS - Core Layout, Typography, and Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

ul {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

h1 {
  font-size: var(--hero-heading-size);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--section-heading-size);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 65ch;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 900px;
}

section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-header {
  margin-bottom: 4rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: all 0.3s ease;
}

.nav.scrolled {
  background-color: var(--bg-primary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-color);
  padding: 1rem 0;
}

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

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

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

/* Mobile Navigation */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 6rem;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
}

.hero-name {
  margin-bottom: 1rem;
  overflow: hidden;
}

.hero-name span {
  display: inline-block;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 2rem;
}

.hero-description {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: 3rem;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Status Badge */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.hero-status.hidden {
  display: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

/* Typewriter cursor */
.typewriter-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Scramble effect character */
.scramble-char {
  color: var(--accent);
}

.hero-social {
  display: flex;
  gap: 1.5rem;
  margin-top: 4rem;
}

.hero-social a {
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.hero-social a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-indicator::after {
  content: '';
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; height: 60px; }
  50% { opacity: 1; height: 80px; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--animation-timing);
  border: none;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

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

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

.about-image-wrapper {
  position: relative;
}

.about-image {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.about-image img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(20%) brightness(1.08) contrast(1.05);
  transition: all 0.5s ease;
}

.about-image:hover img {
  filter: grayscale(0%) brightness(1.08) contrast(1.05);
  transform: scale(1.02);
}

.about-image::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: 20px;
  bottom: 20px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  z-index: -1;
  transition: all 0.3s ease;
}

.about-image:hover::before {
  top: -10px;
  left: -10px;
}

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

.about-text {
  margin-bottom: 2rem;
}

.about-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.about-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.about-detail-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.about-detail-value {
  font-size: 1rem;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Experience Section
   -------------------------------------------------------------------------- */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.experience-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.experience-item:first-child {
  padding-top: 0;
}

.experience-item:last-child {
  border-bottom: none;
}

.experience-date {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  position: sticky;
  top: 100px;
  align-self: start;
}

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

.experience-company {
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.experience-description {
  color: var(--text-secondary);
}

.experience-description ul {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.experience-description li {
  position: relative;
  padding-left: 1.5rem;
  line-height: 1.6;
}

.experience-description li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Education Section
   -------------------------------------------------------------------------- */
.education {
  background-color: var(--bg-secondary);
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.education-card {
  position: relative;
  background-color: var(--bg-primary);
  padding: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.education-logo {
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  width: 60px;
  height: 60px;
  object-fit: contain;
  opacity: 1;
  border-radius: 5%;
}

.education-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.education-degree {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.education-field {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.education-school {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.education-date {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.education-gpa {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  padding: 0.5rem 1rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  display: inline-block;
}

.education-courses {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.education-courses h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.education-courses ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.education-courses li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Skills Section
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.skill-category {
  padding: 2rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.skill-category h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Projects Section
   -------------------------------------------------------------------------- */
.projects {
  background-color: var(--bg-secondary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-primary);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-header {
  margin-bottom: 1rem;
}

.project-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-org {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}

.project-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.project-highlights {
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-highlights ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.project-highlights li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.tech-tag {
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tech-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

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

.contact h2 {
  margin-bottom: 1.5rem;
}

.contact-text {
  font-size: 1.25rem;
  margin-bottom: 3rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-primary);
  padding: 1rem 2rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-bottom: 3rem;
}

.contact-email:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.contact-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-link:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Scroll Animations
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--animation-timing);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-image-wrapper {
    max-width: 400px;
    margin: 0 auto;
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .experience-date {
    position: static;
  }

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

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1.5rem;
  }

  section {
    padding: calc(var(--section-padding) * 0.7) 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-link {
    font-size: 1.25rem;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  h1 {
    font-size: clamp(2.5rem, 10vw, var(--hero-heading-size));
  }

  h2 {
    font-size: clamp(1.75rem, 6vw, var(--section-heading-size));
  }

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

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-social {
    justify-content: center;
  }

  .about-details {
    grid-template-columns: 1fr;
  }

  .contact-email {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .skill-category {
    padding: 1.5rem;
  }

  .education-card {
    padding: 1.5rem;
  }

  .education-logo {
    width: 40px;
    height: 40px;
    top: 1rem;
    right: 1rem;
  }

  .project-card {
    padding: 1.5rem;
  }

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