/* ===== VARIABLES CSS ===== */
:root {
  /* Colors */
  --first-color: #667eea;
  --first-color-alt: #764ba2;
  --title-color: #393939;
  --text-color: #707070;
  --text-color-light: #a6a6a6;
  --body-color: #fbfefd;
  --container-color: #ffffff;
  --border-color: #e4e4e7;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --error-color: #ef4444;

  /* Typography */
  --body-font: 'Inter', sans-serif;
  --biggest-font-size: 2.5rem;
  --h1-font-size: 2.25rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.25rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;
  --smaller-font-size: 0.813rem;

  /* Font weight */
  --font-light: 300;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /* Margins */
  --mb-0-25: 0.25rem;
  --mb-0-5: 0.5rem;
  --mb-0-75: 0.75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* Z index */
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  /* Box shadow */
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* Border radius */
  --border-radius: 0.75rem;
  --border-radius-small: 0.5rem;
  --border-radius-large: 1rem;

  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.2s ease;
}

/* Responsive typography */
@media screen and (max-width: 992px) {
  :root {
    --biggest-font-size: 2rem;
    --h1-font-size: 1.875rem;
    --h2-font-size: 1.375rem;
    --h3-font-size: 1.125rem;
    --normal-font-size: 0.938rem;
    --small-font-size: 0.813rem;
    --smaller-font-size: 0.75rem;
  }
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  line-height: 1.2;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

/* ===== REUSABLE CSS CLASSES ===== */
.container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section {
  padding: 6rem 0 2rem;
}

.section__header {
  text-align: center;
  margin-bottom: var(--mb-3);
}

.section__title {
  font-size: var(--h2-font-size);
  color: var(--title-color);
  margin-bottom: var(--mb-1);
  position: relative;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
  height: 3px;
  background: linear-gradient(90deg, var(--first-color), var(--first-color-alt));
  border-radius: 2px;
}

.section__description {
  font-size: var(--normal-font-size);
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-medium);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
  font-size: var(--normal-font-size);
}

.btn--primary {
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.btn--secondary {
  background: transparent;
  color: var(--first-color);
  border: 2px solid var(--first-color);
}

.btn--secondary:hover {
  background: var(--first-color);
  color: white;
  transform: translateY(-2px);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* ===== HEADER & NAV ===== */
.header {
  width: 100%;
  position: fixed;
  background-color: transparent;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scroll-header {
  background-color: #ffffff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar {
  padding: 1rem 0;
  background-color: transparent !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scroll-header .navbar {
  padding: 0.75rem 0;
}

.navbar-brand.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  font-size: var(--h3-font-size);
  text-decoration: none;
  transition: all 0.3s ease;
}

.header.scroll-header .navbar-brand.nav__logo {
  transform: scale(0.95);
}

.navbar-brand.nav__logo:hover {
  color: var(--title-color);
}

.navbar-brand.nav__logo i {
  font-size: 1.5rem;
  color: var(--first-color);
}

.navbar-nav .nav-link {
  font-size: var(--small-font-size);
  color: var(--title-color) !important;
  font-weight: var(--font-medium);
  transition: var(--transition);
  position: relative;
  margin: 0 0.5rem;
  padding: 0.5rem 0 !important;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--first-color), var(--first-color-alt));
  transition: var(--transition);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 100%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--first-color) !important;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2857, 59, 57, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== HERO ===== */
.hero {
  padding-top: 8rem;
  padding-bottom: 2rem;
}

.hero__container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
  align-items: center;
}

.hero__content {
  order: 1;
}

.hero__title {
  font-size: var(--biggest-font-size);
  margin-bottom: var(--mb-1);
  line-height: 1.2;
}

