/* ============================================================
   Константин Батанов — личный сайт
   Палитра и характер: дизайн Клуба Суньцзы
   рисовая бумага · тушь · киноварь · золото
   ============================================================ */

:root {
  --paper: #f5f0e8;
  --paper-2: #ece4d3;
  --paper-3: #e4dac6;
  --ink: #16130e;
  --ink-soft: #3a352c;
  --ink-mute: #6b6255;
  --line: #d5c9b2;
  --red: #8b1a1a;
  --red-bright: #b22222;
  --gold: #c9a84c;
  --maxw: 1240px;
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --zh: 'Noto Serif SC', 'Noto Serif', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  /* бумажная текстура: тонкий шум поверх рисовой бумаги */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: var(--paper); }

.zh, .zh-head { font-family: var(--zh); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}
.btn-red:hover { background: var(--red-bright); border-color: var(--red-bright); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-ghost.light { border-color: rgba(245, 240, 232, .55); color: var(--paper); }
.btn-ghost.light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(245, 240, 232, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  width: 42px; height: 42px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--zh);
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(139, 26, 26, .25);
  flex-shrink: 0;
}
.brand-text {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.brand-text em {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2px;
}
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--red);
  transition: width .25s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { width: 100%; }
.main-nav .nav-club {
  color: var(--paper);
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 2px;
}
.main-nav .nav-club::after { display: none; }
.main-nav .nav-club:hover { background: var(--red); color: var(--paper); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--ink);
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 0 0;
  overflow: hidden;
}
.hero-vertical {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--zh);
  font-size: 15px;
  letter-spacing: .5em;
  color: var(--red);
  opacity: .65;
  z-index: 1;
  user-select: none;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
  flex: 1;
}
.hero-kicker {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin-bottom: 24px;
}
.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-epigraph {
  font-size: 15px;
  font-style: italic;
  color: var(--ink-mute);
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  max-width: 30em;
}
.hero-epigraph .zh {
  font-style: normal;
  font-size: 17px;
  color: var(--red);
  letter-spacing: .12em;
}
.hero-epigraph em { font-style: italic; }

.photo-frame {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 14px;
  transform: rotate(1.2deg);
  box-shadow: 12px 14px 0 rgba(22, 19, 14, .08);
}
.photo-frame img {
  width: 100%;
  filter: saturate(.94) contrast(1.03);
}
.photo-seal {
  position: absolute;
  right: -14px;
  bottom: 26px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--zh);
  writing-mode: vertical-rl;
  font-size: 17px;
  letter-spacing: .3em;
  padding: 12px 6px;
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(139, 26, 26, .3);
  opacity: .94;
}

