:root {
  /* Референс: Schockemöhle — премиальный конный сайт */
  --gold: #bfa166;
  --charcoal: #2d2d2d;
  --cream: #f5f3ef;
  --cream-dark: #ebe8e2;
  --muted: #9a958c;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --accent-pastel: #a8bcc8;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", Georgia, serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-duration: 0.85s;
  --reveal-duration-photo: 1.15s;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--cream);
}

@media (max-width: 767px) {
  body {
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  html {
    overflow-x: clip;
  }
}

body.is-nav-open {
  overflow: hidden;
}

body.is-preview-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  body.is-nav-open {
    overflow: visible;
  }
}

a {
  color: var(--charcoal);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.1rem 1.75rem;
  padding-left: max(1.1rem, env(safe-area-inset-left));
  padding-right: max(1.1rem, env(safe-area-inset-right));
  padding-top: max(1.1rem, env(safe-area-inset-top));
  background: rgba(245, 243, 239, 0.88);
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header__end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.site-header__backdrop {
  display: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
  background: rgba(45, 45, 45, 0.06);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
}

.nav-toggle__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition:
    transform 0.25s var(--ease-out),
    opacity 0.2s ease,
    top 0.25s var(--ease-out);
}

.nav-toggle__bar:nth-child(1) {
  top: 0;
}

.nav-toggle__bar:nth-child(2) {
  top: 7px;
}

.nav-toggle__bar:nth-child(3) {
  top: 14px;
}

.site-header.is-nav-open .nav-toggle__bar:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.site-header.is-nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle__bar:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

