/* ==========================================================================
   ФУНДАМЕНТАЛ БИЛДИНГ ЕООД — styles
   Brand colours come from the vector logo: blue #0044DD, green #23A005.
   ========================================================================== */

:root {
  --blue: #0044dd;
  --blue-dark: #0a2470;
  --blue-tint: #e8eefc;
  --green: #23a005;
  --green-bright: #3cc51a;
  --ink: #14204a;
  --text: #2a3350;
  --muted: #5b6684;
  --concrete: #f2f5f9;
  --line: #dce3ec;
  --white: #ffffff;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-space: clamp(4.5rem, 9vw, 7.5rem);
  --radius-sm: 4px;
  --radius: 10px;
  --header-h: 76px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { color: var(--ink); margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--blue);
  color: var(--white);
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 52px;
  padding: .85rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: #0036b3; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--white); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--light { background: var(--white); color: var(--blue-dark); }
.btn--light:hover { background: var(--blue-tint); }

.link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link:hover { text-decoration-thickness: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: var(--header-h);
}

.brand img { height: 38px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.6rem; }
.site-nav ul a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding-block: .4rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav ul a:hover,
.site-nav ul a.is-active { border-bottom-color: var(--green); }
.site-nav__cta { min-height: 44px; padding: .6rem 1.2rem; font-size: .95rem; white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  position: relative;
}
.nav-toggle__bar {
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  background: var(--ink);
  transition: transform .25s ease;
}
.nav-toggle__bar:first-child { top: 16px; }
.nav-toggle__bar:nth-child(2) { top: 25px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background: var(--concrete);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: end;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-top: clamp(3rem, 7vw, 6rem);
}
.hero__text { padding-bottom: clamp(3rem, 8vw, 7rem); }

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 4.9vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 13ch;
  text-wrap: balance;
}
.hero__lead {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.08rem, 1.4vw, 1.22rem);
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.25rem; }

.hero__visual { margin: 0; align-self: end; }
.hero__svg { width: 100%; height: auto; }

.hero__bars polygon {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: bar-rise .7s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(.35s + var(--i) * .09s);
}
@keyframes bar-rise {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* ---------- Facts strip ---------- */
.facts { border-bottom: 1px solid var(--line); background: var(--white); }
.facts__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.fact {
  padding: 2rem 1.5rem 2rem 0;
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}
.fact:first-child { border-left: 0; padding-left: 0; }
.fact__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--blue);
  margin-bottom: .35rem;
}
.fact__label { font-size: .95rem; color: var(--muted); line-height: 1.45; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-space); }

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.2vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.section__lead {
  margin-top: 1.1rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40rem;
}
.section__head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.about__media { position: relative; padding-bottom: 4rem; padding-right: 3rem; }
.about__img { background: var(--line); object-fit: cover; }
.about__img--main { width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius); }
.about__img--inset {
  position: absolute;
  right: 0; bottom: 0;
  width: 52%;
  aspect-ratio: 4 / 3;
  border: 8px solid var(--white);
  border-radius: var(--radius);
}
.about__text > p { max-width: 36rem; }
.about__text .section__lead { margin-bottom: 1.25rem; }

.values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2rem;
  margin-top: 2.5rem;
}
.values li { padding-top: 1rem; position: relative; }
.values li::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 36px; height: 3px;
  background: var(--green);
}
.values h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .35rem; }
.values p { font-size: .97rem; color: var(--muted); line-height: 1.55; }

/* ---------- Services ---------- */
.services { background: var(--concrete); }
.services__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.services__intro { position: sticky; top: calc(var(--header-h) + 2rem); }
.services__img {
  margin-top: 2.5rem;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}

.service-list { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.service h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.service__body p { color: var(--muted); max-width: 34rem; }
.service__codes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: .35rem;
  max-width: 11rem;
  margin: .2rem 0 0;
}
.service__codes span {
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .15rem .45rem;
}

/* ---------- What we build ---------- */
.build__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.tile { margin: 0; }
.tile--wide { grid-column: span 2; }
.tile img {
  width: 100%;
  height: clamp(240px, 27vw, 360px);
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}
.tile__caption { padding-top: 1.1rem; }
.tile__caption h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .25rem; }
.tile__caption p { color: var(--muted); font-size: .98rem; }

/* ---------- Process ---------- */
.process { background: var(--white); border-top: 1px solid var(--line); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.step h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.25rem 0 .5rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.step__num {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--blue);
  font-size: 1rem;
}
.step p { color: var(--muted); font-size: .98rem; }

