/*
 * Личные сайты персон — общий CSS главной и блога.
 * Токены, шрифты и приёмы — как на ukhov.su; акцент задаёт site.php сайта
 * (--accent и --accent-rgb ставятся инлайном в <head>).
 */
:root {
  --bg: #f4f1ea;
  --bg-2: #efece4;
  --ink: #14140f;
  --ink-2: #2a2924;
  --mute: #8a877c;
  --line: #cfcabd;
  --accent: #7a3a1f;
  --accent-rgb: 122, 58, 31;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 1200px 600px at 80% -10%, rgba(var(--accent-rgb), 0.06), transparent 60%),
    radial-gradient(ellipse 900px 500px at -10% 110%, rgba(20, 20, 15, 0.04), transparent 60%);
}
/* зерно плёнки */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; color: inherit; }

.page-container {
  max-width: 1500px; margin: 0 auto;
  padding: clamp(24px, 3vw, 40px) clamp(16px, 4vw, 64px);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ── Шапка ─────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar-sep { color: var(--line); }
.topbar a { color: var(--mute); transition: color .25s ease; white-space: nowrap; }
.topbar a:hover { color: var(--accent); }
.topbar a.is-current { color: var(--ink); }
.monogram {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 28px; height: 28px;
  border: 1px solid var(--ink); color: var(--ink);
  font-family: var(--serif); font-style: italic; font-size: 14px; line-height: 1; padding-top: 1px;
}
.pulse {
  display: inline-block; width: 6px; height: 6px; margin-right: 8px;
  background: #2e8b2e; border-radius: 50%; vertical-align: 1px;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 139, 46, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(46, 139, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 139, 46, 0); }
}

.fx-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute);
  display: flex; align-items: center; gap: 12px;
}
.fx-label::before { content: ''; display: inline-block; width: 24px; height: 1px; background: var(--mute); }

/* ── Главная ───────────────────────────────────────────────────── */
main.home {
  flex: 1;
  padding: clamp(40px, 7vh, 88px) 0 24px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 4vw, 64px); align-items: start;
}
.col-left { display: flex; flex-direction: column; gap: clamp(28px, 4vh, 48px); min-width: 0; }
.col-right { min-width: 0; }

.name {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 9.5vw, 150px); line-height: 0.92; letter-spacing: -0.02em;
  margin-top: 14px; overflow-wrap: anywhere;
}
.name .given  { display: block; font-style: italic; font-weight: 300; }
.name .family { display: block; font-weight: 400; }
.role {
  margin-top: clamp(16px, 2.4vh, 28px); max-width: 44ch;
  font-weight: 400; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.45; color: var(--ink-2);
}
.bio {
  max-width: 58ch; margin-top: 18px;
  font-size: clamp(14.5px, 1vw, 15.5px); line-height: 1.65; color: var(--ink-2);
}
.bio + .bio { margin-top: 12px; }

.contacts { display: flex; flex-direction: column; max-width: 520px; margin-top: 18px; }
.contact {
  display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line); position: relative;
  transition: padding-left .35s cubic-bezier(.22,.61,.36,1);
}
.contact:last-child { border-bottom: 1px solid var(--line); }
.contact .key {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--mute); transition: color .25s ease;
}
.contact .val { font-weight: 400; font-size: 15px; overflow-wrap: anywhere; }
.contact .arrow { font-family: var(--mono); font-size: 14px; color: var(--mute); transition: transform .35s ease, color .25s ease; }
.contact::after {
  content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: var(--ink); transition: width .45s cubic-bezier(.22,.61,.36,1);
}
a.contact:hover { padding-left: 8px; }
a.contact:hover::after { width: 100%; }
a.contact:hover .key { color: var(--accent); }
a.contact:hover .arrow { transform: translate(4px, -4px); color: var(--ink); }

