/*
 * Homepage footer (#kvx-footer): identity, contact list and legal row.
 *
 * Transparent — the stone backdrop belongs to the page-end wrapper around it.
 * Layouts:
 *   ≤767px   centred single column;
 *   ≥768px   three columns (identity | divider | contacts) and a legal row.
 *            Sizes grow linearly from 1280px wide (each value interpolates
 *            from its 1280 size with --footer-over = 100vw − 1280px, capped);
 *   ≥1921×1081 type follows the site-wide high-res type scale;
 *   1080p / 2160p bands: contact icons keep their 1280×720 proportion, and in
 *            the 2160p band the whole 1280×720 composition is magnified.
 */

.site-footer {
  --footer-over: calc(100vw - 1280px);
  --footer-base: rgb(255 253 249 / 0.99);
  --footer-muted: rgb(255 253 249 / 0.8);
  --footer-warm: rgb(240 224 201 / 0.96);
  --footer-gold: rgb(240 196 125 / 0.99);
  --footer-gold-line: rgb(198 118 48 / 0.42);
  --footer-shell-width: min(1920px, calc(100% - clamp(20px, 1.6vw, 32px)));
  --footer-pad-x: clamp(40px, calc(40px + var(--footer-over) * 0.03125), 60px);

  position: relative;
  z-index: 2;
  color: var(--footer-base);
}

/* Copper hairline across the full width at the top edge. */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: 100vw;
  height: 1.5px;
  transform: translateX(-50%);
  pointer-events: none;
  background: rgb(222 150 68);
  box-shadow: 0 0 10px rgb(222 150 68 / 0.18);
}

.site-footer__shell {
  position: relative;
  box-sizing: border-box;
  width: var(--footer-shell-width);
  margin: 0 auto;
  padding:
    clamp(56px, calc(56px + var(--footer-over) * 0.04375), 84px)
    var(--footer-pad-x)
    clamp(24px, calc(24px + var(--footer-over) * 0.01875), 36px);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, calc(40px + var(--footer-over) * 0.05), 72px);
  width: 100%;
}

/* ----- Identity ----- */

.site-footer__identity {
  display: flex;
  align-items: center;
  gap: clamp(20px, calc(20px + var(--footer-over) * 0.0140625), 29px);
  min-width: 0;
}

.site-footer__emblem {
  display: block;
  flex: 0 0 auto;
  width: clamp(104px, calc(104px + var(--footer-over) * 0.05), 138px);
  height: clamp(104px, calc(104px + var(--footer-over) * 0.05), 138px);
  max-width: 100%;
  object-fit: contain;
  filter: saturate(0.82) brightness(0.88) contrast(1.06);
}

.site-footer__identity-text {
  min-width: 0;
}

.site-footer__brand-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: clamp(9px, calc(9px + var(--footer-over) * 0.00703125), 13.5px);
  font-family: var(--font-serif);
}

.site-footer__brand-name {
  color: var(--footer-gold);
  font-size: clamp(36px, calc(36px + var(--footer-over) * 0.025), 52px);
  line-height: 1;
  letter-spacing: 0.075em;
}

