/* ============================================================
   ВЕРА МАРКЕЛОВА — Архив
   Издательский галерейный минимализм. Строгий монохром.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --paper:   #f3f1ec;  /* light bg  */
  --ink:     #131210;  /* dark ink  */

  /* DARK (default) */
  --bg:        #0b0b0a;
  --bg-2:      #111110;
  --fg:        #efece4;
  --muted:     #9a978f;
  --faint:     #6a6862;
  --line:      rgba(239,236,228,0.14);
  --line-2:    rgba(239,236,228,0.07);
  --tile-base: 0.30;          /* lightness anchor for placeholders */
  --tile-dir:  1;             /* placeholders go lighter than bg */
  --scrim:     rgba(8,8,7,0.72);

  --maxw: 1640px;
  --gutter: clamp(20px, 5vw, 88px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --ff-grotesque: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

:root[data-theme="light"] {
  --bg:        #f3f1ec;
  --bg-2:      #ebe8e1;
  --fg:        #16140f;
  --muted:     #5f5c54;
  --faint:     #8d8a81;
  --line:      rgba(20,18,14,0.16);
  --line-2:    rgba(20,18,14,0.08);
  --tile-base: 0.80;
  --tile-dir:  -1;            /* placeholders go darker than paper */
  --scrim:     rgba(243,241,236,0.80);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-grotesque);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
  transition: background-color 0.55s var(--ease), color 0.55s var(--ease);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--fg); color: var(--bg); }

/* thinner scrollbar, monochrome */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Utility ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.mono {
  font-family: var(--ff-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.rule { height: 1px; background: var(--line); border: 0; }
.theme-tx { transition: background-color 0.55s var(--ease), color 0.55s var(--ease), border-color 0.55s var(--ease); }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid var(--line-2);
  transition: background-color 0.55s var(--ease), border-color 0.55s var(--ease);
}
.header__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
}
/* empty logo slot — reserved space, no logo */
.logoslot {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.logoslot__mark {
  width: 30px; height: 30px;
  border: 1px dashed var(--line);
  border-radius: 1px;
  opacity: 0.5;
}
.logoslot__name {
  display: flex; flex-direction: column; gap: 3px; line-height: 1;
}
.logoslot__name b { font-weight: 600; letter-spacing: -0.01em; font-size: 15px; white-space: nowrap; }
.logoslot__name span { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-family: var(--ff-mono); white-space: nowrap; }

.nav {
  display: flex; gap: clamp(18px, 2.4vw, 40px);
  justify-content: center;
}
.nav__link {
  position: relative;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 6px 2px;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link[aria-current="page"] { color: var(--fg); }
.nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--fg);
}
.nav__num {
  font-family: var(--ff-mono);
  font-size: 9px; color: var(--faint);
  vertical-align: super; margin-right: 4px;
}

.header__right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* theme toggle */
.tt {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 6px 6px 14px;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.tt:hover { color: var(--fg); border-color: var(--fg); }
.tt__label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.tt__knob {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line);
  position: relative; overflow: hidden; flex: none;
  background: var(--bg-2);
}
.tt__knob::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 0.55s var(--ease), background 0.55s var(--ease);
}
:root[data-theme="light"] .tt__knob::before {
  /* crescent look for light */
  box-shadow: inset -6px -2px 0 0 var(--bg-2);
}

/* burger (mobile) */
.burger {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
}
.burger span { display: block; width: 20px; height: 1px; background: var(--fg); position: relative; }
.burger span::before, .burger span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 1px; background: var(--fg);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* mobile sheet */
.sheet {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: 84px var(--gutter) 40px;
  visibility: hidden; pointer-events: none;
}
.sheet.is-open { visibility: visible; pointer-events: auto; }
.anim-ready .sheet { opacity: 0; transition: opacity 0.4s var(--ease); }
.anim-ready .sheet.is-open { opacity: 1; }
.sheet__link {
  display: flex; align-items: baseline; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: clamp(28px, 9vw, 44px);
  font-weight: 300; letter-spacing: -0.02em;
}
.sheet__link .n { font-family: var(--ff-mono); font-size: 12px; color: var(--faint); letter-spacing: 0.1em; }
.sheet__link.is-active { color: var(--fg); }
.sheet__foot { margin-top: auto; }

/* ============================================================
   FILM PERFORATION RAIL (motif)
   ============================================================ */
.filmrail {
  --hole-h: 16px; --hole-gap: 12px;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0, transparent var(--hole-gap),
      var(--line) var(--hole-gap), var(--line) calc(var(--hole-gap) + 1px),
      transparent calc(var(--hole-gap) + 1px), transparent calc(var(--hole-gap) + var(--hole-h))
    );
}
.perf {
  display: flex; flex-direction: column; gap: 11px;
  padding: 4px 0;
}
.perf i {
  width: 11px; height: 15px; border-radius: 2px;
  border: 1px solid var(--line);
  flex: none;
}
.perf--h { flex-direction: row; }

/* ============================================================
   HOME / SHOWCASE
   ============================================================ */
