* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

main {
  flex: 1 0 auto;
}


header {
  background-color: #000;
  color: #fff;
  padding: 2rem 0;
  text-align: center;
}

.header-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header-subtitle {
  color: #ccc;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

header nav {
  margin-top: 1rem;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
}

header nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

header nav a:hover {
  color: #ccc;
}

header nav a i {
  flex: 0 0 auto;
}


.view-cv-btn,
.download-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #000;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s, transform 0.2s;
}

.view-cv-btn:hover,
.download-cv-btn:hover {
  background: #333;
  transform: translateY(-2px);
}

header nav .view-cv-btn {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: transparent;
}

header nav .view-cv-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}


.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}


.welcome {
  text-align: center;
  max-width: 800px;
  margin: 2rem auto;
}

.welcome h1,
.welcome h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}


.services-container,
.offer-container {
  margin: 3rem 0;
}

.services-section,
.offer-section {
  text-align: center;
}

.service-h2,
.offer-h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 3rem 0 2rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
}

.service-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #000;
}


.offer-list {
  max-width: 800px;
  margin: 2rem auto;
}

.offer-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 2rem 0;
}

.offer-item i {
  font-size: 1.5rem;
  color: #000;
  margin-top: 0.25rem;
}

.offer-content {
  flex: 1;
  text-align: left;
}


.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.project-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.project-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.project-info {
  padding: 1.5rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.tag {
  background: #f5f5f5;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.875rem;
}

.cat-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 0.25rem;
  font: 600 0.95rem/1.4 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.cat-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: currentColor;
  opacity: 0.25;
}

.cat-divider.sticky {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.cat-note {
  grid-column: 1 / -1;
  margin: 0.5rem 0 1.5rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.775rem;
  line-height: 1.35;
  color: #555;
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.cat-note::before {
  content: "ℹ︎";
  font-weight: 600;
  opacity: 0.6;
  line-height: 1;
}

.cat-block {
  display: contents;
}


.pricing-item {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  margin: 0.5rem 0;
  font-size: 1.1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-item.residential { border-left: 4px solid #4CAF50; }
.pricing-item.commercial { border-left: 4px solid #2196F3; }
.pricing-item.basic { border-left: 4px solid #8BC34A; }
.pricing-item.standard { border-left: 4px solid #FFC107; }
.pricing-item.ecommerce { border-left: 4px solid #E91E63; }
.pricing-item.custom { border-left: 4px solid #9C27B0; }
.pricing-item.automation { border-left: 4px solid #607D8B; }
.pricing-item.portrait { border-left: 4px solid #FF9800; }
.pricing-item.photoshoot { border-left: 4px solid #00BCD4; }
.pricing-item.product { border-left: 4px solid #3F51B5; }
.pricing-item.event { border-left: 4px solid #F44336; }
.pricing-item.design { border-left: 4px solid #009688; }
.pricing-item.note { border-left: 4px solid #BDBDBD; font-style: italic; }
.pricing-item.networking { border-left: 4px solid #00BCD4; }
.pricing-item.commercial-networking { border-left: 4px solid #3F51B5; }
.pricing-item.webhosting { border-left: 4px solid #607D8B; }


.contact-section {
  text-align: center;
  margin: 3rem 0;
}

.contact-info {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 810px;
  margin: 2rem auto;
}

.contact-info a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 1rem 0;
  color: #333;
  text-decoration: none;
  gap: 0.5rem;
}

.contact-info a i {
  margin-right: 0.5rem;
}

footer {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}


.cv-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.cv-header {
  text-align: center;
  margin-bottom: 2rem;
}

.cv-section {
  margin-bottom: 2rem;
  text-align: left;
}

.cv-section h2 {
  color: #333;
  border-bottom: 2px solid #000;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.experience-item {
  margin-bottom: 1.5rem;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.cv-section ul {
  margin-left: 0;
  padding-left: 1.2em;
}

.cv-section ul li {
  margin-bottom: 0.5em;
}

.small-skills {
  font-size: 0.9em;
}

.small-subtitle {
  font-size: 0.7em;
}


.gallery-container {
  position: relative;
  flex: 1;
  width: 100%;
  background: #1a1a1a;
  overflow: hidden;
}

.slides {
  display: flex;
  gap: 3rem;
  position: absolute;
  left: 40%;
  top: 50%;
  transform: translate3d(0, -50%, 0);
  overflow: hidden;
}

.gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
}

.gallery-item figure {
  min-width: 25vw;
  height: 70vh;
  cursor: pointer;
  width: 100%;
  max-width: none;
  aspect-ratio: 1 / 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-item figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease-out;
  will-change: object-position;
}

.carousel-wrapper {
  width: 100%;
  overflow: hidden;
  background: #111;
  margin-bottom: 2.5rem;
}

.carousel {
  display: flex;
  gap: 2.5rem;
  animation: scroll-carousel 40s linear infinite;
  will-change: transform;
  align-items: center;
}

.carousel li {
  list-style: none;
  flex: 0 0 auto;
  width: 320px;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes scroll-carousel {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.grid-wrapper {
  width: 100%;
  max-width: 100vw;
  padding: 0 2vw 2vw;
  margin: 0 auto;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  gap: 3rem;
  list-style: none;
  justify-items: center;
  align-items: start;
  will-change: transform;
  transform: translateZ(0);
}

.photo-grid .gallery-item,
.photo-grid .gallery-item figure {
  width: 100%;
  max-width: none;
  min-width: 0;
  aspect-ratio: 1 / 1.5;
}

.photo-grid .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
}

.photo-grid .gallery-item img:hover {
  transform: scale(0.85);
  background: #111;
  object-fit: contain;
  transition: transform 0.9s, background 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  z-index: 2000;
  flex-direction: column;
}

#loading-overlay > * {
  position: relative;
  z-index: 2;
}

#loading-count {
  margin-top: 1rem;
}

#force-open-gallery {
  margin-top: 2rem;
  padding: 0.7rem 2rem;
  font-size: 1.5rem;
  border-radius: 8px;
  border: none;
  background: #333;
  color: #fff;
  cursor: pointer;
}


.gallery-container + footer {
  z-index: 10;
}


@media (max-width: 1200px) {
  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  header nav a {
    font-size: 0.95rem;
  }

  .gallery-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 0;
  }

  .slides {
    position: static;
    flex-direction: column;
    transform: none;
    padding: 1rem;
    gap: 2rem;
    align-items: center;
  }

  .gallery-item figure {
    min-width: unset;
    width: 90%;
    aspect-ratio: 1 / 1.5;
    max-height: 60vh;
  }

  .gallery-item figure img {
    transform: none !important;
  }

  .carousel li,
  .gallery-item figure {
    max-width: 240px;
    max-height: 240px;
  }

  .photo-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 900px) {
  .carousel li {
    width: 180px;
    height: 110px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

  .offer-item {
    flex-direction: column;
    text-align: center;
  }

  .offer-item i {
    margin-bottom: 0.5rem;
  }

  header nav a {
    flex: 0 0 48%;
    justify-content: center;
  }

  header nav a:last-child:nth-child(odd) {
    margin-left: auto;
    margin-right: auto;
  }

  .cv-section ul,
  .cv-section ul li {
    text-align: left !important;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  
  }
   .carousel li,
  .gallery-item figure,
  .gallery-item {
    max-height: 180px;
  }
}

@media (prefers-color-scheme: dark) {
  .cat-note {
    color: #d0d0d0;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
  }
}