.hero-strip {
  margin-top: 64px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.strip-item {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .03em;
  padding: 18px 30px;
  border-left: 1px solid rgba(245, 240, 232, .15);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.strip-item:first-child { border-left: none; }
.strip-item b {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Секции ---------- */
.section { padding: 110px 24px; max-width: var(--maxw); margin: 0 auto; }
.section-dark {
  max-width: none;
  background: var(--ink);
  color: var(--paper);
}
.section-dark > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-dark .section-lead { color: rgba(245, 240, 232, .72); }

.section-head { position: relative; margin-bottom: 64px; max-width: 780px; }
.zh-head {
  position: absolute;
  top: -34px;
  left: -6px;
  font-family: var(--zh);
  font-size: 88px;
  font-weight: 700;
  color: var(--red);
  opacity: .12;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
.section-dark .zh-head { color: var(--red-bright); opacity: .22; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; line-height: 1.15; }
.section-head h2 span { border-bottom: 4px solid var(--gold); padding-bottom: 6px; }
.section-lead {
  margin-top: 24px;
  font-size: 18px;
  color: var(--ink-soft);
}

/* ---------- Обо мне: столпы ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 72px;
}
.pillar {
  padding: 40px 32px;
  border-left: 1px solid var(--line);
}
.pillar:first-child { border-left: none; }
.pillar-num {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.pillar-num .zh { font-size: 26px; color: var(--gold); }
.pillar h3 { font-size: 22px; margin-bottom: 14px; }
.pillar p { font-size: 15.5px; color: var(--ink-soft); }

/* ---------- Обо мне: сетка с фото ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.about-photos { display: flex; flex-direction: column; gap: 28px; }
.about-photos figure {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 10px;
}
.about-photos figure:nth-child(2) { transform: rotate(-1deg); margin-left: 36px; }
.about-photos figure:nth-child(1) { transform: rotate(.8deg); }
.about-photos figcaption {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 4px 4px;
}
.about-text p { margin-bottom: 18px; color: var(--ink-soft); }
.about-text p:first-of-type { color: var(--ink); }
.zh-quote {
  font-size: 20px !important;
  font-style: italic;
  color: var(--ink) !important;
  border-left: 3px solid var(--red);
  padding-left: 18px;
  margin-bottom: 26px !important;
}
.zh-quote .zh { font-style: normal; color: var(--red); margin-right: 8px; }
.awards {
  margin-top: 32px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 28px 30px;
}
.awards h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}
.awards ul { list-style: none; }
.awards li {
  font-size: 15px;
  color: var(--ink-soft);
  padding: 8px 0 8px 22px;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.awards li:last-child { border-bottom: none; }
.awards li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 10px;
  top: 13px;
}
.langs { margin-top: 18px; font-size: 15px; }

/* ---------- Книги ---------- */
.books-grid { display: flex; flex-direction: column; gap: 72px; }
.book {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: center;
}
.book-flip { grid-template-columns: 1fr 300px; }
.book-flip .book-cover { order: 2; }
.book-flip .book-info { order: 1; }
.book-cover {
  background: #201b14;
  border: 1px solid rgba(245, 240, 232, .14);
  padding: 12px;
  transform: rotate(-1.4deg);
  box-shadow: 10px 12px 0 rgba(0, 0, 0, .35);
  transition: transform .35s ease;
}
.book-flip .book-cover { transform: rotate(1.4deg); }
.book-cover:hover { transform: rotate(0deg) translateY(-4px); }
.book-tag {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.book-info h3 { font-size: 26px; line-height: 1.3; margin-bottom: 18px; }
.book-info > p { color: rgba(245, 240, 232, .78); margin-bottom: 28px; max-width: 40em; }
.book-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Услуги ---------- */
.services-list { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 34px 12px;
  border-bottom: 1px solid var(--line);
  transition: background .3s ease, padding-left .3s ease;
}
.service:hover { background: var(--paper-2); padding-left: 24px; }
.service-num {
  font-family: var(--zh);
  font-size: 34px;
  color: var(--red);
  opacity: .8;
  line-height: 1;
  padding-top: 4px;
}
.service-body h3 { font-size: 22px; margin-bottom: 8px; }
.service-body p { font-size: 16px; color: var(--ink-soft); max-width: 52em; }

/* ---------- Публикации ---------- */
.press-list { border-top: 1px solid rgba(245, 240, 232, .18); }
.press-item {
  display: grid;
  grid-template-columns: 220px 1fr 40px;
  gap: 28px;
  align-items: center;
  padding: 28px 12px;
  border-bottom: 1px solid rgba(245, 240, 232, .18);
  transition: background .3s ease, padding-left .3s ease;
}
.press-item:hover { background: rgba(245, 240, 232, .06); padding-left: 24px; }
.press-source {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.press-title { font-size: 19px; line-height: 1.4; }
.press-arrow {
  font-size: 22px;
  color: var(--red-bright);
  transition: transform .3s ease;
}
.press-item:hover .press-arrow { transform: translateX(6px); }
.press-more { margin-top: 36px; font-size: 16px; color: rgba(245, 240, 232, .72); }
.press-more a { color: var(--gold); border-bottom: 1px solid rgba(201, 168, 76, .4); }
.press-more a:hover { border-bottom-color: var(--gold); }

/* ---------- Галерея ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.gallery-grid figure {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 10px;
  transition: transform .35s ease, box-shadow .35s ease;
}
.gallery-grid figure:nth-child(odd) { transform: rotate(.8deg); }
.gallery-grid figure:nth-child(even) { transform: rotate(-.8deg); }
.gallery-grid figure:hover { transform: rotate(0) translateY(-6px); box-shadow: 8px 10px 0 rgba(22, 19, 14, .1); }
.gallery-grid figcaption {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 4px 4px;
}
.gallery-grid img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Контакты ---------- */
.section-contact { position: relative; }
.contact-vertical {
  position: absolute;
  left: 8px;
  top: 130px;
  writing-mode: vertical-rl;
  font-family: var(--zh);
  font-size: 15px;
  letter-spacing: .5em;
  color: var(--red);
  opacity: .55;
  user-select: none;
}
.contact-inner { max-width: 900px; margin: 0 auto; }
.contact-head { text-align: center; margin-bottom: 56px; }
.contact-head .zh-head { left: 50%; transform: translateX(-50%); top: -40px; }
.contact-head h2 { font-size: clamp(30px, 3.4vw, 44px); }
.contact-head h2 span { border-bottom: 4px solid var(--gold); padding-bottom: 6px; }
.contact-lead { margin-top: 22px; font-size: 18px; color: var(--ink-soft); max-width: 36em; margin-left: auto; margin-right: auto; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--red);
  box-shadow: 8px 10px 0 rgba(139, 26, 26, .12);
}
.contact-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.contact-value { font-size: 21px; font-weight: 700; color: var(--red); overflow-wrap: anywhere; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: var(--paper); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand p { font-size: 18px; font-weight: 700; line-height: 1.35; }
.footer-brand p span {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, .6);
}
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-contacts a {
  font-family: var(--sans);
  font-size: 14px;
  color: rgba(245, 240, 232, .8);
  transition: color .25s ease;
  width: fit-content;
}
.footer-nav a:hover, .footer-contacts a:hover { color: var(--gold); }
.footer-contacts { display: flex; flex-direction: column; gap: 10px; }
.footer-contacts p { font-family: var(--sans); font-size: 13px; color: rgba(245, 240, 232, .5); margin-top: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(245, 240, 232, .15);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px 30px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-family: var(--sans); font-size: 13px; color: rgba(245, 240, 232, .55); }
.zh-footer { font-family: var(--zh); letter-spacing: .3em; color: rgba(201, 168, 76, .7) !important; }

/* ---------- Наверх ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px; height: 48px;
  background: var(--red);
  color: var(--paper);
  border: none;
  border-radius: 3px;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background .3s ease;
  transform: translateY(10px);
  z-index: 90;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--red-bright); }

/* ---------- Появление при скролле ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Адаптив ---------- */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-vertical { display: none; }
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-left: none; border-top: 1px solid var(--line); }
  .pillar:first-child { border-top: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photos { flex-direction: row; }
  .about-photos figure:nth-child(2) { margin-left: 0; }
  .book, .book-flip { grid-template-columns: 240px 1fr; gap: 32px; }
  .book-flip .book-cover { order: 0; }
  .book-flip .book-info { order: 1; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .press-item { grid-template-columns: 1fr; gap: 8px; }
  .press-arrow { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 67px;
    left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-130%);
    transition: transform .35s ease;
    z-index: 99;
  }
  .main-nav.open { transform: translateY(0); }
  .section { padding: 76px 20px; }
  .hero { padding-top: 110px; }
  .hero-strip { margin-top: 44px; }
  .strip-item { border-left: none; padding: 10px 18px; }
  .book, .book-flip { grid-template-columns: 1fr; }
  .book-cover { max-width: 260px; margin: 0 auto; }
  .service { grid-template-columns: 48px 1fr; gap: 16px; padding: 26px 4px; }
  .service-num { font-size: 26px; }
  .about-photos { flex-direction: column; }
  .gallery-grid { grid-template-columns: 1fr; }
  .contact-vertical { display: none; }
  .brand-text em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
