/* Visual iteration: airy FitStars communications layer.
   Rollback: remove this stylesheet link from pages and delete this file. */

.portal-page {
  --air-surface: rgba(255, 255, 255, 0.78);
  --air-surface-strong: rgba(255, 255, 255, 0.92);
  --air-stroke: rgba(24, 29, 49, 0.08);
  --air-shadow-soft: 0 24px 70px rgba(24, 29, 49, 0.07);
  --air-shadow-card: 0 16px 46px rgba(24, 29, 49, 0.08);
  --air-shadow-hover: 0 26px 70px rgba(24, 29, 49, 0.12);
  --air-radius-large: 56px;
  --air-radius-card: 32px;
  --air-blur: blur(18px);
  background: var(--color-bright);
}

.portal-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: rgba(24, 29, 49, 0.06);
  box-shadow: 0 12px 32px rgba(24, 29, 49, 0.04);
  backdrop-filter: var(--air-blur);
}

.portal-header__inner {
  min-height: 72px;
}

.portal-logo {
  gap: 0;
  line-height: 0;
}

.portal-logo__img {
  height: 30px;
  width: auto;
  max-width: min(150px, 58vw);
  display: block;
  filter: drop-shadow(0 8px 16px rgba(239, 22, 176, 0.12));
}

.portal-nav {
  gap: var(--space-2);
  padding: 6px;
  border: 1px solid rgba(24, 29, 49, 0.06);
  border-radius: var(--radius-button-pill);
  background: rgba(255, 255, 255, 0.54);
}

.portal-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-button-pill);
}

.portal-nav a:hover {
  border: 0;
  background: rgba(239, 22, 176, 0.08);
}

.portal-nav a[aria-current="page"] {
  border: 0;
  background: var(--color-brand-soft);
  color: var(--text-link);
}

.portal-main {
  padding-top: 44px;
  padding-bottom: var(--space-20);
}

.portal-section {
  margin-top: var(--space-16);
}

.portal-section__header {
  margin-bottom: var(--space-8);
}

.portal-kicker,
.portal-tile__eyebrow,
.birthday-card__date {
  letter-spacing: 0.14em;
}

.portal-section__title {
  font-size: clamp(var(--fs-xl), 2.6vw, var(--fs-2xl));
  line-height: 1.12;
}

.weekly-hero,
.team-hero,
.archive-hero {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--air-radius-large);
  box-shadow: var(--air-shadow-soft);
}

.weekly-hero::before,
.team-hero::before,
.archive-hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: calc(var(--air-radius-large) - 14px);
  pointer-events: none;
}

.archive-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--space-10);
  align-items: center;
  margin-bottom: var(--space-16);
  padding: clamp(40px, 6vw, 72px);
  background:
    radial-gradient(circle at 90% 16%, rgba(239, 22, 176, 0.16), transparent 18rem),
    radial-gradient(circle at 12% 88%, rgba(176, 235, 221, 0.5), transparent 20rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(219, 239, 255, 0.82));
}

