/* Glass surfaces: translucent body, rounded rim and reflected light. */
.link {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 70px;
  gap: 10px;
  border: 1px solid rgb(236 217 255 / 24%);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 8% 0%, rgb(227 199 255 / 18%), transparent 65%),
    linear-gradient(135deg, rgb(255 255 255 / 10%), rgb(194 153 243 / 4%) 55%, rgb(255 255 255 / 8%));
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 30%),
    inset 1px 0 1px rgb(255 255 255 / 12%),
    inset 0 -1px 2px rgb(224 186 255 / 13%),
    0 5px 14px rgb(5 0 13 / 20%);
  text-shadow: 0 1px 3px rgb(0 0 0 / 25%);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.link::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(165deg, rgb(255 255 255 / 10%), transparent 42%);
  pointer-events: none;
}
.link:hover {
  transform: translateY(-2px);
  border-color: rgb(240 215 255 / 50%);
  background-color: rgb(218 183 255 / 9%);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 40%), 0 8px 20px rgb(5 0 13 / 28%);
}
.link:active { transform: translateY(0) scale(.98); }
.service-glass {
  --tint: 166 112 247;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 13px;
  background:
    radial-gradient(ellipse at 30% 100%, rgb(var(--tint) / 36%), transparent 80%),
    linear-gradient(140deg, rgb(255 255 255 / 24%), rgb(255 255 255 / 4%) 50%, rgb(255 255 255 / 12%));
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 65%),
    inset 1px 0 1px rgb(255 255 255 / 20%),
    inset 0 -2px 3px rgb(var(--tint) / 24%),
    0 3px 8px rgb(0 0 0 / 25%);
}
.service-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgb(255 255 255 / 28%), transparent 37%, transparent 66%, rgb(255 255 255 / 12%));
  pointer-events: none;
}
.service-yandex { --tint: 255 91 88; }
.service-2gis { --tint: 164 225 72; }
.service-telegram { --tint: 72 193 255; }
.service-vk { --tint: 68 147 255; }
.service-phone { --tint: 93 224 166; }
.action-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.link { text-align: center; }
.link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.service-icon, .three .service-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 18%));
}
.three .link {
  flex-direction: column;
  min-height: 96px;
  gap: 8px;
  padding: 12px 5px;
}
@media (max-width: 350px) {
  .quick-actions .link { flex-direction: column; }
  .link { gap: 7px; padding-inline: 6px; }
  .service-glass { width: 35px; height: 35px; border-radius: 11px; }
  .service-icon, .three .service-icon { width: 24px; height: 24px; }
}

/* Use the height available with the mobile browser bars visible. */
@media (max-height: 780px) {
  main {
    --page-space: clamp(6px, calc(4svh - 15px), 16px);
    --group-space: clamp(6px, calc(3svh - 10px), 14px);
    --button-height: clamp(48px, calc(10svh - 8px), 70px);
    --icon-frame: clamp(28px, calc(6svh - 5px), 40px);
    padding-block: var(--page-space);
  }
  .brand {
    padding-block: var(--group-space);
    margin-bottom: var(--group-space);
  }
  .logo { max-width: clamp(150px, calc(63svh - 160px), 370px); }
  .group {
    padding: var(--group-space);
    margin-top: var(--group-space);
  }
  h2 { margin-bottom: var(--group-space); }
  nav { gap: clamp(5px, 1.2svh, 9px); }
  .link, .three .link {
    min-height: var(--button-height);
    gap: 5px;
    padding: 5px;
  }
  .three .link { min-height: max(58px, calc(var(--button-height) + 9px)); }
  .service-glass { width: var(--icon-frame); height: var(--icon-frame); }
  .service-icon, .three .service-icon {
    width: min(26px, calc(var(--icon-frame) - 8px));
    height: min(26px, calc(var(--icon-frame) - 8px));
  }
  footer { margin-top: var(--group-space); }
}

@media (max-width: 350px) and (max-height: 780px) {
  .quick-actions .link { flex-direction: row; }
}

@media (orientation: landscape) and (min-width: 640px) and (max-height: 480px) {
  main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--group-space);
    max-width: 850px;
  }
  .brand, footer { grid-column: 1 / -1; }
  .brand, .group, footer { margin-block: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .link { transition: none; }
  .link:hover, .link:active { transform: none; }
}
