/* ============================================================
   Anta Rien — сайт-галерея фотографа
   Дизайн-система: тёмный архив, монохром, фокус на изображении
   ============================================================ */

:root {
  --bg: #0e0e0e;
  --bg-soft: #141414;
  --ink: #e8e5df;
  --muted: #8f8f8f;
  --faint: #545454;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --serif: "Spectral", "Georgia", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--bg); }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- микро-типографика интерфейса ---------- */
.ui {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.serif { font-family: var(--serif); }

/* ============================================================
   ШАПКА — mix-blend-difference: читается на любом фоне
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  mix-blend-mode: difference;
  color: #fff;
}

.wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px); }

.site-nav a {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
  transition: opacity 0.25s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { opacity: 1; }

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: currentColor;
}

.lang-switch { display: flex; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; }
.lang-switch button { opacity: 0.45; transition: opacity 0.25s; text-transform: uppercase; }
.lang-switch button.active { opacity: 1; }
.lang-switch span { opacity: 0.35; }

/* бургер для мобильных */
.burger { display: none; flex-direction: column; gap: 5px; padding: 6px 0; }
.burger i { display: block; width: 22px; height: 1.5px; background: #fff; transition: 0.3s var(--ease); }
.burger.open i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open i:nth-child(2) { opacity: 0; }
.burger.open i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 80;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  gap: 8px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 54px);
  font-weight: 300;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu .lang-switch { margin-top: 28px; font-size: 13px; }

/* ============================================================
   ГЛАВНАЯ — полноэкранный hero-слайдер
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #000;
}

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }

.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 6.5s linear;
}
.hero-slide.active img { transform: scale(1); }

.hero-slide figcaption {
  position: absolute;
  left: var(--pad);
  bottom: clamp(64px, 10vh, 110px);
  color: #fff;
  text-shadow: 0 1px 30px rgba(0, 0, 0, 0.55);
}
.hero-slide .cap-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 4.4vw, 56px);
  line-height: 1.08;
}
.hero-slide .cap-meta { margin-top: 10px; opacity: 0.85; }

/* невидимые зоны навигации: левая / правая половины экрана */
.hero-zone {
  position: absolute; top: 0; bottom: 0; width: 50%;
  z-index: 5;
}
.hero-zone.prev { left: 0; cursor: w-resize; }
.hero-zone.next { right: 0; cursor: e-resize; }

.hero-ui {
  position: absolute; z-index: 6;
  right: var(--pad);
  bottom: clamp(28px, 5vh, 48px);
  display: flex; align-items: center; gap: 18px;
  color: #fff;
}
.hero-counter { font-variant-numeric: tabular-nums; letter-spacing: 0.14em; }
.hero-dots { display: flex; gap: 8px; }
.hero-dots button {
  width: 20px; height: 2px;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.3s;
}
.hero-dots button.active { background: #fff; }

.hero-scroll-hint {
  position: absolute; z-index: 6;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: 1px; height: 42px;
  background: linear-gradient(#fff, transparent);
  opacity: 0.6;
  animation: hint 2.2s var(--ease) infinite;
}
@keyframes hint {
  0% { transform: translateX(-50%) scaleY(0); transform-origin: top; }
  45% { transform: translateX(-50%) scaleY(1); transform-origin: top; }
  55% { transform: translateX(-50%) scaleY(1); transform-origin: bottom; }
  100% { transform: translateX(-50%) scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   СЕКЦИИ
   ============================================================ */
.section { padding: clamp(70px, 12vh, 140px) var(--pad); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 5vh, 56px);
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(24px, 3.2vw, 40px);
}
.section-head .ui { color: var(--muted); }
.section-head a.ui { transition: color 0.25s; }
.section-head a.ui:hover { color: var(--ink); }

/* мини-о себе */
.intro-statement {
  max-width: 900px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(21px, 2.7vw, 34px);
  line-height: 1.35;
}
.intro-statement em { font-style: italic; }
.intro-more { margin-top: 26px; display: inline-block; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: color 0.25s, border-color 0.25s; }
.intro-more:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- список серий с hover-reveal на весь экран ---------- */
.series-list { position: relative; }

.series-reveal {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.series-reveal img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  transition: transform 0.6s var(--ease);
}
.series-reveal.on { opacity: 1; }
.series-reveal.on img { transform: scale(1.02); }

.series-row {
  position: relative; z-index: 45;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 22px;
  padding: clamp(18px, 3.4vh, 34px) 0;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.25s linear;
}
.series-list:hover .series-row { opacity: 0.15; }
.series-list:hover .series-row:hover { opacity: 1; }

.series-row .idx { color: var(--muted); font-variant-numeric: tabular-nums; }
.series-row .name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 6vw, 78px);
  line-height: 1.04;
  transition: letter-spacing 0.45s var(--ease);
}
.series-row:hover .name { letter-spacing: 0.015em; }
.series-row .meta { color: var(--muted); text-align: right; }

/* когда фон раскрыт — текст белый поверх фото */
.series-list.revealed .series-row { color: #fff; text-shadow: 0 1px 24px rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.25); }
.series-list.revealed .series-row .idx,
.series-list.revealed .series-row .meta { color: rgba(255,255,255,0.75); }

/* ---------- masonry-сетка работ ---------- */
.masonry {
  columns: 3;
  column-gap: clamp(14px, 1.8vw, 26px);
}
.masonry .work-card { break-inside: avoid; margin-bottom: clamp(14px, 1.8vw, 26px); }

.work-card { position: relative; display: block; overflow: hidden; background: var(--bg-soft); }
.work-card img {
  width: 100%;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
  opacity: 0;
}
.work-card img.loaded { opacity: 1; }
.work-card:hover img { transform: scale(1.035); }

.work-card .veil {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.work-card:hover .veil { opacity: 1; }
.work-card .veil .t { font-family: var(--serif); font-size: 19px; font-weight: 300; }
.work-card .veil .m { color: rgba(255, 255, 255, 0.75); margin-top: 4px; }

/* появление при скролле */
.rise { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.rise.in { opacity: 1; transform: none; }

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(36px, 6vh, 64px) var(--pad);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: end;
}
.site-footer .col { display: flex; flex-direction: column; gap: 12px; }
.site-footer a { color: var(--muted); transition: color 0.25s; width: fit-content; }
.site-footer a:hover { color: var(--ink); }
.site-footer .copy { color: var(--faint); }

/* ============================================================
   ВНУТРЕННИЕ СТРАНИЦЫ
   ============================================================ */
.page { padding-top: clamp(96px, 16vh, 160px); min-height: 100vh; }

.page-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 7vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.page-sub { color: var(--muted); margin-top: 14px; max-width: 640px; }

/* ---------- фильтры галереи ---------- */
.filters {
  display: flex; flex-wrap: wrap;
  gap: 10px 34px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: clamp(28px, 5vh, 48px) 0;
}
.filter-group { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.filter-group .lbl { color: var(--faint); }
.filter-btn {
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active { color: var(--ink); border-color: var(--ink); }

.works-count { color: var(--faint); margin-bottom: 20px; }

.load-more-wrap { display: flex; justify-content: center; padding: clamp(30px, 6vh, 60px) 0 0; }
.load-more {
  padding: 14px 38px;
  border: 1px solid var(--line);
  transition: background 0.3s, color 0.3s;
}
.load-more:hover { background: var(--ink); color: var(--bg); }

/* ---------- страница работы ---------- */
.work-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.work-figure { position: relative; background: var(--bg-soft); }
.work-figure img { width: 100%; cursor: zoom-in; }

.work-info { position: sticky; top: 110px; }
.work-info h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.08;
}
.work-meta {
  margin: 26px 0;
  border-top: 1px solid var(--line);
}
.work-meta .row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.work-meta .k { color: var(--faint); }
.work-meta .v { color: var(--ink); }

.work-desc {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  color: #cfccc4;
  max-width: 56ch;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.tags span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 12px;
}

.inquire-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 15px 34px;
  border: 1px solid var(--ink);
  transition: background 0.3s, color 0.3s;
}
.inquire-btn:hover { background: var(--ink); color: var(--bg); }
.avail { color: var(--muted); margin-top: 14px; }
.avail::before { content: "●"; font-size: 8px; vertical-align: 2px; margin-right: 8px; color: #7fae7f; }

.work-nav {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: clamp(50px, 9vh, 90px);
  padding-top: 26px;
}
.work-nav a { color: var(--muted); transition: color 0.25s; }
.work-nav a:hover { color: var(--ink); }

/* ---------- страница серии ---------- */
.series-hero { position: relative; height: 62vh; overflow: hidden; margin: 0 calc(var(--pad) * -1); }
.series-hero img { width: 100%; height: 100%; object-fit: cover; }
.series-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--bg)); }

.series-intro {
  max-width: 720px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.55;
  color: #d6d3cb;
}
.series-intro p + p { margin-top: 1.2em; }

.series-feed { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(40px, 9vh, 100px); }
.series-feed figure { display: grid; grid-template-columns: 56px 1fr; gap: 22px; align-items: start; }
.series-feed .num { color: var(--faint); padding-top: 8px; font-variant-numeric: tabular-nums; }
.series-feed img { width: 100%; cursor: zoom-in; }
.series-feed figcaption { margin-top: 12px; color: var(--muted); }

/* ---------- об авторе ---------- */
.about-layout { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: clamp(30px, 5vw, 80px); align-items: start; }
.about-photo img { width: 100%; }
.about-photo figcaption { margin-top: 12px; color: var(--faint); }
.about-text { font-family: var(--serif); font-weight: 300; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.65; color: #d6d3cb; }
.about-text p + p { margin-top: 1.2em; }

.facts { margin-top: clamp(36px, 6vh, 60px); }
.facts h3 { color: var(--faint); margin-bottom: 6px; }
.facts ul { list-style: none; }
.facts li {
  display: grid; grid-template-columns: 72px 1fr; gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.facts li .y { color: var(--muted); font-variant-numeric: tabular-nums; }

.presskit {
  display: inline-block; margin-top: 30px;
  padding: 13px 30px; border: 1px solid var(--line);
  transition: background 0.3s, color 0.3s;
}
.presskit:hover { background: var(--ink); color: var(--bg); }

/* ---------- контакты ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(30px, 5vw, 90px); }
.contact-direct { display: flex; flex-direction: column; gap: 8px; }
.contact-direct a.big {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(21px, 2.6vw, 32px);
  width: fit-content;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s;
}
.contact-direct a.big:hover { border-color: var(--ink); }
.socials { display: flex; gap: 22px; margin-top: 30px; }
.socials a { color: var(--muted); transition: color 0.25s; }
.socials a:hover { color: var(--ink); }

.cform { display: flex; flex-direction: column; gap: 22px; }
.cform .field { display: flex; flex-direction: column; gap: 8px; }
.cform label { color: var(--faint); }
.cform input,
.cform select,
.cform textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  padding: 10px 0;
  transition: border-color 0.25s;
}
.cform select option { background: var(--bg); }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: none; border-color: var(--ink); }
.cform textarea { resize: vertical; min-height: 110px; }
.cform .submit {
  align-self: flex-start;
  padding: 15px 40px;
  border: 1px solid var(--ink);
  transition: background 0.3s, color 0.3s;
}
.cform .submit:hover { background: var(--ink); color: var(--bg); }
.form-note { color: var(--faint); font-size: 13px; }
.form-ok {
  display: none;
  font-family: var(--serif); font-size: 22px; font-weight: 300;
  padding: 40px 0;
}
.form-err { display: none; color: var(--faint); font-size: 14px; padding: 18px 0; }
.form-err a { border-bottom: 1px solid var(--line); }
.cform .submit:disabled { opacity: 0.5; pointer-events: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.faq { margin-top: clamp(50px, 9vh, 90px); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 300;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::after { content: "+"; color: var(--faint); font-family: var(--sans); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding: 0 0 20px; max-width: 64ch; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 6, 6, 0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.lightbox .lb-close {
  position: absolute; top: 22px; right: var(--pad); z-index: 2;
  color: #fff; opacity: 0.7; transition: opacity 0.25s;
}
.lightbox .lb-close:hover { opacity: 1; }
.lightbox .lb-arrow {
  position: absolute; top: 0; bottom: 0; width: 22%;
  color: #fff; opacity: 0; transition: opacity 0.25s;
  display: flex; align-items: center;
  font-size: 30px; padding: 0 26px;
}
.lightbox:hover .lb-arrow { opacity: 0.55; }
.lightbox .lb-arrow:hover { opacity: 1; }
.lightbox .lb-prev { left: 0; }
.lightbox .lb-next { right: 0; justify-content: flex-end; }
.lightbox .lb-cap {
  position: absolute; left: var(--pad); bottom: 24px;
  color: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   ПЕРЕХОД КАРТОЧКА → СТРАНИЦА (разворачивание)
   ============================================================ */
.tile-clone {
  position: fixed;
  z-index: 300;
  object-fit: cover;
  transition: top 0.5s var(--ease), left 0.5s var(--ease),
              width 0.5s var(--ease), height 0.5s var(--ease);
}

.page-fade { animation: pageIn 0.6s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------- VIEW TRANSITIONS (переходы между страницами) ---------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOld 0.28s ease both; }
::view-transition-new(root) { animation: vtNew 0.5s var(--ease) both; }
@keyframes vtOld {
  to { opacity: 0; }
}
@keyframes vtNew {
  from { opacity: 0; transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 980px) {
  .masonry { columns: 2; }
  .work-layout { grid-template-columns: 1fr; }
  .work-info { position: static; }
  .about-layout { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .burger { display: flex; }
  .masonry { columns: 1; }
  .series-row { grid-template-columns: 40px 1fr; }
  .series-row .meta { display: none; }
  .hero-slide figcaption { right: var(--pad); }
  .site-footer { grid-template-columns: 1fr; }
  .series-feed figure { grid-template-columns: 1fr; }
  .series-feed .num { padding-top: 0; }
  .work-meta .row { grid-template-columns: 100px 1fr; }
}

/* защита изображений: без выделения, без долгого нажатия на iOS, без перетаскивания */
img, picture, figure, .work-card, .hero-slide, .series-hero, .series-reveal {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- страница статьи ---------- */
.article-wrap { max-width: 780px; margin: 0 auto; }
.article-back { display: inline-block; margin-bottom: 26px; }
.article-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(30px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.01em;
}
.article-meta { color: var(--muted); margin-top: 16px; }
.article-meta a { text-decoration: underline; text-underline-offset: 3px; }
.article-note { color: var(--muted); font-style: italic; margin-top: 20px; }
.article-body { margin-top: clamp(28px, 5vh, 52px); font-family: var(--serif); font-size: 17.5px; line-height: 1.72; }
.article-body p { margin: 0 0 1.25em; }
.article-body h2 { font-weight: 400; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; margin: 1.7em 0 .8em; }
.article-body ul { margin: 0 0 1.25em; padding-left: 1.2em; }
.article-body li { margin-bottom: .45em; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body .acap { color: var(--muted); font-size: 14.5px; }
.article-body .afig { margin: clamp(26px, 5vh, 48px) 0; }
.article-body .afig img { width: 100%; cursor: zoom-in; }
.article-body .afig figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; letter-spacing: 0.02em; }

/* ---------------- ИГРА «УГАДАЙ, ГДЕ СНЯТО» ---------------- */
.game-wrap { max-width: 760px; margin: 0 auto; }
.game-screen { animation: pageIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.game-start { text-align: center; padding-top: clamp(20px, 6vh, 70px); }
.game-rules { color: var(--faint); margin: 18px 0 40px; letter-spacing: 0.14em; }
.game-btn {
  display: inline-block;
  font: inherit; color: var(--ink); background: none;
  border: 1px solid var(--ink);
  padding: 15px 40px; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s;
}
.game-btn:hover { background: var(--ink); color: var(--bg); }
.game-top {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--faint); margin-bottom: 12px;
}
.game-clock { font-size: 20px; color: var(--ink); min-width: 2ch; text-align: right; }
.game-timer { height: 2px; background: var(--line-soft); margin-bottom: 22px; }
.game-timer i { display: block; height: 100%; background: var(--ink); transition: width 0.1s linear; }
.game-fig { margin: 0 0 22px; }
.game-fig img {
  width: 100%; max-height: 62vh; object-fit: contain;
  background: var(--line-soft);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.game-where { color: var(--faint); margin-bottom: 14px; letter-spacing: 0.1em; }
.game-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-opt { padding: 16px 12px; }
.game-opt:disabled { cursor: default; opacity: 0.45; }
.game-opt.is-correct { background: var(--ink); color: var(--bg); opacity: 1; }
.game-opt.is-wrong { border-color: var(--faint); text-decoration: line-through; opacity: 0.45; }
.game-place { min-height: 30px; margin-top: 20px; font-family: var(--serif); font-size: 19px; }
.game-verdict.ok { color: var(--ink); }
.game-verdict.no { color: var(--faint); }
.game-result { text-align: center; padding-top: clamp(20px, 6vh, 70px); }
.game-score { font-family: var(--serif); font-weight: 300; }
.game-score b { font-size: clamp(70px, 14vw, 120px); font-weight: 300; }
.game-score span { font-size: 22px; color: var(--faint); margin-left: 12px; }
.game-verdict-line { font-family: var(--serif); font-size: 21px; font-style: italic; margin: 18px 0 44px; }
.game-share { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 26px; }
.game-share .game-btn { padding: 12px 26px; }
@media (max-width: 560px) {
  .game-opts { grid-template-columns: 1fr; }
  .game-fig img { max-height: 48vh; }
}

/* ---------------- ИГРА «ЦВЕТОВОЙ АКЦЕНТ» ---------------- */
.accent-bw { filter: grayscale(1); transition: filter 0.9s ease; }
.accent-bw.accent-on { filter: grayscale(0); }
.game-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-chip {
  display: flex; align-items: center; gap: 12px;
  font: inherit; color: var(--ink); background: none;
  border: 1px solid var(--line); padding: 14px 16px; cursor: pointer;
  transition: border-color 0.25s, opacity 0.25s;
}
.game-chip i {
  width: 22px; height: 22px; border-radius: 50%;
  flex: none; border: 1px solid rgba(255,255,255,0.25);
}
.game-chip:hover { border-color: var(--ink); }
.game-chip:disabled { cursor: default; opacity: 0.4; }
.game-chip.is-correct { border-color: var(--ink); opacity: 1; box-shadow: inset 0 0 0 1px var(--ink); }
.game-chip.is-wrong { text-decoration: line-through; opacity: 0.35; }

/* ---------------- ИГРА «ПАРЫ» ---------------- */
.mem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 8px;
}
.mem-card {
  padding: 0; border: 0; background: none; cursor: pointer;
  aspect-ratio: 1; perspective: 700px;
}
.mem-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mem-card.is-open .mem-inner, .mem-card.is-done .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mem-back {
  border: 1px solid var(--line-soft); color: var(--faint);
  font-size: 15px; letter-spacing: 0.2em;
  transition: border-color 0.25s, color 0.25s;
}
.mem-card:hover .mem-back { border-color: var(--ink); color: var(--ink); }
.mem-front { transform: rotateY(180deg); overflow: hidden; }
.mem-front img {
  width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mem-card.is-done { cursor: default; }
.mem-card.is-done .mem-front { outline: 1px solid var(--line); }
@media (max-width: 560px) {
  .mem-grid { gap: 7px; }
  .game-chips { grid-template-columns: 1fr 1fr; }
}

/* ---------- Лента Telegram-канала (главная) ---------- */
.tg-list { border-top: 1px solid var(--line); }
.tg-item {
  display: flex; gap: 24px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
  animation: tgIn 0.7s var(--ease) both;
}
.tg-item:nth-child(2) { animation-delay: 0.12s; }
.tg-item:nth-child(3) { animation-delay: 0.24s; }
.tg-item:hover .tg-text { opacity: 0.65; }
.tg-thumb { flex: 0 0 92px; width: 92px; height: 92px; overflow: hidden; background: var(--bg-soft); }
.tg-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(0.9);
  transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}
.tg-item:hover .tg-thumb img { filter: grayscale(0); transform: scale(1.04); }
.tg-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tg-date { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tg-text { font-family: var(--serif); font-size: 17px; line-height: 1.55; transition: opacity 0.3s; }
@keyframes tgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .tg-item { gap: 16px; padding: 18px 0; }
  .tg-thumb { flex-basis: 68px; width: 68px; height: 68px; }
  .tg-text { font-size: 15px; }
}

/* ---------- Тренажёр каны (скрытая страница kana.html) ---------- */
.kana-wrap { max-width: 860px; }
.kana-h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 4.5vw, 46px); margin: 0 0 8px; }
.kana-sub { color: var(--muted); margin: 0 0 36px; font-size: 13px; letter-spacing: 0.08em; }
.kana-group { margin-bottom: 26px; }
.kana-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.kana-dim { opacity: 0.55; text-transform: none; letter-spacing: 0.04em; }
.kana-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kana-chip {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.kana-chip i { font-style: normal; opacity: 0.6; }
.kana-chip:hover { border-color: var(--ink); }
.kana-chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kana-start { margin-top: 16px; }

.kana-status { display: flex; align-items: center; gap: 22px; }
.kana-score { font-size: 22px; font-family: var(--serif); }
.kana-meter { display: flex; gap: 7px; align-items: center; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); }
.kana-meter.low { color: #c8372d; }
.kana-meter i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); transition: opacity 0.3s; }
.kana-meter i.off { opacity: 0.18; }
.kana-quit {
  white-space: nowrap;
  margin-left: auto; background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--muted); cursor: pointer; font-size: 12px; letter-spacing: 0.1em; padding: 2px 0;
}
.kana-quit:hover { color: var(--ink); }

.kana-prompt { text-align: center; padding: 34px 0 30px; }
.kana-prompt-txt { font-size: clamp(52px, 9vw, 88px); font-weight: 300; line-height: 1.1; }
.jp { font-family: "Noto Serif JP", var(--serif); font-style: normal; }

.kana-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.kana-tile {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  color: var(--ink); font-size: clamp(16px, 2.8vw, 25px); font-family: var(--sans);
  cursor: pointer; transition: border-color 0.25s, background 0.25s, transform 0.15s;
}
.kana-tile.jp { font-size: clamp(19px, 3.4vw, 30px); }
.kana-tile:hover { border-color: var(--ink); }
.kana-tile:active { transform: scale(0.95); }
.kana-tile.is-hit { background: #2e5d33; border-color: #2e5d33; }
.kana-tile.is-miss { background: #6e2420; border-color: #6e2420; animation: kanaShake 0.35s; }
@keyframes kanaShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.kana-over { text-align: center; padding: 40px 0 60px; animation: tgIn 0.6s var(--ease) both; }
.kana-verdict { font-family: var(--serif); font-size: 20px; margin-bottom: 18px; }
.kana-big { font-family: var(--serif); font-size: clamp(70px, 14vw, 120px); line-height: 1; }
.kana-stats { color: var(--muted); margin-top: 14px; font-size: 13px; letter-spacing: 0.06em; }
.kana-over-btns { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }

.game-btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.game-btn.ghost:hover { border-color: var(--ink); }

@media (max-width: 640px) {
  .kana-grid { gap: 6px; }
  .kana-prompt { padding: 22px 0 18px; }
}

/* ---------- Тренажёр каны: компактные настройки ---------- */
.kana-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.kana-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0 26px; }
.kana-details summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; cursor: pointer; list-style: none;
}
.kana-details summary::-webkit-details-marker { display: none; }
.kana-details summary .kana-label { margin: 0; position: relative; padding-right: 22px; }
.kana-details summary .kana-label::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-52%);
  font-size: 15px; color: var(--muted); transition: transform 0.3s var(--ease);
}
.kana-details[open] summary .kana-label::after { transform: translateY(-52%) rotate(45deg); }
.kana-pool { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-align: right; }
.kana-details-body { padding: 6px 0 22px; }
.kana-details-body .kana-group:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .kana-cols { grid-template-columns: 1fr; }
  .kana-sub { margin-bottom: 24px; }
  .kana-group { margin-bottom: 20px; }
  .kana-chip { font-size: 13px; padding: 6px 13px; }
  .kana-chips { gap: 6px; }
  .kana-details summary { padding: 15px 0; }
  .kana-pool { font-size: 11px; }
  .kana-start { width: 100%; }
}

/* ---------- Японский: слова и грамматика (nihongo.html) ---------- */
ruby rt { font-size: 0.45em; color: var(--muted); letter-spacing: 0.02em; }

.nih-info { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; margin: -6px 0 24px; }

.nih-score { font-size: 22px; font-family: var(--serif); }
.nih-meter { display: flex; gap: 7px; align-items: center; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); }
.nih-meter.low { color: #c8372d; }
.nih-meter i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); transition: opacity 0.3s; }
.nih-meter i.off { opacity: 0.18; }

