/* ==========================================================================
   Angular Meetup — базовые стили
   Один файл, без сборки. Порядок: токены → сброс → типографика →
   утилиты → шапка → секции → подвал → адаптив.
   ========================================================================== */

/* --- Токены --------------------------------------------------------------- */

:root {
  /* Палитра унаследована с прежнего сайта */
  --accent: #5552e8;
  --accent-dark: #3f3cc9;
  --accent-soft: #eceafd;
  --pink: #e8368f;

  --ink: #0a083a;
  --ink-soft: #171348;

  --bg: #ffffff;
  --bg-alt: #f6f6fb;
  --text: #21203a;
  --muted: #5f5d7a;
  --border: rgba(10, 8, 58, 0.12);

  --brand-gradient: linear-gradient(120deg, var(--pink), var(--accent));

  /* Шкала отступов */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(10, 8, 58, 0.06), 0 4px 12px rgba(10, 8, 58, 0.05);
  --shadow-md: 0 8px 30px rgba(10, 8, 58, 0.1);

  --container: 1120px;
  --header-h: 72px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* --- Сброс ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(85, 82, 232, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Типографика ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--sp-4);
  line-height: 1.15;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
}
h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}
h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--sp-4);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 60ch;
}

/* --- Утилиты -------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section {
  padding-block: clamp(var(--sp-7), 8vw, var(--sp-9));
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__head {
  max-width: 62ch;
  margin-bottom: var(--sp-7);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* --- Кнопки --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  color: #fff;
}

/* --- Шапка ---------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* На страницах с тёмным героем шапка стартует прозрачной */
.header--overlay {
  background: transparent;
  border-bottom-color: transparent;
  margin-bottom: calc(var(--header-h) * -1);
}

/* Подложка героя намеренно лёгкая, поэтому пункты меню — чистый белый:
   при 85% контраст на светлых участках фотографии падает ниже 4.5:1. */
.header--overlay .header__link {
  color: #fff;
}

.header--overlay .header__link:hover,
.header--overlay .header__link[aria-current="page"] {
  color: #fff;
}

.header--overlay .burger__line {
  background: #fff;
}

.header.is-stuck {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header.is-stuck .header__link {
  color: var(--text);
}

.header.is-stuck .header__link:hover,
.header.is-stuck .header__link[aria-current="page"] {
  color: var(--accent);
}

.header.is-stuck .burger__line {
  background: var(--ink);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  width: 100%;
}

.header__logo {
  flex: none;
  display: block;
  line-height: 0;
}

.header__logo img {
  width: 148px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.header__link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header__link:hover,
.header__link[aria-current="page"] {
  color: var(--accent);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.burger__line {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger[aria-expanded="true"] .burger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger[aria-expanded="true"] .burger__line:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded="true"] .burger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Герой ---------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 86vh, 760px);
  padding-block: calc(var(--header-h) + var(--sp-7)) var(--sp-8);
  color: #fff;
  background-color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

/* Скрим: без него фотография забивает текст */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      100deg,
      rgba(10, 8, 58, 0.66) 0%,
      rgba(10, 8, 58, 0.44) 45%,
      rgba(10, 8, 58, 0.06) 100%
    ),
    linear-gradient(to top, rgba(10, 8, 58, 0.4), transparent 55%);
}

.hero__inner {
  max-width: 44rem;
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--sp-5);
}

.hero h1 .accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__note {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: #fff;
  margin-bottom: var(--sp-6);
  max-width: 40ch;
}

.hero__note a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.6);
}

.hero__note a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* --- Сетка карточек ------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--sp-5);
}

