:root {
  /* PRIMARY COLOR - Main brand color used for: buttons, links, timeline dots, section underlines */
  --color-primary: #14b8a6;
  
  /* PRIMARY DARK - Hover states for: buttons, links */
  --color-primary-dark: #0f766e;
  
  /* SECONDARY - Gradient accents used in: section title underlines, skill progress bars, timeline line */
  --color-secondary: #06b6d4;
  
  /* ACCENT - Additional highlights (currently matches secondary) */
  --color-accent: #22d3ee;
  
  /* DARK - Main text color, headings, navigation logo */
  --color-dark: #0f172a;
  
  /* DARK ALT - Alternative dark (currently unused, available for future use) */
  --color-dark-alt: #1e293b;
  
  /* GRAY - Body text, descriptions, list items, date badges */
  --color-gray: #64748b;
  
  /* LIGHT - Page background, section backgrounds, skill progress track, date badge backgrounds */
  --color-light: #f8fafc;
  
  /* WHITE - Card backgrounds, navigation background, footer text, buttons */
  --color-white: #ffffff;
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  
  --border-radius: 1rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-light);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: var(--spacing-sm);
  color: var(--color-gray);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

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

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

nav.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-links a {
  color: var(--color-gray);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: var(--transition);
}

.nav-links a:hover {
  background: var(--color-light);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--color-dark);
  margin: 5px 0;
  transition: var(--transition);
}

.social-links {
  display: flex;
  gap: var(--spacing-sm);
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-light);
  color: var(--color-gray);
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  /* Use your texture background image - tiles the 128x128 texture */
  background-image: url('../images/a.jpg');
  background-repeat: repeat;
  background-attachment: fixed;
}

/* Dark overlay for hero - helps with text readability */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}

/* Optional: Pattern overlay */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  text-align: center;
}

.hero-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.3);
  margin: 0 auto var(--spacing-md);
  object-fit: cover;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.8s ease-out;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: var(--spacing-sm);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: var(--spacing-md);
  opacity: 0.9;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Typing Animation */
.typing-container {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.typing-line {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  margin: 0.25rem 0;
}

.typing-line.typing {
  animation: typing 2s steps(40) forwards, blink 0.5s step-end infinite;
}

.typing-line.typed {
  border-right: none;
  opacity: 1;
}

@keyframes typing {
  from {
    width: 0;
    opacity: 1;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.hero-cta {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* Section Styles */
section {
  padding: var(--spacing-xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-title {
  position: relative;
  display: inline-block;
  padding-bottom: var(--spacing-sm);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

/* Overview Section */
.overview {
  background: var(--color-white);
}

.overview-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.overview-text h3 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.overview-text p {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
}

.timeline-item {
  position: relative;
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  opacity: 0;
  transform: translateX(-20px);
  transition: var(--transition);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border: 3px solid var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
}

.timeline-content {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Timeline with images */
.timeline-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--spacing-md);
  min-height: 60px;
}

.timeline-logo {
  max-width: 120px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.timeline-info {
  width: 100%;
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.timeline-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.timeline-title {
  flex: 1;
  min-width: 0;
}

.timeline-title h4 {
  color: var(--color-dark);
  margin-bottom: 0.25rem;
}

.timeline-company {
  color: var(--color-primary);
  font-weight: 600;
}

.timeline-date {
  background: var(--color-light);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray);
  white-space: nowrap;
  align-self: flex-start;
}

.timeline-description {
  margin-top: var(--spacing-sm);
}

.timeline-description ul {
  list-style: none;
  padding-left: 0;
}

.timeline-description li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-gray);
}

.timeline-description li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

/* Skills Section */
.skills {
  background: var(--color-light);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.skill-category {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.skill-category h4 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.25rem;
}

.skill-category ul {
  list-style: none;
}

.skill-category li {
  padding: 0.5rem 0;
  color: var(--color-gray);
}

.skill-bars {
  display: grid;
  gap: var(--spacing-md);
}

.skill-bar {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.skill-name {
  font-weight: 600;
  color: var(--color-dark);
}

.skill-level {
  color: var(--color-primary);
  font-weight: 600;
}

.skill-progress {
  height: 10px;
  background: var(--color-light);
  border-radius: 5px;
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 5px;
  transition: width 1s ease-out;
  width: 0;
}

.skill-bar.visible .skill-progress-bar {
  width: var(--skill-width);
}

/* Portfolio */
.portfolio {
  background: var(--color-white);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

.portfolio-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  background: var(--color-light);
  opacity: 0;
  transform: translateY(20px);
}

.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-item:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
}

.portfolio-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.portfolio-item:hover .portfolio-image {
  transform: scale(1.05);
}

.portfolio-content {
  padding: var(--spacing-md);
}

.portfolio-content h4 {
  color: var(--color-dark);
  margin-bottom: var(--spacing-sm);
}

.portfolio-content p {
  font-size: 0.95rem;
}

/* About Section */
.about {
  position: relative;
  background-image: url('../images/a.jpg');
  background-repeat: repeat;
  background-attachment: fixed;
  color: var(--color-white);
}

/* Dark overlay for about section - matches hero */
.about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}

.about .section-header,
.about-content {
  position: relative;
  z-index: 1;
}

.about .section-title {
  color: var(--color-white);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.about-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1.8;
}

.about-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  max-height: 600px;
  overflow-y: auto;
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
}

.about-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: var(--transition);
}

.about-gallery img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* Footer */
footer {
  background: var(--color-dark);
  color: var(--color-white);
  padding: var(--spacing-lg) 0 var(--spacing-md);
  text-align: center;
}

footer p {
  color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .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);
  }
  
  .social-links {
    display: none;
  }
  
  .timeline-logo {
    max-width: 100px;
    max-height: 60px;
  }
  
  /* Stack date below title on mobile */
  .timeline-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-date {
    align-self: flex-start;
  }
}

/* Responsive Grid Adjustments */
@media (min-width: 576px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .about-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .overview-content {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Keep timeline single-column on tablet, switch to alternating at desktop */
  .timeline-logo {
    max-width: 140px;
    max-height: 90px;
  }
}

@media (min-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .about-content {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Desktop: Alternating timeline layout */
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .timeline-item {
    width: 50%;
    padding-left: 0;
    padding-right: var(--spacing-lg);
  }
  
  .timeline-item::before {
    left: auto;
    right: -8px;
  }
  
  .timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: var(--spacing-lg);
  }
  
  .timeline-item:nth-child(even)::before {
    right: auto;
    left: -8px;
  }
  
  .timeline-logo {
    max-width: 180px;
    max-height: 100px;
  }
  
  /* Desktop: Date can stay inline with title */
  .timeline-title-row {
    flex-direction: row;
    align-items: flex-start;
  }
}