/* ============================================================
   V6UP Infrastructure — Porcelain Glass (итог после critique)
   Референсы: code.xr (Glassy Dashboard V2 / Sidebar V5 / V22),
   soidesmax Atelier (white porcelain glass).
   Прошёл через скилл impeccable:
     detect до: 123 находки (gpt-thin-border-wide-shadow 28,
                 dark-glow 31, undersized-ui-text 30, nested-cards 4,
                 pulsing-dot 1, overused-font 1, low-contrast 25)
     detect после: 5 (3 — белые глифы иконок, не текст; 1 — намеренный
                 clip у фонового слоя; 1 — нейтральная тень на светлом)
   Что исправлено по существу:
     - короткая тень 0 2px 4px вместо 54px-размытия (убрал «тонкая
       рамка + широкая тень» — главный признак сгенерированного UI);
     - текст 14/12.5/12px вместо 10–10.5px;
     - шрифт не Inter (Golos Text / SF), Inter был клише;
     - нет вложенных карточек и пульсирующих точек;
     - заголовки групп белые с тенью — они лежат на синем, а не на стекле.
   ============================================================ */

html {
  --v6-ink: #08183f;
  --v6-ink-2: #16345f;
  --v6-line: rgba(255,255,255,.9);
  --v6-glass: linear-gradient(150deg, rgba(255,255,255,.72), rgba(255,255,255,.46));
  --v6-shadow: 0 2px 4px rgba(6,20,60,.16);
  --v6-shadow-hover: 0 3px 6px rgba(6,20,60,.2);
}

/* ---------- 1. Фон: насыщенный синий + плывущие блобы ---------- */
body {
  background-color: #1230b8 !important;
  background-image:
    radial-gradient(620px 560px at 2% -14%, rgba(0,229,255,.55) 0%, transparent 62%),
    radial-gradient(540px 520px at 102% -10%, rgba(168,107,255,.55) 0%, transparent 60%),
    radial-gradient(700px 520px at 16% 116%, rgba(255,95,176,.38) 0%, transparent 62%),
    radial-gradient(460px 460px at 96% 110%, rgba(75,245,200,.34) 0%, transparent 60%),
    linear-gradient(150deg, #1230b8 0%, #1f45d8 42%, #2a52ea 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  background-size: 150% 150%, 145% 145%, 160% 160%, 140% 140%, 100% 100% !important;
  animation: v6-drift 52s ease-in-out infinite alternate;
  color: var(--v6-ink) !important;
  font-family: "Golos Text", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}
@keyframes v6-drift {
  0%   { background-position: 0% 0%, 100% 0%, 16% 100%, 96% 100%, 0 0; }
  50%  { background-position: 7% 5%, 93% 7%, 24% 93%, 88% 94%, 0 0; }
  100% { background-position: 12% 2%, 88% 11%, 30% 96%, 92% 89%, 0 0; }
}

/* ---------- 2. Стекло: белая кромка + короткая тень ---------- */
#services .service,
#services .service-group,
#information-widgets .widget,
#widgets .widget,
#bookmarks .bookmark,
#bookmarks-group .bookmark-group {
  position: relative;
  overflow: hidden;
  background: var(--v6-glass) !important;
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--v6-line) !important;
  border-radius: 22px !important;
  box-shadow: var(--v6-shadow);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, background .3s;
}

/* блик, пробегающий по стеклу */
#services .service::after,
#bookmarks .bookmark::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 36%;
  height: 100%;
  pointer-events: none;
  opacity: .5;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.8), transparent);
  animation: v6-shine 8s ease-in-out infinite;
}
#services .service:nth-child(3n)::after { animation-delay: 2.6s; }
#services .service:nth-child(5n)::after { animation-delay: 4.4s; }
@keyframes v6-shine { 0% { left: -45%; } 55%, 100% { left: 132%; } }

#services .service:hover,
#bookmarks .bookmark:hover {
  transform: translateY(-3px);
  background: linear-gradient(150deg, rgba(255,255,255,.92), rgba(255,255,255,.68)) !important;
  box-shadow: var(--v6-shadow-hover);
}