.archive-hero h1 {
  max-width: 10ch;
  margin-bottom: var(--space-5);
  font-size: clamp(54px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.archive-hero p:not(.portal-kicker) {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: var(--fs-l);
  line-height: 1.45;
}

.archive-hero__badge {
  width: min(100%, 220px);
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 48px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(135deg, var(--color-brand-soft), var(--c-brand-secondary-2));
  box-shadow: 0 28px 70px rgba(24, 29, 49, 0.1);
}

.archive-hero__badge span {
  color: var(--text-link);
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.archive-hero__badge small {
  color: var(--text-secondary);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: var(--fw-semibold);
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.issue-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-8);
  border: 1px solid var(--air-stroke);
  border-radius: var(--air-radius-card);
  background: var(--air-surface-strong);
  box-shadow: var(--air-shadow-card);
  color: inherit;
  text-decoration: none;
  backdrop-filter: var(--air-blur);
  overflow: hidden;
}

.issue-card:hover {
  box-shadow: var(--air-shadow-hover);
  text-decoration: none;
}

.issue-card--featured {
  background:
    radial-gradient(circle at 88% 12%, rgba(239, 22, 176, 0.14), transparent 13rem),
    radial-gradient(circle at 12% 90%, rgba(176, 235, 221, 0.4), transparent 14rem),
    rgba(255, 255, 255, 0.9);
}

.issue-card__number {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--color-brand-soft);
  color: var(--text-link);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  line-height: var(--lh-xl);
  box-shadow: 0 16px 34px rgba(239, 22, 176, 0.12);
}

.issue-card__date {
  margin-bottom: var(--space-3);
  color: var(--text-link);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.issue-card h3 {
  margin-bottom: var(--space-3);
  font-size: clamp(var(--fs-xl), 3vw, var(--fs-2xl));
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.issue-card p:not(.issue-card__date) {
  color: var(--text-secondary);
  font-size: var(--fs-m);
  line-height: 1.45;
}

.issue-card .portal-card__cta {
  margin-top: auto;
}

.weekly-hero {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: var(--layout-col-gap);
  align-items: center;
  margin-bottom: var(--space-10);
  padding: 40px 48px;
  background:
    radial-gradient(circle at 82% 20%, rgba(239, 22, 176, 0.15), transparent 18rem),
    radial-gradient(circle at 96% 88%, rgba(169, 230, 244, 0.72), transparent 20rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 234, 248, 0.9) 46%, rgba(219, 239, 255, 0.9) 100%);
}

.weekly-hero h1,
.team-hero h1 {
  letter-spacing: -0.045em;
}

.weekly-hero h1 {
  max-width: none;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: clamp(56px, 5vw, 64px);
  line-height: 0.98;
  white-space: nowrap;
}

.weekly-hero__meta {
  margin-bottom: var(--space-5);
  color: rgba(24, 29, 49, 0.6);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: var(--fw-medium);
}

.weekly-hero__topic {
  max-width: 46ch;
  margin-bottom: var(--space-5);
  color: var(--text-primary);
  font-size: var(--fs-l);
  line-height: var(--lh-l);
  letter-spacing: 0;
}

.weekly-hero__teasers {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-6);
}

.weekly-hero__teasers li {
  align-items: flex-start;
  padding: 0;
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  white-space: normal;
}

.weekly-hero__teasers li::before {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  filter: drop-shadow(0 8px 12px rgba(239, 22, 176, 0.22));
}

.weekly-hero__visual {
  width: 100%;
  max-width: 300px;
  min-height: 360px;
  align-self: center;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 44px;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.18), transparent 7rem),
    radial-gradient(circle at 26% 76%, rgba(255, 208, 239, 0.13), transparent 8rem),
    linear-gradient(145deg, #181d31 0%, #202743 58%, #2a3150 100%);
  box-shadow: 0 30px 80px rgba(24, 29, 49, 0.18);
}

.hero-star--large {
  width: 170px;
  height: 170px;
  filter: drop-shadow(0 26px 28px rgba(239, 22, 176, 0.28));
}

.hero-star--medium {
  width: 58px;
  height: 58px;
  right: 60px;
  top: 62px;
  filter: drop-shadow(0 18px 20px rgba(255, 255, 255, 0.16));
}

.hero-orbit {
  width: 280px;
  height: 128px;
  border-color: rgba(255, 255, 255, 0.35);
}

.portal-button {
  min-height: 52px;
  padding: 0 var(--space-8);
  box-shadow: 0 16px 30px rgba(239, 22, 176, 0.18);
  transition:
    transform var(--motion-base) var(--ease-out),
    box-shadow var(--motion-base) var(--ease-out),
    filter var(--motion-quick) var(--ease-out);
}

.portal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(239, 22, 176, 0.22);
}

