/* ==========================================================================
   Brücke — Германия и Россия. Акварельная палитра, тёплые тона.
   ========================================================================== */

:root {
  --paper:        #fdf8f2;
  --paper-deep:   #f5ead9;
  --ink:          #2e2a26;
  --ink-soft:     #5d554c;
  --ink-faint:    #8d8277;
  --terracotta:   #c2703d;
  --terracotta-d: #9a5229;
  --ochre:        #d9a441;
  --cornflower:   #6b86b3;
  --sage:         #8aa07c;
  --rule:         rgba(46, 42, 38, 0.12);

  --serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --read: 680px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Бумажное зерно поверх всего: имитирует фактуру акварельной бумаги. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: var(--terracotta-d); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }

/* --- Переключение языка ---------------------------------------------------
   Видимость блоков задаёт атрибут lang на <html>, скрипт только меняет его. */
html[lang="ru"] [data-lang="de"],
html[lang="de"] [data-lang="ru"] { display: none !important; }

/* --- Раскладка ----------------------------------------------------------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.read { width: min(100% - 2.5rem, var(--read)); margin-inline: auto; }

/* --- Акварельные пятна фона ---------------------------------------------- */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  will-change: transform;
  animation: drift 26s var(--ease) infinite alternate;
}
.blob--1 { width: 46vw; height: 46vw; top: -12vw; left: -10vw;  background: radial-gradient(circle at 35% 35%, #e8b27a, transparent 68%); }
.blob--2 { width: 38vw; height: 38vw; top: 30vh;  right: -12vw; background: radial-gradient(circle at 60% 40%, #9db6d8, transparent 68%); animation-delay: -9s; }
.blob--3 { width: 34vw; height: 34vw; bottom: -10vw; left: 22vw; background: radial-gradient(circle at 50% 50%, #cfd9ab, transparent 68%); animation-delay: -16s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, -4vh, 0) scale(1.12); }
}

/* --- Шапка ---------------------------------------------------------------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: rgba(253, 248, 242, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--rule); }
.site-head__inner { display: flex; align-items: center; gap: 1.5rem; padding: 0.95rem 0; }

.brand { display: flex; align-items: center; gap: 0.65rem; font-family: var(--serif); font-size: 1.3rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark .l { fill: none; stroke-width: 2.2; stroke-linecap: round; }

.nav { display: flex; gap: 1.35rem; margin-left: auto; font-size: 0.92rem; }
.nav a { color: var(--ink-soft); text-decoration: none; position: relative; padding-block: 0.2rem; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--terracotta); transition: width 0.35s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

.lang-switch { display: flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.38rem 0.75rem; color: var(--ink-faint); transition: background 0.3s, color 0.3s;
}
.lang-switch button[aria-pressed="true"] { background: var(--terracotta); color: #fff; }

.burger { display: none; appearance: none; border: 0; background: none; cursor: pointer; padding: 0.4rem; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: transform 0.3s var(--ease), opacity 0.3s; }

/* --- Первый экран --------------------------------------------------------- */
.hero { position: relative; padding: clamp(4rem, 11vw, 8.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero__kicker { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--terracotta-d); margin: 0 0 1.1rem; }
.hero__title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.04;
  font-weight: 500;
  margin: 0 0 1.4rem;
  max-width: 15ch;
}
.hero__title em { font-style: italic; color: var(--terracotta-d); }
.hero__lede { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--ink-soft); max-width: 48ch; margin: 0 0 2.2rem; }

/* Мазок кисти под заголовком. */
.stroke { display: block; width: clamp(180px, 26vw, 320px); height: 14px; margin-bottom: 2rem; }
.stroke path { fill: var(--ochre); opacity: 0.55; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.78rem 1.6rem; border-radius: 999px;
  background: var(--terracotta); color: #fff; text-decoration: none;
  font-size: 0.95rem; letter-spacing: 0.01em;
  box-shadow: 0 10px 26px -14px rgba(154, 82, 41, 0.9);
  transition: transform 0.3s var(--ease), background 0.3s, box-shadow 0.3s;
}
.btn:hover { background: var(--terracotta-d); color: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(154, 82, 41, 0.95); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); box-shadow: none; }
.btn--ghost:hover { background: var(--paper-deep); color: var(--ink); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* --- Заголовки секций ------------------------------------------------------ */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section__head { display: flex; align-items: baseline; gap: 1.2rem; margin-bottom: 2.6rem; }
.section__title { font-family: var(--serif); font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 500; margin: 0; }
.section__line { flex: 1; height: 1px; background: var(--rule); }
.section__note { font-size: 0.85rem; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }

/* --- Сетка статей ---------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.8rem; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(194, 112, 61, 0.4); box-shadow: 0 26px 50px -30px rgba(46, 42, 38, 0.55); color: inherit; }

.card__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-deep); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.card:hover .card__media img { transform: scale(1.06); }

.card__body { padding: 1.3rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card__tag { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--terracotta-d); }
.card__title { font-family: var(--serif); font-size: 1.32rem; font-weight: 500; line-height: 1.28; margin: 0; }
.card__excerpt { font-size: 0.94rem; color: var(--ink-soft); margin: 0; }
.card__meta { margin-top: auto; padding-top: 0.6rem; font-size: 0.82rem; color: var(--ink-faint); }

.card--wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .card--wide { flex-direction: row; }
  .card--wide .card__media { flex: 0 0 52%; aspect-ratio: auto; }
  .card--wide .card__body { padding: 2.4rem 2.6rem; justify-content: center; gap: 0.9rem; }
  .card--wide .card__title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
  .card--wide .card__excerpt { font-size: 1.02rem; }
}

/* --- Цифры ----------------------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.6rem; }
.fact { border-top: 2px solid var(--terracotta); padding-top: 1rem; }
.fact__num { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; margin: 0 0 0.45rem; }
.fact__label { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* --- Цитата ----------------------------------------------------------------- */
.quote { position: relative; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.42;
  font-style: italic;
  color: var(--ink);
  max-width: 24ch;
}
.quote cite { display: block; margin-top: 1.2rem; font-family: var(--sans); font-style: normal; font-size: 0.9rem; color: var(--ink-faint); letter-spacing: 0.06em; }

/* --- Тело статьи ------------------------------------------------------------ */
.article-head { padding: clamp(3rem, 8vw, 5.5rem) 0 2rem; }
.article-head__tag { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--terracotta-d); margin: 0 0 1rem; }
.article-head__title { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.1; font-weight: 500; margin: 0 0 1.1rem; }
.article-head__lede { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--ink-soft); margin: 0 0 1.6rem; }
.article-head__meta { font-size: 0.85rem; color: var(--ink-faint); letter-spacing: 0.05em; }

.article-hero { margin: 2rem 0 3rem; border-radius: 20px; overflow: hidden; border: 1px solid var(--rule); }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Поток статьи: отступ задаётся сверху у каждого блока, кроме первого.
   Селектор по тегу специфичнее, чем `.prose > *`, поэтому правила ниже
   перекрывают базовый интервал там, где нужен больший. */
.prose > * { margin-top: 1.35rem; margin-bottom: 0; }
.prose h2 { font-family: var(--serif); font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 500; line-height: 1.26; margin-top: 2.9rem; }
.prose h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.5rem; }
.prose figure { margin: 2.4rem 0; }
.prose figure img { border-radius: 16px; border: 1px solid var(--rule); }
.prose figcaption { margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-faint); }
.prose blockquote {
  margin: 2.2rem 0; padding: 0.4rem 0 0.4rem 1.5rem;
  border-left: 3px solid var(--ochre);
  font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-soft);
}

