/* Light theme variables (default) */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --text-color: #1a1a1a;
  --background-color: #f8f9fa;
  --white: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 4px 6px #0000001a;
  --accent-color: #28a745;
  --hover-color: #0056b3;
  --bg-gradient: #ffffff;
}

/* Dark theme variables */
[data-theme="dark"] {
  --primary-color: #4dabf7;
  --secondary-color: #adb5bd;
  --text-color: #e9ecef;
  --background-color: #1a1a1a;
  --white: #2d2d2d;
  --border-color: #444444;
  --shadow: 0 4px 6px #0000004d;
  --accent-color: #51cf66;
  --hover-color: #339af0;
  --bg-gradient: #000033;
}

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

html,
body {
  font-family: "Inter", sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  scroll-behavior: smooth;
  line-height: 1.7;
}

.background {
  background: var(--bg-gradient);
  position: fixed;
  height: 100vh;
  width: 100vw;
  transition: background 300ms ease;
  z-index: -1;
}

.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.nav-wrapper {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrapper {
  display: flex;
  align-items: center;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle-icon {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-color);
  position: relative;
  transition: background-color 0.3s;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 3px;
  background-color: var(--text-color);
  left: 0;
  transition: transform 0.3s, top 0.3s, bottom 0.3s;
}

.nav-toggle-icon::before {
  top: -8px;
}

.nav-toggle-icon::after {
  bottom: -8px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

.nav-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  top: 16px;
  right: 16px;
}

.nav-close-icon {
  display: block;
  width: 28px;
  height: 28px;
  position: relative;
}

.nav-close-icon::before,
.nav-close-icon::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 3px;
  background-color: var(--text-color);
  top: 50%;
  left: 0;
}

.nav-close-icon::before {
  transform: rotate(45deg);
}

.nav-close-icon::after {
  transform: rotate(-45deg);
}

#navigation {
  display: flex;
  align-items: center;
  gap: 16px;
}

#navigation ul {
  list-style: none;
  display: flex;
  gap: 16px;
  align-items: center;
}

#navigation a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s, transform 0.2s;
  position: relative;
}

#navigation a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

#navigation a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

#navigation a:hover::after {
  width: 100%;
}

.theme-toggle-wrapper {
  display: flex;
  align-items: center;
}

.toggle {
  --size: 1rem;
  appearance: none;
  outline: none;
  cursor: pointer;
  width: var(--size);
  height: var(--size);
  box-shadow: inset calc(var(--size) * 0.33) calc(var(--size) * -0.25) 0;
  border-radius: 999px;
  color: #4242bd;
  transition: all 500ms;
}

.toggle:checked {
  --ray-size: calc(var(--size) * -0.4);
  --offset-orthogonal: calc(var(--size) * 0.65);
  --offset-diagonal: calc(var(--size) * 0.45);
  transform: scale(0.75);
  color: #ffaa00;
  box-shadow: inset 0 0 0 var(--size),
    calc(var(--offset-orthogonal) * -1) 0 0 var(--ray-size),
    var(--offset-orthogonal) 0 0 var(--ray-size),
    0 calc(var(--offset-orthogonal) * -1) 0 var(--ray-size),
    0 var(--offset-orthogonal) 0 var(--ray-size),
    calc(var(--offset-diagonal) * -1) calc(var(--offset-diagonal) * -1) 0
      var(--ray-size),
    var(--offset-diagonal) var(--offset-diagonal) 0 var(--ray-size),
    calc(var(--offset-diagonal) * -1) var(--offset-diagonal) 0 var(--ray-size),
    var(--offset-diagonal) calc(var(--offset-diagonal) * -1) 0 var(--ray-size);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-section {
  background-color: var(--white);
  padding: 64px 0;
  text-align: center;
}

.greeting-wrapper h1 {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.greeting-wrapper h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 16px;
}

.typing {
  color: var(--primary-color);
  font-weight: 700;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 20px);
  max-width: 700px;
  margin: 0 auto 16px;
  color: var(--secondary-color);
  line-height: 1.8;
}

.cta-button {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

.section {
  padding: 64px 0;
}

.section h2 {
  font-size: clamp(32px, 5vw, 40px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.about-text ul {
  list-style: none;
  padding-left: 0;
}

.about-text li {
  margin-bottom: 16px;
  font-size: 16px;
  position: relative;
  padding-left: 16px;
}

.about-text li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-size: 16px;
}

.social-links {
  margin-top: 16px;
  padding: 16px;
}

.social-links a {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.3s, transform 0.2s;
}

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

.skills-grid h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-list span {
  background-color: var(--white);
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.2s, background-color 0.3s;
}

.skills-list span:hover {
  transform: translateY(-2px);
  background-color: var(--border-color);
}

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

.project-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 16px #00000026;
}

.project-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.project-content {
  padding: 16px;
}

.project-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-content p {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 8px;
  line-height: 1.8;
}

.project-content a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s, transform 0.2s;
}

.project-content a:hover {
  color: var(--hover-color);
  transform: translateX(4px);
}

.experience-list {
  max-width: 900px;
  margin: 0 auto;
}

.experience-item {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.experience-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px #00000026;
}

.company-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.experience-details h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.role-timeline {
  position: relative;
  padding-left: 16px;
}

.role-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--primary-color);
}

.role {
  margin-bottom: 16px;
}

.role h4 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.company-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.duration {
  font-size: 14px;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.experience-details ul {
  list-style: none;
  padding-left: 0;
}

.experience-details li {
  font-size: 16px;
  margin-bottom: 8px;
  position: relative;
  padding-left: 16px;
}

.experience-details li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-size: 16px;
}

.contact-section {
  background-color: var(--white);
  padding: 64px 0;
}

#contact-form {
  max-width: 700px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}

.input-field {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: var(--white);
  color: var(--text-color);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px #007bff1a;
}

.input-field::placeholder {
  color: var(--secondary-color);
}

#submit-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

#submit-btn:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

#status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 48px 16px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: none;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

#status.show {
  display: block;
}

#status.hiding {
  animation: slideOutRight 0.3s ease-out;
}

#status.success {
  background-color: var(--accent-color);
  color: var(--white);
}

#status.error {
  background-color: #dc3545;
  color: var(--white);
}

.toast-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInTop {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes slideOutTop {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: block;
  }

  .nav-close {
    display: block;
  }

  #navigation {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 280px;
    background-color: var(--white);
    flex-direction: column;
    justify-content: center;
    transition: right 0.3s ease;
    box-shadow: -2px 0 8px #00000033;
    padding: 16px;
    z-index: 1;
  }

  #navigation.active {
    right: 0;
  }

  #navigation ul {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  #navigation a {
    font-size: 18px;
  }

  #status {
    top: 24px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    max-width: calc(100% - 48px);
    animation: slideInTop 0.3s ease-out;
  }

  #status.hiding {
    animation: slideOutTop 0.3s ease-out;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 32px 0;
  }

  .greeting-wrapper h1 {
    font-size: clamp(32px, 6vw, 40px);
  }

  .greeting-wrapper h2 {
    font-size: clamp(24px, 4vw, 28px);
  }

  .experience-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .company-logo img {
    margin-bottom: 8px;
  }
}