.note {
  max-width: 58ch; margin: 14px 0 22px;
  font-size: clamp(13.5px, 0.95vw, 14.5px); line-height: 1.6; color: var(--ink-2);
}
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 560px; }
.cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.card-link {
  display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 18px;
  border: 1px solid var(--line); position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0));
  transition: border-color .3s ease, transform .4s cubic-bezier(.22,.61,.36,1), box-shadow .4s ease;
}
.card-link::after {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.card-link:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(var(--accent-rgb), 0.5); }
.card-link:hover::after { transform: scaleX(1); }
.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rc-kicker, .rc-label {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute); line-height: 1.35;
}
.rc-arrow { font-family: var(--mono); font-size: 14px; color: var(--mute); transition: transform .35s ease, color .25s ease; }
.card-link:hover .rc-arrow { transform: translate(4px, -4px); color: var(--accent); }
.rc-brand { font-family: var(--serif); font-size: clamp(24px, 2.2vw, 30px); line-height: 1; letter-spacing: -0.01em; }
.rc-text { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.rc-stats { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.rc-score, .rc-count { display: flex; align-items: baseline; gap: 10px; }
.rc-num {
  font-family: var(--serif); font-style: italic; font-size: clamp(40px, 4.4vw, 56px); line-height: 0.9;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.rc-count .n { font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }

/* последние записи блога на главной */
.latest { display: flex; flex-direction: column; max-width: 620px; margin-top: 18px; }
.latest a {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0;
  border-top: 1px solid var(--line); transition: color .25s ease;
}
.latest a:last-child { border-bottom: 1px solid var(--line); }
.latest .d { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); padding-top: 4px; }
.latest .t { font-family: var(--serif); font-size: 20px; line-height: 1.25; }
.latest a:hover .t { color: var(--accent); }
.latest-all {
  display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}

/* портрет или плашка с монограммой */
.portrait-wrap { position: relative; width: 100%; max-width: 460px; margin-left: auto; aspect-ratio: 3 / 4; }
.portrait { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--bg-2); filter: saturate(0.92) contrast(1.02); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; transform: scale(1.02); transition: transform 1.4s cubic-bezier(.22,.61,.36,1); }
.portrait-wrap:hover .portrait img { transform: scale(1.06); }
.portrait.is-empty {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
}
.portrait.is-empty span {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(120px, 16vw, 240px); line-height: 1; color: rgba(var(--accent-rgb), 0.55);
}
.ticks { position: absolute; inset: -1px; pointer-events: none; }
.ticks span { position: absolute; width: 14px; height: 14px; border: 1px solid var(--ink); }
.ticks span:nth-child(1) { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.ticks span:nth-child(2) { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.ticks span:nth-child(3) { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.ticks span:nth-child(4) { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.portrait-meta {
  margin: 40px 0 0 auto; max-width: 460px; display: flex; flex-direction: column; gap: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute);
}
.portrait-meta .row { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.portrait-meta .row:last-child { border-bottom: none; padding-bottom: 0; }
.portrait-meta .v { color: var(--ink); font-weight: 500; text-align: right; line-height: 1.7; }
.portrait-meta .v a { border-bottom: 1px solid var(--line); transition: color .25s ease, border-color .25s ease; }
.portrait-meta .v a:hover { color: var(--accent); border-color: var(--accent); }

/* ── Блог ──────────────────────────────────────────────────────── */
main.blog { padding: clamp(28px, 4vw, 56px) 0 clamp(32px, 5vw, 64px); flex: 1; }
main.blog .fx-label::before { display: none; }
main.blog .fx-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.page-head { margin-bottom: clamp(28px, 4vw, 48px); }
.page-head h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 6vw, 62px); line-height: 1.05; letter-spacing: -0.01em; margin-top: 14px; }
.page-head .lede { margin-top: 14px; max-width: 62ch; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.65; }
.page-head .lede a { border-bottom: 1px solid var(--line); }

.feed { display: grid; gap: clamp(20px, 3vw, 32px); }
.card {
  display: grid; grid-template-columns: 200px 1fr; gap: clamp(16px, 2.5vw, 28px);
  padding-bottom: clamp(20px, 3vw, 30px); border-bottom: 1px solid var(--line); align-items: start;
}
.card:last-child { border-bottom: none; }
.card-thumb { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.card h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(21px, 2.6vw, 29px); line-height: 1.2; margin-top: 10px; }
.card a.card-title { transition: color .25s ease; }
.card a.card-title:hover { color: var(--accent); }
.card p.excerpt { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.7; max-width: 68ch; }
.more {
  display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid transparent; transition: border-color .25s ease;
}
.more:hover { border-color: var(--accent); }

.article { max-width: 74ch; }
.article .meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.article h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin-top: 14px; }
.article .body { margin-top: clamp(22px, 3vw, 34px); }
.article .body p { font-size: clamp(16px, 1.7vw, 18px); line-height: 1.78; color: var(--ink-2); margin-bottom: 1.15em; }
.article figure { margin: clamp(24px, 4vw, 40px) 0 0; }
.article figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); background: var(--bg-2); }
.article .source { margin-top: 18px; color: var(--mute); font-size: 14px; }
.article .source a { border-bottom: 1px solid var(--line); }
.article .sign { margin-top: 8px; color: var(--mute); font-size: 14px; font-style: italic; }

