/* ============================================================
   Сайт-панно · токен-слой (стиль заимствован: warm editorial)
   ============================================================ */

:root {
  /* Цвет */
  --paper: #FAF7F2;
  --paper-soft: #F4EFE6;
  --surface: #FFFFFF;
  --ink: #1C1A17;
  --accent: #A22F20;        /* кумач: алые знамёна праздника, AA */
  --accent-soft: #B03A2C;   /* кумач бренда: крупные знаки, графика */
  --accent-strong: #7E2012; /* hover/press для заливок */
  --accent-deep: #6A1A0E;   /* активное состояние ссылок */
  --gold: #8A6A14;          /* колосья / «Урожай», вторичный знак, AA */
  --forest: #2F5B4F;
  --muted: #726961;         /* метаданные, AA */
  --hairline: rgba(28, 26, 23, 0.14);
  --hairline-strong: rgba(28, 26, 23, 0.3);

  /* Типографика */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.5rem;
  --text-4xl: 5rem;

  /* Отступы (4px ритм) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Геометрия */
  --radius: 8px;
  --radius-card: 16px;
  --radius-btn: 12px;
  --container: 1200px;
  --measure: 65ch;

  /* Motion */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 160ms;
  --duration-med: 320ms;
  --reveal-dur: 380ms;
}

/* ============================================================
   База
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

[id] { scroll-margin-top: 120px; }

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: rgba(176, 58, 44, 0.2); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(162, 47, 32, 0.4);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease),
              text-decoration-color var(--duration-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

a:hover { color: var(--accent-strong); text-decoration-color: transparent; }
a:active { color: var(--accent-deep); }

/* Skip link */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease);
}

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

/* Прогресс чтения */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}

.progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* ============================================================
   Мастхед + навигация
   ============================================================ */
.masthead {
  background: rgba(250, 247, 242, 0.78);
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .masthead { background: var(--paper); border-bottom: 1px solid var(--hairline); }
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand__icon {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  justify-content: flex-end;
}

.nav a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-1) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.nav a:hover { color: var(--accent); border-color: var(--accent); }
.nav a:active { color: var(--accent-strong); }

/* ============================================================
   Секции
   ============================================================ */
.section { padding-block: var(--space-20); }

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

.page-head {
  position: relative;
  display: block;
  background: var(--paper);
  color: #fff;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.page-head__bg {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 26, 23, 0.35), rgba(28, 26, 23, 0.62));
}

.page-head .container {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-head__emblem {
  position: absolute;
  right: 0;
  bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(7rem, 24vw, 21rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 60px rgba(255, 214, 130, 0.18);
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
}

.page-head .kicker { color: #fff; }

.page-head h1 { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35); }

.page-head h1,
.section__head h1,
.section__head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 22ch;
  text-wrap: balance;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: var(--space-3);
}

.lead {
  margin-top: var(--space-4);
  max-width: 56ch;
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--muted);
}

/* ============================================================
   Карусель
   ============================================================ */
.carousel-section {
  margin-top: var(--space-16);
}

.carousel {
  --carousel-sw: 46%;
  position: relative;
  max-width: var(--container);
  margin-inline: auto;
}

.carousel__viewport {
  position: relative;
  overflow: hidden;
  /* Тень слайдов рисуется ниже track: при overflow:hidden добавляем
     нижний padding, иначе обрезается жёсткой гранью. */
  padding: var(--space-6) 0 calc(var(--space-6) + 44px);
  border-radius: var(--radius-card);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}

.carousel__track {
  position: relative;
  aspect-ratio: 16 / 7;
  perspective: 1200px;
}

.carousel__slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  min-width: 0;
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(28, 26, 23, 0.18);
  transition: transform 800ms cubic-bezier(0.34, 1.2, 0.5, 1),
              opacity 800ms var(--ease),
              filter 800ms var(--ease),
              box-shadow 400ms var(--ease);
}

.carousel__track.is-animating .carousel__slide {
  will-change: transform, opacity;
}

.carousel__track.is-dragging .carousel__slide {
  transition: none;
  will-change: transform, opacity;
}

.carousel__slide.is-active {
  box-shadow: 0 20px 60px rgba(28, 26, 23, 0.3);
}

.carousel__media {
  aspect-ratio: 16 / 9;
  background: var(--paper-soft);
  overflow: hidden;
}

.carousel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__slide.is-empty .carousel__media img { display: none; }

.carousel__slide.is-empty .carousel__media::after {
  content: "Фотография появится здесь";
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-8);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-card);
}

.carousel__caption {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--hairline);
  opacity: 0;
  transition: opacity 600ms var(--ease);
}

.carousel__slide.is-active .carousel__caption { opacity: 1; }

.carousel__num {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.carousel__text {
  font-size: var(--text-sm);
  color: var(--muted);
}

.carousel__arrow {
  position: absolute;
  top: 42%;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 18px rgba(28, 26, 23, 0.18);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent;
  transition: color var(--duration-fast) var(--ease),
              background-color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
  z-index: 6;
}

.carousel__arrow:hover {
  color: var(--accent);
  background: var(--paper);
  transform: translateY(-50%) scale(1.06);
}
.carousel__arrow:active { transform: translateY(-50%) scale(0.94); }

.carousel__arrow--prev { left: 8px; }
.carousel__arrow--next { right: 8px; }

@media (hover: none) {
  .carousel__arrow { width: 48px; height: 48px; }
}

.carousel__bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.carousel__dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 auto;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--hairline-strong);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease);
}