@media (max-width: 767px) {
  /* Без blur: иначе WebKit привязывает position:fixed у .nav к хедеру,
     и «шторка» оказывается у верхней кромки, а не у низа экрана. */
  .site-header {
    padding: 0.75rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(0.75rem, env(safe-area-inset-top));
    background: rgba(245, 243, 239, 0.97);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
      0 1px 0 rgba(45, 45, 45, 0.06),
      0 12px 40px rgba(45, 45, 45, 0.06);
  }

  .site-header__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 18;
    margin: 0;
    background: rgba(25, 23, 20, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.35s var(--ease-out),
      visibility 0.35s linear;
    pointer-events: none;
  }

  .site-header.is-nav-open .site-header__backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  /* Нижняя шторка меню — привычный паттерн для iOS/Android */
  .nav {
    display: flex;
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: none;
    max-height: min(86vh, 28rem);
    margin: 0;
    padding: 0 1rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #fcfaf6 0%, #f0ebe4 100%);
    border: none;
    border-top: 1px solid rgba(45, 45, 45, 0.07);
    border-radius: 20px 20px 0 0;
    box-shadow:
      0 -12px 48px rgba(45, 45, 45, 0.14),
      0 -2px 0 rgba(255, 255, 255, 0.6) inset;
    transform: translate3d(0, 108%, 0);
    visibility: hidden;
    transition:
      transform 0.42s var(--ease-out),
      visibility 0.42s linear;
  }

  .nav::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0.55rem auto 0.35rem;
    border-radius: 999px;
    background: rgba(45, 45, 45, 0.12);
    flex-shrink: 0;
  }

  .site-header.is-nav-open .nav {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }

  .nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.95rem 1rem;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 12px;
    border: 1px solid rgba(45, 45, 45, 0.07);
    background: rgba(255, 255, 255, 0.72);
    color: var(--charcoal);
    box-shadow: 0 2px 8px rgba(45, 45, 45, 0.04);
  }

  .nav a:hover,
  .nav a:focus-visible {
    color: #fff;
    background-color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 6px 20px rgba(191, 161, 102, 0.35);
  }

  /* Hero: панель снизу на всю ширину + градиент на фото */
  .hero {
    padding-top: 3.65rem;
  }

  .hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
      185deg,
      rgba(20, 18, 16, 0.15) 0%,
      rgba(245, 243, 239, 0.08) 38%,
      rgba(245, 243, 239, 0.55) 72%,
      rgba(245, 243, 239, 0.97) 100%
    );
  }

  .hero__bg-image {
    object-position: 50% 38%;
  }

  .hero__inner {
    align-items: flex-end;
    justify-content: stretch;
    min-height: calc(100dvh - 3.65rem);
    min-height: calc(100vh - 3.65rem);
    padding: 0.75rem 0.85rem 0;
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .hero__panel {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.35rem 1.2rem 1.5rem;
    border-radius: 18px 18px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow:
      0 -10px 48px rgba(45, 45, 45, 0.1),
      0 24px 60px rgba(45, 45, 45, 0.06);
  }

  .hero__title {
    font-size: clamp(1.45rem, 6.2vw, 1.95rem);
    line-height: 1.18;
    margin-bottom: 0.85rem;
  }

  .hero__lead {
    max-width: none;
    font-size: 0.98rem;
  }

  .hero__note {
    max-width: none;
    font-size: 0.9rem;
  }

  .hero__ctas {
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(45, 45, 45, 0.09);
  }

  .hero-cta {
    letter-spacing: 0.06em;
    line-height: 1.45;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .hero-cta__arrow {
    display: none;
  }

  .module {
    min-height: 0;
  }

  .module__visual {
    min-height: min(48vw, 220px);
  }

  .module__body {
    padding: 1.75rem 1rem 2.25rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .module__panel {
    padding: 1.5rem 1.15rem;
    border-radius: 14px;
    border-color: rgba(45, 45, 45, 0.06);
    box-shadow: 0 12px 40px rgba(45, 45, 45, 0.07);
  }

  .module__body-stack {
    gap: 1.35rem;
  }

  .horse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .horse-card {
    border-radius: 12px;
    overflow: hidden;
  }

  .horse-card:active {
    transform: scale(0.98);
  }

  .horse-card:hover {
    transform: none;
  }

  .cards {
    padding: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    gap: 0.65rem;
    display: flex;
    flex-direction: column;
    background: var(--cream-dark);
    border-top: none;
  }

  .card {
    min-height: 200px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 28px rgba(45, 45, 45, 0.1);
  }

  .card__body {
    padding: 1.15rem 1rem 1.2rem;
  }

  .card h2 {
    font-size: 1.12rem;
  }

  .card p {
    font-size: 0.84rem;
  }

  .card:hover .card__photo img {
    transform: none;
  }

  .site-footer {
    padding-bottom: max(2.5rem, calc(1.5rem + env(safe-area-inset-bottom)));
  }

  .horse-detail {
    padding: 1.5rem 1.15rem;
    border-radius: 14px;
  }

  @media (prefers-reduced-motion: reduce) {
    .nav,
    .site-header__backdrop {
      transition-duration: 0.01ms;
    }

    .horse-card:active {
      transform: none;
    }
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 0.65rem;
  }

  .logo {
    order: 1;
  }

  .site-header__end {
    order: 2;
    margin-left: auto;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
}

.logo__mark {
  height: 2.35rem;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: brightness(0.74) contrast(1.28) saturate(1.25)
    drop-shadow(0 1px 1px rgba(45, 45, 45, 0.18));
}

.logo__wordmark {
  font-weight: 400;
  color: var(--gold);
}

.logo:hover {
  text-decoration: none;
}

/* Только от 768px — иначе перебивают мобильную шторку (цвет/паддинги) */
@media (min-width: 768px) {
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.1rem;
    justify-content: flex-end;
  }

  .nav a {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.55em 1.1em;
    border: 1px solid transparent;
    border-radius: 999px;
    transition:
      color 0.22s ease,
      border-color 0.22s ease,
      background-color 0.22s ease,
      box-shadow 0.22s ease;
  }

  /* Как на KDCH: заливка «таблеткой», текст белый */
  .nav a:hover {
    color: #fff;
    text-decoration: none;
    border-color: var(--gold);
    background-color: var(--gold);
    box-shadow: 0 2px 14px rgba(191, 161, 102, 0.35);
  }

  .nav a:focus-visible {
    color: #fff;
    background-color: var(--gold);
    border-color: var(--gold);
    outline: 2px solid var(--charcoal);
    outline-offset: 3px;
  }
}

/* ——— Reveal animations ——— */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.75rem, 0);
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-reveal="fade"] {
  transform: none;
}

[data-reveal="fade"].is-visible {
  transform: none;
}

[data-reveal="photo"] {
  opacity: 1;
  transform: none;
  overflow: hidden;
}

[data-reveal="photo"] img {
  opacity: 0;
  transform: scale(1.07);
  transition:
    opacity var(--reveal-duration-photo) var(--ease-out),
    transform calc(var(--reveal-duration-photo) * 1.1) var(--ease-out);
}

[data-reveal="photo"].is-visible img {
  opacity: 1;
  transform: scale(1);
}

[data-reveal="scale"] {
  transform: scale(1.04);
  opacity: 0;
  transition:
    opacity 1s var(--ease-out),
    transform 1.2s var(--ease-out);
}

[data-reveal="scale"].is-visible {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal="photo"] img,
  [data-reveal="scale"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 4.5rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--cream-dark);
}

.hero__photo-wrap {
  position: absolute;
  inset: 0;
}