.home { padding-top: clamp(16px, 4vw, 40px); }
.home__masthead {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 24px;
  padding-bottom: clamp(18px, 3vw, 34px);
}
.home__title {
  font-weight: 300;
  font-size: clamp(2.6rem, 9.2vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.home__title em {
  font-style: italic;
  font-weight: 300;
}
.home__sub {
  text-align: right;
  max-width: 320px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.stage {
  position: relative;
  margin-top: clamp(10px, 2vw, 22px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
}
.stage__pair {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 1.2vw, 16px);
  min-width: 0;
}
.stage__rail {
  display: flex; align-items: center;
  overflow: hidden;
}
.stage__rail .coil {
  height: 100%;
  justify-content: space-between;
  gap: 0;
}
.stage__railnum { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); writing-mode: vertical-rl; letter-spacing: 0.2em; padding: 14px 0; }

/* ---- спираль блокнота (вариант C) ---- */
.coil { display: flex; flex-direction: column; gap: 9px; color: var(--fg); }
.coil i {
  width: 38px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-bottom-color: transparent;
  transform: skewY(-14deg);
  opacity: 0.85;
  flex: none;
}
.coil--h { flex-direction: row; }
.coil--h i { transform: skewX(-14deg); border-bottom-color: currentColor; border-right-color: transparent; }

.stage__frame {
  position: relative;
  flex: none;
  width: min(560px, 58vh);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}

/* правая колонка-«разворот» */
.stage__meta {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 1.5vw, 18px);
  max-width: 460px;
}
.stage__eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
.stage__now { display: flex; flex-direction: column; gap: 8px; }
.anim-ready .stage__now { animation: stagefade 0.5s var(--ease); }
@keyframes stagefade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stage__wtitle {
  margin: 0; font-weight: 300;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  letter-spacing: -0.03em; line-height: 1;
}
.stage__wmeta { font-family: var(--ff-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.05em; }
.stage__divider { width: 100%; max-width: 420px; margin: clamp(2px, 0.8vw, 8px) 0; }

.slide {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.02);
  transition: opacity 0.9s var(--ease), transform 1.4s var(--ease);
  pointer-events: none;
}
.slide.is-active { opacity: 1; transform: scale(1); pointer-events: auto; }
.slide .placeholder { width: 100%; height: 100%; }

.slide__cap {
  position: absolute; left: 0; bottom: 0;
  padding: 16px 20px;
  display: flex; align-items: baseline; gap: 14px;
  background: linear-gradient(to top, var(--scrim), transparent);
  width: 100%;
}
.slide__cap h3 { margin: 0; font-weight: 400; font-size: clamp(15px, 2vw, 20px); letter-spacing: -0.01em; }
.slide__cap .meta { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

.stage__ctrl {
  display: flex; gap: 8px; z-index: 4;
}
.stage__ctrl button {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid; place-items: center;
  color: var(--fg);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.stage__ctrl button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.stage__dots { display: flex; gap: 6px; align-items: center; width: 100%; max-width: 420px; }
.stage__dots .wrap-dots { display: flex; gap: 6px; }
.dot {
  width: 26px; height: 2px; background: var(--line);
  transition: background 0.4s var(--ease);
  cursor: pointer;
}
.dot.is-active { background: var(--fg); }
.stage__count { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); margin-left: auto; letter-spacing: 0.1em; }

@media (max-width: 820px){
  .stage { grid-template-columns: 1fr; gap: clamp(20px, 4vw, 30px); align-items: start; }
  .stage__pair { width: 100%; }
  .stage__frame { flex: 1 1 auto; width: auto; }
  .stage__meta { max-width: none; width: 100%; }
  .stage__rail .coil i { width: 28px; }
}

.home__index {
  margin-top: clamp(60px, 9vw, 130px);
}
.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(22px, 3vw, 40px);
}
.section-head h2 {
  margin: 0; font-weight: 300; letter-spacing: -0.025em;
  font-size: clamp(1.6rem, 4.4vw, 3rem); line-height: 1;
}
.section-head a { font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; display: inline-flex; gap: 8px; align-items: center; }
.section-head a:hover { color: var(--fg); }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { padding-top: clamp(20px, 4vw, 44px); padding-bottom: clamp(70px, 10vw, 150px); }
.gallery__head {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 24px;
  padding-bottom: clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.gallery__title { margin: 0; font-weight: 300; font-size: clamp(2.2rem, 7vw, 5.4rem); letter-spacing: -0.035em; line-height: 0.92; }
.gallery__lead { color: var(--muted); font-size: 13.5px; max-width: 360px; margin-top: 14px; }

.gallery__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 0; margin-bottom: clamp(8px, 1.5vw, 20px);
  position: sticky; top: 72px; z-index: 30;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
}
.gallery__count { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.1em; }
.gallery__bar-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 100px; padding: 3px; }
.viewtoggle button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 100px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, background 0.3s;
}
.viewtoggle button.is-active { color: var(--bg); background: var(--fg); }

/* GRID — masonry via columns */
.grid {
  column-gap: clamp(14px, 1.6vw, 26px);
  columns: 3;
}
@media (max-width: 1080px){ .grid { columns: 2; } }
@media (max-width: 620px){ .grid { columns: 1; } }
.grid__item {
  break-inside: avoid;
  margin-bottom: clamp(14px, 1.6vw, 26px);
  cursor: pointer;
}
.grid__item .placeholder { width: 100%; }
.tile-cap {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 1px 0;
  opacity: 0.78; transition: opacity 0.3s;
}
.grid__item:hover .tile-cap { opacity: 1; }
.tile-cap .t { font-size: 13px; letter-spacing: -0.005em; }
.tile-cap .m { font-family: var(--ff-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; margin-left: auto; white-space: nowrap; }

/* media reveal — hidden ONLY when animations are enabled (foreground) */
.anim-ready .reveal { opacity: 0; transform: translateY(14px); }
.anim-ready .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }

