:root{
  --container: 600px;

  /* responsive header sizing */
  --header-h: 60px;      /* 320px baseline */
  --logo-h: 40px;        /* 320px baseline */
  --header-padding-y: 12px;

  /* responsive button font */
  --btn-font: 16px;      /* 320px baseline */

  --radius: 16px;
  --radius-lg: 22px;

  --text: #0b0b0b;
  --muted: rgba(0,0,0,0.45);
  --title-font: 32px;
  --desc-font: 12px;

  --focus: rgba(153, 210, 27, 0.55);
}

@media (min-width: 600px){
  :root{
    --header-h: 80px;
    --logo-h: 65px;
    --btn-font: 18px;
  }
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:#ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

a{ color:inherit; text-decoration:none; }

.container{
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: var(--header-padding-y) 0;
}

.header__inner{
  display:flex;
  gap: 12px;
  align-items: stretch;
}

.header__pill{
  height: var(--header-h);
  border-radius: 16px;
  background: #fbfbfb;
  border: 1px solid rgba(0,0,0,0.10);
  display:flex;
  align-items:center;
}

.header__pill--left{
  width: 80%;
  padding: 0 14px;
  min-width: 0;
}

.header__pill--right{
  width: 20%;
  padding: 0 10px;
  justify-content:center;
}

.brand{
  display:flex;
  align-items:center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.brand__logo{
  height: var(--logo-h);
  width: auto;
  display:block;
}

.brand__desc{
  margin:0;
  font-size: var(--desc-font);
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap;
}

/* Main spacing under fixed header (exact) */
.main{
  padding-top: calc(var(--header-h) + var(--header-padding-y) * 2);
  padding-bottom: 40px;
}

/* Title */
.title{
  margin: 50px 0;
  font-size: var(--title-font);
  font-weight: 700;
  line-height: 1.15;
  text-align:center;
  letter-spacing: -0.02em;
}

/* Hero reveal start */
.hero-title{
  opacity: 0;
  transform: translateY(18px);
  filter: blur(8px);
  will-change: transform, opacity, filter;
}

/* Language selector */
.lang{
  position: relative;
  width: 100%;
  max-width: 120px; /* правый блок 20%, но кнопка не растягивается бесконечно */
}

/* Lang button: transparent, no hover, no outline border */
.lang__btn{
  width: 100%;
  height: calc(var(--header-h) - 16px);
  border-radius: 14px;
  border: none;
  background: transparent;

  display:flex;
  align-items:center;
  justify-content:center;
  gap: 4px;

  cursor:pointer;
  font-size: 17px;
  font-weight: 500;

  box-shadow: none;
  transition: none;
}

.lang__btn:hover{
  box-shadow: none;
  filter: none;
}

.lang__btn:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.lang__flag{
  height: 18px;
  width: auto;
  display:block;
}

/* Animated menu */
.lang__menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 100px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 18px 45px rgba(0,0,0,0.20);
  padding: 8px 6px;

  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transform-origin: top right;

  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(.2,.9,.2,1);
}

.lang.is-open .lang__menu{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang__item{
  width: 100%;
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 16px 10px;
  border-radius: 8px;

  border: none;
  background: transparent;

  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}

.lang__item:hover{ background: rgba(0,0,0,0.06); }
.lang__item.is-active{ background: rgba(0,0,0,0.09); }

/* Groups (no box-shadow, no ::before) */
.group{
  position: relative;
  border-radius: var(--radius-lg);
  padding: 50px 18px;
  display:flex;
  flex-direction: column;
  gap: 18px;
  margin: 26px 0;

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  background-color: rgba(255,255,255,0.65);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);

  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;

  opacity: 0;
  transform: translateY(14px);
  will-change: transform, opacity;
}

.group--one{ background-image: url("./uploads/фон1.svg"); }
.group--two{ background-image: url("./uploads/фон2.svg"); }
.group--three{ background-image: url("./uploads/фон3.svg"); }

/* Buttons: transform from JS only; CSS only brightness/shadow */
.btn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;

  padding: 18px;
  border-radius: var(--radius);

  background: #0b0b0b;
  color: #ffffff;

  font-size: var(--btn-font);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;

  border: none;
  cursor: pointer;

  transition:
    filter 0.28s ease,
    box-shadow 0.28s ease;

  will-change: transform;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover){
  .btn:hover{
    filter: brightness(1.10);
    box-shadow: 0 16px 34px rgba(0,0,0,0.26);
  }
}

.btn:active{
  filter: brightness(1.02);
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.btn:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Modal */
.modal[hidden]{ display:none; }

.modal{
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.46);
  backdrop-filter: blur(4px);
}

.modal__dialog{
  position: relative;
  width: min(600px, calc(100% - 40px));
  min-width: 300px;
  max-height: min(82vh, 760px);
  overflow:auto;

  margin: 10vh auto 0;
  background:#fff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 28px 70px rgba(0,0,0,0.30);

  padding: 22px 18px 18px;
  transform-origin: top center;
}

.modal__close{
  position:absolute;
  top: 10px;
  right: 10px;

  width: 40px;
  height: 40px;
  border-radius: 12px;

  border: 1px solid rgba(0,0,0,0.10);
  background:#fff;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal__close:hover{ box-shadow: 0 10px 22px rgba(0,0,0,0.12); }
.modal__close:active{ transform: translateY(1px); }
.modal__close:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.modal__title{
  margin: 8px 40px 12px 6px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.modal__content{
  padding: 0 6px 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #1a1a1a;
}

.modal__content ul{
  margin: 8px 0 12px 18px;
}

.modal__link{
  text-decoration: underline;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .btn, .group, .modal__close{ transition: none !important; }

  .hero-title{
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .group{
    opacity: 1 !important;
    transform: none !important;
  }
}