.pullout {
  margin: 2.6rem 0;
  padding: 1.5rem 1.7rem;
  background: var(--paper-deep);
  border-radius: 16px;
  border: 1px solid rgba(217, 164, 65, 0.35);
}
.pullout h3 { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 0.6rem; }
.pullout p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.pullout ul, .pullout ol { margin: 0.6rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Первый блок статьи прижат к шапке: правило идёт последним,
   чтобы перебить заголовочные отступы выше. */
.prose > :first-child { margin-top: 0; }

/* Индикатор прочитанного. */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--ochre), var(--terracotta)); z-index: 60; transition: width 0.1s linear; }

.article-nav { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; padding: 3rem 0; border-top: 1px solid var(--rule); margin-top: 4rem; }

/* --- Подвал ------------------------------------------------------------------ */
.site-foot { border-top: 1px solid var(--rule); padding: 3.2rem 0 2.4rem; margin-top: 4rem; background: rgba(245, 234, 217, 0.4); }
.site-foot__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.site-foot__col { max-width: 32ch; }
.site-foot h4 { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; margin: 0 0 0.7rem; }
.site-foot p, .site-foot li { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.site-foot ul { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--terracotta-d); }
.site-foot__legal { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); font-size: 0.82rem; color: var(--ink-faint); }

/* --- Появление при прокрутке --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

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

/* --- Мобильные --------------------------------------------------------------- */
@media (max-width: 760px) {
  .burger { display: block; order: 3; }
  .nav {
    position: fixed; inset: 64px 0 auto; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 1rem 1.25rem 1.6rem; margin-left: 0;
    transform: translateY(-120%); transition: transform 0.4s var(--ease); font-size: 1.05rem;
  }
  .nav.is-open { transform: none; }
  .nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
  .lang-switch { margin-left: auto; }
  .section__head { flex-wrap: wrap; }
}
