:root {
  --page: #f6f8f8;
  --surface: #ffffff;
  --ink: #263238;
  --muted: #66777f;
  --line: #dbe4e5;
  --accent: #557f8c;
  --accent-strong: #325f6d;
  --cool-blue: #dce8eb;
  --cool-green: #dfe9e5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  align-items: center;
  background: rgba(246, 248, 248, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 12px;
}

.brand-text span,
.site-footer span:last-child {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
}

.brand-mark {
  align-items: center;
  background: var(--cool-blue);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.brand-mark img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.brand-mark-logo {
  background: transparent;
  overflow: hidden;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.hero,
.section-grid,
.texts-preview,
.works,
.news,
.contacts-section,
.page-hero,
.article-index {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(42px, 7vw, 88px) clamp(20px, 4vw, 56px);
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  min-height: calc(100vh - 82px);
}

.hero h1,
.page-hero h1,
.section-heading h2,
.contacts-section h2,
.intro-panel h2,
.contact-panel h2 {
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 7.3rem);
  max-width: 780px;
}

.page-hero h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
  max-width: 860px;
}

.hero-copy p:not(.eyebrow),
.page-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 540px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero-actions {
  align-items: center;
  display: flex;
  gap: 18px;
  margin-top: 28px;
}

.button {
  background: var(--accent-strong);
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  padding: 12px 18px;
}

.text-link {
  border-bottom: 1px solid currentColor;
}

.featured-art {
  margin: 0;
}

.featured-art img,
.work-card,
.article-card,
.article-row,
.intro-panel,
.contact-panel,
.news-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.featured-art img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.featured-art figcaption {
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 12px;
}

.featured-art figcaption strong {
  color: var(--ink);
}

.section-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding-top: 0;
}

.intro-panel,
.contact-panel,
.news-list article {
  background: var(--surface);
  padding: 26px;
}

.intro-panel p {
  color: var(--muted);
  max-width: 680px;
}

.article-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.article-links a {
  background: var(--cool-green);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 7px 13px;
}

.contact-panel ul {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h2,
.contacts-section h2,
.intro-panel h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.article-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card,
.article-row {
  background: var(--surface);
  padding: 24px;
}

.article-card h3,
.article-row h2 {
  line-height: 1.2;
  margin: 0 0 10px;
}

.article-card p:not(.eyebrow),
.article-row p:not(.eyebrow) {
  color: var(--muted);
  margin: 0 0 18px;
}

.article-card a,
.article-row a {
  border-bottom: 1px solid currentColor;
  font-weight: 700;
}

.article-index {
  display: grid;
  gap: 16px;
  padding-top: 0;
}

.article-row {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.content-page {
  margin: 0 auto;
  max-width: 860px;
  padding: clamp(42px, 7vw, 88px) clamp(20px, 4vw, 56px);
}

.content-page h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.08;
  margin: 0 0 24px;
}

.article-body {
  color: var(--ink);
  font-size: 1.08rem;
}

.article-body h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.18;
  margin: 42px 0 12px;
}

.article-body h3 {
  font-size: 1.35rem;
  margin: 28px 0 10px;
}

.article-body h4,
.article-body h5,
.article-body h6 {
  line-height: 1.25;
  margin: 24px 0 8px;
}

.article-body h4 {
  font-size: 1.16rem;
}

.article-body h5,
.article-body h6 {
  font-size: 1rem;
}

.article-body p,
.article-body li,
.article-body blockquote {
  color: var(--muted);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 4px 0 4px 18px;
}

.article-body code {
  background: var(--cool-blue);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.95em;
  padding: 0.12em 0.28em;
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  padding: 16px;
}

.article-body pre code {
  background: transparent;
  padding: 0;
}

.article-body table {
  border-collapse: collapse;
  margin: 24px 0;
  width: 100%;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: var(--cool-green);
  color: var(--ink);
}

.article-body figure {
  margin: 32px 0;
}

.article-body img {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}

.article-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 34px;
  padding: 16px;
}

.article-toc strong {
  margin-right: 8px;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tag-filter button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-height: 38px;
  padding: 7px 13px;
}

.tag-filter button.is-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.work-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.work-card {
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.work-card.is-hidden {
  display: none;
}

.work-card-media {
  align-items: center;
  aspect-ratio: 1;
  background: #eef3f2;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 14px;
}

.work-card-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 0;
  width: 100%;
}

.work-card-trigger:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}