.hero__photo-reveal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__bg-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 42%;
  transform: none;
  filter: saturate(1.02) contrast(1.03);
}

@media (min-width: 900px) {
  .hero__bg-image {
    object-position: 56% 40%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bg-image {
    filter: saturate(1) contrast(1.02);
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - 4.5rem);
  min-height: calc(100dvh - 4.5rem);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2rem clamp(1rem, 4vw, 2.75rem) 4rem;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .hero__inner {
    padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
  }
}

.hero__panel {
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  margin-inline: 0;
  padding: 1.85rem 1.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(45, 45, 45, 0.08);
}

@media (min-width: 900px) {
  .hero__panel {
    width: min(22rem, 36vw);
    max-width: 24rem;
  }
}

.hero__brand {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
  color: var(--charcoal);
}

.hero__brand span {
  color: var(--gold);
}

.hero-welcome {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4.2vw, 2.65rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--gold);
}

.hero__lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 38ch;
}

.hero__note {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 38ch;
  line-height: 1.5;
}

.hero__note:last-of-type {
  margin-bottom: 1.5rem;
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal);
}

.hero-cta:hover {
  color: var(--gold);
  text-decoration: none;
}

.hero-cta__diamond {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.hero-cta__diamond--gold {
  background: var(--gold);
}

.hero-cta__diamond--pastel {
  background: var(--accent-pastel);
}

.hero-cta__arrow {
  flex: 1;
  height: 1px;
  max-width: 120px;
  background: linear-gradient(90deg, var(--charcoal), transparent);
  opacity: 0.35;
}

/* Второй ряд ссылок, как на schockemoehle.com */
.hero__ctas-en {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(45, 45, 45, 0.1);
}

.hero__cta-en {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__cta-en:hover {
  color: var(--charcoal);
  text-decoration: none;
}

.hero__cta-en__arr {
  margin-left: 0.2rem;
  opacity: 0.75;
}

.hero-dock {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--gold);
  color: var(--charcoal);
  font-size: 1.1rem;
  transition: filter 0.2s ease;
}

.hero-dock a:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

@media (max-width: 640px) {
  .hero-dock {
    display: none;
  }
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

/* ——— Cards ——— */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid rgba(45, 45, 45, 0.08);
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
  color: inherit;
}

.card:last-child {
  border-right: none;
}

.card__photo {
  position: absolute;
  inset: 0;
}

.card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.card:hover .card__photo img {
  transform: scale(1.04);
}

.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(45, 45, 45, 0.45) 100%
  );
}

.card__body {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.25rem;
  width: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(245, 243, 239, 0.92) 40%
  );
}

.card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--charcoal);
}

.card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.card:hover {
  text-decoration: none;
}

/* ——— Modules ——— */
.module {
  display: grid;
  grid-template-columns: 1fr;
  min-height: min(88vh, 720px);
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
}

@media (min-width: 880px) {
  .module {
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
  }

  .module--flip {
    direction: rtl;
  }

  .module--flip > * {
    direction: ltr;
  }
}

.module__visual {
  position: relative;
  min-height: 280px;
  background: var(--cream-dark);
}

.module__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.module__body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--cream);
}

@media (min-width: 880px) {
  .module__body {
    padding: 3rem 2.5rem;
  }
}

.module__panel {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.75rem;
  border: 1px solid rgba(45, 45, 45, 0.08);
  box-shadow: 0 16px 48px rgba(45, 45, 45, 0.06);
}

.module__panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 400;
  color: var(--charcoal);
}

.module__panel h2 span {
  color: var(--gold);
}

.module__panel .module__subhead {
  margin: 1.35rem 0 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

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

.module__panel p + p {
  margin-top: 1rem;
}

.module__panel code {
  font-size: 0.8em;
  word-break: break-all;
}

.module__body-stack {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Якорь меню «Контакты»: блок телефона/адреса не уезжает под фиксированный header */
#contacts-details {
  scroll-margin-top: calc(5rem + env(safe-area-inset-top, 0px));
}

.contacts__label {
  margin: 0 0 0.4rem;
}

.module__panel .contacts__founder-name {
  margin: 0 0 1.1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--charcoal);
}

.contacts__quote {
  margin: 1.35rem 0 1.25rem;
  padding: 1rem 0 1rem 1.15rem;
  border-left: 3px solid var(--gold);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--charcoal);
}

.contacts__quote p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--charcoal);
}

.contacts__list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contacts__list li {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.contacts__list a {
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.contacts__list a:hover {
  color: var(--charcoal);
}

.contacts__address {
  line-height: 1.5;
}

.horse-grid__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.horse-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(148px, 100%), 1fr)
  );
  gap: 0.85rem;
}

