/* ============================================================
   DEREVO DV — Landing Page Styles
   Palette: warm white · charcoal · wood tan
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F7F4EF;
  --dark:      #1E1B18;
  --wood:      #C4A882;
  --wood-light:#E8DDD0;
  --text:      #2B2926;
  --muted:     #8A8580;
  --white:     #FFFFFF;
  --border:    #DDD8D2;

  --font-serif: 'Jost', system-ui, sans-serif;
  --font-sans:  'Jost', system-ui, sans-serif;

  --r: 4px;
  --section-pad: 96px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }

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

/* ---------- TYPOGRAPHY ---------- */
.section__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--wood);
  margin-bottom: 12px;
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: .02em;
  color: var(--dark);
}

.section__head {
  margin-bottom: 56px;
}

.section { padding: var(--section-pad) 0; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn--light {
  background: var(--white);
  color: var(--dark);
  border-color: var(--white);
}
.btn--light:hover { background: var(--wood-light); border-color: var(--wood-light); }

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn--ghost:hover { border-color: var(--white); background: rgba(255,255,255,.1); }

.btn--outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--wood);
}
.btn--outline:hover { background: var(--wood); color: var(--white); }

.btn--outline-dark {
  background: transparent;
  color: var(--dark);
  border-color: var(--dark);
}
.btn--outline-dark:hover { background: var(--dark); color: var(--white); }

.btn--dark {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.btn--dark:hover { background: #38332E; }

.btn--ghost-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.35);
}
.btn--ghost-light:hover { border-color: var(--white); background: rgba(255,255,255,.1); }

/* ---------- LOGO ---------- */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Картинка-логотип: одноцветная через filter */
.logo__img {
  height: 34px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  transition: filter .3s ease;
}
/* После скролла — только меняем цвет, размер не трогаем */
.header--scrolled .logo__img {
  filter: brightness(0) saturate(100%);
}

/* Fallback текст (если logo.png не загрузился) */
.logo__fallback {
  display: none;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: .14em;
}
.logo__main { font-size: 20px; color: var(--white); }
.logo__sub   { font-size: 15px; color: var(--wood); }
.header--scrolled .logo__main { color: var(--dark); }

/* ---------- HEADER ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  transition: background .3s ease, box-shadow .3s ease;
}

.header--scrolled {
  background: rgba(247, 244, 239, .96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 40px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
}

.nav__link {
  font-size: 18px;
  font-weight: 400;
  color: var(--white);
  letter-spacing: .03em;
  transition: color .2s;
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--wood);
  transition: width .25s;
}
.nav__link:hover::after { width: 100%; }

.header--scrolled .nav__link { color: var(--text); }
.header--scrolled .logo__main { color: var(--dark); }

.header__cta {
  padding: 10px 24px;
  font-size: 18px;
  font-weight: 400;
  /* на тёмном фоне (hero) — белая */
  background: var(--white);
  color: var(--dark);
  border-color: var(--white);
}
.header__cta:hover {
  background: var(--wood-light);
  border-color: var(--wood-light);
}
/* после скролла — акцентная деревянная */
.header--scrolled .header__cta {
  background: var(--wood);
  color: var(--white);
  border-color: var(--wood);
}
.header--scrolled .header__cta:hover {
  background: #b8976e;
  border-color: #b8976e;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.burger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--white);
  transition: all .25s;
}
.header--scrolled .burger span { background: var(--dark); }
.burger--open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger--open span:nth-child(2) { opacity: 0; }
.burger--open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
}
.hero__bg img { object-position: center; }
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(20,17,14,.72) 40%, rgba(20,17,14,.2));
}

.hero__content {
  position: relative;
  max-width: 640px;
  padding-top: 80px;
}

.hero__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bg); /* цвет как у фона блока Услуги — тёплый белый */
  margin-bottom: 20px;
}

.hero__title {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 24px;
}

