:root {
  --bg: #f5f5f5;
  --fg: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e2e2e2;
  --placeholder-bg: #ececec;
  --placeholder-stripe: #e4e4e4;
  --placeholder-fg: #9a9a9a;
  --accent: #101010;
  --menu-bg: #ffffff;
  --footer-bg: #f5f5f5;
  --header-h: 56px;
  --footer-h: 44px;
}

html[data-theme="dark"] {
  --bg: #0e0e0e;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --line: #1e1e1e;
  --placeholder-bg: #171717;
  --placeholder-stripe: #1e1e1e;
  --placeholder-fg: #5a5a5a;
  --accent: #ffffff;
  --menu-bg: #0e0e0e;
  --footer-bg: #0e0e0e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--fg); color: var(--bg); }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }

/* =========================================================
   LOADER
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: transform 1s cubic-bezier(.87,0,.13,1), opacity .3s ease;
}
.loader.hidden {
  transform: translateY(-100%);
  pointer-events: none;
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.loader-mark {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}
.loader-caption {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fg);
  text-transform: uppercase;
  font-weight: 600;
}
.loader-img {
  max-width: min(80vw, 1318px);
  height: auto;
  display: block;
}
.loader-img-dark {
  display: none;
}
html[data-theme="dark"] .loader-img {
  display: none;
}
html[data-theme="dark"] .loader-img-dark {
  display: block;
}

@media (max-width: 600px) {
  .loader-img {
    display: block;
    width: auto;
    max-width: none;
    height: 78vh;
  }
  html[data-theme="dark"] .loader-img {
    display: none;
  }
  .loader-img-dark {
    display: none;
    width: auto;
    max-width: none;
    height: 78vh;
  }
  html[data-theme="dark"] .loader-img-dark {
    display: block;
  }
  .loader-mark {
    font-size: clamp(3rem, 10vw, 5.5rem);
  }
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 90;
  border-bottom: 1px solid transparent;
}
.header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
}
.info-text {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg);
  font-weight: 500;
}
.nav-logo {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg);
  justify-self: start;
  line-height: 0;
}
.nav-logo img {
  height: 23.8px;
  width: auto;
  display: block;
  mix-blend-mode: difference;
}
html[data-theme="dark"] .nav-logo img {
  filter: brightness(0) invert(1);
}
html[data-theme="dark"] .footer-socials img,
html[data-theme="dark"] .about-socials img {
  filter: brightness(0) invert(1);
}
#clock {
  position: absolute;
  right: calc(50% + 156px);
  top: 50%;
  transform: translateY(-50%);
}

.theme-toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.grid-spacer {
  visibility: hidden;
  pointer-events: none;
}

.theme-btn {
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s ease;
}
.theme-btn.active { color: var(--fg); }
.theme-toggle .sep { color: var(--muted); font-size: 11px; }

.email-link {
  position: absolute;
  left: calc(50% + 156px);
  top: 50%;
  transform: translateY(-50%);
  transition: opacity .2s ease;
}
.email-link:hover { opacity: .6; }

.about-link {
  justify-self: end;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
}
.lang-btn {
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .2s ease;
}
.lang-btn.active { color: var(--fg); }
.header-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  margin-right: -70%;
}
.header-lang .sep { color: var(--muted); font-size: 11px; }
.lang-btn:hover { opacity: 1; }

/* =========================================================
   MENU OVERLAY
   ========================================================= */
.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--menu-bg);
  transform: translateY(-100%);
  transition: transform .7s cubic-bezier(.87,0,.13,1);
  padding: calc(var(--header-h) + 24px) 40px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.overlay-menu.open { transform: translateY(0); }

.menu-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.menu-item-name p {
  margin: 0;
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  cursor: pointer;
  transition: opacity .2s ease;
}
.menu-item-name p:hover { opacity: .6; }

.submenu {
  display: none;
  padding: 10px 0 4px 4px;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.submenu.open { display: flex; }
.submenu-item {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 0;
  color: var(--muted);
  transition: color .2s ease;
}
.submenu-item:hover { color: var(--fg); }

.menu-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.social-icons {
  display: flex;
  gap: 16px;
}
.social-icons a {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg);
  opacity: .85;
  transition: opacity .2s ease;
  display: inline-block;
}
.social-icons a:hover { opacity: 1; }

/* =========================================================
   MAIN — GALLERY
   ========================================================= */
