/**
 * Визуальная система одностраничного hero PPC Hospital.
 *
 * Размещает бренд и краткое описание слева, контактную информацию справа и
 * переключатель языков в верхней части hero. Декоративный фон рисует отдельный
 * canvas-скрипт, адаптивные перестроения вынесены в home-responsive.css.
 */

:root {
  --home-bg: #fbfdf9;
  --home-panel: rgba(255, 255, 255, 0.66);
  --home-ink: #073f36;
  --home-copy: #496861;
  --home-muted: #789089;
  --home-green: #3f9b46;
  --home-lime: #b8dd2d;
  --home-coral: #ff765f;
  --home-blue: #3c9fe3;
  --home-line: rgba(7, 63, 54, 0.1);
  --home-content: 1380px;
  --home-gutter: max(28px, calc((100vw - var(--home-content)) / 2));
}

html {
  min-width: 320px;
  background: var(--home-bg);
}

body.home-page {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--home-bg);
  color: var(--home-copy);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.home-page a {
  color: inherit;
}

.home-page :focus-visible {
  outline: 3px solid rgba(95, 174, 56, 0.48);
  outline-offset: 4px;
}

.home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.home-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.38), rgba(249, 253, 248, 0.28) 48%, rgba(244, 251, 247, 0.34)),
    url("/images/home-abstract-background.jpg") center / cover no-repeat;
}

.home-hero::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: -18%;
  background:
    radial-gradient(circle at 24% 35%, rgba(184, 221, 45, 0.16), transparent 24%),
    radial-gradient(circle at 67% 28%, rgba(255, 118, 95, 0.14), transparent 22%),
    radial-gradient(circle at 76% 74%, rgba(60, 159, 227, 0.16), transparent 26%),
    radial-gradient(circle at 36% 82%, rgba(63, 155, 70, 0.12), transparent 23%);
  background-size: 115% 115%;
  filter: blur(22px);
  opacity: 0.82;
  pointer-events: none;
  animation: homeBackgroundFlow 15s ease-in-out infinite alternate;
}

