:root {
  --bg: #0c0d0f;
  --bg-elevated: #15171b;
  --ink: #f2efe8;
  --muted: #a8a399;
  --accent: #c8782a;
  --accent-soft: rgba(200, 120, 42, 0.18);
  --line: rgba(242, 239, 232, 0.12);
  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(200, 120, 42, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(70, 90, 110, 0.22), transparent 50%),
    linear-gradient(180deg, #101114 0%, var(--bg) 40%, #0a0b0d 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

h1, h2, .brand-mark, .logo-title, .company-name, .ref-line {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  margin: 0.2em 0 0.35em;
  max-width: 16ch;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin: 0 0 0.7em;
  max-width: 20ch;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 38rem;
}

.section-inner {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(12, 13, 15, 0.92), rgba(12, 13, 15, 0.55) 70%, transparent);
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-decoration: none;
  line-height: 1;
  min-width: 0;
}

.logo-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.logo-title span {
  color: var(--accent);
  margin-left: 0.25em;
}

.logo-sub {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 2.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.logo-sep {
  display: inline-block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  min-height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 0.55rem 0.6rem;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 0.32rem 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  will-change: opacity;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  transition: transform 7s ease-out;
}

.hero-slide.is-active img {
  transform: scale(1);
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(8, 9, 11, 0.4) 0%, rgba(8, 9, 11, 0.55) 40%, rgba(8, 9, 11, 0.92) 100%),
    linear-gradient(90deg, rgba(8, 9, 11, 0.72) 0%, transparent 58%);
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
  padding: 7rem 0 5.5rem;
  animation: rise 1s ease-out both;
}

.brand-mark {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.55rem;
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(242, 239, 232, 0.35);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.hero-dot.is-active {
  width: 1.6rem;
  background: var(--accent);
}

.hero-dot:hover {
  background: rgba(242, 239, 232, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #140e08;
}

.btn-primary:hover {
  background: #d98935;
  color: #140e08;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--ink);
}

/* About */
.about {
  position: relative;
  overflow: hidden;
}

.about-texture {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 13, 15, 0.88), rgba(12, 13, 15, 0.94)),
    url("assets/fon.jpg") center / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.about .section-inner {
  position: relative;
  border-top: 1px solid var(--line);
}

.about p {
  color: var(--muted);
}

.about .lead {
  margin-bottom: 1.25rem;
}

/* Companies */
.companies {
  background:
    linear-gradient(180deg, transparent, rgba(21, 23, 27, 0.65)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.015) 48px,
      rgba(255, 255, 255, 0.015) 49px
    );
}

.company-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.company-list li {
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.company-list li.is-visible {
  opacity: 1;
  transform: none;
}

.company-link {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 1rem 2rem;
  align-items: baseline;
  padding: 1.35rem 0;
  text-decoration: none;
  transition: padding-left 0.3s ease, color 0.25s ease;
}

.company-link:hover {
  padding-left: 0.5rem;
  color: inherit;
}

.company-link:hover .company-name {
  color: var(--accent);
}

.company-name {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s ease;
}

.company-desc {
  color: var(--muted);
  font-size: 1rem;
}

/* Gallery */
.gallery .lead {
  margin: -0.25rem 0 1.75rem;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter-btn:hover {
  color: var(--ink);
  border-color: rgba(242, 239, 232, 0.28);
}

.filter-btn.is-active {
  color: #140e08;
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.65rem;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-elevated);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
  filter: saturate(0.9);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.gallery-tag {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(12, 13, 15, 0.72);
  padding: 0.28rem 0.5rem;
  pointer-events: none;
}

/* Lightbox */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(6, 7, 9, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  text-align: center;
  max-height: calc(100vh - 2rem);
}

.lightbox-figure img {
  max-width: min(92vw, 1100px);
  max-height: calc(100vh - 5rem);
  width: auto;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.lightbox-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid var(--line);
  background: rgba(21, 23, 27, 0.8);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Expertise */
.expertise {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 70vh;
}

.expertise-media {
  position: relative;
  min-height: 22rem;
  overflow: hidden;
}

.expertise-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}

.expertise-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--bg));
}

.expertise-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 5rem);
}

.expertise-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.expertise-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.35rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.expertise-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
}

/* Refs */
.refs .section-inner {
  text-align: center;
  border-block: 1px solid var(--line);
}

.refs h2 {
  max-width: none;
  margin-inline: auto;
}

.ref-line {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

address {
  font-style: normal;
  color: var(--muted);
  line-height: 1.8;
}

address a {
  text-decoration: none;
}

.map-link {
  margin-top: 1.5rem;
}

/* Footer */
.site-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.scroll-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.3rem;
  z-index: 50;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  background: rgba(21, 23, 27, 0.92);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.scroll-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.scroll-top[hidden] {
  display: none;
}

/* Motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide,
  .hero-slide img,
  .hero-content,
  .company-list li {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }

  .hero-slide:not(.is-active) {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .site-header {
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }

  .logo {
    gap: 0.4rem;
    padding-top: 0.15rem;
    max-width: calc(100% - 3.5rem);
  }

  .logo-title {
    font-size: 1.28rem;
    letter-spacing: 0.1em;
  }

  .logo-sub {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    gap: 0.4rem;
  }

  .logo-sep {
    width: 5px;
    height: 5px;
    min-width: 5px;
    min-height: 5px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    display: none;
    text-align: center;
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child { border-bottom: 0; }

  .hero-content,
  .about .section-inner,
  .companies .section-inner,
  .gallery .section-inner,
  .expertise-content,
  .contact .section-inner,
  .refs .section-inner {
    text-align: center;
  }

  h1,
  h2,
  .lead,
  .hero-lead,
  .about p {
    margin-left: auto;
    margin-right: auto;
    max-width: 28rem;
  }

  .hero-actions,
  .gallery-filters {
    justify-content: center;
  }

  .filter-btn[data-filter="all"] {
    display: none;
  }

  .company-link {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    justify-items: center;
    text-align: center;
  }

  .company-link:hover {
    padding-left: 0;
  }

  .expertise-list li {
    text-align: left;
    max-width: 22rem;
    margin-inline: auto;
  }

  .expertise {
    grid-template-columns: 1fr;
  }

  .expertise-media::after {
    background: linear-gradient(180deg, transparent 50%, var(--bg));
  }

  .contact-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  address {
    text-align: center;
  }

  .map-link {
    display: inline-flex;
  }

  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
  }

  .lightbox-nav {
    order: 2;
  }

  .lightbox-figure {
    order: 1;
  }
}