main.page {
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.section-label {
  padding: 20px 24px 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-label .count { color: var(--muted); }

/* ---- LIST view (default) ---- */
.gallery {
  padding: 0;
}
.gallery[data-layout="grid"] {
  padding: 8px 24px 40px;
}
.gallery[data-layout="list"] {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery[data-layout="list"] .products {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.gallery[data-layout="list"] .product {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: 260px;
}
.gallery[data-layout="list"] .product-index,
.gallery[data-layout="list"] .product-tag { display: none; }
.gallery[data-layout="list"] .product-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.gallery[data-layout="list"] .product-media {
  display: block;
  width: 260px;
  pointer-events: none;
  border-radius: 4px;
  overflow: hidden;
}
.product-media img,
.product-media video,
.product-video {
  width: 100%;
  height: auto;
  display: block;
}
.product-name {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0.02em;
  font-weight: 500;
  pointer-events: none;
}

/* ---- GRID view ---- */
.gallery[data-layout="grid"] .products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 0;
}
.gallery[data-layout="grid"] .product {
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}
.gallery[data-layout="grid"] .product-index { display: none; }

.gallery[data-layout="grid"] .product-media {
  aspect-ratio: 4 / 5;
}
.gallery[data-layout="grid"] .product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-media { display: none; }
.gallery[data-layout="grid"] .product-media,
.gallery[data-layout="list"] .product-media { display: block; }

/* =========================================================
   PLACEHOLDER (заменяемый блок под изображение)
   ========================================================= */
.placeholder {
  position: relative;
  width: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--placeholder-bg) 0px,
      var(--placeholder-bg) 12px,
      var(--placeholder-stripe) 12px,
      var(--placeholder-stripe) 13px
    );
  overflow: hidden;
  border: 1px solid var(--line);
}
.placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--placeholder-fg);
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: center;
}
.placeholder.tall   { aspect-ratio: 3 / 4; }
.placeholder.square { aspect-ratio: 1 / 1; }
.placeholder.wide   { aspect-ratio: 16 / 10; }
.placeholder.hero   { aspect-ratio: 3 / 2; }

/* =========================================================
   PROJECT DETAIL PAGE
   ========================================================= */
.project-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.project-detail .scroller {
  display: flex;
  will-change: transform;
}
main.page.project-page {
  overflow: hidden;
  height: 100vh;
}
.project-detail .panel {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  height: calc(100vh - var(--footer-h) - 90px);
}
.project-detail .panel img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}


/* =========================================================
   ABOUT PAGE
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 24px 4px 40px;
  transform: translateY(5%);
}
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 4px;
}
.about-lead {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.about-bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}
.about-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  margin-top: 12px;
}
.about-heading {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.about-list {
  font-size: 13px;
  line-height: 1.75;
}
.about-gallery { align-items: flex-start !important; justify-content: flex-start !important; padding: 0 !important; }
.about-gallery .products { all: unset; }
.about-gallery .product { all: unset; }
.about-gallery .product-media { all: unset; display: none !important; }
.about-portrait-wrap {
  position: relative;
  justify-self: end;
  margin-right: 40px;
  width: 70%;
}
.about-portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
.about-overlay {
  position: absolute;
  bottom: calc(-150px);
  right: calc(-170px);
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 60%;
  pointer-events: none;
}

@media (min-width: 901px) {
  .about-grid {
    height: calc(100dvh - var(--header-h) - var(--footer-h));
    grid-template-rows: minmax(0, 1fr);
    transform: none;
    padding: 24px 4px 0;
    overflow: clip;
  }
  .about-portrait-wrap { height: 100%; width: auto; aspect-ratio: 3 / 4; }
  .about-portrait { width: 100%; height: 100%; object-fit: cover; }
  .about-lead:empty { display: none; }
  .about-copy { gap: 14px; }
  .about-columns { margin-top: 8px; }
}

@media (min-width: 901px) and (max-height: 700px) {
  .about-lead { font-size: 26px; line-height: 1.1; }
  .about-bio { font-size: 14px; line-height: 1.5; }
  .about-copy { gap: 10px; }
  .about-columns { gap: 14px 32px; margin-top: 6px; }
  .about-list { font-size: 12px; line-height: 1.6; }
  .about-heading { margin-bottom: 4px; }
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-columns { grid-template-columns: 1fr; }
  .about-portrait-wrap {
    width: 100%;
    margin-right: 0;
    justify-self: center;
  }
  .about-overlay {
    bottom: 8px;
    right: 8px;
    max-width: 35%;
  }
  .about-copy {
    padding: 0 4px;
    text-align: center;
  }
  .about-bio {
    text-align: center;
  }
  .about-columns {
    text-align: left;
  }
}

/* =========================================================
   HOVER PREVIEW (right-side)
   ========================================================= */