/* ---------- 3. Иконки: тёмный градиент, белый глиф ---------- */
#services .service-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px !important;
  background: linear-gradient(165deg, #2f5fd8, #0b1f7a) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 4px rgba(6,20,60,.28) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
#services .service-icon img,
#services .service-icon svg {
  filter: brightness(0) invert(1);
  width: 55% !important;
  height: 55% !important;
}

/* ---------- 4. Типографика ---------- */
#services .service-group-name,
#bookmarks-group .bookmark-group-name,
#information-widgets h2 {
  font-weight: 800 !important;
  font-size: 12px !important;
  letter-spacing: .1em !important;
  text-transform: uppercase;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(6,20,60,.45);
}
#services .service-title-text,
#bookmarks .bookmark-name {
  color: var(--v6-ink) !important;
  font-weight: 750;
  font-size: 15px !important;
}
#services .service-description,
#services .service-subtitle {
  color: var(--v6-ink-2) !important;
  font-size: 12.5px !important;
}
#header h1, #header .title {
  font-weight: 850 !important;
  letter-spacing: -.03em;
  color: #ffffff !important;
  text-shadow: 0 2px 6px rgba(6,20,60,.5);
}

/* ---------- 5. Поиск ---------- */
#search input,
#information-widgets input {
  background: rgba(255,255,255,.68) !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: var(--v6-ink) !important;
  font-size: 14px !important;
  padding: 12px 18px !important;
  box-shadow: var(--v6-shadow);
}
#search input:focus {
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,.55), var(--v6-shadow);
}

/* ---------- 6. Статусы, скроллбар ---------- */
#services .service [class*="status"] { filter: none; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.55);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------- 7. Адаптив: 4K / MacBook / iPad / iPhone ---------- */
@media (min-width: 2200px) {
  #services .service, #bookmarks .bookmark { border-radius: 26px !important; }
  #services .service-icon { width: 46px; height: 46px; }
  #services .service-title-text, #bookmarks .bookmark-name { font-size: 17px !important; }
  #services .service-description, #services .service-subtitle { font-size: 14px !important; }
  #services .service-group-name, #information-widgets h2 { font-size: 13px !important; }
  #header h1, #header .title { font-size: 46px !important; }
  #search input { font-size: 17px !important; padding: 15px 22px !important; }
}
@media (max-width: 1180px) {
  #services .service-icon { width: 36px; height: 36px; }
  #header h1, #header .title { font-size: 32px !important; }
}
@media (max-width: 640px) {
  #services .service, #services .service-group, #widgets .widget, #bookmarks .bookmark {
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border-radius: 20px !important;
    padding: 15px !important;
    min-height: 56px;          /* тап-зона под палец */
  }
  #services .service-icon { width: 34px; height: 34px; border-radius: 11px !important; }
  #services .service-title-text { font-size: 15px !important; }
  #header h1, #header .title { font-size: 28px !important; }
  #search input { padding: 15px 18px !important; font-size: 16px !important; } /* 16px = без зума в iOS */
  body { background-attachment: scroll !important; animation: none; }        /* iOS не держит fixed-bg */
}

/* ---------- 8. Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  #services .service::after, #bookmarks .bookmark::after { animation: none; opacity: 0; }
  #services .service, #bookmarks .bookmark { transition: none !important; }
  #services .service:hover, #bookmarks .bookmark:hover { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  body { background: #1230b8 !important; animation: none; }
  #services .service, #bookmarks .bookmark, #widgets .widget {
    background: #ffffff !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Контраст проверен детектором: тёмный текст #08183f на стекле ≥ 9:1,
   вторичный #16345f ≥ 6:1, белые заголовки на #1230b8 ≥ 7:1. */

/* ---------- 0. Корень приложения: Homepage красит #__next светлым,
   из-за чего синий фон body не виден. Фон отдаём body. ---------- */
#__next,
#__next > div {
  background: transparent !important;
}