/* LIST */
.list { display: flex; flex-direction: column; }
.list__row {
  display: grid;
  grid-template-columns: 54px 200px 1fr auto;
  align-items: center; gap: clamp(16px, 3vw, 48px);
  padding: clamp(14px, 1.8vw, 22px) 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: padding-left 0.4s var(--ease);
}
.list__row:first-child { border-top: 1px solid var(--line-2); }
.list__row:hover { padding-left: 14px; }
.list__num { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
.list__thumb { width: 200px; aspect-ratio: 1/1; overflow: hidden; }
.list__thumb .placeholder { width: 100%; height: 100%; }
.list__title { font-weight: 300; font-size: clamp(1.2rem, 3vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.05; }
.list__meta { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-align: right; white-space: nowrap; }
.list__row .arrow { opacity: 0; transform: translateX(-6px); transition: all 0.35s var(--ease); }
.list__row:hover .arrow { opacity: 1; transform: none; }
@media (max-width: 860px){
  .list__row { grid-template-columns: 36px 110px 1fr; }
  .list__thumb { width: 110px; }
  .list__meta { display: none; }
}

/* ============================================================
   PLACEHOLDER (neutral film-frame stand-in)
   ============================================================ */
.ph-img { filter: grayscale(0) brightness(1) contrast(1); }
.anim-ready .ph-img { transition: filter 0.55s var(--ease); }
html.mono-photos .ph-img { filter: grayscale(1) brightness(1.03) contrast(1.04); }
.placeholder.is-photo { background: var(--bg-2); }
.placeholder {
  position: relative;
  background: var(--ph-fill, #2a2a28);
  overflow: hidden;
  transition: background 0.55s var(--ease);
}
.placeholder::before {
  /* subtle film-grain hairline texture */
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 7px),
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.05), transparent 60%);
  mix-blend-mode: soft-light;
}
.placeholder__tag {
  position: absolute; left: 10px; bottom: 9px;
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
}
:root[data-theme="light"] .placeholder__tag { color: rgba(0,0,0,0.42); }
.placeholder__no {
  position: absolute; right: 10px; top: 8px;
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
}
:root[data-theme="light"] .placeholder__no { color: rgba(0,0,0,0.32); }
.placeholder__plus { position: absolute; inset: 0; display: grid; place-items: center; }
.placeholder__plus::before, .placeholder__plus::after {
  content: ""; position: absolute; background: rgba(255,255,255,0.18);
}
:root[data-theme="light"] .placeholder__plus::before,
:root[data-theme="light"] .placeholder__plus::after { background: rgba(0,0,0,0.14); }
.placeholder__plus::before { width: 22px; height: 1px; }
.placeholder__plus::after { width: 1px; height: 22px; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding-top: clamp(28px, 6vw, 80px); padding-bottom: clamp(70px, 10vw, 150px); }
.about__top {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 6vw, 90px);
  align-items: start;
}
@media (max-width: 880px){ .about__top { grid-template-columns: 1fr; } }
.about__lead {
  font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1.2; letter-spacing: -0.02em;
  text-wrap: balance;
}
.about__lead .q { color: var(--muted); }
.about__portrait { position: relative; }
.about__portrait .placeholder { width: 100%; aspect-ratio: 4/5; }
.about__portrait figcaption { margin-top: 10px; font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

.about__body {
  margin-top: clamp(44px, 7vw, 96px);
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 72px);
}
@media (max-width: 880px){ .about__body { grid-template-columns: 1fr; gap: 18px; } }
.about__body h3 { margin: 0; font-weight: 400; font-size: 14px; }
.about__cols { columns: 2; column-gap: clamp(28px, 4vw, 56px); }
@media (max-width: 720px){ .about__cols { columns: 1; } }
.about__cols p { margin: 0 0 1.1em; color: var(--fg); opacity: 0.86; font-size: 15px; line-height: 1.72; }
.about__cols p:first-child::first-letter {
  font-size: 3.1em; line-height: 0.8; float: left; padding: 6px 10px 0 0; font-weight: 300;
}