.product-preview {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 320px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}
.product-preview.visible {
  opacity: 1;
}
.product-preview .placeholder { aspect-ratio: 4/5; }
.product-preview-info {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.product-preview-info .name { color: var(--fg); font-weight: 500; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: transparent;
  border-top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  transition: background .35s ease, border-color .35s ease;
}
.footer-item { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
  width: 14px; height: 14px;
  opacity: .85;
  transition: opacity .2s ease;
  display: flex; align-items: center; justify-content: center;
}
.footer-socials a img {
  width: 100%; height: 100%; object-fit: contain;
}
.footer-socials a[aria-label="Instagram"] img,
.about-socials a[aria-label="Instagram"] img {
  transform: scale(1.3);
}
.footer-socials a:hover { opacity: 1; }

.footer-layout-toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.layout-btn {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  transition: color .2s ease;
  mix-blend-mode: difference;
}
.layout-btn.active { color: var(--fg); }

/* =========================================================
   PROJECT DETAIL PAGE — Horizontal Panel Scroll
   ========================================================= */
.project-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.project-detail .scroller {
  display: flex;
  will-change: transform;
}
main.page.project-page {
  overflow: hidden;
  height: 100vh;
}
.project-detail .panel {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  height: calc(100vh - var(--footer-h) - 90px);
}
.project-detail .panel img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}
.project-detail .info-panel,
.project-detail .final-panel {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 48px;
}
.project-detail .info-panel {
  display: grid;
  grid-template-columns: 500px 1fr;
  grid-template-rows: auto;
  align-content: start;
  align-items: stretch;
  gap: 40px;
  padding: 0 48px;
}
.project-detail .panel-shift {
  transform: translateY(10%);
}