.carousel__dot:hover { background: var(--accent-soft); }
.carousel__dot:active { transform: scale(1.4); }
.carousel__dot.is-active { background: var(--accent); }

.carousel__counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ============================================================
   Полноэкранный просмотр фото
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(8px);
  transition: opacity var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out),
              visibility 0s linear var(--duration-med);
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  transition: opacity var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 26, 23, 0.9);
  backdrop-filter: blur(8px);
}

.lightbox__frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(92vw, 1200px);
}

.lightbox__picture {
  display: grid;
  place-items: center;
}

.lightbox__picture.is-dragging {
  transition: opacity 200ms var(--ease-out);
}

.lightbox__picture img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transition: transform var(--duration-med) var(--ease-out),
              opacity var(--duration-med) var(--ease-out);
  -webkit-user-drag: none;
  user-select: none;
}

.lightbox__picture.is-empty {
  width: 84%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(250, 247, 242, 0.35);
  border-radius: var(--radius-card);
  color: rgba(250, 247, 242, 0.7);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-8);
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 247, 242, 0.25);
  border-radius: 50%;
  background: rgba(28, 26, 23, 0.4);
  color: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              transform 100ms ease-out;
}

.lightbox__arrow:hover {
  background: rgba(176, 58, 44, 0.85);
  color: #fff;
}

.lightbox__arrow:active { transform: translateY(-50%) scale(0.92); }

.lightbox__arrow--prev { left: var(--space-4); }
.lightbox__arrow--next { right: var(--space-4); }

.lightbox__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(28, 26, 23, 0.5);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              transform 100ms ease-out;
}

.lightbox__close:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.06);
}

.lightbox__close:active { transform: scale(0.94); }

.lightbox__counter {
  position: absolute;
  bottom: var(--space-6);
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: rgba(250, 247, 242, 0.8);
}

@media (max-width: 700px) {
  .lightbox__arrow {
    width: 40px;
    height: 40px;
  }
  .lightbox__counter {
    bottom: var(--space-4);
  }
}

html.is-locked,
body.is-locked {
  overflow: hidden;
}

/* ============================================================
   Карусель: подпись-атрибуция
   ============================================================ */
.carousel__note {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: var(--measure);
}

/* ============================================================
   История
   ============================================================ */
.history__body {
  width: 75%;
  margin-inline: auto;
}

.history__story { max-width: none; }

.history__p {
  margin-bottom: var(--space-4);
  max-width: var(--measure);
  margin-inline: auto;
}

.history__p--first:first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 3.2em;
  line-height: 0.85;
  float: left;
  padding-right: 0.12em;
  color: var(--accent-soft);
}

html.is-history-collapsed [data-history-hidden] {
  display: none;
}

.history__more {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 80vw;
  margin-top: var(--space-12);
  margin-bottom: var(--space-16);
}

.history__more::before,
.history__more::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline-strong);
}

.history__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  background: var(--paper);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.history__toggle:hover {
  background: var(--accent);
  color: var(--paper);
}

.history__toggle:active { transform: scale(0.97); }

.history__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.history__toggle svg {
  display: block;
  transition: transform var(--duration-fast) var(--ease);
}

.history__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ============================================================
   Газетный архив
   ============================================================ */
.archive {
  margin-top: var(--space-16);
  padding: var(--space-8) var(--space-8) var(--space-6);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.archive__head {
  text-align: center;
  margin-bottom: var(--space-8);
}

.archive__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.archive__years {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--accent-soft);
}

.archive__years span {
  font-size: var(--text-sm);
  color: var(--gold);
}

.archive__title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.archive__body {
  max-width: none;
}

.archive__body p {
  margin-bottom: var(--space-4);
  max-width: var(--measure);
  margin-inline: auto;
}