/* Ровно две колонки: группы манифеста состоят из 4 карточек и должны
   складываться в 2×2, а не в 3+1, как это делает auto-fit. */
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 680px) {
  .grid--2 {
    grid-template-columns: 1fr;
  }
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.subhead {
  margin: var(--sp-8) 0 var(--sp-5);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

.subhead:first-of-type {
  margin-top: 0;
}

/* --- Карточка манифеста --------------------------------------------------- */

.card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.section--alt .card {
  background: #fff;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(85, 82, 232, 0.35);
}

.card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--sp-4);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.card h4 {
  margin-bottom: var(--sp-2);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

/* --- События -------------------------------------------------------------- */

.events {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.event {
  display: grid;
  grid-template-columns: minmax(210px, 260px) 1fr;
  gap: var(--sp-5) var(--sp-6);
  padding: var(--sp-6);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.event:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(85, 82, 232, 0.3);
}

.event__title {
  margin-bottom: var(--sp-2);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.event__title a {
  color: var(--ink);
  text-decoration: none;
}

.event__title a:hover {
  color: var(--accent);
}

.event__date {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: var(--sp-4);
}

.event__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  font-size: 0.95rem;
}

.event__links span {
  color: var(--muted);
}

.talks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.talks li {
  position: relative;
  padding-left: var(--sp-5);
  color: var(--text);
}

.talks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
}

/* --- Контакты ------------------------------------------------------------- */

.channel {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.channel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(85, 82, 232, 0.35);
  color: inherit;
}

.channel__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
}

.channel:hover .channel__name {
  color: var(--accent);
}

.channel__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.channel__kind {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}

.channel p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
}

/* --- Статьи --------------------------------------------------------------- */

.page-head {
  padding-block: calc(var(--sp-7)) var(--sp-6);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.article-list {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(85, 82, 232, 0.3);
  color: inherit;
}

.article-card__cover {
  aspect-ratio: 16 / 9;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}

.article-card__cover span {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  text-wrap: balance;
}

.article-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--sp-5);
}

.article-card time {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

.article-card h2 {
  font-size: 1.2rem;
  margin-bottom: var(--sp-3);
  text-wrap: balance;
}

.article-card p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
}

/* --- Страница статьи ------------------------------------------------------ */

.article {
  padding-block: var(--sp-7) var(--sp-8);
}

.article__inner {
  max-width: 44rem;
  margin-inline: auto;
}

.article__meta {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: var(--sp-3);
}

.article__inner h2 {
  margin-top: var(--sp-8);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
}

.article__inner h3 {
  margin-top: var(--sp-6);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.article__inner ul {
  margin: 0 0 var(--sp-4);
  padding-left: var(--sp-5);
}

.article__inner li {
  margin-bottom: var(--sp-2);
}

.article__inner pre {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-5);
  background: var(--ink);
  color: #e8e7f5;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

.article__inner pre code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  color: inherit;
  white-space: pre;
}

.article__inner :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 5px;
}

.article__source {
  margin-top: var(--sp-8);
  padding: var(--sp-5);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.article__source p:last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* --- Подвал --------------------------------------------------------------- */

.footer {
  padding-block: var(--sp-7);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
}

.footer__logo img {
  width: 140px;
}

.footer a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.footer a:hover {
  color: #fff;
  text-decoration-color: #fff;
}


/* --- Адаптив -------------------------------------------------------------- */

@media (max-width: 860px) {
  .event {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    padding: var(--sp-5);
  }
}

@media (max-width: 720px) {
  .burger {
    display: flex;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-3) var(--sp-5) var(--sp-5);
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* В открытом меню пункты всегда тёмные — фон белый */
  .nav .header__link,
  .header--overlay .nav .header__link {
    padding-block: var(--sp-3);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 1.05rem;
  }

  .nav .header__link:last-child {
    border-bottom: 0;
  }

  .nav .header__link:hover,
  .header--overlay .nav .header__link:hover,
  .nav .header__link[aria-current="page"] {
    color: var(--accent);
  }

  .hero {
    min-height: 0;
    padding-block: calc(var(--header-h) + var(--sp-6)) var(--sp-7);
  }

  .hero__actions .btn {
    flex: 1 1 auto;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