.horse-grid__empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.horse-grid__empty code {
  font-size: 0.75em;
  word-break: break-all;
}

.horse-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(45, 45, 45, 0.1);
  background: rgba(255, 255, 255, 0.65);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(45, 45, 45, 0.05);
  transition:
    box-shadow 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.horse-card:hover {
  box-shadow: 0 14px 36px rgba(45, 45, 45, 0.1);
  transform: translateY(-3px);
  text-decoration: none;
  color: inherit;
}

.horse-card__photo {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--cream-dark);
}

.horse-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out);
}

.horse-card:hover .horse-card__photo img {
  transform: scale(1.05);
}

.horse-card__body {
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.horse-card__name {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--charcoal);
}

.horse-card__meta {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  text-wrap: balance;
}

.horse-card__meta--stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.38;
}

.horse-card__meta-line {
  display: block;
}

/* PM CASMINE: портретное фото — чуть выше центр кадра */
.horse-card--casmine .horse-card__photo img {
  object-position: 50% 24%;
}

.horse-card--casmine .horse-card__name {
  letter-spacing: 0.02em;
}

.horse-card__hint {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.2rem;
}

/* ——— Страница лошади (профиль: фото слева, текст справа) ——— */
.horse-page__main {
  min-height: 50vh;
  padding: 5.25rem 1.25rem 3rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(3rem, calc(1.5rem + env(safe-area-inset-bottom)));
  max-width: 1180px;
  margin: 0 auto;
}

.horse-detail {
  padding: 2rem 1.75rem;
  border: 1px solid rgba(45, 45, 45, 0.08);
  box-shadow: 0 16px 48px rgba(45, 45, 45, 0.06);
}

.horse-detail__nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.35rem;
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
}

.horse-detail--missing .horse-detail__nav-actions {
  margin-bottom: 1.25rem;
}

.horse-detail--profile .horse-detail__crumb {
  margin-bottom: 1.35rem;
}

.horse-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, 0.88fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: start;
}

@media (max-width: 899px) {
  .horse-detail__layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Сначала имя и описание, ниже фото; родословная — на всю ширину внизу */
  .horse-detail__info-col {
    order: -1;
  }

  .horse-detail__media-col {
    min-width: 0;
  }
}

.horse-detail__media-col {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  min-width: 0;
}

.horse-detail__ancestors {
  margin-top: 0.25rem;
  padding-top: clamp(1rem, 2vw, 1.35rem);
  border-top: 1px solid rgba(45, 45, 45, 0.08);
}

.horse-detail__section-title--ancestors {
  margin-bottom: 0.75rem;
}

.horse-detail__ancestors-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.horse-ancestor__relation {
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.horse-ancestor__name {
  margin: 0 0 0.65rem;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--charcoal);
  letter-spacing: 0.04em;
}

.horse-ancestor__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.horse-ancestor__figure {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--cream-dark);
  border: 1px solid rgba(45, 45, 45, 0.08);
  box-shadow: 0 4px 14px rgba(45, 45, 45, 0.06);
}

.horse-ancestor__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  vertical-align: middle;
  cursor: zoom-in;
}

@media (max-width: 899px) {
  .horse-ancestor__photos {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
}

@media (max-width: 420px) {
  .horse-ancestor__photos {
    grid-template-columns: 1fr;
  }
}

.horse-detail--missing h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.horse-detail__crumb {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.horse-detail__crumb a {
  color: var(--muted);
}

.horse-detail__crumb a:hover {
  color: var(--gold);
}

.horse-detail__info-col .horse-detail__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.85rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--charcoal);
  letter-spacing: -0.02em;
}

.horse-detail__meta-line {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(0.92rem, 1.35vw, 1.05rem);
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.horse-detail__media {
  width: 100%;
}

.horse-detail__stage {
  outline: none;
}

.horse-detail__stage:focus-visible {
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--gold);
  border-radius: 3px;
}

.horse-detail__stage-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 3px;
  background: linear-gradient(165deg, #faf8f5 0%, #ebe8e2 100%);
  box-shadow:
    0 4px 6px rgba(45, 45, 45, 0.04),
    0 18px 42px rgba(45, 45, 45, 0.09);
}

.horse-detail__stage-frame::before,
.horse-detail__stage-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  border-color: rgba(45, 45, 45, 0.1);
}

.horse-detail__stage-frame::before {
  top: 12px;
  right: 12px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.horse-detail__stage-frame::after {
  bottom: 12px;
  left: 12px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.horse-detail__stage-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 620px);
  margin: 0 auto;
  object-fit: contain;
  vertical-align: middle;
  transition: opacity 0.35s var(--ease-out);
  cursor: zoom-in;
}

