/* ---------- основа ---------- */
:root {
  --wall: #eef0ed;
  --paper: #f8f9f7;
  --ink: #15181b;
  --muted: #5b6168;
  --line: #d1d6d2;
  --accent: #2037b0;
  --accent-dark: #162a8a;
  --danger: #a12a1b;
  --serif: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --s: 3.1px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
p { margin: 0 0 1em; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: .6em 1em; text-decoration: none;
}
.skip:focus { left: 8px; }

h1, h2 { font-family: var(--serif); font-weight: 300; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.3rem, 4.8vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 400; }

.lead { font-family: var(--serif); font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.5; color: #2a2f34; max-width: 38em; }
.lead-s { color: var(--muted); max-width: 40em; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; }

.section { padding: clamp(48px, 7vw, 96px) var(--gutter); }
.section.tight-bottom { padding-bottom: clamp(8px, 2vw, 24px); }
.section.tight-top { padding-top: clamp(24px, 3vw, 40px); }

/* ---------- кнопки и ссылки ---------- */
.btn {
  display: inline-block; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--accent); color: #fff; font: 500 1rem/1 var(--sans);
  padding: 1em 1.5em; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: default; }

.link { color: var(--accent); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-top: 2rem; }

/* ---------- шапка ---------- */
.site-header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem 2rem;
  padding: 22px var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
}
.brand { white-space: nowrap; font-family: var(--serif); font-size: 1.45rem; font-weight: 400; text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; gap: 1.75rem; justify-content: flex-end; }
.nav a { text-decoration: none; padding: .3em 0; border-bottom: 1px solid transparent; font-size: .97rem; }
.nav a:hover { border-bottom-color: var(--muted); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.lang { display: flex; gap: .25rem; }
.lang button {
  font: 500 .85rem/1 var(--sans); border: 0; background: none; color: var(--muted);
  padding: .5em .6em; cursor: pointer; border-bottom: 1px solid transparent;
}
.lang button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.menu-btn {
  display: none; font: 500 .95rem/1 var(--sans); background: none; border: 1px solid var(--ink);
  border-radius: 2px; padding: .65em 1em; cursor: pointer; color: var(--ink);
}

/* ---------- главная ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px); align-items: end;
}
.hero-text h1 { max-width: 12em; }
.hero-art { margin: 0; justify-self: end; width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.hero-art figcaption { align-self: flex-start; }
.hero-art .art-box { animation: hang .9s ease-out both; }

@keyframes hang {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }
.head-row h2 { margin: 0; }

.series-list { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.series-row {
  display: grid; grid-template-columns: 88px minmax(0, 1.1fr) minmax(0, 2fr) auto;
  gap: 1.5rem; align-items: center; padding: 1.25rem 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.series-row:hover .series-name { color: var(--accent); }
.series-row .thumb { display: block; width: 88px; height: 88px; overflow: hidden; }
.series-row .thumb svg { display: block; width: 100%; height: 100%; }
.series-name { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; transition: color .15s; }
.series-desc { color: var(--muted); font-size: .96rem; }
.series-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }

.about-band { background: var(--paper); }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 6vw, 96px); align-items: start; }
.about-grid h2 { margin: 0; font-size: clamp(1.9rem, 3.2vw, 2.8rem); font-weight: 300; }

.cta .lead { margin-bottom: 1.75rem; }

/* ---------- картины ---------- */
.art {
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 24, 27, .22), 0 14px 30px -16px rgba(21, 24, 27, .4);
}

button.art, .work-open {
  display: block; padding: 0; border: 0; cursor: zoom-in; font: inherit; color: inherit;
}

.art-box { display: block; aspect-ratio: var(--ar); width: min(100%, calc(var(--maxh, 70vh) * var(--ar))); }
.art-box svg, .art-box img { display: block; width: 100%; height: 100%; }

.wall { display: flex; flex-wrap: wrap; gap: 56px clamp(32px, 4vw, 56px); align-items: flex-end; }

.work { margin: 0; width: max(calc(var(--w) * var(--s)), 9.5rem); max-width: 100%; }
.work-open { width: max(calc(var(--w) * var(--s)), 104px); max-width: 100%; }
.work-open svg, .work-open img { display: block; width: 100%; height: auto; }
.work-open:hover { box-shadow: 0 1px 2px rgba(21, 24, 27, .25), 0 20px 36px -16px rgba(21, 24, 27, .5); }

