/* Главная корпоративного портала — слой 1 (продуктовая стилистика), токены из tokens.css */

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: calc(var(--z-header) + 1);
  transform: translateY(-160%);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-button-pill);
  background: var(--color-brand);
  color: var(--text-on-dark);
  font-weight: var(--fw-semibold);
}

.skip-link:focus {
  transform: translateY(0);
}

.skip-link:hover {
  color: var(--text-on-dark);
  text-decoration: none;
}

.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sur-secondary);
}

.portal-header {
  position: relative;
  z-index: var(--z-header);
  min-height: var(--header-h);
  background: var(--sur-primary);
  border-bottom: 1px solid var(--bord-primary);
  box-shadow: var(--shadow-1);
}

.portal-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--container-pad-mobile);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .portal-header__inner {
    padding: 0 var(--container-pad-tablet);
  }
}

@media (min-width: 1024px) {
  .portal-header__inner {
    padding: 0 var(--page-pad-x);
  }
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 0;
  text-decoration: none;
}

.portal-logo__img {
  display: block;
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.portal-logo:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 4px;
  border-radius: 4px;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.portal-nav a {
  font-size: var(--fs-s);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-quick) var(--ease-out);
}

.portal-nav a:hover {
  color: var(--text-link);
  text-decoration: none;
  border-bottom-color: var(--color-brand);
}

.portal-nav a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
  border-bottom-color: var(--color-brand);
}

.portal-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--section-header-gap) var(--container-pad-mobile) var(--section-gap);
}

@media (min-width: 768px) {
  .portal-main {
    padding-left: var(--container-pad-tablet);
    padding-right: var(--container-pad-tablet);
  }
}

@media (min-width: 1024px) {
  .portal-main {
    padding-left: var(--page-pad-x);
    padding-right: var(--page-pad-x);
  }
}

.portal-kicker {
  margin: 0 0 var(--space-2);
  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;
}

.portal-muted {
  color: var(--text-tertiary);
}

.portal-link {
  color: var(--text-link);
  font-weight: var(--fw-semibold);
}

.portal-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-button-pill);
  padding: 0 var(--space-6);
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: filter var(--motion-quick) var(--ease-out);
}

.portal-button:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

.portal-button--pink {
  background: var(--btn-pink);
  color: var(--text-on-dark);
}

.portal-button--pink:hover {
  color: var(--text-on-dark);
}

.portal-button--secondary {
  background: var(--btn-secondary);
  border: 1px solid var(--bord-primary);
  color: var(--text-primary);
}

.portal-button--secondary:hover {
  color: var(--text-primary);
}

.portal-button--small {
  min-height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.weekly-hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: var(--layout-col-gap);
  align-items: stretch;
  margin-bottom: var(--section-gap);
  padding: var(--space-10);
  border-radius: var(--radius-communications);
  background:
    radial-gradient(circle at 84% 16%, rgba(239, 22, 176, 0.18), transparent 34%),
    linear-gradient(135deg, var(--sur-primary) 0%, var(--color-brand-soft) 48%, var(--c-brand-secondary-2) 100%);
  box-shadow: var(--shadow-banner);
  overflow: hidden;
}

.weekly-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.weekly-hero h1 {
  margin-bottom: var(--space-3);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl));
  line-height: 1.05;
}

.weekly-hero__meta {
  margin-bottom: var(--space-4);
  color: var(--text-tertiary);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: var(--fw-medium);
}

.weekly-hero__topic {
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  color: var(--text-secondary);
  max-width: 48ch;
  margin-bottom: var(--space-5);
}

.weekly-hero__teasers {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-8);
  padding: 0;
  list-style: none;
  color: var(--text-primary);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: var(--fw-medium);
}

.weekly-hero__teasers li {
  display: flex;
  gap: var(--space-2);
}

.weekly-hero__teasers li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 7px;
  flex: 0 0 auto;
  background: var(--color-brand);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.weekly-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.weekly-hero__visual {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-surface-modal);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(145deg, var(--color-ink) 0%, #252b47 100%);
  overflow: hidden;
}

.weekly-hero__visual::before,
.weekly-hero__visual::after {
  content: "";
  position: absolute;
  border-radius: var(--radius-circle);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.weekly-hero__visual::before {
  inset: 42px;
}

.weekly-hero__visual::after {
  inset: 82px;
}

.hero-star {
  position: absolute;
  display: block;
  background: var(--color-brand);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.hero-star--large {
  width: 150px;
  height: 150px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(10deg);
}

.hero-star--medium {
  width: 58px;
  height: 58px;
  right: 54px;
  top: 48px;
  background: var(--color-bright);
}

.hero-star--small {
  width: 34px;
  height: 34px;
  left: 52px;
  bottom: 64px;
  background: var(--color-brand-light);
}

.hero-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 230px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-circle);
  transform: translate(-50%, -50%) rotate(-22deg);
}

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

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

.portal-section__header--row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.portal-section__title {
  font-size: var(--fs-xl);
  line-height: var(--lh-xl);
  margin-bottom: 0;
  font-family: var(--font-display);
}

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

.pulse-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-5);
  border-radius: var(--radius-utility-xl);
  background: var(--sur-primary);
  border: 1px solid var(--bord-primary);
  box-shadow: var(--shadow-1);
}

.pulse-card strong {
  color: var(--color-brand);
  font-family: var(--font-display);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl));
  line-height: 1;
}

.pulse-card:nth-child(even) strong {
  color: var(--text-primary);
}

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

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

.portal-card-grid--three {
  grid-template-columns: 1fr;
}