.prevnext { margin-top: clamp(32px, 5vw, 56px); padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.prevnext .slot { min-width: 0; }
.prevnext .slot.right { text-align: right; }
.prevnext .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.prevnext .t { display: block; margin-top: 6px; font-family: var(--serif); font-size: 19px; line-height: 1.25; transition: color .25s ease; }
.prevnext .t:hover { color: var(--accent); }

.pager { margin-top: clamp(30px, 4vw, 48px); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); color: var(--mute); transition: all .25s ease; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .current { border-color: var(--ink); color: var(--ink); }

.inline-link { color: var(--accent); border-bottom: 1px solid rgba(var(--accent-rgb), .35); word-break: break-word; }
.inline-link:hover { border-bottom-color: var(--accent); }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--line); background: var(--bg-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--ink-2);
  transition: border-color .25s ease, color .25s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag-n { color: var(--mute); font-size: 10px; }
.empty { color: var(--mute); font-size: 15px; }

/* ── Подвал ────────────────────────────────────────────────────── */
footer.site-footer {
  margin-top: auto; padding-top: 32px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
footer.site-footer a:hover { color: var(--accent); }

/* ── Появление ─────────────────────────────────────────────────── */
.fx-up { opacity: 0; transform: translateY(14px); animation: reveal 1.1s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: var(--d, 0ms); }
.fx-fade { opacity: 0; animation: revealFade 1.1s ease forwards; animation-delay: var(--d, 0ms); }
.name .given, .name .family { opacity: 0; transform: translateY(28px); animation: reveal 1.2s cubic-bezier(.22,.61,.36,1) forwards; }
.name .given  { animation-delay: 250ms; }
.name .family { animation-delay: 400ms; }
.portrait img, .portrait.is-empty span { opacity: 0; animation: portraitIn 1.6s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: 350ms; }
@keyframes reveal     { to { opacity: 1; transform: translateY(0); } }
@keyframes revealFade { to { opacity: 1; } }
@keyframes portraitIn { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1.02); } }

/* ── Узкие экраны ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  main.home { grid-template-columns: 1fr; }
  .portrait-wrap { max-width: 320px; margin-left: 0; }
  .portrait-meta { margin-left: 0; max-width: 520px; margin-top: 36px; }
  .topbar-sep { display: none; }
  .topbar, .topbar-left { gap: 8px 12px; font-size: 10px; letter-spacing: 0.08em; }
}
@media (max-width: 640px) {
  .contact { grid-template-columns: 90px 1fr auto; gap: 12px; }
  .contact .val { font-size: 14px; }
  .cards { grid-template-columns: 1fr; }
  .latest a { grid-template-columns: 1fr; gap: 4px; }
  .card { grid-template-columns: 1fr; }
  .card-thumb { max-width: 320px; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .slot.right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .name .given, .name .family, .fx-up, .fx-fade, .portrait img, .portrait.is-empty span { opacity: 1 !important; transform: none !important; }
}