.hero__title-accent {
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.hero__description {
  margin-bottom: var(--mb-2-5);
  font-size: var(--normal-font-size);
  line-height: 1.8;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__image {
  order: 2;
  justify-self: center;
}

.hero__blob {
  position: relative;
  width: 320px;
  height: 320px;
}

.hero__blob svg {
  width: 100%;
  height: 100%;
  fill: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
}

.hero__blob-img {
  width: 170px;
}

.hero__code {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  box-shadow: var(--shadow-medium);
  animation: float 3s ease-in-out infinite;
}

.code-keyword { color: #7c3aed; font-weight: bold; }
.code-variable { color: #059669; }
.code-operator { color: #dc2626; }
.code-function { color: #2563eb; }
.code-bracket { color: #374151; }

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}

/* ===== SERVICES ===== */
/* Services now use Bootstrap grid, keeping only card styles */
.service__card {
  background: var(--container-color);
  padding: 2.5rem 2rem;
  border-radius: var(--border-radius-large);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.service__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--first-color), var(--first-color-alt));
  transform: scaleX(0);
  transition: var(--transition);
}

.service__card:hover::before {
  transform: scaleX(1);
}

.service__card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-strong);
}

.service__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  border-radius: 50%;
  margin-bottom: var(--mb-1-5);
  font-size: 2rem;
  color: white;
}

.service__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-1);
}

.service__description {
  margin-bottom: var(--mb-1-5);
  line-height: 1.6;
}

.service__features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service__features li {
  padding: 0.5rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--border-radius-small);
  font-size: var(--small-font-size);
  color: var(--first-color);
  font-weight: var(--font-medium);
}

/* ===== TEAM ===== */
/* Team now uses Bootstrap grid, keeping only member styles */
.team__member {
  background: var(--container-color);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.team__member:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

.team__image {
  position: relative;
  overflow: hidden;
  height: 280px;
}

.team__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.team__member:hover .team__image img {
  transform: scale(1.1);
}

.team__social {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateX(20px);
  transition: var(--transition);
}

.team__member:hover .team__social {
  opacity: 1;
  transform: translateX(0);
}

.team__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: var(--first-color);
  transition: var(--transition);
}

.team__social-link:hover {
  background: var(--first-color);
  color: white;
  transform: scale(1.1);
}

.team__info {
  padding: 1.5rem;
  text-align: center;
}

.team__name {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-25);
}

.team__role {
  color: var(--first-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-0-75);
  font-size: var(--small-font-size);
}

.team__description {
  font-size: var(--small-font-size);
  line-height: 1.6;
}

/* ===== PROJECTS ===== */
/* Projects now use Bootstrap grid, keeping only card styles */
.project__card {
  background: var(--container-color);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.project__card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

.project__image {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.project__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(102, 126, 234, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.project__card:hover .project__overlay {
  opacity: 1;
}

.project__card:hover .project__image img {
  transform: scale(1.1);
}

.project__links {
  display: flex;
  gap: 1rem;
}

.project__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  color: var(--first-color);
  transition: var(--transition);
}

.project__link:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-medium);
}

.project__content {
  padding: 1.5rem;
}

.project__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-75);
}

.project__description {
  margin-bottom: var(--mb-1);
  line-height: 1.6;
  font-size: var(--small-font-size);
}

.project__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  color: var(--first-color);
  border-radius: var(--border-radius-small);
  font-size: var(--smaller-font-size);
  font-weight: var(--font-medium);
}

/* ===== CONTACT ===== */
/* Contact now uses Bootstrap grid, keeping only custom styles */
.contact__title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-1);
}

.contact__description {
  margin-bottom: var(--mb-2);
  line-height: 1.6;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: var(--mb-2);
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact__detail i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
}

.contact__detail h4 {
  font-size: var(--normal-font-size);
  margin-bottom: 0.25rem;
}

.contact__detail span {
  color: var(--text-color);
  font-size: var(--small-font-size);
}

.contact__social {
  display: flex;
  gap: 1rem;
}

.contact__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: rgba(102, 126, 234, 0.1);
  color: var(--first-color);
  border-radius: 50%;
  transition: var(--transition);
}

.contact__social-link:hover {
  background: var(--first-color);
  color: white;
  transform: translateY(-2px);
}