.step__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 56px;
}
.step__bars i {
  display: block;
  width: 14px;
  background: var(--line);
}
.step__bars i:nth-child(1) { height: 25%; }
.step__bars i:nth-child(2) { height: 50%; }
.step__bars i:nth-child(3) { height: 75%; }
.step__bars i:nth-child(4) { height: 100%; }
.step:nth-child(1) .step__bars i:nth-child(-n+1),
.step:nth-child(2) .step__bars i:nth-child(-n+2),
.step:nth-child(3) .step__bars i:nth-child(-n+3),
.step:nth-child(4) .step__bars i:nth-child(-n+4) { background: var(--green); }

/* ---------- KSB ---------- */
.ksb { background: var(--concrete); }
.ksb__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.cert {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cert__thumb {
  display: block;
  background: #eef1f5;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.cert__thumb img {
  box-shadow: 0 1px 2px rgba(20, 32, 74, .12), 0 8px 24px rgba(20, 32, 74, .08);
  transition: transform .25s ease;
}
.cert__thumb:hover img { transform: scale(1.015); }
.cert__body { padding: 1.5rem 1.75rem 1.75rem; }
.cert__body h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.cert__group { color: var(--green); font-weight: 600; margin: .35rem 0 .75rem; }
.cert__body p:not(.cert__group) { color: var(--muted); }
.cert__body .link { display: inline-block; margin-top: 1rem; }
.ksb__note { margin-top: 2rem; color: var(--muted); }

/* ---------- Area / CTA band ---------- */
.area {
  position: relative;
  isolation: isolate;
  color: var(--white);
  background: var(--blue-dark);
  overflow: hidden;
}
.area__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.area::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(10, 36, 112, .94) 0%, rgba(10, 36, 112, .82) 45%, rgba(10, 36, 112, .45) 100%);
}
.area__inner { padding-block: clamp(4.5rem, 10vw, 8rem); max-width: calc(var(--container) + var(--gutter) * 2); }
.area__inner > * { max-width: 36rem; }
.area__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.4vw, 2.8rem);
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.area p { color: rgba(255, 255, 255, .86); font-size: 1.12rem; margin-bottom: 2rem; }

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.form { margin-top: 2.25rem; display: grid; gap: 1.1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field__label { font-size: .92rem; font-weight: 600; color: var(--ink); }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .8rem .9rem;
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.field input[aria-invalid="true"] { border-color: #c62828; }
.form .btn { justify-self: start; }
.form__status { margin: 0; font-size: .95rem; min-height: 1.4em; }
.form__status.is-error { color: #c62828; }
.form__status.is-ok { color: var(--green); }

.company-card {
  background: var(--concrete);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 4px solid var(--green);
}
.company-card__logo { width: 180px; margin-bottom: 1.75rem; }
.company-card dl { margin: 0; display: grid; gap: 1rem; }
.company-card dt { font-size: .85rem; color: var(--muted); }
.company-card dd { margin: .1rem 0 0; font-weight: 600; color: var(--ink); line-height: 1.45; }
.company-card dd a { text-decoration: none; color: var(--blue); }
.company-card dd a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, .78);
  font-size: .95rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: 4rem 3rem;
}
.site-footer img { height: 36px; width: auto; }
.site-footer__tag { margin-top: 1.25rem; }
.site-footer ul { display: grid; gap: .5rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .87rem;
}
.site-footer__bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .site-nav ul { gap: 1.1rem; }
  .site-nav ul a { font-size: .9rem; }
}

@media (max-width: 1100px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.5rem var(--gutter) 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(20, 32, 74, .08);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .site-nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav ul a:hover, .site-nav ul a.is-active { border-bottom-color: var(--line); color: var(--blue); }

  .hero__grid { grid-template-columns: 1fr; gap: 0; }
  .hero__text { padding-bottom: 2.5rem; }
  .hero__title { max-width: 16ch; }
  .hero__visual { max-width: 560px; margin-left: auto; width: 100%; }

  .facts__grid { grid-template-columns: 1fr 1fr; }
  .fact { padding: 1.5rem 1rem 1.5rem 1.25rem; }
  .fact:nth-child(3) { border-left: 0; padding-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }

  .about__grid,
  .services__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 560px; }
  .services__intro { position: static; }
  .services__img { display: none; }

  .steps { grid-template-columns: 1fr 1fr; row-gap: 3rem; }
  .ksb__grid { grid-template-columns: 1fr; max-width: 640px; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand img { height: 32px; }
  .build__grid { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; }
  .tile img { height: auto; aspect-ratio: 4 / 3; }
  .values { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; }
  .service__codes { justify-content: flex-start; max-width: none; }
  .steps { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .about__media { padding-right: 1.5rem; padding-bottom: 3rem; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