figcaption { display: flex; flex-direction: column; gap: .15rem; margin-top: .9rem; min-height: 4.6rem; }
.work-title { font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.work-meta { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.work-status { font-size: .8rem; color: var(--muted); }
.work-status::before { content: ''; display: inline-block; width: .55em; height: .55em; border-radius: 50%; margin-right: .5em; background: var(--muted); }
.work-status-sold::before { background: #9a4a2f; }
.work-status-reserved::before { background: #c79a2c; }

/* ---------- фильтры ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1.25rem 2.5rem; margin-bottom: 1.25rem; }
.seg { display: flex; gap: 1.25rem; }
.seg button {
  font: 400 1rem/1 var(--sans); background: none; border: 0; border-bottom: 1px solid transparent;
  padding: .4em 0; cursor: pointer; color: var(--muted);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.sel { display: flex; align-items: baseline; gap: .6rem; font-size: .95rem; color: var(--muted); }
.sel select {
  font: 400 1rem var(--sans); color: var(--ink); background: transparent; border: 0;
  border-bottom: 1px solid var(--ink); padding: .3em 1.4em .3em 0; border-radius: 0; cursor: pointer;
}
.chk { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; }
.chk input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

.count { color: var(--muted); font-size: .9rem; margin: 0 0 2.5rem; }
.empty { color: var(--muted); padding: 3rem 0; }

.series-head { margin-bottom: 2.5rem; scroll-margin-top: 24px; }
.series-head .count { margin: .5rem 0 0; }
.series-block + .series-block { border-top: 1px solid var(--line); }

/* ---------- страницы художника, блога, контактов ---------- */
.artist-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.portrait { margin: 0; position: sticky; top: 24px; }
.portrait-box {
  aspect-ratio: 4 / 5; display: grid; place-items: center; text-align: center; padding: 2rem;
  background: linear-gradient(160deg, #dfe3df, #cdd3ce); color: var(--muted); font-size: .95rem;
}
.artist-text h2 { margin-top: 2.5rem; }
.artist-text .lead { margin-bottom: 1.25em; }

.timeline { margin: 0 0 1rem; }
.timeline div { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.timeline div:last-child { border-bottom: 1px solid var(--line); }
.timeline dt { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline dd { margin: 0; }

.posts { max-width: 56rem; }
.post { display: grid; grid-template-columns: 11rem 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post time { color: var(--muted); font-size: .92rem; padding-top: .5rem; }
.post h2 { font-size: 1.6rem; margin-bottom: .4em; }
.post details summary { cursor: pointer; color: var(--accent); width: fit-content; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.post details[open] summary { margin-bottom: 1rem; }
.post details p { max-width: 38em; }

.contacts-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contacts-grid h2 { margin-top: 0; }
.contacts-grid > div > h2:not(:first-child), .contacts-grid ol + h2 { margin-top: 2.5rem; }
.steps { margin: 0 0 1rem; padding-left: 1.4rem; max-width: 30em; }
.steps li { padding-left: .4rem; margin-bottom: .8rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: .4rem; }

.prose { max-width: 42rem; }
.prose h1 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }

/* ---------- форма ---------- */
.req-form { display: grid; gap: 1.25rem; max-width: 34rem; margin-top: 1.5rem; }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; font: 400 1rem var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 2px; padding: .8em .9em;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field.check label { display: flex; gap: .65rem; align-items: flex-start; color: var(--ink); font-size: .9rem; }
.field.check input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.err { color: var(--danger); font-size: .88rem; margin: .35rem 0 0; }
.err:empty { display: none; }
.form-status { color: var(--danger); margin: 0; font-size: .92rem; }
.form-status:empty { display: none; }
.sent { padding: 1.25rem 1.4rem; background: var(--paper); border-left: 3px solid var(--accent); max-width: 34rem; margin-top: 1.5rem; }

/* ---------- окна ---------- */
dialog {
  border: 0; padding: 0; background: var(--paper); color: var(--ink);
  width: min(1120px, 94vw); max-height: 92vh; overflow: auto; margin: auto;
}
dialog[open] { animation: dlg .18s ease-out; }
dialog::backdrop { background: rgba(21, 24, 27, .66); }
@keyframes dlg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#request-dialog { width: min(620px, 94vw); }

.dlg-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(248, 249, 247, .92); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.dlg-close:hover { background: #fff; }

.detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.detail-art { display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); background: var(--wall); }
.detail-info { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.detail-info h2 { margin-bottom: .8em; padding-right: 2rem; }
.facts { margin: 0 0 1.25rem; }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts a { color: var(--accent); }
.note { font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; margin-bottom: 1.5rem; }
.fine { color: var(--muted); font-size: .86rem; margin: 1.25rem 0 0; }

.req { padding: clamp(24px, 4vw, 44px); }
.req h2 { padding-right: 2.5rem; margin-bottom: .4em; }
.req-work { margin: 1rem 0 0; }

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px var(--gutter) 48px; margin-top: 24px; color: var(--muted); font-size: .92rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- адаптивность ---------- */
@media (max-width: 1000px) {
  :root { --s: 2.3px; }
  .hero, .about-grid, .contacts-grid, .artist-grid { grid-template-columns: 1fr; }
  .hero { align-items: start; }
  .hero-art { justify-self: start; align-items: flex-start; }
  .portrait { position: static; max-width: 22rem; }
  .series-row { grid-template-columns: 72px 1fr auto; }
  .series-row .thumb { width: 72px; height: 72px; }
  .series-desc { grid-column: 2 / -1; grid-row: 2; }
  .detail { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .brand { font-size: 1.25rem; }
  .site-header { grid-template-columns: 1fr auto auto; }
  .menu-btn { display: inline-block; order: 2; }
  .lang { order: 3; }
  .nav {
    display: none; grid-column: 1 / -1; order: 4; flex-direction: column; gap: 0;
    border-top: 1px solid var(--line);
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: .9em 0; border-bottom: 1px solid var(--line); }
  .post { grid-template-columns: 1fr; gap: .25rem; }
  .post time { padding-top: 0; }
  .timeline div { grid-template-columns: 4rem 1fr; }
}

@media (max-width: 520px) {
  :root { --s: 1.7px; }
  .wall { gap: 40px 24px; }
  .facts div { grid-template-columns: 6rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art .art-box, dialog[open] { animation: none; }
  .btn, .series-name { transition: none; }
}

/* ---------- демо-плашка и подзаголовок художника ---------- */
.demo-banner { background: #f5e6a8; color: #3a3210; font-size: .88rem; line-height: 1.45; text-align: center; padding: .55rem var(--gutter); border-bottom: 1px solid #d9c670; }
.role { font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.35rem); color: var(--muted); margin: 0; }