.hero__desc {
  font-size: 17px;
  font-weight: 300;
  color: rgba(255,255,255,.8);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ---------- SERVICES ---------- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.service-card {
  background: var(--white);
  padding: 40px 32px;
  transition: background .25s;
}
.service-card:hover { background: var(--dark); }
.service-card:hover .service-card__title,
.service-card:hover .service-card__desc,
.service-card:hover .service-card__icon { color: var(--white); }

.service-card__icon {
  width: 48px; height: 48px;
  color: var(--wood);
  margin-bottom: 24px;
  transition: color .25s;
}
.service-card__icon svg { width: 100%; height: 100%; }

.service-card__title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 12px;
  transition: color .25s;
}

.service-card__desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  transition: color .25s;
}
.service-card:hover .service-card__desc { color: rgba(255,255,255,.65); }

/* ---------- PORTFOLIO ---------- */
.portfolio { background: var(--dark); }
.portfolio .section__label { color: var(--wood); }
.portfolio .section__title { color: var(--white); }
.portfolio .container { padding-bottom: 0; }

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 320px);
  gap: 3px;
  margin-top: 0;
}

.portfolio__item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.portfolio__item--wide {
  grid-column: span 2;
}
.portfolio__item img {
  filter: grayscale(35%) brightness(0.82);
  transition: transform .5s ease, filter .45s ease;
}
.portfolio__item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%) brightness(1);
}

.portfolio__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: rgba(255,255,255,.85);
  font-size: 13px;
  letter-spacing: .04em;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.portfolio__item:hover .portfolio__caption { transform: translateY(0); }

.portfolio__more {
  padding: 48px 32px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn--portfolio-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.35);
  background: transparent;
  transition: all .25s;
  cursor: pointer;
}
.btn--portfolio-social:hover {
  border-color: var(--white);
  background: rgba(255,255,255,.08);
}

/* ---------- WHY US ---------- */
.why__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.why__text {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin: 24px 0 36px;
}

.why__item {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.why__item:first-child { border-top: 1px solid var(--border); }

.why__num {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--wood);
  font-weight: 400;
  min-width: 32px;
  line-height: 1;
  padding-top: 2px;
}

.why__body h4 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--dark);
}

.why__body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- HOW WE WORK ---------- */
.how { background: var(--dark); }
.how .section__label { color: var(--wood); }
.how .section__title { color: var(--white); }

.how__steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 64px;
}

.how__step {
  flex: 1;
  padding: 0 32px;
  border-left: 1px solid rgba(255,255,255,.12);
}
.how__step:first-child { border-left: none; padding-left: 0; }

.how__step-num {
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--wood);
  opacity: .4;
  line-height: 1;
  margin-bottom: 20px;
}

.how__step-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 10px;
}

.how__step-desc {
  font-size: 14px;
  color: rgba(255,255,255,.5);
  line-height: 1.65;
}

.how__arrow {
  color: var(--wood);
  font-size: 1.5rem;
  opacity: .4;
  padding-top: 8px;
  flex-shrink: 0;
}

/* ---------- CTA SECTION ---------- */
.cta-section {
  background: var(--wood);
  padding: 80px 0;
}

.cta-section__inner { text-align: center; }

.cta-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 16px;
}

.cta-section__desc {
  color: rgba(30,27,24,.7);
  font-size: 16px;
  margin-bottom: 40px;
}

.cta-section__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- CONTACTS ---------- */
.contacts__inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}

.contacts__list {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contacts__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
}
.contacts__item svg { flex-shrink: 0; color: var(--wood); margin-top: 2px; }
.contacts__item a:hover { color: var(--dark); }

.contacts__social {
  display: flex;
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  transition: all .25s;
}
.social-link:hover {
  border-color: var(--wood);
  color: var(--wood);
  background: var(--wood-light);
}

.contacts__map {
  height: 420px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--dark);
  padding: 32px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer .logo__main { color: var(--white); }

.footer__copy {
  font-size: 13px;
  color: rgba(255,255,255,.35);
}