.portal-button--secondary {
  box-shadow: none;
}

.portal-button--secondary:hover {
  box-shadow: 0 14px 28px rgba(24, 29, 49, 0.08);
}

.pulse-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: var(--space-5);
}

.pulse-card,
.portal-tile,
.birthday-card,
.birthday-shelf-card,
.person-card {
  border: 1px solid var(--air-stroke);
  background: var(--air-surface-strong);
  box-shadow: var(--air-shadow-card);
  backdrop-filter: var(--air-blur);
}

.pulse-card {
  min-height: 172px;
  padding: var(--space-6) var(--space-5);
  border-radius: 28px;
  overflow: hidden;
}

.pulse-card strong {
  display: block;
  max-width: 100%;
  font-size: clamp(36px, 3.5vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-shadow: 0 14px 28px rgba(239, 22, 176, 0.12);
  white-space: nowrap;
}

.pulse-card strong[data-pulse="workouts_per_week"] {
  font-size: clamp(34px, 3.2vw, 48px);
}

.pulse-card span {
  max-width: 14ch;
  color: var(--text-secondary);
  font-size: var(--fs-s);
  line-height: 1.25;
  font-weight: var(--fw-medium);
}

.portal-card-grid {
  gap: var(--space-6);
}

.portal-tile {
  min-height: 288px;
  padding: var(--space-8);
  border-radius: var(--air-radius-card);
}

.portal-tile:hover,
.birthday-card:hover,
.person-card:hover,
.birthday-shelf-card:hover {
  box-shadow: var(--air-shadow-hover);
  filter: translateZ(0);
}

.portal-tile--muted {
  background:
    radial-gradient(circle at 90% 8%, rgba(176, 235, 221, 0.42), transparent 12rem),
    rgba(255, 255, 255, 0.88);
}

.portal-tile h3 {
  margin-bottom: var(--space-4);
  letter-spacing: -0.025em;
}

.birthday-grid {
  gap: var(--space-5);
}

.birthday-card,
.birthday-shelf-card,
.person-card {
  border-radius: 30px;
}

.birthday-card {
  min-height: 240px;
  padding: var(--space-6);
}

.team-hero {
  margin-bottom: var(--space-6);
  padding: clamp(30px, 4vw, 48px);
  background:
    radial-gradient(circle at 88% 16%, rgba(239, 22, 176, 0.14), transparent 18rem),
    radial-gradient(circle at 8% 88%, rgba(176, 235, 221, 0.48), transparent 19rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 208, 239, 0.72));
}

.team-hero h1 {
  margin-bottom: var(--space-3);
  font-size: clamp(44px, 5vw, 64px);
}

.team-hero p:not(.portal-kicker) {
  max-width: 680px;
  font-size: var(--fs-m);
  line-height: var(--lh-m);
}

.team-page .team-hero {
  margin-bottom: var(--space-5);
  padding: clamp(22px, 3vw, 36px) clamp(26px, 3.5vw, 40px);
}

.team-page .team-hero h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(38px, 4.2vw, 56px);
}

.team-page .team-hero p:not(.portal-kicker) {
  margin-bottom: 0;
  font-size: var(--fs-s);
  line-height: var(--lh-m);
}

.team-controls {
  border: 1px solid var(--air-stroke);
  background: var(--air-surface-strong);
  box-shadow: var(--air-shadow-card);
  /* Без backdrop-filter: иначе в ряде браузеров фон «обрезается» по старой высоте при раскрытии панелей */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  gap: var(--space-4);
  margin-bottom: 0;
  padding: var(--space-5) var(--space-6);
  border-radius: 30px;
  transition:
    border-radius var(--motion-base) var(--ease-out),
    box-shadow var(--motion-base) var(--ease-out),
    padding var(--motion-base) var(--ease-out);
}

