:root {
    --ivory: #f9f7f5;
    --light: #b0b1b3;
    --slate: #646a76;
    --indigo: #28293e;
    --taupe: #b79b8c;
    --gold: #e6c27f;
    --taupe-light: #ddcfc7;
    --burgundy: #723d46;
    --sage: #8a9a5b;
}


html, body {
  margin: 0;
  background: var(--ivory);
  font-size: clamp(14px, 1.2vw, 18px);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

section {
  width: min(1140px, 92%);
  margin: 0 auto;
  padding: 4rem 0;
}

*, ::after, ::before {
    box-sizing: border-box;
}

a, button {
    text-decoration: none;
    cursor: pointer;
    font-weight: 400;
}

.header_scroll {
  position: fixed;

  left: 0;
  width: 100%;

  border-top: 1px solid var(--indigo);

  padding-top: 10px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  color: var(--slate);

  z-index: 1000;

  transition:
    top 0.45s ease,
    transform 0.45s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

h1 {
  font-size: clamp(28px, 5vw, 72px);
  color: var(--burgundy);
  padding: 20px;
  margin-bottom: 15px;
}

h2 {
  font-size: clamp(18px, 3vw, 36px);
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-align: center;
}

/* старт — по центру экрана (вертикально) */
.header_scroll.middle{
  top: 50%;
  transform: translateY(-50%);
}

/* при скролле вниз — фиксировать вверху */
.header_scroll.top {
  top: 0;
  transform: none;

  min-height: 35px;

  background: rgba(249, 247, 245, 0.84);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
/* Время */
.header_time {
  font-size: 12px;
  margin-left: 15px;
  margin-top: 0;
  color: var(--slate);
}

/* Центральная часть */
.header_wrap {
  position: absolute;
  top: -30px;
  left: 85%;
  transform: translateX(-50%);

  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 0 10px;
}

/* Текст SCROLL */
.scroll-text {
  font-size: 12px;
    /* чтобы текст был над линией */
  letter-spacing: 1px;
  color: var(--indigo);
  margin-bottom: 8px;
}

/* Навигация */
.header_nav {
  display: flex;
  gap: 30px;
}

.menu-item {
  font-size: clamp(14px, 1vw, 18px);
  color: var(--indigo);
  text-decoration: none;
  transition: color 0.3s; 
}

.menu-item:hover {
  color: var(--taupe);
}

.menu-item.active {
  color: var(--taupe);
  font-weight: 600;
}

.home_home_wrapper {
    min-height: 60vh;
    padding: 30px;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.home_words_wrapper {
    width: 100%;
    display: flex;    
    gap: 1rem;
    height: 100%;
    align-items: flex-start;
}

.home_web_wrapper {
    flex-shrink: 0;
    padding: 0 10px;
    line-height: 0.8;
}

.home_text {
    font-size: clamp(3rem, 10vw, 9rem);
    padding-top: 40px;
}

.home_work_wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform;
    position: relative;
    gap: 2rem;
    transition: transform 0.75s cubic-bezier(0.5, 0.33, 0, 1);
    margin: 20px 0 0 35px;
}
.home_work {
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1;
    display: flex;  
    flex-direction: row;
    align-items: flex-start;
}

.design {
    color: var(--slate);
}
.develop {
    color: var(--light);
}
.support {
    color: var(--taupe-light);
}

.home_work_wrapper a:hover {
  color: var(--indigo);
}

.home_work_wrapper a.active {
  color: var(--taupe);
  font-weight: 600;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 50px;
}

.intro-text {
  margin-bottom: 40px;
  max-width: 600px;
}

.btn {
  display: inline-block;
  font-size: 18px;
  width: 100%;
  padding: 15px;
  background: var(--taupe);
  color: var(--ivory);
  border: none;
  transition: 0.3s;
  margin-top: 30px;
  text-align: center;
}

.btn:hover {
  background: var(--light);
}

.intro-image {
  position: relative;
  width: 420px;
  height: 520px;
}

.intro-image img {
  width: 90%;
  max-width: 520px;
  transition: opacity 5s ease;
}

.hero-img{
  position: absolute;
  inset: 0;        /* top:0 left:0 right:0 bottom:0 */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.2s ease;
}

.img-side {
  opacity: 0;
}

.service-block {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;  
  gap: 60px;
}

#titly_design {
  background: #fdf6f0;
}

#titly_develop {
  background: #f0f4fd;
}

#titly_support {
  background: #f0fdf4;
}

.service-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.title_text, .service-block p {
  font-size: clamp(14px, 1.6vw, 20px);
  color: var(--slate);
  line-height: 1.6;
  padding: 10px;
  margin: 0 auto;
  width: 100%;
  max-width: 700px;
  min-width: unset;
}

.service-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 20px auto;
  border-radius: 2px;
}

.service-inner {
  width: 100%;
  max-width: 850px;
  text-align: center;
}

.service-inner ul {
  list-style: none;

  text-align: left;

  display: block;

  width: 100%;
  max-width: 650px;
  min-width: 0;

  font-size: clamp(14px, 1.6vw, 20px);

  color: var(--slate);

  line-height: 1.6;

  padding: 10px;

  margin: 0 auto;
}

.service-inner ul li::before  {
  content: "✓";
  color: var(--gold);
  font-weight: bold;
  margin-right: 10px;
}

