﻿/* CSS Variables and Reset */
:root {
  --bg: #0b0f12;
  --surface: #0f1418;
  --card: #141a1f;
  --primary: #0f6c5c;
  --primary-700: #0a4e43;
  --text: #e8f0f2;
  --muted: #9fb0b8;
  --border: #20303a;
  --accent: #e8f9f3;
  --radius: 12px;
  --gap: 1rem;
  --container: min(1120px, 92vw);
  /* Scrollbar */
  --scrollbar-size: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #0b0f12 0%, #0d1014 100%);
}

/* Cross-browser scrollbar styling */
html {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary) var(--surface); /* thumb track */
  scrollbar-gutter: stable; /* Chrome/Firefox; Safari ignores gracefully */
}

/* WebKit/Blink (Chrome/Safari/Edge) */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
  border: 2px solid var(--surface);
}
*::-webkit-scrollbar-corner { background: var(--surface); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: -999px;
}
.skip-link:focus {
  left: 16px; top: 12px; background: var(--accent); color: #0b0f12; padding: .5rem .75rem; border-radius: 8px;
}

/* Layout */
.container { width: var(--container); margin-inline: auto; }
.section { padding: 1.5em 0; }
.section__lead { color: var(--muted); margin-top: .25rem; margin-bottom: 1.25rem; }
/* Promo */
.promo { margin-top: 1rem; }
.promo__inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .75rem; background: linear-gradient(90deg, rgba(15,108,92,.2), rgba(15,108,92,.05)); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.promo__badge { background: var(--primary); color: #fff; padding: .25rem .5rem; border-radius: 8px; font-size: .9rem; }
.promo__text { margin: 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(11,15,18,.7); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header__inner { display: flex; align-items: center; /*gap: 1rem;*/ padding: .75rem 0; }

.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: .2px; }
.logo__mark { background: var(--primary); color: #fff; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.logo__text { color: var(--text); }
.logo__img { height: 32px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.logo--footer .logo__img { height: 26px; }  

/* Use image-based logo in header/footer (hide text spans) */
.site-header .logo,
.site-footer .logo--footer { position: relative; }
.site-header .logo { background: no-repeat left center / auto 60px url('../img/logo/logo_icon_256x256_transparent.png'); padding-left: 64px; min-height: 64px; }
.site-footer .logo--footer { background: no-repeat left center / auto 48px url('../img/logo/logo_icon_text_256x256_transparent.png'); padding-left: 42px; min-height: 48px; }

/*
.site-header .logo .logo__text,
.site-footer .logo--footer .logo__text { display: none; }
*/

.site-header .logo .logo__mark,
.site-footer .logo--footer .logo__text { display: none; }
.site-footer .logo--footer .logo__mark { display: none; }


/* Header contacts (phone + VK) */
.header__contacts { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; }
.header__phone { display: inline-block;  white-space: nowrap; color: var(--text); font-weight: 700; padding: .35rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.header__phone_icon { padding: .25rem; display: none;}
.btn--icon { padding: .45rem .6rem; }

@media (min-width: 960px) {
  .header__contacts { display: inline-flex; }
}

/* Grouped info blocks */
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: 0 6px 14px rgba(0,0,0,.06); }
.group--accent { position: relative; }
.group--accent::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--primary); opacity: .35; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }

/*.site-nav { margin-left: auto; }*/
.nav__list { display: flex; /* gap: 1rem;*/ list-style: none; margin: 1rem; padding: 0; }
.nav__list a { color: var(--muted); padding: .5rem .75rem; border-radius: 8px; }
.nav__list a:hover { color: var(--text); background: rgba(255,255,255,.04); }

.nav-toggle { display: none; background: transparent; border: 0; padding: .25rem; }
.nav-toggle__bar { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* Hero */
.hero { padding: 1em 0 24px; border-bottom: 1px solid var(--border); }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.hero__content h1 { font-size: clamp(28px, 2.6vw, 44px); line-height: 1.15; margin: 0 0 .75rem; }
.hero__content p { color: var(--muted); margin: 0 0 1rem; max-width: 62ch; }
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero__media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.35); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; }
.btn--primary { background: var(--primary); border-color: var(--primary-700); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: rgba(255,255,255,.06); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.card__title { margin: 0 0 .25rem; font-size: 1.1rem; }
.card__text { margin: 0; color: var(--muted); }

/* Projects / Gallery */
.projects { display: grid; gap: 1rem; }
.project { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.project__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.project__title { margin: 0; font-size: 1.1rem; }
.project__meta { margin: 0; color: var(--muted); font-size: .95rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.gallery__item { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.gallery__item img { aspect-ratio: 4/3; object-fit: cover; transition: transform .2s ease; }
.gallery__item:hover img { transform: scale(1.02); }

/* Carousel */
.carousel { position: relative; }
.carousel__track { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .25rem; }
.carousel__item { display: block; scroll-snap-align: start; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--card); position: relative; }
.carousel__item img { width: 100%; height: 280px; object-fit: cover; }
.carousel__item--more { display: grid; place-items: center; color: var(--accent); font-weight: 600; }
.carousel__btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: 0; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.carousel__btn--prev { left: -10px; }
.carousel__btn--next { right: -10px; }

/* Reviews carousel tweaks */
.reviews .carousel__item img { height: 360px; object-fit: contain; background: var(--surface); }

/* Square tiles for project carousel */
.carousel--square .carousel__item { aspect-ratio: 1 / 1; }
.carousel--square .carousel__item img { width: 100%; height: 100%; object-fit: cover; }

/* Project carousel responsive widths */
@media (min-width: 960px) {
  .carousel--square .carousel__track,
  .carousel--square [data-carousel-track] { grid-auto-columns: 40%; }
}
@media (min-width: 1280px) {
  .carousel--square .carousel__track,
  .carousel--square [data-carousel-track] { grid-auto-columns: 28%; }
}

/* Price table */
.price-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.price-table table th, .price-table table td { padding: .75rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.price-table table thead th { background: rgba(255,255,255,.03); color: var(--muted); font-weight: 600; }
.price-table table tbody tr:hover { background: rgba(255,255,255,.03); }
.note { margin-top: .75rem; color: var(--muted); }
.note summary { cursor: pointer; color: var(--text); margin-bottom: .5rem; }
.price__actions { margin-top: .75rem; }

/* Contacts */
.contacts__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contacts { font-style: normal; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.contacts a { color: var(--accent); }

.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.form__row { display: grid; gap: .35rem; margin-bottom: .75rem; }
.form__row--actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.form__hint { color: var(--muted); margin: 0; font-size: .9rem; }
.form__status { margin-top: .25rem; color: var(--accent); }

.contacts-short { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.contact-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .5rem .9rem; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
.contacts-short .btn { border-radius: 999px; min-height: 40px; display: inline-flex; align-items: center; gap: .5rem; }
a .icon, .btn .icon { width: 18px; height: 18px; display: inline-block; }

label { color: var(--text); }
input, textarea { background: #0c1116; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .65rem .75rem; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,108,92,.2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 48px; }
.footer__grid { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer__nav { list-style: none; margin: 0; padding: 0; display: flex; gap: .75rem; }
.muted { color: var(--muted); }
.logo--footer .logo__mark { width: 24px; height: 24px; }

/* Responsive */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .contacts__grid { grid-template-columns: 1fr; }

}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; inset: 56px 0 auto 0; background: rgba(11,15,18,.98); border-bottom: 1px solid var(--border); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .2s ease; }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__list { padding: .75rem; gap: .25rem; flex-direction: column; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .carousel__track { grid-auto-columns: 88%; }
  .header__phone  { display: none;}
  .header__phone_icon {display: flex;}
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; padding: 2rem; z-index: 50; }
.lightbox.open { display: flex; }
.lightbox__img { max-width: 92vw; max-height: 86vh; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.lightbox__close { position: absolute; top: 16px; right: 16px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .75rem; cursor: pointer; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: .5rem .75rem; box-shadow: 0 6px 16px rgba(0,0,0,.18); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.toast.show { opacity: 1; }
.group--alt { position: relative; }
.group--alt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--primary), rgba(15,108,92,.25)); opacity: .25; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }