:root {
  --ink: #111111;
  --muted: #949494;
  --line: #ececec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
}

body {
  font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Top nav ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 3rem;
  border-bottom: 1px solid var(--line);
}

.topbar .logo {
  text-decoration: none;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.topbar nav a {
  text-decoration: none;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--ink);
}

.lang-toggle {
  display: flex;
  gap: 0.4rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.lang-toggle button {
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  text-transform: uppercase;
}

.lang-toggle button.active { color: var(--ink); }

/* Language switching is handled in script.js by swapping textContent
   between the data-ru / data-en attributes — no CSS visibility toggle. */

/* ---------- Home / split hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 78px);
}

.hero-text {
  padding: 5rem 2rem 3rem 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 800px;
}

.hero-text p {
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
}

.hero-text p:last-child { margin-bottom: 0; }

.hero-photo {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo img {
  width: 69%;
  height: 69%;
  object-fit: cover;
  display: block;
}

/* ---------- Generic page ---------- */

.page {
  padding: 4rem 3rem 6rem;
}

.page-title {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 3rem;
}

/* ---------- About + CV ---------- */

.about {
  max-width: 680px;
}

.about .bio-facts p {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.about .bio-facts {
  margin-bottom: 2.6rem;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
}

.about .statement p {
  margin: 0 0 1.3rem;
  font-size: 1.05rem;
}

.cv {
  max-width: 680px;
  margin-top: 4rem;
}

.cv-section {
  margin-bottom: 2.6rem;
}

.cv-section h2 {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.9rem;
}

.cv-section p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

.cv-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-section li {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.cv-section li:last-child { margin-bottom: 0; }

/* ---------- Paintings grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.grid figure {
  margin: 0;
  min-width: 0;
}

.grid-item {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  overflow: hidden;
}

.grid img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #ffffff;
  transition: transform 0.5s ease;
}

.grid-item:hover img {
  transform: scale(1.08);
}

.grid figcaption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
}

.grid figcaption .title {
  display: block;
  text-align: left;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid figcaption .meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}

.grid figcaption .meta-inner {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  z-index: 1000;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.lightbox-stage img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.4s ease;
  transform: scale(1);
  transform-origin: center center;
  opacity: 0;
}

.lightbox.open .lightbox-stage img {
  opacity: 1;
  transition: transform 0.4s ease, opacity 0.4s ease 0.05s;
}

.lightbox-stage img.zoomed {
  cursor: zoom-out;
  transform: scale(1.9);
}

.lightbox-close {
  position: fixed;
  top: 1.6rem;
  right: 2rem;
  background: none;
  border: none;
  color: #f5f5f5;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-zoom {
  position: fixed;
  bottom: 1.8rem;
  right: 2rem;
  display: flex;
  gap: 0.6rem;
  z-index: 1001;
}

.lightbox-zoom button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(245, 245, 245, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.lightbox-zoom button:hover { background: rgba(255, 255, 255, 0.16); }

.lightbox-zoom button:disabled,
.lightbox-zoom button.disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.lightbox-zoom svg {
  width: 18px;
  height: 18px;
}

/* ---------- Contacts ---------- */

.contacts {
  max-width: 480px;
}

.contacts p {
  margin: 0 0 1.4rem;
  font-size: 1rem;
}

.contacts .links {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: flex-start;
}

.contacts .links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink);
}

.contacts .links a:hover { color: var(--muted); }

.contacts .links svg {
  width: 17px;
  height: 17px;
  flex: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .topbar { padding: 1.2rem 1.5rem; flex-wrap: wrap; gap: 0.8rem; }

  .topbar .logo { order: 1; }
  .lang-toggle { order: 2; }

  .topbar nav {
    order: 3;
    gap: 1rem;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar nav::-webkit-scrollbar { display: none; }

  .topbar nav a {
    flex: none;
    white-space: nowrap;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .hero { grid-template-columns: 1fr; }
  .hero-text { padding: 2.5rem 1.5rem; max-width: none; }
  .hero-photo { padding: 1.5rem 0 2.5rem; }
  .hero-photo img { width: 60%; height: 40vh; }

  .page { padding: 2.5rem 1.5rem 4rem; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .grid img { height: 200px; }

  .lightbox-stage { padding: 1.5rem; }
  .lightbox-close { top: 1rem; right: 1.2rem; }
  .lightbox-zoom { bottom: 1.2rem; right: 1.2rem; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}
