/* =========================
   Design tokens
   ========================= */
:root {
  /* Основной светлый фон страницы: используется для body и спокойных секций */
  --bg-page: #f6f6fa;

  /* Тёмный холодный фон первого экрана: создаёт ощущение галерейной стены */
  --bg-hero: #111322;

  /* Фон карточек и панелей: используется в artwork card, галереях и contact */
  --bg-surface: #ffffff;

  /* Лёгкий альтернативный фон секций: story и технические блоки */
  --bg-soft: #efedf6;

  /* Основной цвет обычного текста: заголовки и основной контент */
  --text-main: #202234;

  /* Приглушённый текст: подписи, второстепенная информация, nav */
  --text-muted: #66677a;

  /* Основной акцент: кнопки, ссылки, небольшие метки */
  --accent: #3f3c84;

  /* Тёмный акцент для hover-состояний кнопок */
  --accent-strong: #2c2a5a;

  /* Цвет текста на акцентных кнопках */
  --button-text: #ffffff;

  /* Мягкие линии и рамки карточек */
  --line-soft: #dcd8e8;

  /* Минимальная высота первого экрана на desktop */
  --hero-min-height: min(70vh, 720px);

  /* Максимальная ширина внутренней hero-композиции */
  --hero-content-max-width: 1320px;

  /* Расстояние между текстом и изображением в hero */
  --hero-grid-gap: clamp(34px, 6vw, 84px);

  /* Максимальная ширина изображения Atris в hero */
  --hero-art-max-width: 940px;

  /* Вертикальные поля hero: дают первому экрану галерейный воздух */
  --hero-pad-y: clamp(58px, 8vw, 110px);

  /* Горизонтальные поля hero */
  --hero-pad-x: var(--page-pad);

  /* Мягкая рамка вокруг изображения Atris */
  --hero-art-border: rgba(220, 216, 232, 0.32);

  /* Фон внутри рамки hero-изображения, когда полная работа даёт поля */
  --hero-art-bg: #f7f7fb;

  /* Радиус рамки hero-изображения */
  --hero-art-radius: 6px;

  /* Размер главного заголовка Atris в текстовой колонке hero */
  --hero-title-size: clamp(3.8rem, 8vw, 7.2rem);

  /* Размер основного текста hero */
  --hero-lede-size: clamp(1.45rem, 2.4vw, 2.15rem);

  /* Максимальная ширина текстовой колонки hero */
  --hero-copy-max-width: 500px;

  /* Максимальная ширина блока Artist statement */
  --statement-max-width: var(--content-max);

  /* Фон раскрывающегося длинного текста */
  --statement-details-bg: rgba(255, 255, 255, 0.62);

  /* Отступ внутри раскрывающегося длинного текста */
  --statement-details-pad: clamp(20px, 4vw, 34px);

  /* Фон затемнения lightbox */
  --lightbox-backdrop: rgba(9, 10, 20, 0.84);

  /* Цвет поверхности lightbox вокруг изображения */
  --lightbox-surface: #10111f;

  /* Максимальная ширина изображения в lightbox */
  --lightbox-image-max-width: min(92vw, 1320px);

  /* Максимальная высота изображения в lightbox */
  --lightbox-image-max-height: 82vh;

  /* Максимальная ширина контента страницы */
  --content-max: 1180px;

  /* Горизонтальные поля контента на разных экранах */
  --page-pad: clamp(18px, 4vw, 48px);

  /* Основной вертикальный отступ секций */
  --section-pad: clamp(54px, 8vw, 96px);

  /* Радиус карточек и изображений */
  --radius-card: 8px;

  /* Радиус кнопок */
  --radius-button: 999px;

  /* Мягкая тень для приподнятых карточек */
  --shadow-soft: 0 18px 48px rgba(30, 30, 58, 0.08);
}

/* =========================
   Base
   ========================= */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

p {
  margin-bottom: 16px;
}

.section {
  padding: var(--section-pad) var(--page-pad);
}

.content-wrap {
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

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

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading p:last-child {
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--button-text);
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

/* =========================
   Header
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--page-pad);
  border-bottom: 1px solid rgba(220, 216, 232, 0.78);
  background: rgba(246, 246, 250, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  flex: 0 0 auto;
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text-main);
}

/* =========================
   Hero
   ========================= */
.hero {
  width: 100%;
  max-width: 100%;
  min-height: var(--hero-min-height);
  overflow: hidden;
  padding: var(--hero-pad-y) var(--hero-pad-x);
  background: var(--bg-hero);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: var(--hero-grid-gap);
  width: min(100%, var(--hero-content-max-width));
  margin: 0 auto;
}

.hero-copy {
  max-width: var(--hero-copy-max-width);
  color: #ffffff;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.hero h1 {
  margin-bottom: clamp(18px, 3vw, 30px);
  color: #ffffff;
  font-size: var(--hero-title-size);
  font-weight: 650;
  line-height: 0.9;
  opacity: 0.94;
}

.hero-lede {
  margin-bottom: 18px;
  font-size: var(--hero-lede-size);
  line-height: 1.18;
}

.hero-meta {
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
}

.hero-button {
  width: fit-content;
}

.hero-art-wrap {
  width: 100%;
  max-width: var(--hero-art-max-width);
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  justify-self: end;
}

.hero-art {
  display: block;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--hero-art-border);
  border-radius: var(--hero-art-radius);
  background: var(--hero-art-bg);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.28);
}

.hero img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  object-fit: contain;
  object-position: center;
}

.hero-art-wrap figcaption {
  padding: 10px 2px 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  text-align: right;
}

/* =========================
   Intro / artwork card
   ========================= */