/* Полная панель: в потоке, высота по содержимому — подложка тянется за чипсами */
.team-controls:not(.is-compact) {
  position: static;
  top: auto;
  height: fit-content;
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  z-index: auto;
  align-content: start;
  grid-auto-rows: auto;
}

.team-controls + .portal-section {
  margin-top: var(--space-8);
}

.team-page .team-controls + .portal-section {
  margin-top: var(--space-5);
}

.team-controls__compact {
  display: none;
}

.team-controls.is-compact {
  position: sticky;
  top: 88px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-height: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-button-pill);
  overflow: visible;
}

.team-controls.is-compact .team-search,
.team-controls.is-compact > .team-filter-group,
.team-controls.is-compact .team-advanced {
  display: none;
}

.team-controls.is-compact .team-controls__compact {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
}

.team-controls__summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
}

.team-controls__summary .portal-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-search {
  gap: var(--space-2);
}

.team-search input {
  min-height: 44px;
  padding: 0 var(--space-5);
  border-color: rgba(24, 29, 49, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.chip-row {
  gap: var(--space-2);
}

.filter-chip {
  min-height: 32px;
  padding: 0 var(--space-4);
  background: rgba(24, 29, 49, 0.055);
  transition:
    transform var(--motion-base) var(--ease-out),
    background var(--motion-base) var(--ease-out),
    box-shadow var(--motion-base) var(--ease-out);
}

.filter-chip:hover {
  transform: translateY(-1px);
  background: rgba(239, 22, 176, 0.1);
}

.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(239, 22, 176, 0.18);
}

.filter-chip--toggle,
.filter-chip--summary {
  background: var(--color-brand-soft);
  color: var(--text-link);
  font-weight: var(--fw-semibold);
}

.filter-chip--summary {
  flex: 0 1 auto;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-advanced {
  display: grid;
  gap: var(--space-3);
}

.team-advanced__toggle {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border-radius: var(--radius-button-pill);
  background: rgba(24, 29, 49, 0.055);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
}

.team-advanced__toggle span {
  transition: transform var(--motion-base) var(--ease-out);
}

.team-advanced.is-open .team-advanced__toggle span {
  transform: rotate(180deg);
}

.team-advanced__panel {
  display: none;
}

.team-advanced.is-open .team-advanced__panel {
  display: grid;
  gap: var(--space-3);
  min-height: min-content;
}

.team-results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
}

.team-results-count {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  font-weight: var(--fw-medium);
}

.team-results-count strong {
  color: var(--text-primary);
  font-weight: var(--fw-bold);
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.team-reset {
  min-height: 36px;
  padding: 0;
  font-size: var(--fs-s);
}

.birthday-shelf {
  grid-auto-columns: minmax(250px, 320px);
  gap: var(--space-5);
  padding-bottom: var(--space-4);
}

.birthday-shelf-card {
  min-height: 220px;
  padding: var(--space-6);
}

.department-list {
  gap: var(--space-16);
}

.department-section {
  scroll-margin-top: 260px;
}

.department-section__header {
  margin-bottom: var(--space-6);
  padding: 0 var(--space-2);
}

.team-page .department-section:first-child .department-section__header {
  margin-bottom: var(--space-4);
}

.department-section__header h3 {
  letter-spacing: -0.02em;
}

.people-grid {
  gap: var(--space-5);
}

.person-card {
  min-height: 250px;
  padding: var(--space-6);
}

.person-card__avatar {
  width: 64px;
  height: 64px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.95), transparent 38%),
    linear-gradient(135deg, var(--color-brand-soft), var(--c-brand-secondary-6));
  box-shadow: 0 16px 32px rgba(239, 22, 176, 0.12);
}

.portal-footer {
  border-top: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 -18px 60px rgba(24, 29, 49, 0.035);
}