.horse-detail__stage-img.is-fading {
  opacity: 0.35;
}

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

  .horse-detail__stage-img.is-fading {
    opacity: 1;
  }
}

.horse-detail__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.horse-detail__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  transition:
    opacity 0.25s var(--ease-out),
    transform 0.25s var(--ease-out),
    background 0.25s ease;
}

.horse-detail__dot:hover {
  opacity: 0.95;
}

.horse-detail__dot.is-active {
  opacity: 1;
  background: var(--gold);
  transform: scale(1.08);
}

.horse-detail__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-bottom: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.horse-detail__thumbs::-webkit-scrollbar {
  height: 4px;
}

.horse-detail__thumbs::-webkit-scrollbar-thumb {
  background: rgba(45, 45, 45, 0.15);
  border-radius: 2px;
}

.horse-detail__thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  background: var(--cream-dark);
  transition:
    border-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    transform 0.2s ease;
}

.horse-detail__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.horse-detail__thumb:hover {
  border-color: rgba(191, 161, 102, 0.55);
}

.horse-detail__thumb.is-active {
  border-color: #c62828;
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.2);
}

.has-photo-viewer {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.photo-viewer[hidden] {
  display: none;
}

.photo-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.84);
  backdrop-filter: blur(2px);
}

.photo-viewer__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1400px);
  height: min(92vh, 980px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.photo-viewer__img {
  display: block;
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.photo-viewer__close,
.photo-viewer__nav {
  appearance: none;
  border: none;
  background: rgba(22, 22, 22, 0.62);
  color: #fff;
  cursor: pointer;
}

.photo-viewer__close {
  position: absolute;
  top: -0.2rem;
  right: 0.15rem;
  transform: translateY(-100%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
}

.photo-viewer__nav {
  width: 2.6rem;
  height: 4rem;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.photo-viewer__close:hover,
.photo-viewer__nav:hover {
  background: rgba(22, 22, 22, 0.84);
}

.photo-viewer__close:focus-visible,
.photo-viewer__nav:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .photo-viewer__dialog {
    width: 100vw;
    height: 100vh;
    padding: 0.6rem;
    gap: 0.35rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .photo-viewer__close {
    top: 0.3rem;
    right: 0.35rem;
    transform: none;
  }

  .photo-viewer__nav {
    width: 2.2rem;
    height: 3.2rem;
  }

  .photo-viewer__img {
    max-height: calc(100vh - 1.2rem);
  }
}

.horse-detail__lead-box {
  margin: 0 0 1.35rem;
  padding: 1rem 1.15rem 1.1rem;
  background: linear-gradient(
    145deg,
    rgba(191, 161, 102, 0.11) 0%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(245, 243, 239, 0.9) 100%
  );
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 8px 28px rgba(45, 45, 45, 0.06);
}

.horse-detail__info-col .horse-detail__lead {
  margin: 0;
  font-size: clamp(0.98rem, 1.2vw, 1.06rem);
  color: var(--charcoal);
  font-weight: 500;
  line-height: 1.62;
  letter-spacing: 0.01em;
}

.horse-detail__section-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.92;
}

.horse-detail__text.horse-detail__prose {
  padding-top: 0;
}

.horse-detail__prose p {
  margin: 0 0 1.05rem;
  color: var(--charcoal);
  font-size: 0.94rem;
  line-height: 1.75;
  opacity: 0.88;
  max-width: 40em;
}

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

.horse-detail__pedigree {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(45, 45, 45, 0.08);
}

.horse-detail__pedigree .horse-detail__section-title {
  margin-bottom: 0.65rem;
}

.horse-detail__pedigree--fullwidth .horse-detail__section-title {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

/* Родословная на всю ширину карточки — под фото и текстом (вылет к краям padding) */
.horse-detail__pedigree--fullwidth {
  flex: none;
  width: auto;
  max-width: none;
  min-width: 0;
  margin-top: clamp(1.35rem, 3vw, 2.25rem);
  margin-left: -1.75rem;
  margin-right: -1.75rem;
  margin-bottom: 0;
  padding: clamp(1.15rem, 2.5vw, 1.5rem) 1.75rem clamp(1.25rem, 2.5vw, 1.6rem);
  border-top: 1px solid rgba(45, 45, 45, 0.08);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(250, 248, 244, 0.95) 100%
  );
  border-left: 1px solid rgba(45, 45, 45, 0.06);
  border-right: 1px solid rgba(45, 45, 45, 0.06);
  border-bottom: 1px solid rgba(45, 45, 45, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 32px rgba(45, 45, 45, 0.06);
}

.horse-detail--profile.glass {
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .horse-detail__pedigree--fullwidth .pedigree-chart__scroll {
    width: 100%;
  }

  .horse-detail__pedigree--fullwidth .pedigree-chart__grid {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns:
      minmax(5rem, 1.05fr)
      minmax(5.75rem, 1.1fr)
      minmax(6.25rem, 1.15fr)
      minmax(7rem, 1.2fr)
      minmax(6.5rem, 1.15fr);
  }
}


/* Горизонтальная родословная: поколения I→V слева направо */
.pedigree-chart {
  margin-top: 0.35rem;
}

.pedigree-chart__swipe-hint {
  display: none;
}

.pedigree-chart__legend {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.45;
}

.pedigree-chart__legend-i {
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.pedigree-chart__scroll {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 -0.1rem;
  padding: 0 0.1rem 0.4rem;
  -webkit-overflow-scrolling: touch;
}

.pedigree-chart__grid {
  display: grid;
  grid-template-columns:
    minmax(5.25rem, 7.25rem)
    minmax(5.75rem, 8.25rem)
    minmax(6.25rem, 9rem)
    minmax(7.25rem, 1.05fr)
    minmax(6.75rem, 1fr);
  grid-template-rows: repeat(16, minmax(2.35rem, auto));
  gap: 0;
  min-width: 48rem;
  position: relative;
  background: rgba(236, 232, 224, 0.55);
  border: 1px solid rgba(45, 45, 45, 0.1);
  border-radius: 10px;
}

.pedigree-chart__cell {
  position: relative;
  border-right: 1px solid rgba(45, 45, 45, 0.08);
  min-width: 0;
  padding: 0.32rem 0.4rem;
}

.pedigree-chart__cell--subject {
  grid-column: 1;
  grid-row: 1 / 17;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
}

.pedigree-chart__cell--father {
  grid-column: 2;
  grid-row: 1 / 9;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.28);
}

.pedigree-chart__cell--mother {
  grid-column: 2;
  grid-row: 9 / 17;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.32);
}

.pedigree-chart__cell--gp-ff {
  grid-column: 3;
  grid-row: 1 / 5;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.pedigree-chart__cell--gp-fm {
  grid-column: 3;
  grid-row: 5 / 9;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.pedigree-chart__cell--gp-mf {
  grid-column: 3;
  grid-row: 9 / 13;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.pedigree-chart__cell--gp-mm {
  grid-column: 3;
  grid-row: 13 / 17;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.pedigree-chart__cell--iv-ffs {
  grid-column: 4;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-ffd {
  grid-column: 4;
  grid-row: 3 / 5;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-fms {
  grid-column: 4;
  grid-row: 5 / 7;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-fmd {
  grid-column: 4;
  grid-row: 7 / 9;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-mfs {
  grid-column: 4;
  grid-row: 9 / 11;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-mfd {
  grid-column: 4;
  grid-row: 11 / 13;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-mms {
  grid-column: 4;
  grid-row: 13 / 15;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv-mmd {
  grid-column: 4;
  grid-row: 15 / 17;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.pedigree-chart__cell--iv:not(.pedigree-chart__cell--iv-mmd) {
  border-bottom: 1px solid rgba(45, 45, 45, 0.06);
}

.pedigree-chart__cell--v {
  grid-column: 5;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-right: none;
}

.pedigree-chart__cell--v:not(.pedigree-chart__cell--v-end) {
  border-bottom: 1px solid rgba(45, 45, 45, 0.05);
}

.pedigree-chart__divider {
  grid-column: 2 / 6;
  grid-row: 8;
  align-self: end;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 2px solid rgba(45, 45, 45, 0.16);
  z-index: 2;
  pointer-events: none;
}

.pedigree-node {
  width: 100%;
  min-width: 0;
}

.pedigree-node__card {
  padding: 0.42rem 0.48rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 45, 45, 0.07);
  width: 100%;
  min-width: 0;
}

.pedigree-node__card--subject {
  padding: 0.6rem 0.5rem;
  text-align: center;
}

.pedigree-node__name {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--charcoal);
  line-height: 1.22;
  margin-bottom: 0.25rem;
  word-break: normal;
  overflow-wrap: break-word;
}

.pedigree-node__name--subject {
  font-size: clamp(0.74rem, 1.4vw, 0.88rem);
  letter-spacing: 0.07em;
}

.pedigree-node__subject-meta {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: left;
}

.pedigree-node--subject .pedigree-node__subject-facts {
  text-align: left;
  margin: 0.2rem 0 0;
}

.pedigree-node--subject .pedigree-node__subject-facts li {
  font-size: 0.64rem;
  line-height: 1.32;
}

.pedigree-node--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  opacity: 0.4;
}

.pedigree-node__dash {
  font-weight: 600;
  color: var(--muted);
}

.pedigree-node .pedigree__facts {
  margin: 0.18rem 0 0;
  padding-left: 0;
}

.pedigree-node .pedigree__facts > li {
  padding: 0.2rem 0 0.2rem 0.55rem;
  font-size: 0.62rem;
  line-height: 1.32;
  border-left-width: 2px;
}

.pedigree-node .pedigree__detail {
  margin: 0.18rem 0 0;
  font-size: 0.62rem;
  line-height: 1.38;
}

.pedigree-node .pedigree__highlight {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

/* Общие списки фактов (используются в карточках) */
.pedigree__facts {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.pedigree__facts > li {
  padding: 0.38rem 0 0.38rem 0.8rem;
  border-left: 2px solid rgba(191, 161, 102, 0.32);
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--muted);
}

.pedigree__facts > li + li {
  margin-top: 0.18rem;
}

.pedigree__facts--parent > li {
  font-size: 0.84rem;
  line-height: 1.48;
}

.pedigree__facts--grand > li {
  font-size: 0.8rem;
  line-height: 1.42;
}

.pedigree__facts--iv > li {
  padding: 0.3rem 0 0.3rem 0.65rem;
  font-size: 0.74rem;
  line-height: 1.38;
  border-left-color: rgba(191, 161, 102, 0.22);
}

.pedigree__facts--subject > li {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--charcoal);
  border-left-color: rgba(191, 161, 102, 0.4);
  padding-left: 0.75rem;
}

.pedigree__detail {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.52;
  color: var(--muted);
  overflow-wrap: break-word;
}

.pedigree__detail--parent {
  font-size: 0.76rem;
  line-height: 1.48;
  opacity: 0.92;
}

.pedigree__detail--grand {
  font-size: 0.78rem;
  line-height: 1.42;
  opacity: 0.9;
}

.pedigree__detail--iv {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.38;
  color: var(--muted);
  opacity: 0.88;
}

.pedigree__detail--v {
  margin-top: 0.1rem;
  font-size: 0.66rem;
  line-height: 1.34;
  color: var(--muted);
  opacity: 0.86;
}

.pedigree__facts--v > li {
  padding: 0.22rem 0 0.22rem 0.55rem;
  font-size: 0.68rem;
  line-height: 1.32;
  border-left-color: rgba(191, 161, 102, 0.18);
}

.pedigree-node--v .pedigree-node__name {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.pedigree-node--v .pedigree-node__card {
  padding: 0.36rem 0.4rem;
}

.pedigree__highlight {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #2d6a4f;
  font-weight: 500;
  overflow-wrap: break-word;
}

.pedigree-jump {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pedigree-jump__word {
  text-transform: uppercase;
}

.pedigree__badge {
  display: inline-block;
  margin: 0.25rem 0 0.2rem;
  padding: 0.16rem 0.48rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #c62828;
  border-radius: 5px;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* ——— Страница лошади: смартфоны ——— */
@media (max-width: 767px) {
  body.horse-page {
    overflow-x: hidden;
  }

  .horse-page__main {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(4.5rem, calc(3.15rem + env(safe-area-inset-top)));
    padding-bottom: max(2rem, calc(1.25rem + env(safe-area-inset-bottom)));
  }

  .horse-detail {
    padding: 1.15rem 1rem 1.25rem;
    overflow-x: visible;
    min-width: 0;
  }

  .horse-detail__nav-actions {
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .horse-detail__crumb {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.85rem;
  }

  .horse-detail__info-col .horse-detail__title {
    font-size: clamp(1.5rem, 6.5vw, 2.15rem);
    line-height: 1.12;
  }

  .horse-detail__meta-line {
    font-size: clamp(0.87rem, 3.6vw, 0.98rem);
    line-height: 1.42;
  }

  .horse-detail__lead-box {
    padding: 0.85rem 0.95rem 0.95rem;
  }

  .horse-detail__info-col .horse-detail__lead {
    font-size: 1rem;
    line-height: 1.58;
  }

  .horse-detail__prose p {
    font-size: 1rem;
    line-height: 1.7;
    max-width: none;
  }

  .horse-detail__stage-img {
    max-height: min(52vh, 440px);
  }

  .horse-detail__thumb {
    min-width: 72px;
    min-height: 52px;
  }

  .horse-detail__media-col {
    min-width: 0;
    max-width: 100%;
  }

  .horse-detail__pedigree--fullwidth {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1rem;
    padding-bottom: 1.15rem;
    min-width: 0;
  }

  .pedigree-chart__legend {
    font-size: clamp(0.62rem, 2.8vw, 0.72rem);
    margin-bottom: 0.45rem;
    line-height: 1.5;
    padding-right: 0.15rem;
  }

  .pedigree-chart__swipe-hint {
    display: block;
    margin: 0 0 0.55rem;
    padding: 0.4rem 0.55rem;
    font-size: clamp(0.65rem, 3vw, 0.75rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: center;
    color: var(--gold);
    background: rgba(191, 161, 102, 0.12);
    border-radius: 8px;
    border: 1px solid rgba(191, 161, 102, 0.22);
  }

  .pedigree-chart__scroll {
    margin-left: calc(-1 * max(0.75rem, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(0.75rem, env(safe-area-inset-right, 0px)));
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0.65rem;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .pedigree-chart__scroll::-webkit-scrollbar {
    height: 6px;
  }

  .pedigree-chart__scroll::-webkit-scrollbar-thumb {
    background: rgba(191, 161, 102, 0.45);
    border-radius: 4px;
  }

  .pedigree-chart__scroll::-webkit-scrollbar-track {
    background: rgba(45, 45, 45, 0.06);
    border-radius: 4px;
  }

  .pedigree-chart__grid {
    min-width: 44rem;
    border-radius: 8px;
    grid-template-rows: repeat(16, minmax(2.5rem, auto));
  }

  .pedigree-chart__cell {
    padding: 0.42rem 0.38rem;
  }

  .pedigree-node__card {
    padding: 0.5rem 0.45rem;
    min-height: 2.75rem;
  }

  .pedigree-node__card--subject {
    padding: 0.65rem 0.5rem;
  }

  .pedigree-node__name {
    font-size: clamp(0.72rem, 3.1vw, 0.82rem);
    line-height: 1.28;
  }

  .pedigree-node__name--subject {
    font-size: clamp(0.78rem, 3.4vw, 0.92rem);
  }

  .pedigree-node__subject-meta {
    font-size: clamp(0.68rem, 3vw, 0.78rem);
  }

  .pedigree-node--subject .pedigree-node__subject-facts li {
    font-size: clamp(0.65rem, 2.9vw, 0.74rem);
  }

  .pedigree-node .pedigree__facts > li {
    font-size: clamp(0.66rem, 2.9vw, 0.76rem);
    padding: 0.28rem 0 0.28rem 0.5rem;
  }

  .pedigree-node .pedigree__detail {
    font-size: clamp(0.65rem, 2.85vw, 0.74rem);
  }

  .pedigree-node--empty {
    min-height: 2.75rem;
  }

  .pedigree-chart__divider {
    border-bottom-width: 2px;
  }
}

/* Очень узкие телефоны: чуть компактнее таблица */
@media (max-width: 380px) {
  .pedigree-chart__grid {
    min-width: 40rem;
  }

  .pedigree-chart__legend {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .pedigree-chart__scroll {
    scroll-snap-type: none;
  }
}

.horse-detail__back {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.horse-detail__back:hover {
  color: var(--charcoal);
}

.site-footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--cream-dark);
}

.site-footer__line {
  margin: 0 0 0.5rem;
}

.site-footer__line a {
  color: var(--gold);
}

.site-footer__line a:hover {
  color: var(--charcoal);
}

.site-footer__dot {
  margin: 0 0.35rem;
  opacity: 0.45;
}

.site-footer__muted {
  color: var(--muted);
}

.site-footer__muted a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-footer__muted a:hover {
  color: var(--gold);
}

.site-footer__copy {
  margin: 1.25rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
}

.site-footer > a {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-footer > a:hover {
  color: var(--charcoal);
}

/* ——— First visit preview ——— */
.first-visit-preview {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 1.1rem;
}

.first-visit-preview[hidden] {
  display: none;
}

.first-visit-preview__backdrop {
  position: absolute;
  inset: 0;
  background: var(--charcoal);
}

.first-visit-preview__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: clamp(1.35rem, 3vw, 2.4rem);
  text-align: center;
}

.first-visit-preview__logo {
  display: block;
  width: min(420px, 82%);
  height: auto;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 0 28px rgba(191, 161, 102, 0.26));
}

.first-visit-preview__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(0.86rem, 4vw, 2rem);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.22em;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .first-visit-preview {
    padding: 0.9rem;
  }

  .first-visit-preview__dialog {
    padding: 1.25rem 1rem 1.35rem;
  }

  .first-visit-preview__logo {
    width: min(300px, 84%);
    margin-bottom: 0.7rem;
  }

  .first-visit-preview__title {
    letter-spacing: 0.035em;
  }
}