.archive__foot {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* === Стихи === */
.poem {
  margin-block: var(--space-8);
  text-align: center;
}

.poem p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.poem--long p + p {
  margin-top: var(--space-4);
}

/* ============================================================
   Воспоминания
   ============================================================ */
.memories {
  margin-top: var(--space-20);
  padding-top: var(--space-12);
  border-top: 1px solid var(--hairline-strong);
}

.memories__head {
  margin-bottom: var(--space-12);
}

.memories__head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

.memory {
  display: flex;
  flex-direction: column;
  margin-block: var(--space-8);
  padding: var(--space-6) var(--space-6);
  border-left: 3px solid var(--accent);
  background: rgba(162, 47, 32, 0.05);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.memory:first-child {
  margin-top: 0;
  padding-top: var(--space-6);
}

.memory__person {
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--accent-strong);
}

.memory__text p {
  margin-bottom: var(--space-4);
  max-width: var(--measure);
  margin-inline: auto;
}

.memory.is-collapsed .memory__text > p:not(.memory__preview) {
  display: none;
}

.memory:not(.is-collapsed) .memory__preview {
  display: none;
}

.memory__toggle {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  background: var(--paper);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.memory__toggle:hover {
  background: var(--accent);
  color: var(--paper);
}

.memory__toggle:active { transform: scale(0.97); }

.memory__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.memory__toggle svg {
  display: block;
  transition: transform var(--duration-fast) var(--ease);
}

.memory__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ============================================================
   Футер
   ============================================================ */
.footer {
  border-top: 1px solid var(--hairline);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-8);
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer__top { text-decoration: none; font-weight: 500; }

/* ============================================================
   Комментарии · Книга отзывов
   ============================================================ */
.comments {
  margin-top: var(--space-20);
  padding-top: var(--space-12);
  border-top: 1px solid var(--hairline-strong);
}

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

.comments__head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 24ch;
}

.comments__lead {
  margin-top: var(--space-3);
  max-width: var(--measure);
  color: var(--muted);
  font-size: var(--text-sm);
}

.comments__form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.6fr;
  gap: var(--space-6);
  padding: var(--space-8);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(28, 26, 23, 0.03),
              0 16px 44px -28px rgba(28, 26, 23, 0.22);
}

.comments__meta-line {
  grid-column: 1 / -1;
}

/* Поля-«строчки» книги отзывов */
.comments__field label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.comments__field input,
.comments__field textarea {
  width: 100%;
  padding: var(--space-2) 0;
  border: none;
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

.comments__field input::placeholder,
.comments__field textarea::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

.comments__field input:focus,
.comments__field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.comments__field input:focus:not(:focus-visible),
.comments__field textarea:focus:not(:focus-visible) {
  outline: none;
}

.comments__field input:focus-visible,
.comments__field textarea:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.comments__field textarea {
  min-height: 120px;
}

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

.comments__status {
  font-size: var(--text-sm);
  color: var(--ink);
}

.comments__status.is-error { color: var(--accent-strong); }
.comments__status.is-success { color: var(--forest); }

.comments__submit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px var(--space-6);
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.comments__submit:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.comments__submit:active { transform: scale(0.97); }
.comments__submit:disabled { opacity: 0.6; cursor: default; }

.comments__list-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-top: var(--space-16);
  margin-bottom: var(--space-2);
  padding-top: var(--space-8);
  border-top: 1px solid var(--hairline-strong);
}

.comments__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.comments__list {
  list-style: none;
}

/* Запись книги отзывов: номер-хроники, имя, дата, текст */
.comment {
  padding-block: var(--space-6);
  border-top: 1px solid var(--hairline);
}

.comment:first-child { border-top: none; }

.comment__number {
  display: inline-block;
  min-width: 2.2em;
  margin-right: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--gold);
}

.comment__meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  max-width: var(--measure);
}

.comment__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--ink);
}

.comment__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.comment__text {
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-width: var(--measure);
}

.comments__empty {
  margin-top: var(--space-8);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ============================================================
   Motion: reveal
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--reveal-dur) var(--ease-out),
                transform var(--reveal-dur) var(--ease-out);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Респонсив
   ============================================================ */
@media (max-width: 700px) {
  .page-head__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
  }
  .page-head::before {
    z-index: 1;
  }
  .page-head .container {
    position: relative;
    z-index: 2;
    padding-top: var(--space-8);
    padding-bottom: var(--space-6);
  }
  .page-head__emblem {
    font-size: clamp(4rem, 22vw, 8rem);
    bottom: 0;
    opacity: 0.8;
  }
  .section { padding-block: var(--space-12); }

  .masthead__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding-block: var(--space-2);
  }

  .nav { justify-content: flex-start; }

  /* История и газетный архив — во всю ширину колонки */
  .history__body { width: 100%; }

  .archive {
    padding: var(--space-6);
  }

  .archive__years {
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-lg);
  }

  .poem p { font-size: var(--text-md); }

  .memory { padding-block: var(--space-6); }

  .carousel__arrow {
    width: 40px;
    height: 40px;
  }

  /* 54 точки нечитаемы на мобильном — навигация стрелками и свайпом */
  .carousel__dots { display: none; }

  .carousel__bar {
    justify-content: flex-end;
  }

  .comments__form {
    padding: var(--space-6);
    grid-template-columns: 1fr;
  }

  .comments__meta-line {
    flex-direction: column;
    align-items: stretch;
  }

  .comments__submit {
    width: 100%;
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding-block: var(--space-6);
  }
}

@media (max-width: 420px) {
  .container { padding-inline: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track { transition: none; }
}

/* Reduced-transparency: стекло мастхеда становится матовым */
@media (prefers-reduced-transparency: reduce) {
  .masthead {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Reduced-motion: guard поверх всех ранее объявленных transition */
@media (prefers-reduced-motion: reduce) {
  a, .nav a, .history__toggle, .memory__toggle,
  .comments__submit, .carousel__arrow, .carousel__dot,
  .lightbox__arrow, .lightbox__close, .lightbox,
  .lightbox__picture img {
    transition: none;
  }
}