/* Form */
.contact__form {
  background: var(--container-color);
  padding: 2rem;
  border-radius: var(--border-radius-large);
  border: 1px solid var(--border-color);
}

/* Bootstrap Form Overrides */
.form-floating > .form-control {
  background: var(--body-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-family: var(--body-font);
}

.form-floating > .form-control:focus {
  border-color: var(--first-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-floating > label {
  color: var(--text-color-light);
  font-size: var(--small-font-size);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--first-color);
}

.form__group {
  margin-bottom: var(--mb-1-5);
}

.form__input {
  width: 100%;
  background: var(--body-color);
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  outline: none;
  transition: var(--transition);
}

.form__input:focus {
  border-color: var(--first-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form__textarea {
  resize: none;
  height: 140px;
}

/* ===== BOOTSTRAP ENHANCEMENTS ===== */
/* Add spacing for Bootstrap rows */
.row.g-4 {
  margin-top: 3rem;
}

.row.g-5 {
  margin-top: 3rem;
}

/* Ensure equal height cards */
.service__card,
.team__member,
.project__card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service__card .service__features,
.team__member .team__info,
.project__card .project__content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Bootstrap responsive adjustments */
@media (max-width: 992px) {
  .col-lg-3 {
    margin-bottom: 1rem;
  }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--title-color);
  color: white;
  padding: 4rem 0 2rem;
}

.footer__content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  align-items: start;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--font-semi-bold);
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-1-5);
}

.footer__logo i {
  font-size: 2rem;
  color: var(--first-color);
}

.footer__description {
  margin-bottom: var(--mb-2);
  line-height: 1.8;
  opacity: 0.9;
  max-width: 300px;
  font-size: var(--normal-font-size);
}

.footer__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-1-5);
  color: white;
  font-weight: var(--font-semi-bold);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__link {
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
  font-size: var(--small-font-size);
  padding: 0.25rem 0;
}

.footer__link:hover {
  color: var(--first-color);
  transform: translateX(5px);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__copy {
  font-size: var(--small-font-size);
  opacity: 0.8;
  color: rgba(255, 255, 255, 0.9);
}

.footer__social {
  display: flex;
  gap: 1rem;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer__social-link:hover {
  background: var(--first-color);
  transform: translateY(-3px);
  border-color: var(--first-color);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed;
  right: 1.5rem;
  bottom: -20%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: var(--first-color);
  color: white;
  border-radius: 50%;
  z-index: var(--z-tooltip);
  transition: var(--transition);
}

.scroll-top:hover {
  background: var(--first-color-alt);
  transform: translateY(-2px);
}

.scroll-top.show-scroll {
  bottom: 3rem;
}

/* ===== BREAKPOINTS ===== */

/* For large devices (Bootstrap lg) */
@media screen and (max-width: 992px) {
  .container {
    margin-left: var(--mb-1-5);
    margin-right: var(--mb-1-5);
  }

  .hero__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__content {
    order: 2;
    text-align: center;
  }

  .hero__image {
    order: 1;
  }

  .hero__blob {
    width: 280px;
    height: 280px;
  }

  .navbar-nav {
    text-align: center;
    padding-top: 1rem;
  }

  .navbar-nav .nav-link {
    margin: 0.5rem 0;
  }
}

/* For medium devices (Bootstrap md) */
@media screen and (max-width: 768px) {
  .section {
    padding: 4rem 0 2rem;
  }

  .hero {
    padding-top: 6rem;
  }

  .hero__buttons {
    justify-content: center;
  }

  .navbar-collapse {
    background: var(--body-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-light);
  }
}

/* For small devices (Bootstrap sm) */
@media screen and (max-width: 576px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }

  .hero__blob {
    width: 240px;
    height: 240px;
  }

  .hero__buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .contact__form {
    padding: 1.5rem;
  }

  .footer__content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .footer__description {
    max-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .scroll-top {
    right: 1rem;
  }
}

@media screen and (max-width: 350px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }

  .hero__blob {
    width: 200px;
    height: 200px;
  }

  .section__title {
    font-size: var(--h2-font-size);
  }
}