.work-card-media img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.paint-swatch {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.paint-swatch {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(135deg, #b9cdd3, #edf2f1 52%, #7595a0);
}

.swatch-silver {
  background:
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, 0.8), transparent 18%),
    linear-gradient(145deg, #d8e0df, #a9bdc4 48%, #eef2ee);
}

.work-card-caption {
  padding: 18px;
}

.work-card h3,
.news-list h3 {
  margin: 0 0 4px;
}

.work-card p,
.work-card span,
.news-list p,
.news-list time {
  color: var(--muted);
}

.work-card p,
.news-list p {
  margin: 0;
}

.work-card span {
  display: block;
  font-size: 0.9rem;
  margin-top: 10px;
}

.gallery-modal {
  display: none;
}

.gallery-modal.is-open {
  display: block;
}

body.gallery-modal-open {
  overflow: hidden;
}

.gallery-modal-backdrop {
  background: rgba(17, 28, 32, 0.72);
  inset: 0;
  position: fixed;
  z-index: 40;
}

.gallery-modal-dialog {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  inset: 0;
  padding: clamp(8px, 1.8vw, 22px);
  position: fixed;
  z-index: 41;
}

.gallery-modal-figure {
  align-self: center;
  display: grid;
  gap: 14px;
  grid-column: 2;
  grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100vh - 32px);
  justify-self: center;
  margin: 0;
  max-height: calc(100vh - 32px);
  max-width: min(1280px, 100%);
  min-height: 0;
  width: 100%;
}

.gallery-modal-image-frame {
  align-items: center;
  background: #f7faf9;
  border: 1px solid var(--line);
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 0;
  padding: clamp(4px, 1vw, 10px);
}

.gallery-modal-image {
  height: 100%;
  max-height: min(78vh, 860px);
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.gallery-modal-caption {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.32;
  max-height: 18vh;
  overflow: auto;
  padding: 10px 14px;
}

.gallery-modal-caption h2 {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0 0 4px;
}

.gallery-modal-caption p {
  margin: 0;
}

.gallery-modal-description:not(:empty) {
  margin-top: 5px;
}

.gallery-modal-tags:not(:empty) {
  font-size: 0.9rem;
  margin-top: 6px;
}

.gallery-modal-link {
  display: inline-flex;
  font-weight: 700;
  margin-top: 6px;
}

.gallery-modal-link[hidden],
.gallery-modal-description:empty,
.gallery-modal-tags:empty,
.gallery-modal-size:empty {
  display: none;
}

.gallery-modal-close,
.gallery-modal-nav {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.gallery-modal-close {
  border-radius: 50%;
  font-size: 1.7rem;
  height: 44px;
  line-height: 1;
  position: fixed;
  right: clamp(10px, 2vw, 24px);
  top: clamp(10px, 2vw, 24px);
  width: 44px;
  z-index: 42;
}

.gallery-modal-nav {
  border-radius: 50%;
  font-size: clamp(2rem, 4vw, 3.6rem);
  height: clamp(46px, 6vw, 64px);
  width: clamp(46px, 6vw, 64px);
}

.gallery-modal-prev {
  grid-column: 1;
}

.gallery-modal-next {
  grid-column: 3;
}

.gallery-modal-nav:disabled {
  cursor: default;
  opacity: 0.36;
}

.gallery-modal-close:focus-visible,
.gallery-modal-nav:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.news-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contacts-section {
  align-items: start;
  display: grid;
  gap: clamp(24px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
}

.contacts-section > div:first-child p:not(.eyebrow),
.contacts-list p {
  color: var(--muted);
  margin: 14px 0 0;
  max-width: 560px;
}

.contacts-list {
  align-content: start;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
}

.contacts-list > p {
  padding: 20px;
}

.contact-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 110px minmax(0, 1fr);
  min-height: 54px;
  padding: 8px 18px;
}

.contact-row + .contact-row {
  border-top: 1px solid var(--line);
}

.contact-row span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.contact-icon {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-strong);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.contact-icon svg {
  fill: currentColor;
  height: 17px;
  width: 17px;
}

.contact-row strong {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 24px clamp(20px, 4vw, 56px);
}

@media (max-width: 820px) {
  .site-header,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .section-grid,
  .article-grid,
  .article-row,
  .work-grid,
  .news-list {
    grid-template-columns: 1fr;
  }

  .contacts-section {
    grid-template-columns: 1fr;
  }

  .contact-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .tag-filter {
    justify-content: flex-start;
  }

  .gallery-modal-dialog {
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .gallery-modal-figure {
    grid-column: 1 / -1;
  }

  .gallery-modal-image {
    height: 100%;
    max-height: 68vh;
  }

  .gallery-modal-caption {
    max-height: 22vh;
    padding: 9px 12px;
  }

  .gallery-modal-prev,
  .gallery-modal-next {
    grid-column: auto;
    justify-self: center;
  }
}
