/* ============================================================
   /assets/styles-index.css
   Общий стилевой слой для трёх домашних страниц сайта
   (/index.html, /fr/index.html, /ru/index.html):
   палитра, сброс, типографика body, навигация (.sidenav +
   мобильный hamburger, по образцу /assets/styles.css) и весь
   каркас домашней страницы — masthead, секция видео-карусели,
   грид текущих проектов, список эссе, список книг.

   До этого файла палитра/reset/body/sidenav/main дублировались
   построчно в <style> каждой из трёх страниц (EN/RU/FR были
   идентичны по CSS, отличался только текст в HTML) — вынесены
   сюда во избежание тройного дублирования и рассинхронизации
   при будущих правках (как это уже произошло один раз с
   .video-section/.projects-section/.essays-section/.books-section).

   Держится отдельно от /assets/styles.css (lecture-* страницы) и
   /assets/styles-essay.css (essay-* страницы): разметка домашней
   страницы (masthead, вертикальный список секций одной колонкой)
   не совпадает с разметкой каркаса лекции/эссе, так что общий
   файл на троих создал бы больше условностей, чем пользы. Палитра
   и sidenav-скелет при этом идентичны всем трём файлам — так и
   задумано, это единственный источник правды для сайта в целом.

   Что остаётся в <style> каждой домашней страницы (если вообще
   что-то остаётся):
   - <title>, подключение шрифтов (Google Fonts <link>)
   - responsive-подстройки, специфичные именно для этой страницы
     (на данный момент ни одной — все три страницы используют
     этот файл без переопределений)
   ============================================================ */

:root {
  --bg:          #fdfcfb;
  --ink:         #1c1c22;
  --ink-strong:  #0f0f14;
  --ink-muted:   #888;
  --accent:      #c0392b;
  --accent-text: #3d1f1a;
  --accent-bg:   #fdf4f3;
  --rule:        #ddd;
  --rule-strong: #1c1c22;
  --navy:        #1a2e4a;
  --navy-light:  #e8edf4;
  --sage:        #2d4a3e;
  --sage-light:  #e8f0ec;
  --amber:       #8a5c1a;
  --amber-light: #fdf4e3;
  --slate:       #3a4a5c;
  --slate-light: #edf0f4;

  /* Display font for headline-style elements (.mh-name, .mh-stat-val,
     .pc-title). DM Serif Display has no Cyrillic glyphs, so
     the RU homepage overrides both variables in its own <style> block
     (--display-font: 'Alegreya', serif; --display-font-weight: 500;)
     right after loading this file — the Alegreya Google Fonts <link>
     stays in the RU page's <head> for that reason. EN/FR use the
     defaults below and need no override. */
  --display-font: 'DM Serif Display', serif;
  --display-font-weight: 400;

  /* Script font for the essay-row icon letter (.er-icon). Lavishly Yours
     has no Cyrillic glyphs, so the RU homepage overrides this variable
     in its own <style> block (--er-icon-font: 'Comforter', cursive;)
     right after loading this file — the Comforter Google Fonts <link>
     stays in the RU page's <head> for that reason. EN/FR use the
     default below and need no override. */
  --er-icon-font: 'Lavishly Yours', cursive;
}

/* Type scale — keep new rules on these values (same scale as the lecture /
   book / project-index pages, see /assets/styles.css):
     Inter        labels 9px · meta 10px · UI text 11px
     Merriweather reading text 13px · descriptions 12px
     Display      card title 1.1rem · figure 1.4rem
     Lists        item title 13px > item description 12px
   The masthead name (.mh-name, 2.6rem) is the one deliberate exception:
   it is the site's own name, larger than any page title. */

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

html { scroll-behavior: smooth; }

#videos, #projects, #essays, #books { scroll-margin-top: 24px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
}