.meta-list { display: flex; flex-direction: column; gap: 0; }
.meta-list .mrow { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.meta-list .mrow:first-child { border-top: 1px solid var(--line-2); }
.meta-list .k { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.meta-list .v { font-size: 14px; text-align: right; }

/* ============================================================
   BLOG
   ============================================================ */
.blog { padding-top: clamp(28px, 6vw, 80px); padding-bottom: clamp(70px, 10vw, 150px); }

/* блокнот: корешок-спираль слева + лист справа */
.notebook { display: grid; grid-template-columns: 64px 1fr; gap: clamp(16px, 3vw, 40px); align-items: stretch; }
.notebook__spine {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 6px;
  overflow: hidden;
}
.notebook__spine .coil { gap: 11px; }
@media (max-width: 720px){
  .notebook { grid-template-columns: 34px 1fr; gap: 14px; }
  .notebook__spine .coil i { width: 26px; }
}
.notelist { display: flex; flex-direction: column; }
.note {
  display: grid; grid-template-columns: 150px 1fr auto;
  gap: clamp(18px, 4vw, 56px); align-items: baseline;
  padding: clamp(22px, 3vw, 38px) 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer; transition: padding-left 0.4s var(--ease);
}
.note:first-child { border-top: 1px solid var(--line); }
.note:hover { padding-left: 12px; }
.note__date { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.note__title { font-weight: 300; font-size: clamp(1.4rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.08; }
.note__excerpt { margin-top: 10px; color: var(--muted); font-size: 14px; max-width: 60ch; line-height: 1.6; }
.note__tag { font-family: var(--ff-mono); font-size: 10px; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 720px){ .note { grid-template-columns: 1fr; gap: 8px; } .note__tag { display: none; } }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in oklab, var(--bg) 96%, #000 0%);
  display: grid; grid-template-rows: 1fr auto;
  opacity: 1; visibility: hidden; pointer-events: none;
}
:root[data-theme="dark"] .lightbox { background: rgb(6,6,5); }
:root[data-theme="light"] .lightbox { background: rgb(243,241,236); }
.lightbox.is-open { visibility: visible; pointer-events: auto; }
/* fade only when foreground + motion allowed */
.anim-ready .lightbox { opacity: 0; transition: opacity 0.4s var(--ease); }
.anim-ready .lightbox.is-open { opacity: 1; }
.lightbox__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
}
.lightbox__counter { font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.12em; }
.lightbox__close { display: inline-flex; align-items: center; gap: 9px; font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.lightbox__close:hover { color: var(--fg); }
.lightbox__stage {
  position: relative;
  display: grid; place-items: center;
  padding: clamp(64px, 9vw, 110px) clamp(56px, 10vw, 160px) 20px;
  min-height: 0;
}
.lightbox__img {
  max-width: min(1100px, 100%); max-height: 100%;
  display: flex;
}
.lightbox__img .placeholder { max-height: 72vh; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--fg);
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  transition: background 0.3s, border-color 0.3s, opacity 0.3s;
}
.lightbox__nav:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.lightbox__nav--prev { left: clamp(12px, 3vw, 44px); }
.lightbox__nav--next { right: clamp(12px, 3vw, 44px); }
.lightbox__cap {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px;
  padding: 22px var(--gutter) 30px;
  border-top: 1px solid var(--line-2);
}
.lightbox__cap h3 { margin: 0 0 6px; font-weight: 300; font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: -0.02em; }
.lightbox__cap p { margin: 0; color: var(--muted); font-size: 14px; max-width: 56ch; line-height: 1.55; }

/* читалка заметки как страница блокнота */
.notereader { padding-inline: clamp(20px, 6vw, 80px) !important; }
.notereader__inner {
  display: grid; grid-template-columns: 56px minmax(0, 640px);
  gap: clamp(18px, 3vw, 44px);
  width: 100%; max-width: 760px; margin: 0 auto;
  padding-block: 12px 40px;
}
.notereader__spine { display: flex; flex-direction: column; align-items: center; overflow: hidden; padding-top: 4px; }
.notereader__sheet { min-width: 0; }
@media (max-width: 640px){
  .notereader__inner { grid-template-columns: 30px 1fr; gap: 14px; }
  .notereader__spine .coil i { width: 24px; }
}
.lightbox__cap .meta { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-align: right; white-space: nowrap; }
@media (max-width: 720px){
  .lightbox__nav { width: 42px; height: 42px; }
  .lightbox__stage { padding-inline: 8px; }
  .lightbox__cap { grid-template-columns: 1fr; }
  .lightbox__cap .meta { text-align: left; }
}

/* ============================================================
   FOOTER (minimal — no contacts, no share)
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
  margin-top: clamp(40px, 6vw, 80px);
}
.footer__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__big { font-weight: 300; font-size: clamp(1.4rem, 5vw, 3rem); letter-spacing: -0.03em; line-height: 1; }
.footer__meta { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.08em; text-align: right; line-height: 1.8; }

/* ============================================================
   PAGE TRANSITION — only when foreground + motion allowed
   ============================================================ */
.anim-ready .page { animation: pagein 0.6s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive header ---------- */
@media (max-width: 860px){
  .nav { display: none; }
  .header__row { grid-template-columns: 1fr auto; }
  .tt__label { display: none; }
  .tt { padding: 5px; }
  .burger { display: inline-flex; }
  .header__right { gap: 4px; }
}

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

/* ============================================================
   ДРУЗЬЯ (гостевой раздел) + дерево авторов
   ============================================================ */
.friends { padding-top: clamp(20px, 4vw, 44px); padding-bottom: clamp(70px, 10vw, 150px); }
.friends__body {
  display: grid; grid-template-columns: 220px 1fr;
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(28px, 4vw, 52px);
  align-items: start;
}
.friends__main { min-width: 0; }

/* дерево */
.friends__aside { position: sticky; top: 96px; }
.tree { display: block; }
.tree__root {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left;
  padding: 0 0 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.tree__root .tree__label { font-size: 15px; letter-spacing: -0.01em; transition: color 0.3s; }
.tree__root:not(.is-active) .tree__label { color: var(--muted); }
.tree__root:hover .tree__label { color: var(--fg); }

.tree__list { list-style: none; margin: 0; padding: 0; position: relative; }
.tree__list::before {
  content: ""; position: absolute; left: 8px; top: 0; bottom: 24px;
  width: 1px; background: var(--line);
}
.tree__node {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 0 12px 28px;
  border-bottom: 1px solid var(--line-2);
  color: var(--muted);
  transition: color 0.3s var(--ease), padding-left 0.35s var(--ease);
}
.tree__tick {
  position: absolute; left: 8px; top: 50%;
  width: 13px; height: 1px; background: var(--line);
}
.tree__node .tree__label { flex: 1; font-size: 15px; letter-spacing: -0.01em; }
.tree__c {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--faint);
}
.tree__node:not(.is-empty):hover { color: var(--fg); padding-left: 32px; }
.tree__node.is-active { color: var(--fg); }
.tree__node.is-active::before {
  content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; background: var(--fg);
}
.tree__node.is-active .tree__tick { background: var(--fg); }
.tree__node.is-empty { color: var(--faint); cursor: default; }
.tree__node.is-empty .tree__c { text-transform: lowercase; font-style: italic; }
.tree__hint {
  margin: 18px 0 0; padding-left: 28px;
  font-family: var(--ff-mono); font-size: 10px; line-height: 1.6;
  letter-spacing: 0.04em; color: var(--faint);
}

/* вступление автора */
.friends__intro { margin-bottom: clamp(24px, 3vw, 40px); max-width: 60ch; }
.friends__intro h2 { margin: 0; font-weight: 300; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -0.03em; line-height: 1; display: inline; }
.friends__role {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-left: 14px; vertical-align: middle;
}
.friends__intro p { margin: 16px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.7; }

/* пусто */
.friends__empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
  min-height: 320px; border: 1px dashed var(--line-2);
  color: var(--faint);
}
.friends__empty p { margin: 0; font-size: 14px; }
.perf-mini { display: flex; gap: 10px; }
.perf-mini i { width: 12px; height: 18px; border: 1px solid var(--line); border-radius: 2px; }

@media (max-width: 820px){
  .friends__body { grid-template-columns: 1fr; gap: 26px; }
  .friends__aside { position: static; }
  .tree__root { padding-bottom: 10px; }
  .tree__list { display: flex; flex-wrap: wrap; gap: 8px; }
  .tree__list::before { display: none; }
  .tree__node {
    width: auto; padding: 8px 14px; gap: 8px;
    border: 1px solid var(--line); border-radius: 100px;
  }
  .tree__tick { display: none; }
  .tree__node.is-active::before { display: none; }
  .tree__node.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .tree__node.is-active .tree__c { color: var(--bg); }
  .tree__node:not(.is-empty):hover { padding-left: 14px; }
  .tree__hint { padding-left: 0; margin-top: 14px; }
}

/* ============================================================
   НОВАЯ ВЕРСИЯ ГЛАВНОЙ (#new) — корешок + чертёжная сетка
   Полностью изолированный блок: свои переменные на .nv и все классы
   с префиксом nv-, чтобы не пересекаться со стилями основного сайта.
   ============================================================ */
.nv {
  --m: 28px;                        /* базовый модуль = диаметр витка */
  --spine: calc(var(--m) * 2.6);    /* ширина корешка */
  --nv-bg: #0b0b0a; --nv-bg2: #141312;
  --nv-fg: #efece4; --nv-muted: #9a978f; --nv-faint: #6a6862;
  --nv-line: rgba(239,236,228,0.14); --nv-line2: rgba(239,236,228,0.07);
  --draft-minor: rgba(239,236,228,0.07); --draft-major: rgba(239,236,228,0.13);
  --nv-ease: cubic-bezier(0.22,1,0.36,1);
  --nv-ff: "Archivo","Helvetica Neue",Helvetica,Arial,sans-serif;
  --nv-mono: "IBM Plex Mono",ui-monospace,Menlo,monospace;

  /* вторичный масштаб и ширина колонки — вынесены, чтобы переключать варианты */
  --nv-maxw: 1500px;      /* ширина контентной колонки */
  --nv-fs-body: 13.5px;   /* описание под заголовком, меню */
  --nv-fs-meta: 13px;     /* подпись работы в витрине */
  --nv-fs-cap: 13px;      /* название работы в сетке */
  --nv-fs-capm: 10.5px;   /* подпись работы в сетке */
  --nv-fs-micro: 11px;    /* надзаголовки, счётчик */
  --nv-fs-link: 12px;     /* ссылка «все работы» */
  --nv-lead-w: 300px;     /* ширина описания под заголовком */

  position: relative; min-height: 100vh;
  background: var(--nv-bg); color: var(--nv-fg);
  font-family: var(--nv-ff); font-weight: 400; line-height: 1.55;
  transition: background-color 0.55s var(--nv-ease), color 0.55s var(--nv-ease);
}
:root[data-theme="light"] .nv {
  --nv-bg: #f3f1ec; --nv-bg2: #e7e3da;
  --nv-fg: #16140f; --nv-muted: #5f5c54; --nv-faint: #8d8a81;
  --nv-line: rgba(20,18,14,0.18); --nv-line2: rgba(20,18,14,0.08);
  --draft-minor: rgba(20,18,14,0.045); --draft-major: rgba(20,18,14,0.085);
}
.nv img { display: block; max-width: 100%; }
.nv a { color: inherit; text-decoration: none; }
.nv button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---- чертёжная сетка ---- */
.nv-draft {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, var(--draft-major) 0 1px, transparent 1px calc(var(--m) * 16)),
    repeating-linear-gradient(to right, var(--draft-minor) 0 1px, transparent 1px calc(var(--m) * 4));
  background-position: var(--spine) 0;
  transition: background-image 0.55s var(--nv-ease);
}

/* ---- корешок на всю высоту окна ---- */
.nv-spine {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--spine); z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden; pointer-events: none;
  border-right: 1px solid var(--nv-line2);
  background: linear-gradient(to right, color-mix(in oklab, var(--nv-bg) 90%, transparent), transparent);
}
.nv-coil { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; color: var(--nv-fg); opacity: 0.5; }
.nv-coil i {
  width: 30px; height: 12px; flex: none;
  border: 1.5px solid currentColor; border-radius: 50%; border-bottom-color: transparent;
  transform: skewY(-14deg);
}