.portfolio-title {
    text-align: center;
    font-size: 40px;
    color: var(--burgundy);
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4/3;
  box-shadow: 0 6px 28px rgba(0,0,0,0.3);
  transition: transform 0.3s;
  padding: 18px;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(40, 41, 62, 0.75); /* полупрозрачный фон */
  color: #fff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: opacity 0.4s ease;
  padding: 20px;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

canvas {
  display: block;
}

/* ---- particles.js container ---- */

#particles-js {
  position: absolute;
  inset: 0;          /* вместо width/height */
  z-index: 0; 
  background-color: var(--ivory);
  background-image: url("");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
}

/* ---- stats.js ---- */

.count-particles{
  
  position: absolute;
  top: 48px;
  left: 0;
  width: 80px;
  color: var(--indigo);
  font-size: .8em;
  text-align: left;
  text-indent: 4px;
  line-height: 14px;
  padding-bottom: 2px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: bold;
}

.js-count-particles{
  font-size: 1.1em;
}
#particles-js canvas {
  opacity: 0.45;
}

#stats{
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}

.count-particles{
  border-radius: 0 0 3px 3px;
}

#contact {
    background: var(--ivory);
    display: flex;
    justify-content: center;
    margin-bottom: 20px;

    position: relative;      /* ВАЖНО */
    overflow: hidden; 
}

.link {
  display: inline-block;
  color: var(--slate);        
  transition: transform 0.3s ease, color 0.3s ease; 
  padding: 0 5px;
}

.link svg {
  display: block;
}

.link:hover {
  color: var(--sage);        
  transform: scale(1.15);  
} 

.form-container {
  width: 100%;
  max-width: 600px;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* GROUP */

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 25px;
}

label {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--slate);
}

/* INPUTS */

input, textarea {
  padding: 14px;
  border: 1px solid var(--light);
  font-size: 15px;
  border-radius: 4px;
  transition: 0.3s;
  font-family: inherit;
}

input:focus,
textarea:focus {
  border-color: var(--burgundy);
  outline: none;
  box-shadow: 0 0 0 2px rgba(31,111,84,0.1);
}

footer {
  background-color: var(--slate);
  height: 20vh;
  position: relative;
  overflow: hidden;  
}

.skills-cloud {
  position: relative;
  width: 100%;
  height: 100%;
}

.word {
  position: absolute;
  left: 50%;
  font-size: 22px;
  color: var(--taupe-light);  
}



@media (max-width: 1699px) {

  .header_scroll,
  .header_scroll.middle,
  .header_scroll.top {
    top: 0;
    transform: none;

    min-height: 58px;

    padding: 0 24px;

    align-items: center;

    border-top: none;
    border-bottom: 1px solid rgba(40, 41, 62, 0.15);

    background: rgba(249, 247, 245, 0.94);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }


  .header_time {
    margin: 0;

    display: flex;
    align-items: center;

    min-height: 58px;
  }


  .header_wrap {
    position: absolute;

    top: 0;
    right: 30px;
    left: auto;

    transform: none;

    min-height: 58px;

    flex-direction: row;
    justify-content: center;
  }


  .scroll-text {
    display: none;
  }


  .header_nav {
    gap: clamp(18px, 2vw, 30px);
    align-items: center;
  }


  .home_home_wrapper {
    padding-top: 75px;
  }
}

@media (max-width: 900px) { 
 .portfolio-grid {
      justify-items: center;
 }
 .home_text {
  padding-top: 10px;
}
.intro {
    flex-direction: column;
    text-align: center;
  }
  .intro-text {
    order: 2;   
  }
  .intro-image {
    order: 1;
    margin-top: 30px;
    width: 220px;
    height: 220px;
    margin-inline: auto;
    position: relative;
    display: flex;
    justify-content: center;
  }
  .hero-img{
    position: absolute;   /* вернуть как было */
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  .intro-text {
    order: 2;
  }
  .intro-image img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
  }
}

@media (max-width: 600px) {

  .header_scroll,
  .header_scroll.middle,
  .header_scroll.top {
    top: 0;
    left: 0;

    width: 100%;
    min-height: 52px;

    transform: none;

    padding: 0 10px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(249, 247, 245, 0.96);

    border-top: none;
    border-bottom: 1px solid rgba(40, 41, 62, 0.12);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  }

.service-block {
    min-height: auto;

    padding: 70px 22px;

    scroll-margin-top: 60px;
  }

  .service-inner {
    width: 100%;
  }

  .service-inner h2 {
    font-size: clamp(22px, 7vw, 30px);
    letter-spacing: 2px;
  }

  .service-block p {
    padding-inline: 0;
  }

  .service-inner ul {
    padding-inline: 0;
  }

  .service-inner ul li {
    margin-bottom: 8px;
  }
  .header_time {
    display: none;
  }


  .header_wrap {
    position: absolute;

    top: 0;
    left: 50%;
    right: auto;

    transform: translateX(-50%);

    width: max-content;
    height: 52px;

    padding: 0;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }


  .header_nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: clamp(12px, 4vw, 20px);

    flex-wrap: nowrap;
  }


  .menu-item {
    font-size: clamp(12px, 3.4vw, 14px);

    white-space: nowrap;
  }


  .scroll-text {
    display: none;
  }


  .home_home_wrapper {
    padding-top: 65px;
  }
}

@media (max-width: 440px) {
   .home_text {
    margin: 0 auto;
    font-size: 2.5rem;
  }

  .home_work {
    font-size: 2rem;
  }
   .home_home_wrapper {    
    min-height: 1vh;
   }
   .home_work_wrapper {
      margin: 20px 0 0;
   }
  }