/* ── Sidenav (desktop) ── */
.sidenav {
  position: fixed;
  top: 0; left: 0;
  width: 200px; height: 100vh;
  background: var(--ink-strong);
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.nav-logo {
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.nav-section {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 8px;
}
.sidenav a.nav-item {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 5px 20px;
  transition: color 0.15s;
}
.sidenav a.nav-item:hover { color: rgba(255,255,255,0.9); }
.sidenav a.nav-item.active { color: #fff; }
.nav-lang-group { padding: 16px 20px 0; }
.nav-lang-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.25); margin-bottom: 8px;
}
.nav-lang-btn {
  display: block; font-family: 'Inter', sans-serif;
  font-size: 11px; color: rgba(255,255,255,0.55);
  text-decoration: none; padding: 4px 0; transition: color 0.15s;
}
.nav-lang-btn:hover { color: rgba(255,255,255,0.9); }
.nav-lang-btn.active { color: #fff; font-weight: 600; }
.sidenav a.nav-cta {
  margin: 20px 20px 0;
  display: block;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
}
.sidenav a.nav-cta:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

/* ── Main ── */
.main { margin-left: 200px; }

/* ── Мобильный topbar + hamburger (скрыт на десктопе) ──
   Разметка и классы идентичны /assets/styles.css, чтобы поведение
   мобильной навигации было одинаковым на всех типах страниц сайта. */
#mobile-topbar { display: none; }
#nav-overlay { display: none; }

@media (max-width: 860px) {
  #mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; height: 52px;
    background: var(--ink-strong); border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 16px; z-index: 110;
  }
  #mobile-topbar .mt-logo {
    font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.55);
  }
  #mobile-topbar .mt-toggle {
    display: flex; flex-direction: column; gap: 3px;
    background: none; border: none; padding: 8px; cursor: pointer;
  }
  #mobile-topbar .mt-toggle span {
    display: block; width: 18px; height: 1.5px; background: rgba(255,255,255,0.85);
  }

  .sidenav {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    top: 0; height: 100vh; padding-top: 68px;
    width: 78vw; max-width: 280px;
    box-shadow: 2px 0 18px rgba(0,0,0,0.35);
  }
  .sidenav.open { transform: translateX(0); }

  #nav-overlay.open {
    display: block; position: fixed; inset: 52px 0 0 0;
    background: rgba(0,0,0,0.45); z-index: 95;
  }

  .main { margin-left: 0; padding-top: 52px; }
}

/* ============================================================
   Каркас домашней страницы (masthead + секции: видео / проекты /
   эссе / книги) — общий для всех трёх языковых версий
   ============================================================ */

/* ── Masthead ── */
.masthead {
  padding: 52px 56px 44px 52px;
  border-bottom: 2px solid var(--ink-strong);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mh-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mh-bottomrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.mh-left {}
.mh-name {
  font-family: var(--display-font);
  font-weight: var(--display-font-weight);
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--ink-strong);
  margin-bottom: 8px;
}
.mh-descriptor {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.mh-tagline {
  font-family: 'Merriweather', serif;
  font-weight: 300; font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 520px;
  line-height: 1.65;
}
.mh-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.mh-date {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted);
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-switch a {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 6px 14px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lang-switch a:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--navy-light);
}
.mh-stats {
  display: flex; gap: 24px;
}
.mh-stat { text-align: right; }
.mh-stat-val {
  font-family: var(--display-font);
  font-weight: var(--display-font-weight);
  font-size: 1.4rem;
  color: var(--ink-strong);
  line-height: 1;
}
.mh-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Page layout: single column, full width ── */
.col-main {
  min-height: calc(100vh - 160px);
}

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 52px 18px;
  border-bottom: none;
}
.section-header + .video-list {
  border-top: 1px solid var(--rule);
}
.section-header.with-rule {
  border-bottom: 1px solid var(--rule);
}
.sh-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted);
}
.sh-link {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--navy);
  text-decoration: none;
}
.sh-link:hover { text-decoration: underline; }

/* ── Video carousel ── */
.video-section { border-bottom: 1px solid var(--rule); padding-bottom: 20px; }

.vc-wrap {
  padding: 20px 52px 20px 52px;
}
.vc-track-outer {
  overflow: hidden;
}
.vc-track {
  display: flex;
  gap: 16px;
  transition: transform 0.35s ease;
}
.vc-card {
  flex: 0 0 calc(33.333% - 11px);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
  background: var(--bg);
}
.vc-card:hover { border-color: var(--navy); }

