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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.4s ease, color 0.4s ease;
  scroll-behavior: smooth;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

:root {
  --bg: #fff;
  --text: #222;
  --primary: #007BFF;
  --secondary: #6c757d;
  --hover: #0056b3;
  --header-bg: #f8f9fa;
  --footer-bg: #f1f1f1;
  --highlight: #3399ff;
  --btn-bg: var(--primary);
  --btn-hover-bg: var(--hover);
  --timeline-line: #ddd;
  --timeline-point: var(--primary);
  --scrolltop-bg: var(--primary);
  --bg-image: url('images/bg1.jpg');
  --bg-pos-y: 0px;
}

body.dark {
  --bg: #121212;
  --text: #eee;
  --primary: #3399ff;
  --secondary: #ccc;
  --hover: #66b2ff;
  --header-bg: #1e1e1e;
  --footer-bg: #222;
  --highlight: #66b2ff;
  --btn-bg: var(--primary);
  --btn-hover-bg: var(--hover);
  --timeline-line: #444;
  --timeline-point: var(--primary);
  --scrolltop-bg: var(--primary);
  --bg-image: url('images/bg2.jpg');
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: -76px;
  width: 100%; height: 100%;
  background: var(--bg-image) center/cover no-repeat;
  opacity: 0.1;
  z-index: -1;
  transition: background 1s ease;
  background-attachment: scroll;
  background-position: center var(--bg-pos-y, 0);
}

header,footer {
  background: var(--header-bg);
  padding: 1rem 2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: default;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
  border-radius: 3px;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  width: 100%;
}

#theme-toggle {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  transition: color 0.3s ease;
}

#theme-toggle:hover {
  color: var(--primary);
}

/* Hero */
.hero.fullscreen {
  display: flex;
  height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  align-items: center;
  gap: 4rem;
  scroll-margin-top: 70px;
}

.hero-left {
  flex: 1;
  color: var(--text);
}

.hero-left h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.hero-left h1 .highlight {
  color: var(--highlight);
}

.hero-left h2 {
  font-weight: 400;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: var(--secondary);
  min-height: 2rem;
}

/* Typed text cursor animation */
.cursor {
  display: inline-block;
  font-weight: 700;
  animation: blink 0.7s steps(2, start) infinite;
  color: var(--primary);
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

/* See More arrow button */
.btn-arrow {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary);
  transition: color 0.3s ease;
  padding: 0;
  margin-top: 1rem;
}

.btn-arrow::before {
  content: '↓';
  display: inline-block;
}

.btn-arrow:hover {
  color: var(--hover);
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background-color: var(--btn-bg);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--btn-hover-bg);
  transform: scale(1.05);
}

.hero-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img {
  max-width: 100%;
  border-radius: 20px;
  /*box-shadow: 0 6px 15px rgba(0,0,0,0.2);*/
  /*user-select: none;*/
  pointer-events: none;
}

/* About Me section */
.about-section {
  max-width: 1100px;
  margin: 4rem auto;
  display: flex;
  gap: 3rem;
  scroll-margin-top: 70px;
  padding: 0 1rem;
}

.about-left {
  flex: 1;
}

.about-left img {
  width: 100%;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  user-select: none;
  pointer-events: none;
}

.about-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-right h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.about-right p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--text);
}

/* Intro text styles - to be used on paragraphs in intro sections */
.intro-text {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.btn-secondary {
  padding: 0.7rem 1.8rem;
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  width: max-content;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  text-align: center;
}

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

/* Education and Experience Section */
.edu-exp-section {
  max-width: 1100px;
  margin: 4rem auto;
  display: flex;
  gap: 5rem;
  padding: 0 1rem;
  scroll-margin-top: 70px;
}

.edu-section,
.exp-section {
  flex: 1;
}

.edu-exp-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 22px;
  bottom: 0;
  width: 3px;
  background: var(--timeline-line);
  border-radius: 2px;
}

.timeline-point {
  position: absolute;
  left: -14px;
  top: 19px;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-color: var(--timeline-point);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--timeline-point);
}

.timeline li {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 1.5rem;
}

.timeline li:last-child {
  margin-bottom: 0;
}

.timeline-content h3 {
  font-size: 1.3rem;
  color: var(--highlight);
  margin-bottom: 0.3rem;
}

.timeline-content p {
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.timeline-content ul {
  margin-left: 1rem;
  color: var(--text);
  font-size: 1rem;
}

.timeline-content ul li {
  margin-bottom: 0.4rem;
}

/* Skills Section */
.skills-section {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1rem;
  scroll-margin-top: 70px;
  text-align: center;
}

.skills-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(110px,1fr));
  gap: 1.6rem 2rem;
  justify-items: center;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  font-weight: 600;
  cursor: default;
  position: relative;
  user-select: none;
}