.portal-card {
  display: block;
  max-width: 400px;
  padding: var(--space-5);
  background: var(--sur-primary);
  border: 1px solid var(--bord-primary);
  border-radius: var(--radius-utility-l);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--motion-base) var(--ease-out);
}

.portal-card + .portal-card {
  margin-top: var(--space-4);
}

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

.portal-card h2 {
  font-size: var(--fs-l);
  line-height: var(--lh-l);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.portal-card p {
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  color: var(--text-tertiary);
  margin: 0;
}

.portal-card .portal-card__cta {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--fs-s);
  font-weight: var(--fw-semibold);
  color: var(--text-link);
}

.portal-tile {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  padding: var(--space-6);
  border-radius: var(--radius-surface-modal);
  border: 1px solid var(--bord-primary);
  background: var(--sur-primary);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--motion-base) var(--ease-out), filter var(--motion-quick) var(--ease-out);
}

.portal-tile:hover {
  box-shadow: var(--shadow-2);
  text-decoration: none;
}

.portal-tile--muted {
  background: linear-gradient(135deg, var(--sur-primary), var(--sur-secondary));
}

.portal-tile__eyebrow {
  margin-bottom: var(--space-4);
  color: var(--text-link);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
}

.portal-tile h3 {
  margin-bottom: var(--space-3);
  font-size: var(--fs-xl);
  line-height: var(--lh-xl);
}

.portal-tile p {
  color: var(--text-secondary);
}

.portal-tile .portal-card__cta {
  margin-top: auto;
}

.birthday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.birthday-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-utility-xl);
  background: var(--sur-primary);
  border: 1px solid var(--bord-primary);
  box-shadow: var(--shadow-1);
}

.birthday-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);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.birthday-card h3 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-l);
  line-height: var(--lh-l);
}

.birthday-card p:not(.birthday-card__date) {
  color: var(--text-secondary);
}

.team-hero {
  margin-bottom: var(--space-8);
  padding: var(--space-10);
  border-radius: var(--radius-communications);
  background:
    radial-gradient(circle at 12% 18%, rgba(239, 22, 176, 0.14), transparent 28%),
    linear-gradient(135deg, var(--sur-primary), var(--c-brand-secondary-5));
  box-shadow: var(--shadow-banner);
}

.team-hero h1 {
  margin-bottom: var(--space-4);
  font-size: clamp(var(--fs-2xl), 5vw, var(--fs-4xl));
  line-height: 1.05;
}

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

.team-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--section-gap);
  padding: var(--space-5);
  border: 1px solid var(--bord-primary);
  border-radius: var(--radius-surface-modal);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px);
}

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

.team-search label,
.team-filter-group h3 {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
}

.team-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-input-pad);
  border: 1px solid var(--bord-field);
  border-radius: var(--radius-field);
  background: var(--sur-tertiary-alpha);
  color: var(--text-primary);
}

.team-search input::placeholder {
  color: var(--text-passive);
}

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

.chip-row {
  display: flex;
  gap: var(--space-chip-gap);
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 32px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-button-pill);
  background: var(--btn-chip);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-medium);
}

.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--text-on-dark);
}

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

.birthday-shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 280px);
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-width: none;
}

.birthday-shelf::-webkit-scrollbar {
  display: none;
}

.birthday-shelf-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  border: 1px solid var(--bord-primary);
  border-radius: var(--radius-utility-xl);
  background: var(--sur-primary);
  box-shadow: var(--shadow-1);
}

.birthday-shelf-card h3 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-l);
  line-height: var(--lh-l);
}

.birthday-shelf-card p:not(.birthday-card__date) {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

.birthday-shelf-card .portal-link,
.birthday-shelf-card .portal-muted {
  margin-top: auto;
}

.department-list {
  display: grid;
  gap: var(--section-gap);
}

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

.department-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.department-section__header h3 {
  font-size: var(--fs-xl);
  line-height: var(--lh-xl);
}

.department-section__header p {
  color: var(--text-tertiary);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: var(--fw-medium);
}

.people-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.person-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--bord-primary);
  border-radius: var(--radius-utility-xl);
  background: var(--sur-primary);
  box-shadow: var(--shadow-1);
}

.person-card__avatar {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-circle);
  background: var(--color-brand-soft);
  color: var(--text-link);
  font-family: var(--font-display);
  font-size: var(--fs-l);
  line-height: var(--lh-l);
  font-weight: var(--fw-bold);
}

.person-card__body {
  flex: 1;
}

.person-card h4 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-m);
  line-height: var(--lh-m);
}

.person-card p {
  color: var(--text-secondary);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
}

.person-card .portal-button {
  align-self: flex-start;
}

.portal-footer {
  margin-top: auto;
  padding: var(--space-8) var(--container-pad-mobile) var(--space-6);
  border-top: 1px solid var(--bord-primary);
  background: var(--sur-primary);
  text-align: center;
}

.portal-footer p {
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  color: var(--text-tertiary);
  margin: 0;
}

@media (min-width: 1024px) {
  .portal-footer {
    padding-left: var(--page-pad-x);
    padding-right: var(--page-pad-x);
  }
}

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

  .portal-card-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .people-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .weekly-hero {
    grid-template-columns: 1fr;
    padding: var(--space-6);
  }

  .weekly-hero__visual {
    min-height: 240px;
  }

  .team-controls {
    position: static;
  }
}

@media (max-width: 560px) {
  .portal-header__inner {
    align-items: flex-start;
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .weekly-hero {
    border-radius: var(--radius-surface-modal);
  }

  .weekly-hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-button {
    width: 100%;
  }

  .team-hero,
  .team-controls {
    padding: var(--space-5);
    border-radius: var(--radius-surface-modal);
  }

  .person-card .portal-button {
    align-self: stretch;
  }
}