.vc-thumb {
  width: 100%;
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}
.vt-d1 { background: linear-gradient(145deg, #1a2e4a 0%, #0f1e36 100%); }
.vt-d2 { background: linear-gradient(145deg, #1e3a2e 0%, #102a1e 100%); }
.vt-d3 { background: linear-gradient(145deg, #3a2010 0%, #2a1508 100%); }
.vt-d4 { background: linear-gradient(145deg, #221630 0%, #140c22 100%); }

.vc-play {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
}
.vc-play svg { margin-left: 3px; }
.vc-type {
  position: absolute;
  top: 10px; left: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.vc-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 5px;
  flex: 1;
}
.vc-project {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-block;
  width: fit-content;
}
.vc-project:hover { color: var(--navy); text-decoration: underline; }
.vc-title {
  font-family: 'Merriweather', serif;
  font-weight: 400; font-size: 13px;
  color: var(--ink-strong); line-height: 1.45;
  text-decoration: none;
}
.vc-title:hover { text-decoration: underline; }
.vc-desc {
  font-family: 'Merriweather', serif;
  font-weight: 300; font-size: 12px;
  color: var(--ink-muted); line-height: 1.55;
  margin-top: 2px;
}

/* Nav arrows */
.vc-nav {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.vc-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.vc-btn:hover { border-color: var(--navy); background: var(--navy-light); }
.vc-btn svg { display: block; }
.vc-dots {
  display: flex; gap: 5px; align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-bottom: 4px;
}
.vc-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--rule); cursor: pointer;
  transition: background 0.15s;
  border: none; padding: 0;
}
.vc-dot.active { background: var(--navy); }

/* ── Current Projects grid ── */
.projects-section { border-bottom: 1px solid var(--rule); padding-bottom: 20px; }
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 4px 52px 40px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.project-card:hover { border-color: var(--navy); background: #f8f9fb; }
.pc-top {}
.pc-domain {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-muted);
}
.pc-title {
  font-family: var(--display-font);
  font-weight: var(--display-font-weight);
  font-size: 1.1rem;
  color: var(--ink-strong);
  line-height: 1.25;
  margin-top: 4px;
}
.pc-desc {
  font-family: 'Merriweather', serif;
  font-weight: 300; font-size: 12px;
  color: var(--ink); line-height: 1.6;
}
.pc-footer {
  margin-top: auto;
  padding-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px; font-weight: 500;
  color: var(--navy);
}
.project-card:hover .pc-footer { text-decoration: underline; }

/* ── Essays ── */
.essay-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.essay-row:hover { background: #f8f6f3; }
.essay-row:first-of-type { border-top: 1px solid var(--rule); }
.er-icon {
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--rule);
  font-family: var(--er-icon-font);
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-muted);
}
.er-info {
  padding: 14px 52px 14px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.er-project {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.er-title {
  font-family: 'Merriweather', serif;
  font-weight: 400; font-size: 13px;
  color: var(--ink-strong); line-height: 1.4;
}
.er-langs { display: flex; gap: 5px; margin-top: 2px; }
.er-date {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px; color: var(--ink-muted);
  margin-top: 3px;
}

/* ── Essays / Books section spacing ── */
.essays-section { border-bottom: 1px solid var(--rule); padding-bottom: 20px; }
.books-section { padding-bottom: 40px; }

/* ── Books ── */
.book-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.book-row:hover { background: #f8f6f3; }
.br-cover {
  height: 160px;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
}
.br-cover-img {
  width: 86px;
  height: 128px;
  object-fit: cover;
  border-radius: 1px;
  box-shadow: 2px 3px 10px rgba(0,0,0,0.4);
  display: block;
}
.br-info {
  padding: 16px 52px 16px 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.br-project {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.br-title {
  font-family: 'Merriweather', serif;
  font-weight: 400; font-size: 13px;
  color: var(--ink-strong); line-height: 1.4;
}
.br-subtitle {
  font-family: 'Merriweather', serif;
  font-style: italic; font-weight: 300;
  font-size: 12px; color: var(--ink-muted);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .vc-card { flex: 0 0 calc(50% - 8px); }
  .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .masthead { padding: 32px 24px 28px; gap: 14px; }
  .mh-toprow { flex-wrap: wrap; gap: 12px; }
  /* Language buttons live in the hamburger menu (.nav-lang-group) on mobile —
     hide the top-right duplicate in the masthead. */
  .lang-switch { display: none; }
  .mh-bottomrow { flex-direction: column; align-items: flex-start; gap: 16px; }
  .section-header { padding: 24px 24px 16px; }
  .vc-wrap { padding: 16px 24px; }
  .er-info, .br-info { padding-right: 24px; }
  .projects-grid { grid-template-columns: 1fr; padding: 4px 24px 32px; }
}
@media (max-width: 600px) {
  .vc-card { flex: 0 0 100%; }
  .book-row { grid-template-columns: 130px 1fr; }
}