.project-detail .info-panel .col-left {
  flex: 0 0 500px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.project-detail .final-panel .col-left {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.title-block + .meta-item {
  margin-top: auto;
}
.project-detail .info-panel .col-left .project-title {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
  white-space: nowrap;
}
.project-detail .final-panel .col-left .project-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.project-detail .info-panel .col-left .project-subtitle,
.project-detail .final-panel .col-left .project-subtitle {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.project-detail .info-panel .col-left .meta-item,
.project-detail .final-panel .col-left .meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-detail .info-panel .col-left .meta-item .meta-label,
.project-detail .final-panel .col-left .meta-item .meta-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.project-detail .info-panel .col-left .meta-item .meta-value {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}
.project-detail .final-panel .col-left .meta-item .meta-value {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}
.project-detail .info-panel .col-right,
.project-detail .final-panel .col-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.project-detail .info-panel .col-right img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}
.project-detail .info-panel .col-right .product-video {
  width: 72.25%;
  margin-left: auto;
  margin-right: calc(5% + 48px);
}
.project-detail .info-panel .col-right .placeholder,
.project-detail .final-panel .col-right img,
.project-detail .final-panel .col-right .placeholder {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}
.project-detail .info-panel .col-right .img-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 60px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.project-detail .info-panel .col-right .img-stack::-webkit-scrollbar {
  display: none;
}
.project-detail .info-panel .col-right .img-stack-text-block {
  flex: 0 0 auto;
  width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.project-detail .info-panel .col-right .img-stack-title {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0;
}
.project-detail .info-panel .col-right .img-stack-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-detail .info-panel .col-right .img-stack-meta .meta-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.project-detail .info-panel .col-right .img-stack-meta .meta-value {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}

.project-detail .panel .placeholder {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
.project-detail .final-panel .col-right {
  position: relative;
}

/* =========================================================
   GRID STAGE — WebGL
   ========================================================= */
.grid-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 45;
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity .4s ease, visibility 0s .4s, background .35s ease;
}
.grid-stage.active {
  visibility: visible;
  opacity: 1;
  transition: opacity .4s ease, visibility 0s 0s, background .35s ease;
}
.grid-stage #grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.grid-stage .image-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 95;
  display: flex;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .35s ease, visibility 0s .35s;
  pointer-events: none;
}
.grid-stage .image-modal.active {
  visibility: visible;
  opacity: 1;
  transition: opacity .35s ease, visibility 0s 0s;
  pointer-events: auto;
}
.grid-stage .modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 4rem 5rem;
}
.grid-stage .close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .85);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color .2s ease;
}
.grid-stage .close-btn:hover { color: #fff; }
.grid-stage .close-btn::after {
  content: "\00D7";
  font-size: 16px;
  font-weight: 300;
  opacity: .6;
  transition: transform .3s ease, opacity .2s ease;
}
.grid-stage .close-btn:hover::after { opacity: 1; transform: rotate(90deg); }
.grid-stage .modal-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  max-width: 90vw;
}
.grid-stage .modal-center img {
  max-width: 44vw;
  max-height: 62vh;
  width: auto;
  height: auto;
  border: 1px solid rgba(255, 255, 255, .15);
}
.grid-stage .modal-caption {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  max-width: 60ch;
  margin: 0;
  overflow: hidden;
}
.grid-stage .caption-word {
  display: inline-block;
  transform: translateY(110%);
}
.grid-stage .modal-nav {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}
.grid-stage .nav-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  cursor: pointer;
  transition: color .2s ease;
}
.grid-stage .nav-btn:hover { color: #fff; }
.grid-stage .modal-copy {
  color: rgba(255, 255, 255, .4);
  font-size: 11px;
  letter-spacing: 0.15em;
}
body.grid-modal-open .site-header,
body.grid-modal-open .site-footer {
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.project-detail .final-panel .next-campaign-link {
  position: absolute;
  bottom: 24px;
  right: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.project-detail .final-panel .next-campaign-link:hover {
  color: var(--fg);
}
.project-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: transparent;
}
.project-footer a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
  mix-blend-mode: difference;
}
.project-footer a:hover {
  color: var(--fg);
}
.project-footer a .back-icon { display: none; }
.project-footer .project-footer-center {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
}
main.page.project-page { padding-bottom: var(--footer-h); }
main.page.project-page ~ .site-footer { display: none; }
main.page.project-page .placeholder::after { display: none; }

.footer-copyright {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- Player (Yandex-style) ---------- */
.header-player {
  display: inline-flex;
  align-items: center;
  position: absolute;
  right: 20px;
  bottom: 6px;
  transform: translateY(60px);
}
.player {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.controls {
  display: flex;
  align-items: center;
  gap: 2px;
}
.btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: color 0.2s;
}
.btn:hover {
  color: var(--fg);
}
.play-btn {
  color: var(--fg);
}
.play-btn:hover {
  color: var(--accent);
}
.track-name {
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.time {
  color: var(--fg);
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* =========================================================
   HEADER BUTTON (framer-style) + mobile-only blocks
   ========================================================= */
.framer-btn {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
}
.framer-btn .framer-btn-inner {
  display: flex;
  flex-direction: column;
  transition: transform .4s cubic-bezier(.65, 0, .35, 1);
}
.framer-btn:hover .framer-btn-inner,
.framer-btn:focus-visible .framer-btn-inner {
  transform: translateY(-33.3333%);
}
.framer-btn:active .framer-btn-inner {
  transform: translateY(-66.6666%);
}
.framer-btn .framer-btn-text {
  line-height: 1.2;
  white-space: nowrap;
}

.about-socials { display: none; }
.about-contact-link { display: none; }
.about-contact-extras { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto 1fr; }
  #clock, .theme-toggle, .email-link { display: none; }
  .nav-logo { justify-self: start; }
  .menu-container { justify-self: end; }

  .gallery[data-layout="list"] .product {
    width: 140px;
  }
  .gallery[data-layout="list"] .product-tag { display: none; }

  .gallery[data-layout="grid"] .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .product-preview { display: none; }

  .site-footer { grid-template-columns: 1fr 1fr 1fr; }
  .footer-copyright { display: none; }

  .overlay-menu { padding: 80px 24px 24px; }
}

/* ---- Tablets (≤900px) ---- */
@media (max-width: 900px) {
  .header-player { display: none !important; }

  .gallery[data-layout="list"] .product { width: min(32vw, 300px); }
  .gallery[data-layout="list"] .product-media { width: min(32vw, 300px); }

  .footer-layout-toggle .layout-btn[data-layout="grid"],
  .footer-layout-toggle .sep { display: none !important; }

  .footer-socials a { width: 16px; height: 16px; }

  .project-detail .panel { height: calc(100vh - var(--footer-h) - 70px); width: calc(100vw - 10px); }
  .project-detail .info-panel { grid-template-columns: 320px 1fr; gap: 28px; padding: 0 24px; }
  .project-detail .info-panel .col-left { flex: 0 0 320px; gap: 18px; }
  .project-detail .info-panel .col-right { min-width: 0; }
  .project-detail .info-panel .col-right .img-stack { min-width: 0; }
  .project-detail .info-panel .col-left .project-title { font-size: 34px; white-space: normal; }
  .project-detail .final-panel .col-left { flex: 0 0 260px; }
  .project-detail .panel img,
  .project-detail .info-panel .col-right img,
  .project-detail .info-panel .col-right .placeholder,
  .project-detail .final-panel .col-right img,
  .project-detail .final-panel .col-right .placeholder { max-height: 58vh; }
  .project-detail .panel img,
  .project-detail .info-panel .col-right img,
  .project-detail .info-panel .col-right video {
    width: 100%;
    height: auto;
    max-height: none;
    min-width: 0;
    flex: none;
  }
  .project-detail .info-panel .col-right .product-video {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .project-detail .info-panel .col-right .img-stack { gap: 32px; }

  .about-overlay {
    right: calc(-170px - 10%);
    max-width: 60%;
    max-height: 60%;
  }

  .grid-stage .modal-content { padding: 6rem 1.5rem 4rem; }
  .grid-stage .modal-center img { max-width: 88vw; max-height: 50vh; }
  .grid-stage .modal-nav { padding: 0 20px; }
}

@media (max-width: 600px) {
  .site-header { height: auto; }
  .header-inner {
    display: flex !important;
    align-items: center;
    padding: 0 10px;
    gap: 14px;
    height: auto;
    grid-template-columns: none;
  }
  .nav-logo { margin-right: auto; display: flex; }
  .nav-logo img { height: 17px; width: auto; display: block; }
  .about-link { font-size: 13px; }
  .header-lang { display: none !important; }
  .lang-btn { font-size: 13px; }
  .grid-spacer, #clock, .theme-toggle, .email-link,
  .menu-container, .overlay-menu { display: none !important; }

  .header-player { display: none !important; }

  main.page { padding-top: 42px; padding-bottom: 0; min-height: 100dvh; }

  .gallery[data-layout="list"] .product { width: 55vw; }
  .gallery[data-layout="list"] .product-media { width: 55vw; }
  .gallery[data-layout="list"] .product-title { font-size: 11px; letter-spacing: 0.06em; }

  .gallery[data-layout="list"] .products { touch-action: none; }
  .gallery:not(.about-gallery)[data-layout="list"] .products {
    transform: translateY(-70px);
  }

  .gallery[data-layout="grid"] .products {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .product-preview { display: none !important; }
  .section-label { padding: 12px 16px 6px; font-size: 10px; }

  .site-footer { display: none !important; }

  .about-grid { padding: 24px 10px 32px; transform: none; }
  .about-portrait-wrap { width: 65%; margin-right: 0; justify-self: center; }
  .about-overlay { bottom: calc(8px - 10%); right: calc(8px - 25%); max-width: 50%; max-height: 50%; }
  .about-copy { padding: 0 4px; text-align: center; }
  .about-bio { text-align: center; }
  .about-columns { text-align: left; }
  .resume-inline { display: none !important; }
  .about-socials {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 4px;
  }
  .about-socials .about-socials-icons { display: flex; align-items: center; gap: 14px; }
  .about-socials .about-socials-icons { display: none !important; }
  .about-socials .resume-btn { font-size: 11px; }
  .about-socials a { font-size: 10px; display: inline-flex; align-items: center; }
  .about-socials img { width: 16px; height: 16px; }
  .about-contact-extras { display: inline; }
  .about-contact-link { display: inline; }

  main.page.project-page { height: auto; overflow: visible; }
  .project-detail { padding: 5vh 5px; overflow: visible; }
  .project-detail .scroller {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px 0;
    transform: none !important;
  }
  .project-detail .panel {
    height: auto;
    width: 100%;
    margin-right: 0;
    padding: 0;
    transform: none;
  }
  .project-detail .info-panel,
  .project-detail .final-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 0;
  }
  .project-detail .info-panel .col-left,
  .project-detail .final-panel .col-left { flex: 0 0 auto; width: 100%; }
  .project-detail .info-panel .col-left .title-block,
  .project-detail .final-panel .col-left .title-block {
    text-align: center;
    transform: none;
    margin-top: 0;
  }
  .project-detail .info-panel .col-left .project-title,
  .project-detail .final-panel .col-left .project-title {
    font-size: 40px;
    white-space: normal;
  }
  .project-detail .final-panel .col-left .project-title { font-size: 32px; }
  .project-detail .info-panel .col-left .project-subtitle,
  .project-detail .final-panel .col-left .project-subtitle {
    text-align: center;
  }
  .project-detail .info-panel .col-left .meta-item,
  .project-detail .final-panel .col-left .meta-item {
    align-items: flex-start;
    text-align: left;
  }
  .project-detail .title-block + .meta-item { margin-top: 24px; }
  .project-detail .info-panel .col-left { gap: 16px; }
  .project-detail .panel img { max-width: 100%; max-height: none; }
  .project-detail .info-panel .col-right,
  .project-detail .final-panel .col-right { width: 100%; min-height: 0; }
  .project-detail .info-panel .col-right img { height: auto; width: 100%; }
  .project-detail .info-panel .col-right .product-video { width: 100%; margin: 0; }
  .project-detail .info-panel .col-right img,
  .project-detail .info-panel .col-right video {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto;
  }
  .project-detail .info-panel .col-right .img-stack {
    flex-direction: column;
    overflow: visible;
    gap: 24px;
    width: 100%;
  }
  .project-detail .info-panel .col-right .img-stack-text-block { width: 100%; }
  .project-detail .final-panel .next-campaign-link { position: static; margin-top: 12px; }
  .grid-stage .modal-content { padding: 4rem 1rem 3rem; }
  .grid-stage .modal-center img { max-width: 94vw; max-height: 40vh; }
  .grid-stage .modal-nav { padding: 0 12px; bottom: 16px; }
  .grid-stage .close-btn { top: 12px; right: 12px; font-size: 10px; }
  .project-footer { display: none; }
  .project-detail .scroller { will-change: auto; }
  .mini-player .mini-back { display: none; }
  .mini-player .mini-back svg { width: 26px; height: 26px; }
  main.page.project-page ~ .mini-player .mini-back { display: flex; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 8px; gap: 12px; }
  .nav-logo img { height: 15px; }
  .lang-btn, .about-link { font-size: 12px; }

  main.page { padding-top: 38px; }

  .gallery[data-layout="list"] .product { width: 55vw; }
  .gallery[data-layout="list"] .product-media { width: 55vw; }
  .gallery[data-layout="list"] .product-title {
    font-size: 10px;
    white-space: normal;
    line-height: 1.2;
  }

  .gallery[data-layout="grid"] .products { gap: 4px; }

  .section-label { padding: 12px 12px 6px; font-size: 9px; }
  .section-label .count { font-size: 9px; }

  .about-lead { font-size: 20px; }
  .about-bio { font-size: 12px; }

  .project-detail .info-panel { padding: 0 12px; gap: 16px; }
  .project-detail .info-panel .col-left .project-title { font-size: 34px; }
}

/* ---- Very small phones (≤360px) ---- */
@media (max-width: 360px) {
  .header-inner { padding: 0 6px; gap: 10px; }
  .nav-logo img { height: 13px; }
  .lang-btn, .about-link { font-size: 11px; }
  .gallery[data-layout="list"] .product-title { font-size: 9px; }
}

/* =========================================================
   MOBILE MINI PLAYER (phone only)
   ========================================================= */
.mini-player { display: none; }

@media (max-width: 600px) {
  .mini-player {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 2px);
    top: auto;
    transform: translateX(-50%);
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 20px);
    margin: 0;
  }
  .mini-circle {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--fg);
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font: inherit;
  }
  .mini-circle svg { width: 20px; height: 20px; display: block; }
  .mini-circle .mini-theme-sun { display: block; }
  .mini-circle .mini-theme-moon { display: none; }
  .mini-circle.is-dark .mini-theme-sun { display: none; }
  .mini-circle.is-dark .mini-theme-moon { display: block; }
  .mini-lang { font-size: 11px; letter-spacing: 0.08em; }
  .mini-player-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .mini-player .player-btn {
    background: none;
    border: none;
    padding: 2px;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .mini-player .player-btn svg { width: 16px; height: 16px; display: block; }
  .player-marquee {
    overflow: hidden;
    min-width: 0;
    max-width: 30vw;
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: var(--fg);
  }
  .player-marquee-inner { display: inline-block; white-space: nowrap; }
  .player-marquee.scroll .player-marquee-inner {
    animation: pl-marquee 9s linear infinite;
  }
  @keyframes pl-marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
  }
}