/* ---- каркас ---- */
.nv-shell { position: relative; z-index: 1; padding-left: var(--spine); }
.nv-wrap { max-width: var(--nv-maxw); margin: 0 auto; padding-inline: clamp(var(--m), 4vw, calc(var(--m) * 3.5)); }

/* ---- шапка ---- */
.nv-header {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--nv-bg) 78%, transparent);
  border-bottom: 1px solid var(--nv-line2);
  transition: background-color 0.55s var(--nv-ease), border-color 0.55s var(--nv-ease);
}
.nv-header__row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  column-gap: clamp(16px, 3vw, 40px); align-items: center; height: calc(var(--m) * 2.6);
}
.nv-logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nv-logo__mark { width: 30px; height: 30px; border: 1px dashed var(--nv-line); opacity: 0.5; }
.nv-logo__name { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.nv-logo__name b { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.nv-logo__name span {
  font-family: var(--nv-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--nv-muted); white-space: nowrap;
}
.nv-nav { display: flex; gap: clamp(18px, 2.4vw, 40px); justify-content: center; }
.nv-nav a {
  font-size: var(--nv-fs-body); color: var(--nv-muted); padding: 6px 2px;
  white-space: nowrap; transition: color 0.3s; position: relative;
}
.nv-nav a:hover, .nv-nav a.is-on { color: var(--nv-fg); }
.nv-nav a.is-on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--nv-fg);
}
.nv-n { font-family: var(--nv-mono); font-size: 9px; color: var(--nv-faint); vertical-align: super; margin-right: 4px; }
.nv-header__right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* переключатель темы */
.nv-tt {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--nv-line); border-radius: 100px; padding: 6px 6px 6px 14px;
  color: var(--nv-muted); transition: color 0.3s, border-color 0.3s;
}
.nv-tt:hover { color: var(--nv-fg); border-color: var(--nv-fg); }
.nv-tt span { font-family: var(--nv-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.nv-tt b {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--nv-line);
  background: var(--nv-bg2); position: relative; display: block;
}
.nv-tt b::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--nv-fg); transition: box-shadow 0.55s var(--nv-ease);
}
:root[data-theme="light"] .nv-tt b::before { box-shadow: inset -6px -2px 0 0 var(--nv-bg2); }

