/* Стили публичной страницы. Используются и в предпросмотре админки. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; }

:root {
  color: #33452d;
  background: #1b2119;
  font-family: Nunito, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body { min-width: 320px; min-height: 100vh; line-height: 1.5; }
a { color: inherit; text-decoration: none; }

.page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 13%, #eeaeab21 0 3px, #0000 4px),
    radial-gradient(circle at 86% 73%, #eeaeab1f 0 4px, #0000 5px),
    #1b2119;
}

.profile {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #91a66a;
}

.profile__body {
  position: relative;
  min-height: 100vh;
  padding: 34px 20px 28px;
  background:
    radial-gradient(circle at 10% 30%, #ffe0d51f 0 40px, #0000 41px),
    radial-gradient(circle at 104% 84%, #3b583238 0 92px, #0000 93px),
    #91a66a;
}

/* Декоративные цветочки */
.flower {
  position: absolute;
  width: 34px;
  height: 34px;
  fill: #e7aaa9;
  stroke: #d99998;
  stroke-width: 1.5px;
}
.flower circle:first-child { fill: #f3d0aa; }
.flower--top { top: 52px; right: 16px; transform: rotate(17deg); }
.flower--side { top: 300px; left: -9px; width: 25px; height: 25px; opacity: .75; transform: rotate(-12deg); }

/* Шапка */
.intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 116px;
  height: 116px;
  overflow: hidden;
  border: 5px solid #f8efd8;
  border-radius: 50%;
  background: #246b3b;
  box-shadow: 0 8px #36462b2e, 0 14px 34px #2938213d;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); }
.avatar img.avatar__img--custom { transform: none; }

/* Бейдж с именем — «наклейка» на краю аватара */
.avatar-wrap { position: relative; }

.name-tag {
  position: absolute;
  left: 50%;
  bottom: -13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px 5px 11px;
  color: #34492e;
  background: #fff0d4;
  border: 2px solid #4f663f;
  border-radius: 999px;
  box-shadow: 0 3px #3c4e3099;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-4deg);
}
.name-tag__leaf {
  width: 9px;
  height: 12px;
  background: #efb1aa;
  border-radius: 100% 0;
  transform: rotate(-28deg);
}

.intro__eyebrow {
  margin: 26px 0 7px;
  color: #f7e8cd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  color: #fff0d4;
  font-size: clamp(38px, 12vw, 52px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-shadow: 0 3px #38492c3b, 1px 0 #4a5e3d, -1px 0 #4a5e3d, 0 1px #4a5e3d, 0 -1px #4a5e3d;
}

.intro__subtitle {
  max-width: 300px;
  margin: 10px 0 0;
  color: #f4e4c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

/* Кнопка магазинчика */
.shop-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 6px 18px 6px 6px;
  color: #34492e;
  font-size: 15px;
  font-weight: 900;
  background: #fff0d4;
  border: 2px solid #4f663f;
  border-radius: 999px;
  box-shadow: 0 4px #3c4e3099;
  transition: transform .18s, box-shadow .18s;
}
.shop-cta:active { transform: translateY(3px); box-shadow: 0 1px #3c4e3099; }
.shop-cta:focus-visible { outline: 3px solid #fff0d4; outline-offset: 3px; }
.shop-cta__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff0d4;
  background: #47613b;
  border-radius: 50%;
}
.shop-cta__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.shop-cta__arrow { transition: transform .18s; }
@media (hover: hover) and (pointer: fine) {
  .shop-cta:hover { transform: translateY(-2px); box-shadow: 0 6px #3c4e3099; }
  .shop-cta:hover .shop-cta__arrow { transform: translateX(3px); }
}

/* Ссылки */
.socials {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.social-link {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 11px 13px;
  background: var(--bg, #d9edf5);
  border: 2px solid #4f663f;
  border-radius: 22px;
  box-shadow: 0 5px #3c4e3099;
  transition: transform .18s, box-shadow .18s;
}
.social-link:active { transform: translateY(3px); box-shadow: 0 2px #3c4e3099; }
.social-link:focus-visible { outline: 3px solid #fff0d4; outline-offset: 3px; }

.social-link__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  color: var(--ic, #47613b);
  background: #fffaf0b3;
  border: 2px solid #4d653e;
  border-radius: 15px;
  box-shadow: inset 0 -3px #32462826;
}
.social-link__icon svg { width: 25px; height: 25px; fill: currentColor; }
.social-link__icon svg rect,
.social-link__icon svg circle { fill: none; stroke: currentColor; stroke-width: 1.8px; }
.social-link__icon svg .icon-dot { fill: currentColor; stroke: none; }
.social-link__icon svg.icon--stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social-link__icon img { width: 30px; height: 30px; object-fit: contain; }

.social-link__text { display: flex; flex-direction: column; min-width: 0; }
.social-link__text strong { color: #34492e; font-size: 16px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.social-link__text small {
  margin-top: 3px;
  overflow: hidden;
  color: #34492eb8;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Подвал */
.profile footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding-top: 24px;
  color: #f6e7cc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.footer-leaf {
  width: 13px;
  height: 8px;
  background: #f0b5ad;
  border-radius: 100% 0;
  transform: rotate(-24deg);
}

/* Десктоп: карточка по центру */
@media (min-width: 520px) {
  .page { display: grid; place-items: center; padding: 32px 0; }
  .profile {
    width: 430px;
    min-height: auto;
    border: 3px solid #394b31;
    border-radius: 34px;
    box-shadow: 0 24px 80px #00000061;
  }
  .profile__body { min-height: auto; padding: 34px 26px 30px; }
  .social-link:hover { transform: translateY(-3px); box-shadow: 0 8px #3c4e3099; }
}

/* ---------- Планшет и десктоп ----------
   Переключаемся по ширине самой страницы (container query), а не окна:
   в узком предпросмотре админки остаётся мобильная раскладка. */
.page { container: page / inline-size; }

/* Планшет: карточка шире, кнопки в две колонки. */
@container page (min-width: 700px) {
  .profile { width: min(660px, 100%); }
  .profile__body { padding: 44px 40px 36px; }
  .avatar { width: 132px; height: 132px; }
  .intro h1 { font-size: 58px; }
  .intro__subtitle { max-width: 380px; font-size: 14px; }
  .socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
  .socials > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 1000px) {
  .page { padding: 48px 32px; }
}

/* Десктоп: слева — визитка, справа — сетка кнопок. */
@container page (min-width: 1000px) {
  .profile {
    width: min(1200px, 100%);
    border-radius: 44px;
  }

  .profile__body {
    display: grid;
    grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    column-gap: clamp(36px, 4vw, 60px);
    min-height: min(720px, calc(100vh - 96px));
    padding: 56px 56px 44px;
    background:
      radial-gradient(circle at 6% 22%, #ffe0d51f 0 70px, #0000 71px),
      radial-gradient(circle at 101% 96%, #3b583238 0 170px, #0000 171px),
      radial-gradient(circle at 38% 108%, #3b583224 0 110px, #0000 111px),
      #91a66a;
  }

  .flower--top { top: 40px; right: 44px; width: 46px; height: 46px; }
  .flower--side { top: auto; bottom: 150px; left: -12px; width: 34px; height: 34px; }

  .intro {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    align-items: center;
    text-align: center;
  }
  .avatar { width: 172px; height: 172px; border-width: 6px; }
  .name-tag { bottom: -15px; padding: 5px 16px 6px 13px; font-size: 16px; }
  .intro__eyebrow { margin: 38px 0 10px; font-size: 12px; }
  .intro h1 { font-size: clamp(48px, 4.1vw, 60px); letter-spacing: -.03em; overflow-wrap: break-word; }
  .intro__subtitle { max-width: 340px; margin-top: 18px; font-size: 16px; line-height: 1.5; }

  .socials {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
    gap: 16px;
  }
  .social-link { min-height: 96px; padding: 14px 16px; gap: 14px; border-radius: 26px; }
  .social-link__icon { width: 58px; height: 58px; border-radius: 18px; }
  .social-link__icon svg { width: 30px; height: 30px; }
  .social-link__icon img { width: 36px; height: 36px; }
  .social-link__text strong { font-size: 17px; }
  .social-link__text small {
    display: -webkit-box;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .profile footer {
    grid-column: 1;
    grid-row: 2;
    justify-content: center;
    padding-top: 28px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ---------- Страница 404 ---------- */
.nf__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 28px 22px 34px;
  text-align: center;
  background:
    radial-gradient(circle at 12% 18%, #ffe0d51f 0 46px, #0000 47px),
    radial-gradient(circle at 104% 88%, #3b583238 0 110px, #0000 111px),
    #91a66a;
}
.nf .flower--top { top: 30px; right: 22px; }
.nf__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: #f4e4c8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nf__num {
  padding: 4px 12px;
  color: #34492e;
  letter-spacing: .08em;
  background: #fff0d4;
  border: 2px solid #4f663f;
  border-radius: 999px;
  box-shadow: 0 3px #3c4e3099;
}
.nf__img {
  width: min(100%, 360px);
  margin: 12px 0 22px;
  overflow: hidden;
  background: #fff0d4;
  border: 3px solid #4f663f;
  border-radius: 26px;
  box-shadow: 0 6px #3c4e3099, 0 18px 40px #29382140;
  transform: rotate(-2deg);
}
.nf__img img { width: 100%; height: auto; }
.nf__title {
  max-width: 420px;
  color: #fff0d4;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-shadow: 0 3px #38492c3b, 1px 0 #4a5e3d, -1px 0 #4a5e3d, 0 1px #4a5e3d, 0 -1px #4a5e3d;
}
.nf__text { max-width: 380px; margin-top: 12px; color: #f4e4c8; font-size: 15px; font-weight: 700; line-height: 1.5; }
.nf__btn { margin-top: 24px; }
.nf__btn .shop-cta__icon { font-size: 18px; font-weight: 900; }

@media (min-width: 520px) {
  .profile.nf { width: min(560px, 100%); }
  .nf__body { min-height: 0; padding: 34px 40px 40px; }
}
