/* MASHIKA — стили. Версия 1.1 */

:root {
  --bg: #0f0d0c;
  --bg-2: #171413;
  --ink: #f3ece1;
  --muted: #a89f93;
  --accent: #e3a33a;
  --accent-2: #d2453f;
  --line: rgba(243, 236, 225, .14);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; line-height: 1.05; margin: 0; }
::selection { background: var(--accent); color: var(--bg); }

/* Фактура холста поверх всего */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Свой курсор — только для мыши */
.cursor { display: none; }
@media (pointer: fine) {
  .cursor {
    display: block; position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
    width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    background: var(--ink); mix-blend-mode: difference;
    transition: width .25s, height .25s, margin .25s, opacity .25s;
    opacity: 0;
  }
  .cursor.on { opacity: 1; }
  .cursor.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
}

/* Шапка */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
.top.scrolled { background: rgba(15, 13, 12, .72); backdrop-filter: blur(12px); padding-block: 12px; }
.logo { font-family: var(--serif); font-size: 22px; letter-spacing: .32em; font-weight: 500; }
.top nav { display: flex; gap: clamp(14px, 3vw, 36px); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.top nav a { position: relative; color: var(--muted); transition: color .3s; }
.top nav a:hover { color: var(--ink); }
.top nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .35s;
}
.top nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Первый экран */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
}
#paint {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  filter: blur(28px) saturate(1.25); transform: scale(1.12);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(15,13,12,.55) 75%, var(--bg) 100%);
}
.hero-inner { text-align: center; padding: 0 var(--gutter); }
.kicker {
  margin: 0 0 18px; font-size: 13px; letter-spacing: .4em; text-transform: uppercase; color: var(--ink); opacity: .8;
}
.name {
  font-size: clamp(64px, 17vw, 260px); font-weight: 300; letter-spacing: .06em;
  line-height: .9; mix-blend-mode: difference; white-space: nowrap;
}
.name .ch {
  display: inline-block; opacity: 0; filter: blur(18px);
  transform: translateY(.25em) scale(1.1);
  animation: appear 1.4s cubic-bezier(.2, .7, .1, 1) forwards;
  animation-delay: calc(.25s + var(--i) * .09s);
}
@keyframes appear { to { opacity: 1; filter: blur(0); transform: none; } }
.lead {
  margin: 22px auto 34px; max-width: 34em; font-size: clamp(16px, 2vw, 20px);
  opacity: 0; animation: fade 1.2s 1.2s forwards;
}
.hero .btn { opacity: 0; animation: fade 1.2s 1.45s forwards; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.btn {
  display: inline-block; padding: 14px 30px; border: 1px solid var(--ink); border-radius: 999px;
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat left / 0 100%;
  transition: background-size .45s cubic-bezier(.6, 0, .2, 1), color .45s;
}
.btn:hover { background-size: 100% 100%; color: var(--bg); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; width: 24px; height: 40px; margin-left: -12px;
  border: 1px solid var(--line); border-radius: 12px;
}
.scroll-hint span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--ink); animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Бегущая строка */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; }
.marquee-track {
  display: flex; gap: 40px; width: max-content; align-items: center;
  font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 48px); color: var(--muted);
  animation: marquee 40s linear infinite;
}
.marquee i { font-style: normal; font-size: .5em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Секции */
section { padding: clamp(80px, 12vw, 160px) var(--gutter); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2, .about h2 { font-size: clamp(48px, 8vw, 110px); }
.section-head p { color: var(--muted); max-width: 22em; margin: 0; }

/* Появление при прокрутке */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s, transform 1s cubic-bezier(.2, .7, .1, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Галерея: «кирпичная» раскладка колонками */
.grid { columns: 3 320px; column-gap: clamp(18px, 2.4vw, 36px); }
.card {
  break-inside: avoid; margin: 0 0 clamp(28px, 4vw, 56px); cursor: pointer;
  opacity: 0; transform: translateY(60px);
  transition: opacity 1s, transform 1s cubic-bezier(.2, .7, .1, 1);
  transition-delay: var(--d, 0s);
}
.card.in { opacity: 1; transform: none; }
.card-frame {
  position: relative; overflow: hidden; border-radius: 3px; background: var(--bg-2);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2, .7, .1, 1), box-shadow .5s;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .8);
  will-change: transform;
}
.card:hover .card-frame { box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .9); transition-duration: .15s, .5s; }
.card-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .28), transparent 45%);
  mix-blend-mode: soft-light;
}
.card:hover .card-frame::after { opacity: 1; }
.card-frame svg, .card-frame img { display: block; width: 100%; height: auto; transition: transform 1.2s cubic-bezier(.2, .7, .1, 1); }
.card:hover .card-frame svg, .card:hover .card-frame img { transform: scale(1.04); }
.card-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.card-cap h3 { font-size: 26px; font-style: italic; }
.card-cap span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card .status { margin: 2px 0 0; }