/* бургер + шторка меню */
.nv-burger { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; }
.nv-burger i { display: block; width: 20px; height: 1px; background: var(--nv-fg); position: relative; }
.nv-burger i::before, .nv-burger i::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 1px;
  background: var(--nv-fg); transition: transform 0.35s var(--nv-ease);
}
.nv-burger i::before { top: -6px; }
.nv-burger i::after { top: 6px; }
.nv-burger[aria-expanded="true"] i { background: transparent; }
.nv-burger[aria-expanded="true"] i::before { transform: translateY(6px) rotate(45deg); }
.nv-burger[aria-expanded="true"] i::after { transform: translateY(-6px) rotate(-45deg); }
.nv-sheet {
  position: fixed; inset: 0; z-index: 40; background: var(--nv-bg);
  display: flex; flex-direction: column;
  padding: 84px clamp(var(--m), 4vw, calc(var(--m) * 3.5)) 40px;
  padding-left: calc(var(--spine) + clamp(var(--m), 4vw, calc(var(--m) * 3.5)));
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.4s var(--nv-ease);
}
.nv-sheet.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.nv-sheet a {
  display: flex; align-items: baseline; gap: 16px; padding: 18px 0;
  border-bottom: 1px solid var(--nv-line2);
  font-size: clamp(28px, 7vw, 44px); font-weight: 300; letter-spacing: -0.02em;
}
.nv-sheet .nv-n { font-size: 12px; color: var(--nv-faint); letter-spacing: 0.1em; vertical-align: baseline; }
.nv-sheet__foot {
  margin-top: auto; font-family: var(--nv-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--nv-muted);
}

/* ---- заголовок ---- */
.nv-mast {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px;
  padding-top: calc(var(--m) * 2); padding-bottom: calc(var(--m) * 1.5);
}
.nv-mast h1 { margin: 0; font-weight: 300; font-size: clamp(3rem, 8.4vw, 7.6rem); line-height: 0.9; letter-spacing: -0.04em; }
.nv-mast h1 em { font-style: italic; }
.nv-mast p { margin: 0; text-align: right; max-width: var(--nv-lead-w); color: var(--nv-muted); font-size: var(--nv-fs-body); line-height: 1.6; }

