/* =====================================================================
   Библиотеки Йошкар-Олы — сайт-презентация логотипа
   ===================================================================== */

@font-face { font-family: 'PT Serif'; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-700.woff2) format('woff2'); }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-400.woff2) format('woff2'); }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/pt-serif-400i.woff2) format('woff2'); }
@font-face { font-family: 'PT Sans'; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'PT Sans'; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-700.woff2) format('woff2'); }
@font-face { font-family: 'PT Sans Caption'; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-caption-700.woff2) format('woff2'); }

:root {
  --red: #B3232B;
  --red-light: #E0474E;
  --ink: #1E2235;
  --ink-2: #2A2F47;
  --linen: #F3ECDF;
  --linen-2: #E9E1D1;
  --linen-3: #DDD3C0;
  --blush: #F2B8B0;
  --ochre: #D9A02F;
  --pine: #3F7A55;
  --muted: #5E5866;
  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --sans: 'PT Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --caps: 'PT Sans Caption', 'PT Sans', system-ui, sans-serif;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --band-h: 46px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font: 400 18px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, :is(svg, img) { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.05; margin: 0 0 .45em; letter-spacing: -0.01em; }
h1 { font-size: clamp(48px, 7.4vw, 104px); }
h2 { font-size: clamp(34px, 4.6vw, 62px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); }
p { margin: 0 0 1em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 700 13px/1.2 var(--caps); letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin-bottom: 14px;
}
.eyebrow-light { color: var(--blush); }
.lead { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; }
.narrow { max-width: 760px; }
.accent { font: 400 italic clamp(20px, 1.9vw, 25px)/1.45 var(--serif); color: var(--red); }
.note { color: var(--muted); font-size: 16px; max-width: 760px; }
.muted { color: rgba(243, 236, 223, .55); font-size: 14px; }
.mt { margin-top: clamp(64px, 9vw, 120px); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 17px/1 var(--sans); text-decoration: none; cursor: pointer;
  padding: 16px 26px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-red { background: var(--red); color: var(--linen); }
.btn-red:hover { background: #9c1d24; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--linen); }
.btn-linen { background: var(--linen); color: var(--red); }
.btn-ghost-light { border-color: var(--linen); color: var(--linen); background: transparent; }
.btn-ghost-light:hover { background: var(--linen); color: var(--red); }
.btn-small { padding: 10px 18px; font-size: 15px; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px;
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: rgba(243, 236, 223, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 34, 53, .08);
  transform: translateY(-100%); transition: transform .35s;
}
.topbar.show { transform: none; }
.topbar-brand { display: block; height: 36px; }
.topbar-logo { height: 36px; width: auto; display: block; }
.topbar-nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.topbar-nav a { text-decoration: none; opacity: .75; }
.topbar-nav a:hover { opacity: 1; color: var(--red); }
@media (max-width: 900px) { .topbar-nav { display: none; } .topbar .btn { margin-left: auto; } }

/* ---------- орнаментальные ленты ---------- */
.band { height: var(--band-h); background-repeat: repeat-x; background-size: auto 100%; background-position: center; }
.band-stroke { height: 26px; }
.band-diamonds { height: 54px; }
.band-marks { height: 64px; }

/* ---------- первый экран ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 96px 0 72px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; opacity: .55;
  background-image: linear-gradient(var(--linen-2) 1px, transparent 1px), linear-gradient(90deg, var(--linen-2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 30% 50%, #000 30%, transparent 75%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; width: 100%; }
.hero-visual { display: flex; justify-content: center; }
.hero-mark { width: min(100%, 460px); overflow: visible; }
.hm-grid line { stroke: var(--linen-3); stroke-width: .6; opacity: 0; transition: opacity 1s; }
.hero.go .hm-grid line { opacity: 1; }
.hero.done .hm-grid line { opacity: 0; transition-duration: 1.6s; }
.hm-i .st {
  fill: var(--red); opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center;
  transition: opacity .18s, transform .28s cubic-bezier(.3, 1.6, .5, 1);
  transition-delay: calc(400ms + var(--i) * 16ms);
}
.hero.go .hm-i .st { opacity: 1; transform: none; }
.hm-book {
  fill: var(--ink); transform-box: fill-box; transform-origin: 50% 0;
  transform: scaleY(.06); opacity: 0;
  transition: transform .9s cubic-bezier(.2, .9, .2, 1) 1.75s, opacity .2s 1.7s;
}
.hero.go .hm-book { transform: none; opacity: 1; }
.hm-solid { fill: var(--red); opacity: 0; transition: opacity .8s ease .3s; }
.hero.done .hm-solid { opacity: 1; }
.hero-text > * { opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s; }
.hero.go .hero-text > * { opacity: 1; transform: none; }
.hero.go .hero-text > :nth-child(1) { transition-delay: 1.9s; }
.hero.go .hero-text > :nth-child(2) { transition-delay: 2.05s; }
.hero.go .hero-text > :nth-child(3) { transition-delay: 2.25s; }
.hero.go .hero-text > :nth-child(4) { transition-delay: 2.45s; }
.hero h1 { margin-bottom: 24px; font-size: clamp(44px, 6.2vw, 92px); }
.nobr { white-space: nowrap; }
.hero .lead { max-width: 560px; color: var(--ink-2); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; border: 2px solid var(--ink); border-radius: 14px; transform: translateX(-50%); opacity: .5; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: cue 1.8s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-mark { width: min(70vw, 300px); }
  .hero { padding-top: 84px; }
}

/* ---------- «вышитые» svg: появляются стежок за стежком ---------- */
.stitched { display: block; overflow: visible; }
.stitched .st {
  opacity: 0; transform: scale(.25); transform-box: fill-box; transform-origin: center;
  transition: opacity .15s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
  transition-delay: calc(var(--i) * 9ms);
}
.is-in .stitched .st, .stitched.is-in .st { opacity: 1; transform: none; }

/* ---------- появление при прокрутке ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s, transform .9s cubic-bezier(.2, .8, .2, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- главы истории ---------- */
.chapter { padding: clamp(80px, 12vw, 160px) 0; }
.chapter-ink { background: var(--ink); color: var(--linen); }
.chapter-ink .eyebrow { color: var(--blush); }
.chapter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.year .stitched { width: 100%; color: var(--red); }
.chapter-ink .year .stitched { color: var(--red-light); }
.chapter-text p { font-size: clamp(18px, 1.5vw, 21px); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.fact { border-top: 3px solid var(--red); padding-top: 14px; }
.fact b { display: block; font: 700 clamp(36px, 4vw, 56px)/1 var(--serif); color: var(--red); }
.fact span { display: block; font-size: 15px; color: var(--muted); margin-top: 8px; }
.founder { margin: 34px 0 0; padding: 26px 28px; border-left: 4px solid var(--red-light); background: rgba(243, 236, 223, .06); border-radius: 0 var(--radius) var(--radius) 0; }
.founder p { font: 400 italic clamp(19px, 1.6vw, 22px)/1.5 var(--serif); }
.founder footer { font-size: 15px; color: var(--blush); }
@media (max-width: 860px) {
  .chapter-grid { grid-template-columns: 1fr; }
  .year { max-width: 440px; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
}

/* ---------- идея ---------- */
.idea { padding: clamp(90px, 13vw, 170px) 0; background: var(--red); color: var(--linen); }
.idea .eyebrow { color: var(--blush); }
.idea-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 100px); align-items: center; }
.idea-letter .stitched { width: 100%; max-width: 300px; color: var(--linen); }
.idea h2 { font-size: clamp(38px, 5.2vw, 72px); }
.idea p { font-size: clamp(18px, 1.5vw, 21px); }
@media (max-width: 860px) { .idea-grid { grid-template-columns: 1fr; } .idea-letter .stitched { max-width: 160px; } }

/* ---------- анатомия знака ---------- */
.anatomy { padding: clamp(80px, 12vw, 150px) 0; }
.anatomy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 90px); align-items: center; }
.anatomy-mark { width: 100%; max-width: 520px; display: block; margin: 0 auto; overflow: visible; }
.an-grid line { stroke: var(--linen-3); stroke-width: .6; transition: stroke .3s; }
.an-part { transition: opacity .35s, fill .35s; }
.an-stems, .an-diag { fill: var(--red); }
.an-book { fill: var(--ink); }
.an-45 { stroke: var(--linen); stroke-width: 1.3; stroke-dasharray: 4 3; opacity: 0; transition: opacity .3s; }
.anatomy[data-active] .an-part { opacity: .18; }
.anatomy[data-active="book"] .an-book,
.anatomy[data-active="stitch"] .an-diag,
.anatomy[data-active="grid"] .an-part,
.anatomy[data-active="color"] .an-stems,
.anatomy[data-active="color"] .an-diag { opacity: 1; }
.anatomy[data-active="stitch"] .an-45 { opacity: 1; }
.anatomy[data-active="grid"] .an-grid line { stroke: #c4b79f; }
.part {
  display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--linen-3); padding: 20px 0;
  font: inherit; color: inherit; cursor: pointer;
}
.part:hover b, .part.on b { color: var(--red); }
.part span { font-size: 17px; }
.dot { flex: none; width: 16px; height: 16px; border-radius: 4px; margin-top: 5px; }
.dot-ink { background: var(--ink); }
.dot-red { background: var(--red); }
.dot-grid { background: linear-gradient(var(--linen-3) 1px, transparent 1px) 0 0/5px 5px, linear-gradient(90deg, var(--linen-3) 1px, var(--linen) 1px) 0 0/5px 5px; border: 1px solid #c4b79f; }
@media (max-width: 860px) { .anatomy-grid { grid-template-columns: 1fr; } }

/* ---------- книгагудо ---------- */
.kudo { padding: clamp(80px, 11vw, 150px) 0; background: var(--linen-2); }
.kudo-word .stitched { width: 100%; color: var(--red); margin-bottom: clamp(36px, 6vw, 70px); }
.kudo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 70px); align-items: center; }
.card-white { background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); }
.card-white :is(svg, img) { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .kudo-grid { grid-template-columns: 1fr; } }