.site-footer__brand-ltd {
  color: rgb(231 213 187 / 0.96);
  font-size: clamp(16px, calc(16px + var(--footer-over) * 0.0125), 24px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-footer__tagline {
  max-width: clamp(390px, calc(390px + var(--footer-over) * 0.265625), 560px);
  margin: clamp(14px, calc(14px + var(--footer-over) * 0.009375), 20px) 0 0;
  color: var(--footer-warm);
  font-family: var(--font-serif);
  font-size: clamp(15px, calc(15px + var(--footer-over) * 0.01171875), 22.5px);
  line-height: 1.55;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-footer__divider {
  align-self: stretch;
  width: 1px;
  min-height: clamp(104px, calc(104px + var(--footer-over) * 0.065625), 146px);
  background: linear-gradient(to bottom, transparent, var(--footer-gold-line) 18%, var(--footer-gold-line) 82%, transparent);
}

/* ----- Contacts ----- */

.site-footer__contacts {
  display: grid;
  justify-self: end;
  gap: clamp(8px, calc(8px + var(--footer-over) * 0.00625), 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__contact {
  --contact-size: clamp(17px, calc(17px + var(--footer-over) * 0.01328125), 25.5px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, calc(8px + var(--footer-over) * 0.00625), 12px);
  margin: 0;
  padding: 0;
  font-family: var(--font-serif);
  font-size: var(--contact-size);
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-align: right;
}

.site-footer__icon {
  display: block;
  width: clamp(22px, calc(22px + var(--footer-over) * 0.0125), 30px);
  height: clamp(22px, calc(22px + var(--footer-over) * 0.0125), 30px);
  color: rgb(224 177 105 / 0.72);
}

.site-footer__link {
  color: var(--footer-base);
  text-decoration: none;
  transition: color 220ms ease;
}

.site-footer__link:hover {
  color: rgb(238 190 132 / 0.96);
}

/* Phone number set in lining figures, nudged onto the row's optical line. */
.site-footer__link--phone {
  position: relative;
  top: -1px;
  font-family: var(--font-serif);
  font-size: 1.04em;
  font-weight: 600;
  font-variant-numeric: lining-nums proportional-nums;
  font-feature-settings: "kern" 1, "lnum" 1, "pnum" 1;
  letter-spacing: 0.018em;
}

.site-footer__muted {
  color: rgb(240 224 201 / 0.91);
}

/* ----- Legal row ----- */

.site-footer__bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, calc(20px + var(--footer-over) * 0.015625), 30px);
  margin-top: clamp(24px, calc(24px + var(--footer-over) * 0.01875), 36px);
  padding-top: clamp(14px, calc(14px + var(--footer-over) * 0.0109375), 21px);
}

.site-footer__bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(232 187 117 / 0.36) 12%,
    rgb(240 196 125 / 0.68) 50%,
    rgb(232 187 117 / 0.36) 88%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgb(232 187 117 / 0.12);
}

.site-footer__copyright {
  margin: 0;
  color: var(--footer-muted);
  font-family: var(--font-serif);
  font-size: clamp(11px, calc(11px + var(--footer-over) * 0.00859375), 16.5px);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.site-footer__legal {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, calc(10px + var(--footer-over) * 0.0078125), 15px);
  margin: 0;
  padding: 0;
  color: var(--footer-muted);
  font-family: var(--font-serif);
  font-size: clamp(10.5px, calc(10.5px + var(--footer-over) * 0.008203125), 15.75px);
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-footer__legal-link {
  color: inherit;
  text-decoration: none;
  outline: none;
  transition: color 220ms ease;
}

.site-footer__legal-link:hover {
  color: rgb(242 169 0 / 0.9);
}

.site-footer__legal-sep {
  color: var(--footer-gold);
  opacity: 0.55;
}

/* ----- Phone ----- */

@media (max-width: 767px) {
  .site-footer__shell {
    width: 100%;
    margin: 0;
    padding: 40px 20px 28px;
  }

  .site-footer__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    text-align: center;
  }

  .site-footer__identity {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }

  .site-footer__emblem {
    width: 128px;
    height: 128px;
    filter: saturate(0.88) brightness(0.94) contrast(1.04);
  }

  .site-footer__identity-text {
    width: 100%;
  }

  .site-footer__brand-line {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .site-footer__brand-name {
    font-size: 54px;
    line-height: 0.95;
    letter-spacing: 0.06em;
  }

  .site-footer__brand-ltd {
    font-size: 20px;
    letter-spacing: 0.14em;
  }

  .site-footer__tagline {
    max-width: 30ch;
    margin: 16px auto 0;
    font-size: 22px;
    line-height: 1.5;
    letter-spacing: 0.1em;
  }

  .site-footer__divider {
    align-self: center;
    width: min(168px, 42vw);
    min-height: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--footer-gold-line) 18%, var(--footer-gold-line) 82%, transparent);
  }

  .site-footer__contacts {
    width: 100%;
    max-width: 100%;
    gap: 12px;
  }

  .site-footer__contact {
    --contact-size: 20px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-align: center;
  }

  /* The first row keeps a faint rule above it. */
  .site-footer__contact:first-child {
    border-top: 1px solid rgb(198 118 48 / 0.22);
  }

  .site-footer__icon {
    width: 18px;
    height: 18px;
    color: inherit;
  }

  .site-footer__link--phone {
    top: auto;
    font-size: inherit;
  }

  .site-footer__bottom {
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    padding-top: 20px;
    text-align: center;
  }

  .site-footer__copyright {
    max-width: 32ch;
    color: rgb(255 253 249 / 0.83);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0.03em;
  }

  .site-footer__legal {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    font-size: 12px;
    letter-spacing: 0.12em;
    white-space: normal;
  }
}

/* ----- Large screens ----- */

@media (min-width: 1921px) and (min-height: 1081px) {
  .site-footer__brand-name { font-size: clamp(52px, min(2.708333vw, 4.814815vh), 75.4px); }
  .site-footer__brand-ltd { font-size: clamp(24px, min(1.25vw, 2.222222vh), 36px); }
  .site-footer__tagline { font-size: clamp(22.5px, min(1.171875vw, 2.083333vh), 33.75px); }
  /* (The first contact row keeps the 1920 size, exactly as the original.) */
  .site-footer__contact:not(:first-child) { --contact-size: clamp(25.5px, min(1.328125vw, 2.361111vh), 38.25px); }
  .site-footer__copyright { font-size: clamp(16.5px, min(0.859375vw, 1.527778vh), 24.75px); }
  .site-footer__legal { font-size: clamp(15.75px, min(0.820313vw, 1.458333vh), 23.625px); }
}

/* 1080p and 2160p bands: icons keep the 22px:17px proportion of 1280×720. */
@media (min-width: 1600px) and (max-width: 2200px) and (min-height: 900px) and (max-height: 1250px),
       (min-width: 3200px) and (max-width: 4400px) and (min-height: 1800px) and (max-height: 2500px) {
  .site-footer__icon {
    width: calc(22 * min(100vw / 1280, 100vh / 720));
    height: calc(22 * min(100vw / 1280, 100vh / 720));
  }
}

/* 2160p band: the 1280×720 footer composition, magnified as a whole. */
@media (min-width: 3200px) and (max-width: 4400px) and (min-height: 1800px) and (max-height: 2500px) {
  .site-footer {
    --s: min(calc(100vw / 1280), calc(100vh / 720));
    /* The hairlines follow the 1920×1080 scale. */
    --s1080: min(calc(100vw / 1920), calc(100vh / 1080));
  }

  .site-footer::before {
    height: calc(1.5 * var(--s1080));
    box-shadow: 0 0 calc(10 * var(--s1080)) rgb(222 150 68 / 0.18);
  }

  .site-footer__bottom::before {
    height: calc(1 * var(--s1080));
    box-shadow: 0 0 calc(8 * var(--s1080)) rgb(232 187 117 / 0.12);
  }

  .site-footer__shell {
    width: min(calc(1280 * var(--s)), calc(100% - 20.48 * var(--s)));
    padding: calc(56 * var(--s)) calc(40 * var(--s)) calc(24 * var(--s));
  }

  .site-footer__main { gap: calc(40 * var(--s)); }
  .site-footer__identity { gap: calc(20 * var(--s)); }

  .site-footer__emblem {
    width: calc(104 * var(--s));
    height: calc(104 * var(--s));
  }

  .site-footer__brand-line { gap: calc(9 * var(--s)); }
  .site-footer__brand-name { font-size: calc(36 * var(--s)); }
  .site-footer__brand-ltd { font-size: calc(16 * var(--s)); }

  .site-footer__tagline {
    max-width: calc(390 * var(--s));
    margin-top: calc(14 * var(--s));
    font-size: calc(15 * var(--s));
  }

  .site-footer__divider {
    width: calc(1 * var(--s));
    min-height: calc(104 * var(--s));
  }

  .site-footer__contacts { gap: calc(8 * var(--s)); }

  .site-footer__contact,
  .site-footer__contact:not(:first-child) {
    --contact-size: calc(17 * var(--s));
    gap: calc(8 * var(--s));
  }

  .site-footer__link--phone { font-size: inherit; }

  .site-footer__bottom {
    gap: calc(20 * var(--s));
    margin-top: calc(24 * var(--s));
    padding-top: calc(14 * var(--s));
  }

  .site-footer__copyright { font-size: calc(11 * var(--s)); }

  .site-footer__legal {
    gap: calc(10 * var(--s));
    font-size: calc(10.5 * var(--s));
  }
}