.intro {
  background: var(--bg-soft);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.intro-copy {
  max-width: 690px;
}

.intro-copy p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.art-card {
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
}

.art-card h2 {
  margin-bottom: 22px;
}

.art-card dl {
  margin: 0 0 24px;
}

.art-card div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.art-card dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.art-card dd {
  margin: 4px 0 0;
  font-weight: 650;
}

/* =========================
   Details gallery
   ========================= */
.details {
  background: var(--bg-page);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(220, 216, 232, 0.54);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.62);
}

figure img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

figcaption {
  padding: 11px 4px 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.details figure,
.sketchbook figure {
  border-color: transparent;
  background: transparent;
}

.details figure img,
.sketchbook figure img {
  border: 1px solid rgba(220, 216, 232, 0.5);
  border-radius: var(--radius-card);
  cursor: zoom-in;
}

/* =========================
   Artist statement
   ========================= */
.artist-statement {
  background: var(--bg-soft);
}

.statement-wrap {
  width: min(100%, var(--statement-max-width));
  max-width: var(--statement-max-width);
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.42);
}

.statement-intro {
  max-width: 820px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.statement-details {
  max-width: 860px;
  margin-top: 34px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.statement-details summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.statement-details summary::marker {
  content: "";
}

.statement-details summary::-webkit-details-marker {
  display: none;
}

.statement-details summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
}

.statement-details[open] summary::after {
  content: "−";
}

.statement-body {
  max-width: 820px;
  padding: var(--statement-details-pad) 0;
  border-top: 1px solid var(--line-soft);
  color: var(--text-muted);
}

.statement-body p:last-child {
  margin-bottom: 0;
}

/* =========================
   Technical details
   ========================= */
.technical {
  background: var(--bg-page);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--line-soft);
}

.spec-grid > div {
  min-height: 180px;
  padding: 22px;
  background: var(--bg-surface);
}

.spec-grid p {
  margin-bottom: 0;
  color: var(--text-muted);
}

/* =========================
   Sketchbook
   ========================= */
.sketchbook {
  background: var(--bg-soft);
}

.sketchbook .section-heading {
  max-width: 680px;
}

.sketchbook h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.sketch-grid {
  gap: clamp(16px, 2vw, 24px);
}

.sketch-grid figure {
  border: 1px solid var(--line-soft);
  background: var(--bg-surface);
}

.sketch-grid figure img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  opacity: 0.94;
}

.sketch-grid figcaption {
  display: none;
}

/* =========================
   Contact
   ========================= */
.contact {
  background: var(--bg-page);
}

.contact-panel {
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
}

.contact-panel h2 {
  margin-bottom: 12px;
}

.contact-panel p:not(.eyebrow) {
  color: var(--text-muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 24px;
}

.contact-actions span {
  color: var(--text-muted);
  font-weight: 650;
}

/* =========================
   Lightbox
   ========================= */
.lightbox {
  width: min(100%, 1440px);
  max-width: 100vw;
  max-height: 100vh;
  padding: clamp(18px, 3vw, 32px);
  border: 0;
  background: transparent;
  color: #ffffff;
}

.lightbox::backdrop {
  background: var(--lightbox-backdrop);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox-figure {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 0;
  background: var(--lightbox-surface);
}

.lightbox-image {
  width: auto;
  height: auto;
  max-width: var(--lightbox-image-max-width);
  max-height: var(--lightbox-image-max-height);
  aspect-ratio: auto;
  border: 1px solid rgba(220, 216, 232, 0.28);
  border-radius: var(--radius-card);
  cursor: zoom-out;
  object-fit: contain;
}

.lightbox-caption {
  padding: 14px 2px 0;
  color: rgba(255, 255, 255, 0.72);
}

.lightbox-close {
  position: fixed;
  top: clamp(14px, 3vw, 28px);
  right: clamp(14px, 3vw, 28px);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(16, 17, 31, 0.72);
  color: #ffffff;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

/* =========================
   Footer
   ========================= */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px var(--page-pad);
  border-top: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 980px) {
  :root {
    /* Минимальная высота hero на планшетах */
    --hero-min-height: auto;

    /* Максимальная ширина hero-изображения на планшетах */
    --hero-art-max-width: 640px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-art-wrap {
    max-width: 720px;
    justify-self: start;
  }

  .intro-grid,
  .gallery-grid,
  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    /* Вертикальные поля hero на мобильных */
    --hero-pad-y: 44px;

    /* Размер заголовка Atris на мобильных */
    --hero-title-size: clamp(3.4rem, 17vw, 4.5rem);
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    max-width: 100vw;
    overflow: hidden;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .intro-grid,
  .gallery-grid,
  .spec-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro-grid > *,
  .gallery-grid > *,
  .spec-grid > * {
    min-width: 0;
  }

  .spec-grid > div {
    min-height: auto;
  }

  .art-card {
    width: min(100%, 380px);
    max-width: calc(100vw - (2 * var(--page-pad)));
  }

  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    width: 100%;
  }

  .hero-copy,
  .hero-art-wrap {
    width: 100%;
    max-width: 350px;
    min-width: 0;
  }

  .hero-lede,
  .hero-meta {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .hero-button {
    width: 100%;
    max-width: 350px;
  }

  .hero-art-wrap figcaption {
    text-align: left;
  }

  .button {
    max-width: 100%;
    width: 100%;
  }

  .lightbox {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    padding: 16px;
  }

  .lightbox-figure {
    width: 100%;
  }

  .lightbox-image {
    width: 100%;
    max-width: 100%;
    max-height: 76vh;
  }

  .site-footer {
    flex-direction: column;
  }

  .section,
  .hero,
  .site-footer {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .content-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .intro-copy {
    max-width: 350px;
  }

  .intro-copy h2 {
    max-width: 350px;
  }

}
