/* === CSS Reset & Variables === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #171717;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #ffffff;
  --line-color: rgba(255, 255, 255, 0.1);
  --font-family: 'JetBrains Mono', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* === Animated Background === */
.lines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 90vw;
  margin: 0 auto;
  pointer-events: none;
  z-index: 0;
}

.line {
  position: absolute;
  width: 1px;
  height: 100%;
  top: 0;
  background: var(--line-color);
  overflow: hidden;
}

.line::after {
  content: '';
  display: block;
  position: absolute;
  height: 15vh;
  width: 100%;
  top: -50%;
  left: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 75%, #ffffff 100%);
  animation: drop 7s infinite;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.4, 0.26, 0, 0.97);
}

.line:nth-child(1) {
  left: 5%;
}

.line:nth-child(1)::after {
  animation-delay: 1s;
}

.line:nth-child(2) {
  left: 10%;
}

.line:nth-child(2)::after {
  animation-delay: 2s;
}

.line:nth-child(3) {
  left: 25%;
}

.line:nth-child(3)::after {
  animation-delay: 0.5s;
}

.line:nth-child(4) {
  left: 40%;
}

.line:nth-child(4)::after {
  animation-delay: 3s;
}

.line:nth-child(5) {
  left: 50%;
}

.line:nth-child(5)::after {
  animation-delay: 0s;
}

.line:nth-child(6) {
  left: 60%;
}

.line:nth-child(6)::after {
  animation-delay: 2.5s;
}

.line:nth-child(7) {
  left: 75%;
}

.line:nth-child(7)::after {
  animation-delay: 1.5s;
}

.line:nth-child(8) {
  left: 90%;
}

.line:nth-child(8)::after {
  animation-delay: 3.5s;
}

.line:nth-child(9) {
  left: 95%;
}

.line:nth-child(9)::after {
  animation-delay: 4s;
}

@keyframes drop {
  0% {
    top: -50%;
  }
  100% {
    top: 110%;
  }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .line::after {
    animation: none;
  }
}

/* === Main Layout === */
main {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  margin-bottom: 6rem;
}

/* === Hero Section === */
.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 300;
}

.hero .intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.7;
}

/* === Section Headers === */
h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* === Experience Section === */
.experience-item {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.date {
  color: var(--text-secondary);
  font-size: 0.95rem;
  white-space: nowrap;
}

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

.experience-item ul {
  margin-left: 1.5rem;
  margin-top: 1rem;
}

.experience-item li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* === Projects Section === */
.project-item {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.project-item h3 {
  margin-bottom: 0.75rem;
}

.tech-stack {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.project-item p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.7;
}

/* === Tech Stack Section === */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-tag {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s;
}

.tech-tag:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* === Education Section === */
.education-item {
  margin-bottom: 2rem;
}

/* === Contact Section === */
#contact {
  text-align: center;
  padding: 4rem 0;
}

.contact-text {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

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

.social-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.social-links a:hover {
  opacity: 0.7;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  main {
    padding: 1.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .subtitle {
    font-size: 1.3rem;
  }

  .hero .intro {
    font-size: 1rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  section {
    margin-bottom: 4rem;
  }

  .experience-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .social-links {
    flex-direction: column;
    gap: 1rem;
  }
}