/* ---------- система ---------- */
.system { padding: clamp(80px, 12vw, 150px) 0; }
.logo-main { background: #fff; border-radius: var(--radius); padding: clamp(36px, 8vw, 110px) clamp(24px, 6vw, 90px); margin: 28px 0 18px; display: flex; justify-content: center; }
.logo-main :is(svg, img) { width: 100%; max-width: 760px; height: auto; }
.logo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.lg-cell { margin: 0; border-radius: var(--radius); padding: 34px 26px 18px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-height: 240px; }
.lg-cell :is(svg, img) { width: 100%; height: auto; max-height: 170px; }
.lg-cell .mark { max-width: 120px; }
.lg-cell .lockup-v { max-width: 210px; }
.lg-wide { grid-column: span 2; }
.lg-white { background: #fff; }
.lg-red { background: var(--red); color: var(--linen); }
.lg-ink { background: var(--ink); color: var(--linen); }
.lg-photo { background: linear-gradient(135deg, rgba(30, 34, 53, .55), rgba(179, 35, 43, .35)), radial-gradient(circle at 20% 30%, #8a7b66, #3d3a40 70%); color: var(--linen); }
.lg-cell figcaption { font: 700 12px var(--caps); letter-spacing: .12em; text-transform: uppercase; opacity: .6; margin-top: 18px; }
@media (max-width: 960px) { .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .logo-grid { grid-template-columns: 1fr; } .lg-wide { grid-column: auto; } }

.jubilee { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: center; background: var(--red); color: var(--linen); border-radius: var(--radius); padding: clamp(28px, 5vw, 60px); margin-top: 18px; }
.jubilee-logo :is(svg, img) { width: 100%; height: auto; }
@media (max-width: 860px) { .jubilee { grid-template-columns: 1fr; } }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(4, minmax(0, .8fr)); gap: 14px; margin-top: 26px; }
.swatch { border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.swatch-chip { background: var(--c); height: 150px; }
.swatch-main .swatch-chip { height: 220px; }
.swatch-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.swatch-body b { font: 700 21px var(--serif); color: var(--ink); }
.swatch-body p { font-size: 14px; line-height: 1.4; margin: 4px 0 10px; color: var(--ink-2); }
.swatch-body code { font: 700 15px var(--sans); color: var(--ink); }
.swatch[style*="F3ECDF"] .swatch-chip { box-shadow: inset 0 0 0 1px var(--linen-3); }
@media (max-width: 1100px) { .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.font-card { background: #fff; border-radius: var(--radius); padding: 30px; }
.font-card-wide { grid-column: span 2; background: var(--linen-2); }
.font-card-wide p { margin: 0; font-size: 18px; }
.font-sample { display: block; font-size: clamp(32px, 4vw, 54px); line-height: 1.2; margin-bottom: 20px; color: var(--red); }
.font-sample.serif { font-family: var(--serif); font-weight: 700; }
.font-sample.sans { font-family: var(--sans); }
@media (max-width: 640px) { .fonts { grid-template-columns: 1fr; } .font-card-wide { grid-column: auto; } }

.specimen { background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 54px); margin-top: 26px; display: grid; gap: clamp(14px, 2vw, 24px); }
.specimen .stitched { height: clamp(26px, 4.6vw, 62px); width: auto; color: var(--ink); }
.specimen .stitched:nth-child(4) { color: var(--red); }
.bands-showcase { display: grid; gap: 10px; margin-top: 26px; border-radius: var(--radius); overflow: hidden; }
.bands-showcase .band { --band-h: 64px; height: var(--band-h); }
.bands-showcase .band-stroke { height: 36px; }
.bands-showcase .band-diamonds { height: 80px; }
.bands-showcase .band-marks { height: 96px; }

/* ---------- генератор имени ---------- */
.name { background: var(--red); color: var(--linen); padding: clamp(80px, 11vw, 150px) 0; }
.name-form { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 34px; }
.name-form input {
  flex: 1 1 260px; max-width: 480px; font: 700 22px var(--sans); padding: 16px 24px;
  border-radius: 999px; border: 2px solid var(--blush); background: rgba(243, 236, 223, .08); color: var(--linen); outline: none;
}
.name-form input::placeholder { color: rgba(243, 236, 223, .55); }
.name-form input:focus { border-color: var(--linen); }
.name-stage { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: clamp(24px, 4vw, 60px); align-items: center; }
.name-canvas { min-height: 140px; background: var(--linen); border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); display: flex; align-items: center; justify-content: center; }
.name-canvas :is(svg, img) { width: 100%; max-height: 220px; overflow: visible; }
.name-canvas .st { fill: var(--red); opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; transition: opacity .15s, transform .25s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(var(--i) * 12ms); }
.name-canvas.on .st { opacity: 1; transform: none; }
.name-canvas .tex { fill: url(#stitchTex); pointer-events: none; }
.bookmark-wrap { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.bookmark { width: 160px; aspect-ratio: 1 / 3.2; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 50px rgba(0, 0, 0, .28); background: var(--ink); }
.bookmark :is(svg, img, canvas) { width: 100%; height: 100%; display: block; }
.name-hint { margin-top: 26px; color: var(--blush); font-size: 15px; }
@media (max-width: 760px) { .name-stage { grid-template-columns: 1fr; } }

/* ---------- 14 библиотек ---------- */
.branches { padding: clamp(80px, 11vw, 150px) 0; background: var(--linen-2); }
.branch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.branch { background: #fff; border-radius: 14px; padding: 22px 26px; display: flex; align-items: center; }
.branch-svg { height: 62px; width: auto; max-width: 100%; }
@media (max-width: 760px) { .branch-grid { grid-template-columns: 1fr; } .branch-svg { height: 52px; } }

/* ---------- носители ---------- */
.life { padding: clamp(80px, 11vw, 150px) 0; }
.mk-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
.mk { margin: 0; grid-column: span 2; display: flex; flex-direction: column; }
.mk-cards, .mk-libcard, .mk-letter, .mk-poster { grid-column: span 3; }
.mk-cert { grid-column: span 6; }
.mk-cards { order: 1; } .mk-libcard { order: 2; } .mk-bookmark { order: 3; } .mk-stamp { order: 4; } .mk-game { order: 5; }
.mk-letter { order: 6; } .mk-poster { order: 7; } .mk-plaque { order: 8; } .mk-badge { order: 9; } .mk-vk { order: 10; } .mk-cert { order: 11; }
.mk-cert .mk-stage { min-height: 380px; }
.mk-stage { flex: 1; background: var(--linen-2); border-radius: var(--radius); padding: clamp(20px, 3vw, 40px); display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 300px; position: relative; overflow: hidden; }
.mk figcaption { font-size: 15px; color: var(--muted); margin-top: 10px; }
@media (max-width: 1000px) { .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mk, .mk-cards, .mk-libcard, .mk-letter, .mk-poster, .mk-cert, .mk-vk { grid-column: span 1; } }
@media (max-width: 640px) { .mk-grid { grid-template-columns: 1fr; } }

/* фото-визуализации */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 17vw, 240px); gap: 14px; margin-top: 30px; }
.ph { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--linen-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.ph:hover img { transform: scale(1.04); }
.ph figcaption { position: absolute; left: 14px; bottom: 12px; font: 700 12px var(--caps); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(30, 34, 53, .62); padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.ph-facade { grid-column: span 2; grid-row: span 2; }
.ph-street { grid-row: span 2; }
.ph-rollup { grid-column: span 2; }
.ph-tote { grid-row: span 2; }
.ph-tote img { object-position: 50% 60%; }
.ph-street img { object-position: 65% 50%; }
.photo-note { margin-top: 12px; }
.mk-title { margin-top: clamp(40px, 6vw, 70px); }
@media (max-width: 760px) {
  .photo-grid { grid-template-columns: 1fr; grid-auto-rows: 230px; }
  .ph-facade, .ph-street, .ph-rollup, .ph-tote { grid-column: auto; grid-row: auto; }
}

.shadow { box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 18px 40px rgba(30, 34, 53, .16); }

/* визитки */
.mk-cards .mk-stage { flex-direction: column; background: var(--ink); }
.bcard { width: min(100%, 330px); aspect-ratio: 90 / 50; border-radius: 8px; container-type: inline-size; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); overflow: hidden; min-height: 0; }
.mk-in { height: 100%; }
.bcard-front { background: var(--red); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg) translateX(-14%); }
.bcard-front :is(svg, img) { height: 26cqw; width: auto; }
.bcard-back { background: var(--linen); transform: rotate(3deg) translateX(10%) translateY(-6%); }
.bcard-back .mk-in { padding: 8cqw; display: grid; grid-template-rows: auto 1fr auto; }
.bcard-logo :is(svg, img) { height: 10cqw; width: auto; display: block; }
.bcard-person { align-self: center; }
.bcard-person b { display: block; font: 700 5.6cqw/1.2 var(--serif); }
.bcard-person span { font-size: 3.8cqw; color: var(--muted); }
.bcard-contacts { display: flex; flex-wrap: wrap; gap: 0 4cqw; font-size: 3.5cqw; color: var(--ink); }

/* читательский билет */
.libcard { width: min(100%, 360px); aspect-ratio: 85.6 / 54; background: #fff; border-radius: 12px; container-type: inline-size; position: relative; overflow: hidden; box-shadow: 0 18px 40px rgba(30, 34, 53, .2); }
.libcard .mk-in { padding: 7cqw 7cqw 0; }
.libcard-top :is(svg, img) { height: 11cqw; width: auto; display: block; }
.libcard-title { font: 700 7.4cqw/1.1 var(--serif); margin-top: 7cqw; }
.libcard-num { font: 700 4cqw var(--caps); letter-spacing: .1em; color: var(--red); margin-top: 2.5cqw; }
.libcard .band { position: absolute; left: 0; right: 0; bottom: 0; height: 9cqw; }

/* закладка */
.mk-bookmark .mk-stage { background: var(--linen-3); }
.bm { width: 110px; aspect-ratio: 1 / 3.4; background: var(--red); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 0 20px; box-shadow: 0 18px 40px rgba(30, 34, 53, .25); transform: rotate(-6deg); }
.bm-mark :is(svg, img) { width: 58px; height: auto; }
.bm .band { width: 100%; height: 28px; }
.bm-text { font: 700 13px/1.25 var(--serif); color: var(--linen); text-align: center; }

/* штамп */
.mk-stamp .mk-stage { background: #f3ebdd; background-image: linear-gradient(90deg, rgba(0, 0, 0, .03) 50%, transparent 50%); background-size: 6px 6px; }
.stamp { width: min(78%, 240px); color: #4b3a7a; opacity: .82; transform: rotate(-12deg); filter: url(#roughen); }

/* бланк */
.letter { width: min(100%, 300px); aspect-ratio: 210 / 297; background: #fff; container-type: inline-size; position: relative; box-shadow: 0 18px 40px rgba(30, 34, 53, .18); overflow: hidden; }
.letter .mk-in { padding: 9cqw 9cqw 0; display: flex; flex-direction: column; }
.letter-head :is(svg, img) { height: 12cqw; width: auto; display: block; }
.letter-contacts { font-size: 2.9cqw; color: var(--muted); margin-top: 4cqw; padding-bottom: 4cqw; border-bottom: 1.2px solid var(--red); }
.letter-lines { display: grid; gap: 3.4cqw; margin-top: 10cqw; }
.letter-lines i, .vk-post i, .m-card i { display: block; height: 1.6cqw; min-height: 4px; background: var(--linen-2); border-radius: 4px; }
.letter-lines i.short, .vk-post i.short, .m-card i.short { width: 60%; }
.letter .band { position: absolute; left: 0; right: 0; bottom: 0; height: 6cqw; }
.libcard, .letter, .game, .plaque, .poster, .cert { min-height: 0; }

/* игра */
.mk-game .mk-stage { background: var(--pine); }
.game { width: min(100%, 230px); aspect-ratio: 63 / 88; background: var(--linen); border-radius: 12px; container-type: inline-size; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); overflow: hidden; }
.game .mk-in { padding: 8cqw; display: flex; flex-direction: column; gap: 5cqw; border: 3cqw solid var(--red); border-radius: 12px; }
.game-head .stitched { width: 100%; color: var(--red); }
.game-q { font: 700 8cqw/1.2 var(--serif); }
.game-a { font-size: 6cqw; color: var(--muted); border-top: 1px dashed var(--linen-3); padding-top: 4cqw; margin-top: auto; }
.game-foot { display: flex; gap: 4cqw; align-items: center; font: 700 5cqw var(--caps); letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.game-foot :is(svg, img) { width: 14cqw; height: auto; border-radius: 3px; }

/* табличка */
.mk-plaque .mk-stage { background: #b9b1a3; background-image: linear-gradient(0deg, rgba(0, 0, 0, .05) 1px, transparent 1px); background-size: 100% 12px; }
.plaque { width: min(100%, 300px); aspect-ratio: 1 / 1.05; background: var(--ink); border-radius: 6px; container-type: inline-size; box-shadow: 0 18px 36px rgba(0, 0, 0, .35); overflow: hidden; }
.plaque .mk-in { padding: 9cqw; display: flex; flex-direction: column; }
.plaque-num .stitched { height: 30cqw; width: auto; color: var(--red-light); }
.plaque-text { margin-top: 7cqw; color: var(--linen); }
.plaque-text b { display: block; font: 700 7.6cqw/1.15 var(--serif); }
.plaque-text span { font-size: 5cqw; color: var(--blush); }
.plaque-logo { margin-top: auto; }
.plaque-logo :is(svg, img) { height: 12cqw; width: auto; display: block; }

/* афиша */
.mk-poster .mk-stage { background: #cfc6b6; }
.poster { width: min(100%, 300px); aspect-ratio: 297 / 420; background: var(--red); container-type: inline-size; display: flex; flex-direction: column; color: var(--linen); box-shadow: 0 18px 40px rgba(30, 34, 53, .3); overflow: hidden; }
.poster .band { height: 9cqw; }
.poster-50 { padding: 10cqw 9cqw 0; }
.poster-50 .stitched { width: 72%; color: var(--linen); }
.poster-title { font: 700 12cqw/1 var(--serif); padding: 3cqw 9cqw 0; }
.poster-sub { font-size: 4.2cqw; padding: 4cqw 9cqw 0; color: var(--blush); }
.poster-logo { margin-top: auto; padding: 0 9cqw 9cqw; }
.poster-logo :is(svg, img) { height: 12cqw; width: auto; display: block; }

/* грамота */
.mk-cert .mk-stage { background: #d9d1c2; }
.cert { width: min(100%, 420px); aspect-ratio: 297 / 210; background: #fff; container-type: inline-size; display: flex; box-shadow: 0 18px 40px rgba(30, 34, 53, .2); overflow: hidden; }
.cert .band { width: 12cqw; height: auto; background-repeat: repeat-y; background-size: 100% auto; transform: none; }
.cert-body { flex: 1; padding: 7cqw; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cert-title .stitched { height: 9cqw; width: auto; color: var(--red); }
.cert-text { font-size: 3.4cqw; color: var(--muted); margin-top: 4cqw; }
.cert-name { font: 700 italic 7cqw var(--serif); margin-top: 2cqw; border-bottom: 1px solid var(--linen-3); padding: 0 6cqw 1cqw; }
.cert-foot { margin-top: auto; }
.cert-foot :is(svg, img) { height: 8cqw; width: auto; }

/* ВКонтакте и телефоны */
.phone { width: 230px; aspect-ratio: 9 / 18.5; background: #111; border-radius: 34px; padding: 10px; box-shadow: 0 24px 50px rgba(0, 0, 0, .3); }
.phone-screen { width: 100%; height: 100%; background: #fff; border-radius: 26px; overflow: hidden; container-type: inline-size; position: relative; }
.vk-cover { height: 30cqw; overflow: hidden; background: var(--red); display: flex; align-items: center; }
.vk-cover .band { height: 42%; width: 100%; }
.vk-avatar { width: 26cqw; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 1.6cqw solid #fff; margin: -13cqw auto 0; position: relative; }
.vk-avatar :is(svg, img) { width: 100%; height: 100%; display: block; }
.vk-name { text-align: center; font: 700 7cqw/1.2 var(--sans); margin-top: 3cqw; }
.vk-sub { text-align: center; font-size: 4.6cqw; color: #818c99; }
.vk-btn { margin: 4cqw 8cqw; background: #2688eb; color: #fff; text-align: center; border-radius: 3cqw; font: 700 5cqw/1 var(--sans); padding: 3.4cqw; }
.vk-post { margin: 2cqw 6cqw; display: grid; gap: 2.6cqw; }
.vk-post-img { background: var(--red); border-radius: 3cqw; padding: 6cqw; }
.vk-post-img :is(svg, img) { width: 100%; height: auto; display: block; }

/* бейдж */
.mk-badge .mk-stage { background: var(--linen-3); }
.badge { width: 150px; aspect-ratio: 54 / 86; background: #fff; border-radius: 10px; container-type: inline-size; box-shadow: 0 18px 40px rgba(30, 34, 53, .22); position: relative; overflow: visible; }
.badge .mk-in { display: flex; flex-direction: column; align-items: center; padding: 14cqw 10cqw 0; overflow: hidden; border-radius: 10px; }
.badge::before { content: ''; position: absolute; top: -60px; left: 50%; width: 18px; height: 70px; margin-left: -9px; background: var(--red); }
.badge-hole { position: absolute; top: 5cqw; left: 50%; width: 20cqw; height: 4cqw; margin-left: -10cqw; border-radius: 4cqw; background: var(--linen-3); }
.badge-logo :is(svg, img) { width: 64cqw; height: auto; display: block; }
.badge-photo { width: 42cqw; aspect-ratio: 1; border-radius: 50%; background: var(--linen-2); margin-top: 8cqw; }
.badge-name { font: 700 9cqw/1.15 var(--serif); margin-top: 5cqw; text-align: center; }
.badge-role { font-size: 6.5cqw; color: var(--muted); }
.badge .band { margin-top: auto; width: calc(100% + 20cqw); height: 9cqw; }

/* ---------- примерка ---------- */
.tryon { padding: clamp(80px, 11vw, 150px) 0; background: var(--linen-2); }
.ba { position: relative; margin-top: 34px; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(30, 34, 53, .16); aspect-ratio: 16 / 7; min-height: 340px; user-select: none; }
.ba-layer { position: absolute; inset: 0; background: #fff; container-type: inline-size; }
.ba-after { clip-path: inset(0 calc(100% - var(--cut, 55%)) 0 0); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 3; margin: 0; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 55%); width: 3px; background: var(--red); z-index: 2; pointer-events: none; }
.ba-handle span { position: absolute; top: 50%; transform: translateY(-50%); font: 700 12px var(--caps); letter-spacing: .1em; text-transform: uppercase; background: var(--red); color: var(--linen); padding: 6px 10px; border-radius: 999px; }
.ba-handle span:first-child { right: 10px; }
.ba-handle span:last-child { left: 10px; }
.site-head { display: flex; align-items: center; gap: 2.4cqw; padding: 2.2cqw 4cqw; }
.site-head.old { background: #e6ffff; border-bottom: 1px solid #e2e8f0; }
.old-logo { height: 6cqw; width: auto; }
.old-name { font: 500 1.45cqw/1.25 var(--sans); color: #0f172a; }
.old-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: .5cqw; font-size: 1.3cqw; color: #0f172a; }
.old-right b { font-size: 2cqw; }
.old-btn { font-style: normal; background: linear-gradient(#ffd400, #ffaa00); border: 1px solid #cc9500; border-radius: 4px; padding: .7cqw 1.6cqw; font-size: 1.3cqw; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.site-head.new { background: var(--linen); }
.new-logo :is(svg, img) { height: 7.4cqw; width: auto; display: block; }
.new-right { color: var(--ink); }
.new-btn { font-style: normal; background: var(--red); color: var(--linen); border-radius: 999px; padding: .8cqw 2cqw; font-size: 1.3cqw; font-weight: 700; }
.site-nav { display: flex; gap: 3.4cqw; padding: 1.4cqw 4cqw; font-size: 1.35cqw; }
.site-nav.old { background: #e6ffff; color: #0f172a; }
.site-nav.new { background: var(--linen); color: var(--ink); font-weight: 700; }
.site-nav.small { font-size: 2.6cqw; padding: 2cqw 5cqw; gap: 4cqw; }
.ba-after .band { height: 1.8cqw; }
.site-body { padding: 2.4cqw 4cqw; display: grid; gap: 2cqw; }
.sb-banner { height: 11cqw; border-radius: 1cqw; }
.site-body.old .sb-banner { background: linear-gradient(90deg, #cfe9f5, #fde7c2); }
.site-body.new .sb-banner { background: var(--red) url(../patterns/books-linen-on-red.svg) repeat-x center/auto 34%; }
.sb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.sb-cards i { height: 8cqw; border-radius: 1cqw; background: #f1f5f9; }
.site-body.new .sb-cards i { background: var(--linen-2); }
@media (max-width: 700px) { .ba { aspect-ratio: auto; height: 300px; } }

.devices { display: flex; gap: clamp(20px, 4vw, 50px); align-items: flex-end; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.device-phone { width: 230px; aspect-ratio: 9 / 18.5; background: #111; border-radius: 34px; padding: 10px; box-shadow: 0 24px 50px rgba(0, 0, 0, .25); }
.device-phone .phone-screen { background: var(--linen); }
.m-head { display: flex; align-items: center; gap: 3cqw; padding: 5cqw 5cqw 4cqw; background: var(--linen); }
.m-burger { width: 7cqw; height: 5cqw; background: linear-gradient(var(--ink) 0 0) top/100% 1cqw no-repeat, linear-gradient(var(--ink) 0 0) center/100% 1cqw no-repeat, linear-gradient(var(--ink) 0 0) bottom/100% 1cqw no-repeat; }
.m-mark :is(svg, img) { width: 10cqw; height: auto; display: block; }
.m-title { font: 700 5.4cqw/1.1 var(--serif); }
.device-phone .band { height: 4cqw; }
.m-hero { margin: 5cqw; background: var(--red); border-radius: 4cqw; padding: 7cqw 6cqw; }
.m-hero :is(svg, img) { width: 100%; height: auto; display: block; }
.m-card { margin: 0 5cqw 4cqw; background: #fff; border-radius: 3cqw; padding: 5cqw; display: grid; gap: 3cqw; }
.device-tab { width: min(100%, 520px); aspect-ratio: 4 / 3; background: #111; border-radius: 26px; padding: 14px; box-shadow: 0 24px 50px rgba(0, 0, 0, .25); }
.tab-screen { width: 100%; height: 100%; background: #fff; border-radius: 12px; overflow: hidden; container-type: inline-size; }
.t-head { background: var(--linen); padding: 4cqw 5cqw; }
.t-head :is(svg, img) { height: 9cqw; width: auto; display: block; }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; padding: 4cqw 5cqw; }
.t-grid i { height: 16cqw; background: var(--linen-2); border-radius: 2cqw; }
.t-grid i:first-child { grid-column: span 2; background: var(--red) url(../patterns/books-linen-on-red.svg) repeat-x center/auto 30%; }

/* ---------- загрузки ---------- */
.download { background: var(--ink); color: var(--linen); padding: clamp(80px, 11vw, 150px) 0; }
.dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.dl { position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none; background: var(--ink-2); border-radius: var(--radius); padding: 28px 26px 66px; transition: background .2s, transform .2s; }
.dl:hover { background: var(--red); transform: translateY(-3px); }
.dl b { font: 700 24px var(--serif); }
.dl span { font-size: 15px; opacity: .8; }
.dl i { position: absolute; left: 26px; bottom: 24px; font: 700 13px var(--caps); letter-spacing: .12em; font-style: normal; border: 1.5px solid currentColor; border-radius: 999px; padding: 5px 12px; }
.dl-more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dl-more a { text-decoration: none; font-size: 15px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid rgba(243, 236, 223, .35); }
.dl-more a:hover { background: var(--red); border-color: var(--red); }
.ready { margin: 34px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 30px; }
.ready li { padding-left: 30px; position: relative; font-size: 17px; }
.ready li::before { content: ''; position: absolute; left: 0; top: 9px; width: 14px; height: 8px; border-left: 3px solid var(--red-light); border-bottom: 3px solid var(--red-light); transform: rotate(-45deg); }
@media (max-width: 960px) { .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dl-grid, .ready { grid-template-columns: 1fr; } }

/* ---------- подвал ---------- */
.footer { background: var(--ink); color: var(--linen); }
.footer-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; padding-top: 56px; padding-bottom: 64px; align-items: start; }
.footer-logo :is(svg, img) { width: 100%; max-width: 360px; height: auto; }
.footer-text { font-size: 16px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- без анимаций, если пользователь просил ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  [data-reveal], .hero-text > *, .stitched .st, .hm-i .st, .hm-book, .name-canvas .st { opacity: 1 !important; transform: none !important; }
}

/* режим ?static: без анимаций (скриншоты, печать) */
html.static *, html.static *::before, html.static *::after { transition: none !important; animation: none !important; }
html.static .topbar { display: none; }