/* ---- витрина ---- */
.nv-stage {
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(var(--m), 5vw, calc(var(--m) * 3.5)); align-items: start; padding-top: var(--m);
}
.nv-frame {
  position: relative; flex: none; width: min(calc(var(--m) * 20), 56vh); aspect-ratio: 1 / 1;
  overflow: hidden; background: var(--nv-bg2); cursor: pointer;
}
.nv-slide {
  position: absolute; inset: 0; opacity: 0; transform: scale(1.02); pointer-events: none;
  transition: opacity 0.9s var(--nv-ease), transform 1.4s var(--nv-ease);
}
.nv-slide.is-on { opacity: 1; transform: none; }
.nv-slide img { width: 100%; height: 100%; object-fit: cover; }
/* размерная засечка сверху кадра — намёк на чертёж */
.nv-frame__dim { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--nv-line2); z-index: 2; }

.nv-meta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--m); max-width: calc(var(--m) * 16); }
.nv-meta__eyebrow {
  font-family: var(--nv-mono); font-size: var(--nv-fs-micro); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--nv-muted);
}
.nv-meta__now { display: flex; flex-direction: column; gap: 10px; }
.nv-meta__now h2 { margin: 0; font-weight: 300; font-size: clamp(2rem, 3.6vw, 3.2rem); letter-spacing: -0.03em; line-height: 0.95; }
.nv-mm { font-family: var(--nv-mono); font-size: var(--nv-fs-meta); color: var(--nv-muted); letter-spacing: 0.05em; }
.nv-rule { width: 100%; height: 1px; background: var(--nv-line); border: 0; margin: 0; }
.nv-dots { display: flex; gap: 6px; align-items: center; width: 100%; }
.nv-d { width: 26px; height: 2px; background: var(--nv-line); transition: background 0.4s var(--nv-ease); cursor: pointer; }
.nv-d.is-on { background: var(--nv-fg); }
.nv-count { font-family: var(--nv-mono); font-size: var(--nv-fs-micro); color: var(--nv-faint); letter-spacing: 0.1em; margin-left: auto; }
.nv-ctrl { display: flex; gap: 8px; }
.nv-ctrl button {
  width: 44px; height: 44px; border: 1px solid var(--nv-line); display: grid; place-items: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.nv-ctrl button:hover { background: var(--nv-fg); color: var(--nv-bg); border-color: var(--nv-fg); }

/* ---- индекс ---- */
.nv-index { margin-top: calc(var(--m) * 4); padding-bottom: calc(var(--m) * 4); }
.nv-sechead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding-bottom: 18px; border-bottom: 1px solid var(--nv-line); margin-bottom: calc(var(--m) * 1.5);
}
.nv-sechead h2 { margin: 0; font-weight: 300; font-size: clamp(1.6rem, 4.4vw, 3rem); letter-spacing: -0.025em; line-height: 1; }
.nv-sechead a { font-family: var(--nv-mono); font-size: var(--nv-fs-link); color: var(--nv-muted); letter-spacing: 0.04em; }
.nv-grid { columns: 3; column-gap: var(--m); }
.nv-grid figure { break-inside: avoid; margin: 0 0 var(--m); cursor: pointer; }
.nv-grid img { width: 100%; }
.nv-cap { display: flex; align-items: baseline; gap: 10px; padding: 9px 1px 0; opacity: 0.78; transition: opacity 0.3s; }
.nv-grid figure:hover .nv-cap { opacity: 1; }
.nv-t { font-size: var(--nv-fs-cap); }
.nv-m { font-family: var(--nv-mono); font-size: var(--nv-fs-capm); color: var(--nv-muted); margin-left: auto; white-space: nowrap; }

@media (max-width: 1080px) { .nv-grid { columns: 2; } }
@media (max-width: 1020px) {
  .nv { --spine: calc(var(--m) * 1.6); }
  .nv-coil i { width: 20px; }
  .nv-nav { display: none; }
  .nv-burger { display: inline-flex; }
  .nv-tt span { display: none; }
  .nv-tt { padding: 5px; }
  .nv-header__row { grid-template-columns: 1fr auto; }
  .nv-stage { grid-template-columns: 1fr; gap: calc(var(--m) * 1.2); }
  .nv-frame { width: 100%; }
  .nv-meta { max-width: none; width: 100%; }
  .nv-mast { grid-template-columns: 1fr; }
  .nv-mast p { text-align: left; }
}
@media (max-width: 620px) { .nv-grid { columns: 1; } }

/* ---- пробный режим правки текста на #new (?edit=1) ---- */
.nv--nolines .nv-draft { display: none; }
.nv-mast p { white-space: pre-line; }

.nv [data-nv-ed] {
  outline: 1px dashed var(--nv-line); outline-offset: 4px;
  border-radius: 2px; cursor: text;
}
.nv [data-nv-ed]:hover { outline-color: var(--nv-muted); }
.nv [data-nv-ed]:focus { outline: 1px solid var(--nv-fg); outline-offset: 4px; }