.footer__links {
  display: flex;
  gap: 24px;
}
.footer__links a {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  transition: color .2s;
}
.footer__links a:hover { color: var(--white); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio__grid { grid-template-rows: repeat(3, 260px); }
  .why__inner { grid-template-columns: 1fr; gap: 48px; }
  .contacts__inner { grid-template-columns: 1fr; }
  .contacts__map { height: 320px; }
}

@media (max-width: 768px) {
  :root { --section-pad: 64px; }

  .nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 40px 40px;
    gap: 28px;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.08);
  }
  .nav--open { transform: translateX(0); }
  .nav__link { color: var(--text); font-size: 17px; }
  .nav__link::after { display: none; }

  .burger { display: flex; }
  .header__cta { display: none; }

  .hero__title { font-size: clamp(2.2rem, 8vw, 3.5rem); }

  .services__grid { grid-template-columns: 1fr; gap: 2px; }

  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 220px);
  }
  .portfolio__item--wide { grid-column: span 2; }

  .how__steps {
    flex-direction: column;
    gap: 0;
  }
  .how__step {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 28px 0;
  }
  .how__step:first-child { border-top: none; }
  .how__arrow { display: none; }

  .footer__inner { flex-direction: column; align-items: flex-start; gap: 16px; }

  .cta-section__actions { flex-direction: column; align-items: center; }
  .hero__actions { flex-direction: column; }
  .btn { width: fit-content; }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .portfolio__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .portfolio__item, .portfolio__item--wide {
    grid-column: span 1;
    height: 240px;
  }
  .portfolio__caption { transform: translateY(0); }
  .contacts__social { flex-wrap: wrap; }
}

/* ---------- TICKER ---------- */
.ticker {
  background: var(--wood);
  padding: 14px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  animation: ticker-scroll 28s linear infinite;
}
.ticker__track:hover { animation-play-state: paused; }
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dark);
  padding-right: 60px;
}
.ticker__sep {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--dark);
  opacity: .4;
  flex-shrink: 0;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- STATS ---------- */
.stats {
  background: var(--dark);
  padding: 72px 0;
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.stat-card {
  padding: 40px 32px;
  border-left: 1px solid rgba(255,255,255,.08);
  text-align: center;
}
.stat-card:first-child { border-left: none; }
.stat-card__num {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 200;
  color: var(--wood);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.stat-card__label {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.5);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- FLOATING BUTTONS ---------- */
.float-btns {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.float-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}
.float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,.35);
}
.float-btn--wa  { background: #25D366; }
.float-btn--tg  { background: #2AABEE; }
.float-btn svg  { width: 26px; height: 26px; }

/* ---------- SCROLL ANIMATIONS ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .65s ease, transform .65s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up:nth-child(2) { transition-delay: .1s; }
.fade-up:nth-child(3) { transition-delay: .2s; }
.fade-up:nth-child(4) { transition-delay: .3s; }
.fade-up:nth-child(5) { transition-delay: .4s; }

@media (max-width: 768px) {
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { border-left: none; border-top: 1px solid rgba(255,255,255,.08); }
  .stat-card:nth-child(1), .stat-card:nth-child(2) { border-top: none; }
  .float-btns { bottom: 20px; right: 20px; }
  .float-btn { width: 48px; height: 48px; }
}

/* Скрытые доп. фото проекта — не отображаются в сетке */
.portfolio__extra { display: none; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 60px rgba(0,0,0,.5);
  transition: opacity .25s ease;
}
.lightbox__img.loading { opacity: 0; }

.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color .2s;
}
.lightbox__close:hover { color: var(--white); }

.lightbox__arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  color: var(--white);
  font-size: 22px;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}
.lightbox__arrow:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.lightbox__arrow--prev { left: 24px; }
.lightbox__arrow--next { right: 24px; }

.lightbox__counter {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.45);
  font-size: 13px;
  letter-spacing: .08em;
  font-family: var(--font-sans);
}

/* на мобильных стрелки снизу */
@media (max-width: 600px) {
  .lightbox__arrow--prev { left: 12px; }
  .lightbox__arrow--next { right: 12px; }
  .lightbox__arrow { width: 44px; height: 44px; font-size: 18px; }
}