.status { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.status::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #6fbf73; vertical-align: 1px; }
.status.reserved::before { background: var(--accent); }
.status.sold::before { background: var(--accent-2); }

/* О художнице */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; background: var(--bg-2); }
.about-art { border-radius: 50% 50% 4px 4px; overflow: hidden; aspect-ratio: 4 / 5; }
.about-art svg { width: 100%; height: 100%; display: block; }
.about-text p { color: #d8cfc2; max-width: 34em; }
.about-text h2 { margin-bottom: 28px; }
blockquote {
  margin: 36px 0 0; padding-left: 24px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.3;
}

/* Контакты */
.contact { text-align: center; }
.contact-title { font-size: clamp(52px, 10vw, 150px); }
.contact-title em { color: var(--accent); }
.contact-note { color: var(--muted); max-width: 32em; margin: 24px auto 48px; }
.contact-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.contact-links a {
  display: block; padding: 14px 26px; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .3s, background .3s, color .3s;
}
.contact-links a:hover { border-color: var(--accent); background: var(--accent); color: var(--bg); }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 28px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}

/* Просмотр картины */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 9, 8, .94); color: var(--ink);
}
.viewer[open] { display: grid; place-items: center; animation: fade .4s; }
.viewer::backdrop { background: transparent; }
.v-figure {
  margin: 0; display: grid; grid-template-columns: auto 300px; gap: 48px; align-items: center;
  max-width: calc(100vw - 2 * var(--gutter)); padding: 0 var(--gutter);
}
.v-art { display: flex; justify-content: center; }
.v-art svg, .v-art img {
  display: block; max-height: 82vh; max-width: min(62vw, 900px); width: auto; height: auto;
  box-shadow: 0 50px 100px -40px #000; animation: zoom .6s cubic-bezier(.2, .7, .1, 1);
}
@keyframes zoom { from { transform: scale(.94); opacity: 0; } }
.v-info h3 { font-size: 48px; font-style: italic; margin-bottom: 12px; }
.v-info p { color: var(--muted); margin: 0 0 10px; }
.v-info .btn { margin-top: 24px; }
.v-close, .v-nav {
  position: absolute; z-index: 2; background: none; border: 0; color: var(--ink); cursor: pointer;
  font: 300 44px/1 var(--serif); padding: 12px 18px; opacity: .7; transition: opacity .3s;
}
.v-close:hover, .v-nav:hover { opacity: 1; }
.v-close { top: 12px; right: 12px; }
.v-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.v-next { right: 4px; top: 50%; transform: translateY(-50%); }

.noscript { text-align: center; color: var(--muted); }

/* Подсказка «оставьте мазок» */
.hero { cursor: crosshair; }
.paint-hint {
  position: absolute; left: var(--gutter); bottom: 34px; margin: 0;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
  opacity: 0; animation: fade 1.2s 2.2s forwards;
}
.paint-hint.gone { transition: opacity .8s; opacity: 0 !important; animation: none; }
@media (max-width: 820px) { .paint-hint { left: 0; right: 0; bottom: 84px; text-align: center; } }

/* Фильтр галереи */
.filter { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.filter button {
  border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  background: none; color: var(--muted); font: 400 12px var(--sans); letter-spacing: .14em; text-transform: uppercase;
  transition: background .3s, color .3s;
}
.filter button.on { background: var(--ink); color: var(--bg); }
.card.hidden { display: none; }

/* Примерка в интерьере: 1% ширины комнаты = 4 см */
.link-btn {
  display: inline-block; margin: 6px 0 0; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: 400 15px var(--sans); text-decoration: underline; text-underline-offset: 4px;
}
.room {
  position: relative; width: min(62vw, 900px, 128vh); aspect-ratio: 16 / 10; overflow: hidden; border-radius: 3px;
  background: linear-gradient(180deg, #e4ddd2, #d6cdbf 84%, #b49a7c 84%, #a58a6b);
  box-shadow: 0 50px 100px -40px #000; animation: zoom .6s cubic-bezier(.2, .7, .1, 1);
}
.room::before { /* мягкий свет сверху */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255, 250, 240, .7), transparent 60%);
}
.room-art { position: absolute; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .2); }
.room-art svg, .room-art img {
  width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
  object-fit: cover; box-shadow: none !important; animation: none !important;
}
.v-art .room-sofa {
  position: absolute; left: 22.5%; width: 55%; height: auto; bottom: 13%;
  max-width: none; max-height: none; box-shadow: none; animation: none;
}
.room-note { position: absolute; right: 12px; bottom: 8px; margin: 0; font-size: 11px; color: rgba(40, 30, 20, .6); }
@media (max-width: 820px) { .room { width: 100%; } }

/* Пасхалка-посвящение */
.gift {
  position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; text-align: center;
  background: rgba(15, 13, 12, .55); backdrop-filter: blur(6px); cursor: pointer; animation: fade .8s;
}
.gift[hidden] { display: none; }
.gift-text { margin: 0; font: 300 clamp(48px, 9vw, 120px)/1 var(--serif); }
.gift-text em { color: var(--accent); }
.gift-close { margin-top: 28px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* Телефоны и планшеты */
@media (max-width: 820px) {
  .top nav a:not(:last-child) { display: none; }
  .about { grid-template-columns: 1fr; }
  .about-art { max-width: 420px; }
  .v-figure { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .v-art svg, .v-art img { max-width: 100%; max-height: 60vh; }
  .v-info h3 { font-size: 34px; }
}

/* Уважение к настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