.nih-prompt { text-align: center; padding: 30px 0 26px; }
.nih-word-big { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 6vw, 54px); line-height: 1.25; }
.nih-word-big.jp { font-family: "Noto Serif JP", var(--serif); }
.nih-hint { color: var(--muted); }

.nih-ru { color: var(--muted); font-family: var(--serif); font-size: clamp(17px, 3vw, 23px); margin-bottom: 18px; }
.nih-sent { font-size: clamp(19px, 3.4vw, 28px); line-height: 1.8; }
.nih-gap { display: inline-block; min-width: 1.6em; border-bottom: 1px solid var(--ink); color: var(--faint); text-align: center; }

.nih-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 620px; margin: 0 auto; }
.nih-opt {
  padding: 16px 8px; background: var(--bg-soft); border: 1px solid var(--line-soft);
  color: var(--ink); font-size: clamp(18px, 3vw, 24px); font-family: "Noto Serif JP", var(--serif);
  cursor: pointer; transition: border-color 0.25s, background 0.25s, transform 0.15s;
}
.nih-opt:hover { border-color: var(--ink); }
.nih-opt:active { transform: scale(0.95); }
.nih-opt.is-hit { background: #2e5d33; border-color: #2e5d33; }
.nih-opt.is-miss { background: #6e2420; border-color: #6e2420; animation: kanaShake 0.35s; }

.nih-grid .nih-tile {
  aspect-ratio: auto; min-height: 78px; padding: 10px 6px;
  font-size: clamp(13px, 1.9vw, 17px); line-height: 1.35; text-align: center;
}
.nih-grid .nih-tile.jp { font-size: clamp(16px, 2.5vw, 22px); }

.nih-answer {
  min-height: 70px; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); padding: 12px; margin-bottom: 20px;
  transition: background 0.3s, border-color 0.3s;
}
.nih-answer.is-hit { background: rgba(46, 93, 51, 0.18); border-color: #2e5d33; }
.nih-answer.is-miss { background: rgba(110, 36, 32, 0.18); border-color: #6e2420; animation: kanaShake 0.35s; }
.nih-blocks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.nih-block {
  padding: 10px 16px; background: var(--bg-soft); border: 1px solid var(--line-soft);
  color: var(--ink); font-size: clamp(17px, 2.8vw, 22px); font-family: "Noto Serif JP", var(--serif);
  cursor: pointer; transition: border-color 0.25s, transform 0.15s;
}
.nih-block:hover { border-color: var(--ink); }
.nih-block:active { transform: scale(0.95); }

.nih-card .mem-front {
  border: 1px solid var(--line-soft); background: var(--bg-soft);
  padding: 8px; text-align: center; line-height: 1.3;
  font-size: clamp(12px, 1.8vw, 16px); color: var(--ink);
}
.nih-card .mem-front.jp { font-size: clamp(15px, 2.4vw, 20px); }
.nih-card .mem-back { font-family: "Noto Serif JP", var(--serif); font-size: 22px; }

@media (max-width: 640px) {
  .nih-opts { grid-template-columns: 1fr 1fr; }
  .nih-grid .nih-tile { min-height: 64px; padding: 8px 4px; font-size: 12px; }
  .nih-grid .nih-tile.jp { font-size: 15px; }
  .nih-prompt { padding: 20px 0 16px; }
  .nih-sent { line-height: 1.9; }
}

/* ---------- Кана-бинго (bingo.html) ---------- */
.bingo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-width: 560px; margin: 20px auto 0;
}
.bingo-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  color: var(--ink); font-size: clamp(44px, 11vw, 76px); font-weight: 300;
  font-family: "Noto Serif JP", var(--serif);
  cursor: pointer; transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.15s;
  user-select: none; -webkit-user-select: none;
}
.bingo-cell:hover { border-color: var(--ink); }
.bingo-cell:active { transform: scale(0.95); }
.bingo-cell.is-marked {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
  text-decoration: line-through; text-decoration-thickness: 2px;
}
.bingo-note { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; margin-top: 18px; }
.bingo-game .kana-over-btns { margin-top: 28px; }

@media (max-width: 640px) {
  .bingo-grid { gap: 7px; }
  .bingo-cell { font-size: clamp(38px, 14vw, 60px); }
}

/* пустой пул каны (бинго) */
.kana-pool.is-zero { color: #c8372d; }
.bingoFlash { animation: bingoFlash 0.9s; }
@keyframes bingoFlash { 0%, 60% { opacity: 1; } 30% { opacity: 0.25; } }