.nv-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  font-family: var(--nv-mono); font-size: 11px; color: var(--nv-fg);
}
.nv-panel__toggle {
  border: 1px solid var(--nv-line); background: var(--nv-bg);
  padding: 8px 14px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--nv-muted); transition: color 0.3s, border-color 0.3s;
}
.nv-panel__toggle:hover { color: var(--nv-fg); border-color: var(--nv-fg); }
.nv-panel__body {
  width: 272px; border: 1px solid var(--nv-line); background: var(--nv-bg);
  padding: 14px; display: flex; flex-direction: column; gap: 11px;
}
.nv-panel__row { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.nv-panel__row input { accent-color: var(--nv-fg); margin: 0; }
.nv-panel__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.nv-panel__btns button {
  border: 1px solid var(--nv-line); padding: 7px 10px; color: var(--nv-muted);
  transition: color 0.3s, border-color 0.3s;
}
.nv-panel__btns button:hover { color: var(--nv-fg); border-color: var(--nv-fg); }
.nv-panel__msg { color: var(--nv-fg); letter-spacing: 0.06em; }
.nv-panel__note { margin: 0; color: var(--nv-faint); font-size: 10.5px; line-height: 1.55; }

@media (max-width: 620px) {
  .nv-panel { right: 12px; bottom: 12px; }
  .nv-panel__body { width: calc(100vw - 44px); }
}

/* ============================================================
   ВАРИАНТЫ ОФОРМЛЕНИЯ (страница ?design=1)
   Переключаются классами на .nv — чтобы выбрать вживую, а не по скриншотам.
   ============================================================ */

/* ---- типографика: вторичный масштаб ---- */
.nv--type-b {
  --nv-fs-body: 15px;  --nv-fs-meta: 14.5px; --nv-fs-cap: 14.5px;
  --nv-fs-capm: 11.5px; --nv-fs-micro: 12px; --nv-fs-link: 13px;
  --nv-lead-w: 340px;
}
.nv--type-c {
  --nv-fs-body: 17px;  --nv-fs-meta: 16px;  --nv-fs-cap: 16px;
  --nv-fs-capm: 12.5px; --nv-fs-micro: 13px; --nv-fs-link: 14px;
  --nv-lead-w: 380px;
}
/* крупная шапка — по просьбе «шапку шрифтом наверху тоже крупнее» */
.nv--type-b .nv-logo__name b { font-size: 16.5px; }
.nv--type-c .nv-logo__name b { font-size: 18px; }
.nv--type-b .nv-logo__name span,
.nv--type-c .nv-logo__name span { font-size: 11px; }

/* ---- ширина колонки ---- */
.nv--w-1280 { --nv-maxw: 1280px; }
.nv--w-1120 { --nv-maxw: 1120px; }

/* ---- фоновые сетки ----
   Рисуются градиентами: около килобайта кода вместо картинки,
   резко на любом экране и само подстраивается под тёмную/светлую тему. */
.nv--bg-none .nv-draft { display: none; }

/* косые 45° в двух направлениях */
.nv--bg-diag .nv-draft {
  background-image:
    repeating-linear-gradient(45deg,  var(--draft-major) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(-45deg, var(--draft-minor) 0 1px, transparent 1px 112px);
  background-position: 0 0;
}

/* косые + круги ровно в точках пересечения
   шаг линий 112px -> решётка пересечений 158.4px со сдвигом 79.2px */
.nv--bg-geo .nv-draft {
  background-image:
    radial-gradient(circle, var(--draft-major) 0 3px, transparent 3.5px),
    radial-gradient(circle, var(--draft-major) 0 3px, transparent 3.5px),
    repeating-linear-gradient(45deg,  var(--draft-major) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(-45deg, var(--draft-major) 0 1px, transparent 1px 112px);
  background-size: 158.4px 158.4px, 158.4px 158.4px, auto, auto;
  background-position: 0 0, 79.2px 79.2px, 0 0, 0 0;
}

/* плотнее: три направления + круги — «начертательная геометрия» */
.nv--bg-geo2 .nv-draft {
  background-image:
    radial-gradient(circle, var(--draft-major) 0 3px, transparent 3.5px),
    radial-gradient(circle, var(--draft-major) 0 3px, transparent 3.5px),
    repeating-linear-gradient(45deg,  var(--draft-major) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(-45deg, var(--draft-major) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(to right, var(--draft-minor) 0 1px, transparent 1px 112px);
  background-size: 158.4px 158.4px, 158.4px 158.4px, auto, auto, auto;
  background-position: 0 0, 79.2px 79.2px, 0 0, 0 0, 0 0;
}

/* ---- панель выбора вариантов ---- */
.nv-design {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  font-family: var(--nv-mono); font-size: 11px; color: var(--nv-fg);
}
.nv-design__body {
  width: 268px; border: 1px solid var(--nv-line); background: var(--nv-bg);
  padding: 14px; display: flex; flex-direction: column; gap: 13px;
}
.nv-design__group { display: flex; flex-direction: column; gap: 7px; }
.nv-design__label {
  color: var(--nv-muted); letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px;
}
.nv-design__row { display: flex; gap: 6px; flex-wrap: wrap; }
.nv-design__row button {
  border: 1px solid var(--nv-line); padding: 6px 10px; color: var(--nv-muted);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.nv-design__row button:hover { color: var(--nv-fg); border-color: var(--nv-fg); }
.nv-design__row button.is-on { background: var(--nv-fg); color: var(--nv-bg); border-color: var(--nv-fg); }
.nv-design__code {
  border-top: 1px solid var(--nv-line2); padding-top: 10px;
  color: var(--nv-faint); font-size: 10.5px; line-height: 1.5;
}
.nv-design__code b { color: var(--nv-fg); font-weight: 400; }
.nv-design__toggle {
  border: 1px solid var(--nv-line); background: var(--nv-bg);
  padding: 8px 14px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--nv-muted); transition: color 0.3s, border-color 0.3s;
}
.nv-design__toggle:hover { color: var(--nv-fg); border-color: var(--nv-fg); }
@media (max-width: 620px) {
  .nv-design { right: 12px; bottom: 12px; }
  .nv-design__body { width: calc(100vw - 44px); }
}
