:root {
  --font-primary: "Times New Roman", Times, "Liberation Serif", "Noto Serif", Georgia, serif;
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.68);
  --text-soft: rgba(255, 255, 255, 0.84);
  --panel-bg: rgba(12, 12, 16, 0.48);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-hover: rgba(18, 18, 24, 0.62);
  --footer-text: rgba(255, 255, 255, 0.5);
  --focus-ring: rgba(255, 255, 255, 0.45);
  --shade-opacity: 0;
  --tint: 0.36;
  --transition-fast: 180ms ease;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scroll-behavior: smooth;
  background: #000000;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.6);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

img,
video {
  max-width: 100%;
}

/* ---------- Фон: фото или видео ---------- */

.background-media {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  background: #000000;
  filter: brightness(0.78);
}

.background-tint,
.scroll-shade {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000000;
  pointer-events: none;
}

.background-tint {
  opacity: var(--tint);
}

.scroll-shade {
  opacity: var(--shade-opacity);
}

.page-shell {
  position: relative;
  z-index: 1;
}

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

.hero {
  display: flex;
  min-height: 100svh;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(5rem, 13vh, 8.5rem) 1.25rem 4rem;
}

.hero__content {
  width: min(100%, 760px);
  text-align: center;
  animation: hero-in 1.1s ease both;
}

.hero__avatar {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.6rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 42px rgba(255, 255, 255, 0.2),
    0 24px 70px rgba(0, 0, 0, 0.48);
}

.hero__title {
  margin: 0 0 0.4rem;
  color: #ffffff;
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.55);
}

.hero__eyebrow {
  margin: 0 0 1.8rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast);
}

.contact-link svg {
  width: 1.08rem;
  height: 1.08rem;
  fill: currentColor;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

/* ---------- Карточки ---------- */

.posts-section {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(5rem, 12vw, 9rem);
}

.section-heading {
  margin-bottom: 1.6rem;
}

.section-heading h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.posts-empty {
  color: var(--text-muted);
  font-style: italic;
}

.post-card {
  position: relative;
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.35rem, 3vw, 1.8rem);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel-bg);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--panel-hover);
  box-shadow: 0 30px 95px rgba(0, 0, 0, 0.4);
}

.post-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 1.1rem;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.post-card__media img,
.post-card__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}

.post-card:hover .post-card__media img,
.post-card:hover .post-card__media video {
  transform: scale(1.04);
}

.post-card__badge {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.post-card__badge svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

.post-card time {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-card h3 {
  margin: 0.8rem 0 0.7rem;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card p {
  display: -webkit-box;
  margin: 0 0 1.6rem;
  overflow: hidden;
  color: var(--text-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color var(--transition-fast);
}

/* Вся карточка кликабельна, но ссылка остаётся одна */
.read-more::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.read-more::after {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  transition: width var(--transition-fast), opacity var(--transition-fast);
}

/* без transform: иначе ::before перестанет накрывать всю карточку */
.post-card:hover .read-more,
.read-more:focus-visible {
  color: #ffffff;
}

.read-more:focus-visible {
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

.post-card:hover .read-more::after,
.read-more:focus-visible::after {
  width: 2.35rem;
  opacity: 0.9;
}

/* ---------- Страница карточки ---------- */

.article-section {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  background: rgba(0, 0, 0, 0.82);
}

.article-section__inner {
  width: min(100% - 2rem, 860px);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.article-section__back {
  display: inline-flex;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition-fast);
}

.article-section__back:hover,
.article-section__back:focus-visible {
  color: #ffffff;
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

.article {
  color: var(--text-soft);
}

.article__header {
  margin-bottom: clamp(1.8rem, 5vw, 2.8rem);
}

.article__eyebrow {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article__header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.article__body {
  display: grid;
  gap: 1.2rem;
  font-size: clamp(1.1rem, 1.9vw, 1.28rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.article__body p {
  margin: 0;
}

.article__body a,
.article__link {
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.article__body a:hover,
.article__body a:focus-visible {
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.8);
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

.article__gallery {
  display: grid;
  gap: 1rem;
  margin: 0 0 clamp(1.8rem, 5vw, 2.6rem);
}

.article__gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.article__gallery img,
.article__gallery video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  background: #000000;
}

.article__gallery img {
  cursor: zoom-in;
}

.article__action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2rem;
  padding: 0.8rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.article__action:hover,
.article__action:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

/* Просмотр фото на весь экран */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 200ms ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

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

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #000000;
}

.site-footer__inner {
  display: flex;
  width: min(100% - 2rem, var(--max-width));
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 0 auto;
  padding: 1.6rem 0;
  color: var(--footer-text);
  font-size: 0.85rem;
}

.site-footer__copyright {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
}

.footer-links a {
  color: var(--footer-text);
  transition: color var(--transition-fast);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #ffffff;
  outline: 1px solid var(--focus-ring);
  outline-offset: 0.25rem;
}

/* ---------- Анимации ---------- */

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Без JavaScript всё видно сразу */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .hero {
    padding-top: 4.5rem;
  }

  .contacts {
    gap: 0.65rem;
  }

  .contact-link {
    padding-inline: 0.9rem;
  }

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

  .post-card {
    min-height: 240px;
    border-radius: 24px;
  }

  .site-footer__inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .hero__avatar {
    width: 104px;
    height: 104px;
  }

  .contact-link {
    width: 100%;
    max-width: 16rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
