/* Вариант 3 «Акварель». Основа — стиль Cosmos (styles.refero.design): белый холст-«стена галереи»,
   коллаж из изображений обрамляет текст, сетка из карточек с картинками. Поверх — акварель:
   пятна краски рисует скрипт (слои полупрозрачных деформированных многоугольников),
   фото с рваным краем акварельной бумаги, мазки кистью под заголовками, выкраски вместо тегов. */
:root {
  --paper: #ffffff;
  --ink: #2a2346;          /* текст: глубокий индиго, как тени на картинах */
  --ink-soft: #5d5872;
  --violet: #5b3fc4;       /* кнопки и ссылки — от фиолетового меню нынешнего сайта */
  --gold: #e9b13a;         /* золото логотипа */
  --gold-deep: #a8730c;    /* рукописные подписи на белом */
  --line: #ebe7f3;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(72px, 9vw, 128px);
  /* мазки кистью для подчёркиваний */
  --stroke-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .5' numOctaves='2' seed='4'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='7'/%3E%3C/filter%3E%3Cpath d='M6 17 C70 9 150 21 294 12' stroke='%23f2c24b' stroke-width='17' fill='none' stroke-linecap='round' opacity='.75' filter='url(%23r)'/%3E%3C/svg%3E");
  --stroke-aqua: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .5' numOctaves='2' seed='9'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='7'/%3E%3C/filter%3E%3Cpath d='M5 13 C90 20 180 8 295 16' stroke='%2362cfc4' stroke-width='17' fill='none' stroke-linecap='round' opacity='.7' filter='url(%23r)'/%3E%3C/svg%3E");
  --stroke-rose: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .5' numOctaves='2' seed='2'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='7'/%3E%3C/filter%3E%3Cpath d='M6 15 C80 10 200 20 294 13' stroke='%23f290bf' stroke-width='17' fill='none' stroke-linecap='round' opacity='.7' filter='url(%23r)'/%3E%3C/svg%3E");
  --stroke-lilac: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .5' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='7'/%3E%3C/filter%3E%3Cpath d='M5 16 C100 9 190 19 295 11' stroke='%23b08ff3' stroke-width='17' fill='none' stroke-linecap='round' opacity='.7' filter='url(%23r)'/%3E%3C/svg%3E");
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1320px; margin: 0 auto; padding-inline: var(--gutter); position: relative; }
section { position: relative; }

/* холст акварели позади содержимого раздела */
.wash, .trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wash { z-index: 0; }
.trail { z-index: 1; }
.over { position: relative; z-index: 2; }

/* фото с краем акварельной бумаги: маску рисует скрипт */
.wc { margin: 0; position: relative; }
.wc img { width: 100%; height: 100%; object-fit: cover; }

.hand { font-family: var(--hand); font-weight: 600; color: var(--gold-deep); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.1; }
.h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; }
.stroke { background: var(--stroke-gold) no-repeat 0 100% / 100% .62em; padding-inline: .06em; }
.stroke.aqua { background-image: var(--stroke-aqua); }
.stroke.rose { background-image: var(--stroke-rose); }
.stroke.lilac { background-image: var(--stroke-lilac); }

.btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 15px 28px; font-weight: 600; font-size: 15px; letter-spacing: .02em; transition: transform .25s ease, box-shadow .25s ease, background .25s; }
.btn.primary { background: var(--violet); color: #fff; box-shadow: 0 10px 24px -12px var(--violet); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px var(--violet); }
.btn.soft { border: 1.5px solid var(--ink); color: var(--ink); }
.btn.soft:hover { background: var(--ink); color: #fff; }
.link { font-weight: 600; color: var(--violet); display: inline-flex; gap: 8px; align-items: center; }
.link:hover { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Шапка: логотип на белом ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 16px; flex: none; }
.brand img { width: 68px; height: 68px; }
.brand-name { display: grid; line-height: 1.15; }
.brand-name b { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.brand-name span { font-family: var(--hand); font-size: 21px; color: var(--gold-deep); }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; font-weight: 500; }
.nav a { padding: 6px 2px; background: no-repeat 0 100% / 0 .5em; transition: background-size .35s ease; background-image: var(--stroke-lilac); }
.nav a:hover { background-size: 100% .5em; }
.lang { display: flex; gap: 4px; font-size: 14px; font-weight: 600; }
.lang a { padding: 6px 10px; border-radius: 999px; }
.lang a[aria-current] { background: #f3effc; color: var(--violet); }
.burger { display: none; margin-left: auto; border: 1.5px solid var(--ink); background: none; border-radius: 999px; padding: 9px 18px; font: 600 14px var(--sans); color: var(--ink); }

/* ---------- Герой: коллаж обрамляет текст ---------- */
.hero { overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: center; padding-block: clamp(40px, 5vw, 72px) clamp(56px, 6vw, 88px); }
.portrait { aspect-ratio: 3 / 4; }
.portrait img { object-position: 50% 50%; }
.hero-copy { text-align: center; display: grid; gap: 26px; justify-items: center; }
.hero-copy h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 5.6vw, 84px); line-height: 1.04; letter-spacing: -.015em; text-wrap: balance; }
.paint-text { font-style: italic; font-weight: 500; color: var(--violet); }
.paint-text.on { color: transparent; -webkit-background-clip: text; background-clip: text; background-size: cover; background-position: center; }
.hero-copy p { margin: 0; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-soft); max-width: 30ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.stack { display: grid; gap: 22px; }
.canvas-art { margin: 0; background: #fff; padding: 10px; box-shadow: 0 18px 40px -22px rgba(42, 35, 70, .55); transition: transform .5s ease; }
.stack .canvas-art:nth-child(1) { transform: rotate(-3deg); width: 82%; justify-self: end; }
.stack .canvas-art:nth-child(2) { transform: rotate(2.5deg); width: 74%; }
.stack .canvas-art:hover { transform: rotate(0) scale(1.03); }
.canvas-art figcaption { font-family: var(--hand); font-size: 20px; color: var(--ink-soft); padding-top: 6px; text-align: center; }

/* ---------- Приветствие ---------- */
.welcome { padding-block: var(--section) 0; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.welcome-text { display: grid; gap: 22px; min-width: 0; }
.welcome-text p { margin: 0; color: var(--ink-soft); }
.welcome-text p.lead { color: var(--ink); font-size: 19px; }
.welcome-photo { aspect-ratio: 4 / 3; }
.welcome-photo img { object-position: 50% 50%; }
.note { display: flex; gap: 14px; align-items: center; padding-top: 6px; }
.note img { width: 44px; height: 44px; flex: none; }

/* ---------- Три Храма ---------- */
.temples { margin-top: var(--section); padding-block: clamp(64px, 8vw, 112px); }
.sec-head { display: grid; gap: 10px; justify-items: center; text-align: center; margin-bottom: clamp(36px, 5vw, 64px); }
.temple-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.temple { display: grid; grid-template-rows: auto 1fr; gap: 18px; }
.temple .wc { aspect-ratio: 4 / 3.3; }
.temple .tx { display: flex; flex-direction: column; gap: 10px; }
.temple h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.15; }
.temple .via { font-family: var(--hand); font-size: 22px; color: var(--gold-deep); line-height: 1.1; }
.temple p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.temple .link { margin-top: auto; padding-top: 6px; }

/* ---------- Галерея ---------- */
.gallery { padding-block: var(--section) 0; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 40px; }
.row-head .h2 { flex: 1 1 420px; }
.row-head .side { flex: 1 1 320px; max-width: 520px; color: var(--ink-soft); display: grid; gap: 10px; }
.row-head .side p { margin: 0; }
.masonry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.masonry .canvas-art { margin: 0; display: grid; grid-template-rows: auto auto; }
.masonry .canvas-art img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.masonry .canvas-art:nth-child(odd):hover { transform: rotate(-1deg) scale(1.02); }
.masonry .canvas-art:nth-child(even):hover { transform: rotate(1deg) scale(1.02); }
.masonry figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; text-align: left; font-family: var(--sans); font-size: 14px; color: var(--ink); padding-top: 10px; }
.masonry figcaption small { font-family: var(--hand); font-size: 18px; color: var(--gold-deep); white-space: nowrap; }

.palette { margin-top: 40px; display: grid; gap: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.swatches a { flex: 1 1 auto; justify-content: center; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: #faf8fd; font-size: 15px; transition: background .2s, transform .2s; }
.swatches a::before { content: ""; width: 30px; height: 30px; flex: none; background: var(--sw, var(--gold)) center / contain no-repeat; border-radius: 50%; }
.swatches a:hover { background: #f1ecfb; transform: translateY(-2px); }

/* ---------- Единство: розетка на акварели ---------- */
.unity { margin-top: var(--section); padding-block: clamp(64px, 8vw, 120px); }
.unity-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.rosette { aspect-ratio: 1; width: 100%; max-width: 460px; justify-self: center; }
.rosette canvas { width: 100%; height: 100%; display: block; }
.quote { display: grid; gap: 22px; }
.quote p { margin: 0; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 36px); line-height: 1.3; }
.quote p.one { font-style: italic; font-weight: 500; font-size: clamp(34px, 3.8vw, 54px); }

/* ---------- Обо мне ---------- */
.about { padding-block: var(--section) 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.about-photo { aspect-ratio: 5 / 4; }
.about-photo img { object-position: 30% 50%; }
.about-text { display: grid; gap: 20px; min-width: 0; }
.about-text p { margin: 0; color: var(--ink-soft); }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.roles li { background: #faf8fd; border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; }
.roles b { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.roles span { font-size: 14px; color: var(--ink-soft); }

/* ---------- Подвал ---------- */
footer { margin-top: var(--section); position: relative; overflow: hidden; }
footer .wrap { padding-block: clamp(80px, 9vw, 130px) 32px; display: grid; gap: 48px; }
footer .home-message { margin: 0; font-family: var(--serif); font-size: clamp(44px, 6.4vw, 96px); line-height: 1.05; text-align: center; text-wrap: balance; }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.foot-card { background: rgba(255, 255, 255, .82); border-radius: 18px; padding: 24px 26px; display: grid; gap: 6px; align-content: start; }
.foot-card h4 { margin: 0 0 6px; font-family: var(--hand); font-weight: 600; font-size: 26px; color: var(--gold-deep); }
.foot-card p { margin: 0; }
.foot-card a:hover { color: var(--violet); }
.sel { user-select: all; font-weight: 600; }
.legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-soft); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: inline-block; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-copy { grid-column: 1 / -1; order: -1; }
  .welcome-grid, .unity-grid, .about-grid { grid-template-columns: 1fr; }
  .welcome-photo { aspect-ratio: 4 / 3; }
  .temple-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .foot-grid { grid-template-columns: 1fr; }
  .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .rosette { max-width: 340px; }
}
@media (max-width: 560px) {
  .top .wrap { min-height: 76px; gap: 12px; }
  .brand img { width: 52px; height: 52px; }
  .brand-name b { font-size: 18px; }
  .brand-name span { font-size: 18px; }
  .lang { display: none; }
  .roles { grid-template-columns: 1fr; }
  .masonry figcaption { flex-direction: column; gap: 0; }
  .stack .canvas-art:nth-child(1), .stack .canvas-art:nth-child(2) { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