@media (min-width: 1180px) {
  .weekly-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1180px) {
  .pulse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .weekly-hero,
  .team-hero,
  .archive-hero {
    border-radius: 40px;
  }

  .weekly-hero {
    grid-template-columns: minmax(0, 1fr) 280px;
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  .weekly-hero h1,
  .team-hero h1,
  .archive-hero h1 {
    max-width: none;
  }

  .weekly-hero h1 {
    font-size: clamp(42px, 7vw, 56px);
  }

  .weekly-hero__visual {
    max-width: 280px;
    min-height: 320px;
  }

  .archive-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .archive-hero__badge {
    width: 160px;
    border-radius: 36px;
  }

  .archive-hero__badge span {
    font-size: 54px;
  }

  .issue-grid {
    grid-template-columns: 1fr;
  }

  .team-controls,
  .team-controls.is-compact {
    top: auto;
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .pulse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .pulse-card {
    min-height: 148px;
  }

  .pulse-card strong {
    font-size: clamp(34px, 11vw, 48px);
  }
}

@media (max-width: 767px) {
  .weekly-hero {
    grid-template-columns: 1fr;
  }

  .weekly-hero__meta {
    max-width: none;
  }

  .weekly-hero__visual {
    display: none;
  }
}

@media (max-width: 560px) {
  .portal-header__inner {
    min-height: 88px;
  }

  .portal-nav {
    width: 100%;
    justify-content: space-between;
  }

  .portal-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 var(--space-3);
  }

  .portal-main {
    padding: var(--space-6) var(--container-pad-mobile) var(--space-16);
  }

  .portal-section {
    margin-top: var(--space-12);
  }

  .portal-section__header {
    margin-bottom: var(--space-5);
  }

  .weekly-hero,
  .team-hero,
  .archive-hero,
  .team-controls,
  .portal-tile,
  .pulse-card,
  .birthday-card,
  .birthday-shelf-card,
  .person-card {
    border-radius: 28px;
  }

  .weekly-hero,
  .team-hero,
  .archive-hero,
  .team-controls,
  .portal-tile,
  .issue-card {
    padding: var(--space-6);
  }

  .weekly-hero::before,
  .team-hero::before,
  .archive-hero::before {
    display: none;
  }

  .weekly-hero__visual {
    min-height: 220px;
    border-radius: 30px;
  }

  .archive-hero {
    gap: var(--space-6);
    margin-bottom: var(--space-12);
  }

  .archive-hero p:not(.portal-kicker),
  .team-hero p:not(.portal-kicker),
  .issue-card p:not(.issue-card__date) {
    font-size: var(--fs-s);
    line-height: var(--lh-s);
  }

  .weekly-hero__topic {
    font-size: var(--fs-m);
    line-height: var(--lh-m);
  }

  .weekly-hero h1 {
    font-size: clamp(36px, 10vw, 46px);
    white-space: normal;
  }

  .weekly-hero__teasers li {
    white-space: normal;
  }

  .archive-hero__badge {
    width: 128px;
    border-radius: 30px;
  }

  .archive-hero__badge span {
    font-size: 46px;
  }

  .issue-card {
    min-height: 280px;
  }

  .issue-card__number {
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }

  .pulse-card {
    padding: var(--space-5);
  }

  .pulse-card span {
    max-width: none;
    font-size: var(--fs-xs);
    line-height: var(--lh-xs);
  }

  .team-controls.is-compact .team-controls__compact,
  .team-results-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .team-controls.is-compact {
    border-radius: 28px;
  }

  .team-controls.is-compact .team-controls__compact {
    display: grid;
    gap: var(--space-3);
  }

  .team-controls__summary {
    flex-wrap: wrap;
  }

  .filter-chip--summary {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .portal-nav {
    gap: 4px;
    padding: 4px;
  }

  .portal-nav a {
    min-height: 34px;
    padding: 0 var(--space-2);
    font-size: var(--fs-xs);
  }

  .pulse-grid {
    grid-template-columns: 1fr;
  }

  .pulse-card {
    min-height: 128px;
  }
}