.skill-item i,
.skill-item img.skill-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  transition: filter 0.3s ease;
}

.skill-item .skill-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 1px var(--primary));
}

.skill-item:hover .skill-icon {
  filter: drop-shadow(0 0 4px var(--hover));
}

.skill-item:hover .colored {
  filter: drop-shadow(0 0 4px var(--hover));
}

.skill-item > .postman-icon{
  width: 94px;
  height: 58px;
}

.skill-item > .skill-icon {
  width: 47px;
  height: 48px;
}


/* Tooltip for skills */
.skill-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.skill-item:hover::after {
  opacity: 1;
  pointer-events: auto;
}

/* Recent works section */
.recent-works-section {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1rem;
  scroll-margin-top: 70px;
}

.recent-works-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
  text-align: center;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 1.5rem;
}

.work-card {
  background: var(--header-bg);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.work-card:hover {
  background: var(--primary);
  color: white;
}

/* Contact Section */
.contact-section {
  max-width: 1100px;
  margin: 4rem auto 6rem auto;
  padding: 0 1rem;
  scroll-margin-top: 70px;
  text-align: center;
}

.contact-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.contact-section p.intro-text {
  margin-bottom: 3rem;
}

.contact-info {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-part {
  flex: 1;
  min-width: 250px;
  background: var(--header-bg);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  user-select: none;
}

.contact-part h3 {
  margin-bottom: 1.2rem;
  color: var(--highlight);
}

.contact-part p {
  margin-bottom: 0.7rem;
  font-weight: 600;
  color: var(--text);
}

.contact-part a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.contact-part a:hover,
.contact-part a:focus {
  text-decoration: underline;
}

/* Scroll to top button */
#scrollTopBtn {
  position: fixed;
  width: 56px;
  bottom: 30px;
  right: 30px;
  background-color: var(--scrolltop-bg);
  border: none;
  color: white;
  padding: 0.8rem 1rem;
  font-size: 1.6rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0.75;
  transition: opacity 0.3s ease;
  z-index: 2000;
  user-select: none;
  display: none;
}

#scrollTopBtn:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .hero.fullscreen {
    flex-direction: column;
    height: auto;
  }
  .hero-left {
    margin-bottom: 2rem;
    text-align: center;
  }
  .hero-left h1 {
    font-size: 2.5rem;
  }
  .hero-left h2 {
    font-size: 1.3rem;
  }
  .about-section {
    flex-direction: column;
  }
  .about-left,
  .about-right {
    flex: none;
  }
  .edu-exp-section {
    flex-direction: column;
  }
  .edu-section,
  .exp-section {
    flex: none;
  }
  .skills-grid {
    grid-template-columns: repeat(auto-fill,minmax(100px,1fr));
  }
}

@media (max-width: 600px) {
  .hero-left h1 {
    font-size: 2rem;
  }
  .hero-left h2 {
    font-size: 1rem;
  }
  .intro-text {
    font-size: 1.1rem;
  }
  .skills-grid {
    grid-template-columns: repeat(auto-fill,minmax(90px,1fr));
  }
  .nav-links {
    display: none;
  }
  .navbar {
    justify-content: space-between;
  }
  /* Works Section */
  .note {
    font-size: 1rem;
    margin-bottom: 25px;
    color: var(--text);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-left: 4px solid var(--highlight);
    border-radius: 5px;
  }

  .works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .work-card {
    position: relative;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .work-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }

  .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.4s ease;
    padding: 15px;
  }

  .work-card:hover .overlay {
    opacity: 1;
  }

  .overlay i {
    font-size: 2rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
  }

  .work-card:hover .overlay i {
    transform: scale(1.2);
  }

  .overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .overlay p {
    font-size: 0.95rem;
    opacity: 0.85;
  }

  .works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
  }

  .work-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #222);
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
  }

  .work-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  }

  .image-wrapper {
    height: 180px;
    background-size: cover;
    background-position: center;
    transition: filter 0.4s ease;
  }

  .work-card:hover .image-wrapper {
    filter: blur(4px);
  }

  .content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .content h3 {
    font-size: 1.2rem;
    margin: 0;
    flex-grow: 1;
  }

  .content p {
    font-size: 0.95rem;
    margin: 0 0 0 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    opacity: 0.8;
  }

  .content p i {
    margin-left: 6px;
    font-size: 1.1rem;
    color: var(--highlight);
    transition: transform 0.3s ease;
  }

  .work-card:hover .content p i {
    transform: scale(1.3);
  }


}