.home-hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: radial-gradient(rgba(7, 63, 54, 0.12) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  opacity: 0.13;
  mask-image: linear-gradient(112deg, transparent 0 43%, #000 70%, transparent 100%);
  pointer-events: none;
}

.home-pulse-canvas {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.home-life-visual {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
}

.home-life-visual svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.home-life-center,
.home-life-core {
  transform-box: view-box;
  transform-origin: center;
}

.home-life-orbit-line {
  fill: none;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: center;
}

.home-life-orbit-line--outer {
  stroke: rgba(60, 159, 227, 0.11);
  stroke-width: 1.8;
  stroke-dasharray: 4 18;
  animation: homeLifeOrbit 32s linear infinite;
}

.home-life-orbit-line--inner {
  stroke: rgba(60, 159, 227, 0.12);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 68 24 12 24;
  animation: homeLifeOrbitReverse 22s linear infinite;
}

.home-life-core {
  fill: transparent;
  opacity: 0;
}

.home-ambient {
  position: absolute;
  z-index: -2;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  filter: blur(86px);
  opacity: 0.2;
  pointer-events: none;
  animation: homeAmbientDrift 11s ease-in-out infinite alternate;
}

.home-ambient--coral {
  top: 14%;
  right: 36%;
  background: var(--home-coral);
}

.home-ambient--lime {
  right: 3%;
  bottom: 5%;
  background: var(--home-lime);
  animation-delay: -4s;
}

.home-ambient--blue {
  bottom: 2%;
  left: 8%;
  background: var(--home-blue);
  animation-delay: -7s;
}

.home-shell {
  position: relative;
  z-index: 2;
  width: min(var(--home-content), calc(100% - (var(--home-gutter) * 2)));
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px 0 34px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.home-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  animation: homeHeaderReveal 600ms ease-out both;
}

.home-language-switcher {
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 14px 38px rgba(25, 77, 61, 0.08);
}

.home-language-link {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #31564e;
  font-size: 10px;
  font-weight: 820;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.home-language-link:hover {
  color: var(--home-green);
  transform: translateY(-1px);
}

.home-language-link.is-active {
  border-color: rgba(112, 180, 56, 0.28);
  background: linear-gradient(135deg, #f3fbdc, #ffffff);
  color: var(--home-ink);
  box-shadow: 0 6px 18px rgba(99, 157, 49, 0.12);
}

.home-hero-layout {
  min-height: 0;
  padding: clamp(34px, 6vh, 80px) 3% clamp(28px, 5vh, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: clamp(50px, 8vw, 130px);
}

.home-hero-content {
  position: relative;
  z-index: 3;
  max-width: 750px;
  animation: homeContentReveal 760ms 80ms ease-out both;
}

.home-eyebrow {
  width: max-content;
  max-width: 100%;
  margin: 0 0 22px;
  color: var(--home-green);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.home-hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.home-hero-brand > img {
  flex: 0 0 auto;
  width: clamp(132px, 10.5vw, 180px);
  height: clamp(162px, 12.8vw, 218px);
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 22px 42px rgba(75, 153, 54, 0.2));
  animation: homeLogoBreathe 4.8s ease-in-out infinite;
}

.home-hero-brand > span {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.home-hero h1 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(62px, 6.2vw, 102px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.07em;
  white-space: nowrap;
  text-wrap: nowrap;
}

.home-hero-brand small {
  color: var(--home-muted);
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 680;
  line-height: 1.35;
}

.home-hero-description {
  max-width: 620px;
  margin-top: 38px;
  padding-left: 4px;
}

.home-hero-promise {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(24px, 2.25vw, 34px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.home-hero-promise strong {
  color: var(--home-green);
  font-weight: inherit;
}

.home-hero-lead {
  max-width: 560px;
  margin: 13px 0 0;
  color: var(--home-copy);
  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.55;
}

.home-eyebrow--location {
  margin: 22px 0 0;
}

.home-since {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--home-ink);
  font-size: 11px;
  font-weight: 760;
}

.home-since::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--home-green), var(--home-lime));
}

.home-contacts {
  width: min(100%, 470px);
  justify-self: end;
  padding: clamp(30px, 3vw, 46px);
  border-radius: 42px;
  background: var(--home-panel);
  backdrop-filter: blur(24px);
  box-shadow: 0 34px 90px rgba(25, 77, 61, 0.11);
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: transform;
  transition: transform 420ms cubic-bezier(0.2, 0.75, 0.2, 1), box-shadow 420ms ease;
}

.home-contacts-heading {
  margin-bottom: 25px;
}

.home-contacts-heading .home-eyebrow {
  margin-bottom: 12px;
}

.home-contacts-heading h2 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.home-contacts-list {
  display: grid;
  gap: 10px;
}

.home-contact {
  min-width: 0;
  padding: 14px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: inherit;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease;
}

.home-contact--address {
  cursor: pointer;
}

.home-contact:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateX(4px);
}

.home-contact-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.home-contact--address .home-contact-icon {
  background: #eef8e8;
}

.home-contact--phones .home-contact-icon {
  background: #fff0ec;
}

.home-contact--social .home-contact-icon {
  background: #eaf5fd;
}

.home-contact-icon img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.home-contact-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.home-contact-copy small {
  color: var(--home-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-contact-copy strong,
.home-contact-copy a {
  color: var(--home-ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
  text-decoration: none;
}

.home-contact-copy a {
  width: max-content;
  max-width: 100%;
  transition: color 180ms ease, transform 180ms ease;
}

.home-contact-copy a:hover {
  color: var(--home-green);
  transform: translateX(2px);
}

.home-phone-links {
  display: grid;
  gap: 2px;
}

@keyframes homeHeaderReveal {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes homeContentReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes homeLogoBreathe {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-7px) rotate(-1.5deg); }
}

@keyframes homeAmbientDrift {
  0% { transform: translate3d(-12px, -8px, 0) scale(0.92); }
  100% { transform: translate3d(20px, 18px, 0) scale(1.1); }
}

@keyframes homeBackgroundFlow {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(0.98) rotate(-1deg);
    background-position: 0% 20%;
  }
  50% {
    transform: translate3d(2%, 1%, 0) scale(1.04) rotate(1deg);
    background-position: 55% 70%;
  }
  100% {
    transform: translate3d(-1%, 2%, 0) scale(1.01) rotate(0deg);
    background-position: 100% 35%;
  }
}

@keyframes homeLifeOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes homeLifeOrbitReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes homeContactTilt {
  0%, 100% {
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateY(0);
  }
  28% {
    transform: perspective(1200px) rotateX(1.8deg) rotateY(-2.6deg) translateY(-3px);
  }
  58% {
    transform: perspective(1200px) rotateX(-1.4deg) rotateY(2.4deg) translateY(-5px);
  }
  82% {
    transform: perspective(1200px) rotateX(1deg) rotateY(1.4deg) translateY(-2px);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-contacts {
    animation: homeContactTilt 7s 1s ease-in-out infinite;
  }

  .home-contacts:hover,
  .home-contacts:focus-within {
    opacity: 1;
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateY(-5px);
    animation: none;
    box-shadow: 0 42px 105px rgba(25, 77, 61, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page *,
  .home-page *::before,
  .home-page *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
