/* ================================================
   vladimirov.me — mockup v0.2
   Дизайн: «Modern Editorial»
   Fraunces (серифный заголовочный) + Inter (sans)
   Палитра: тёплая бумага + near-black + deep navy
   ================================================ */

:root {
  --bg:           #f5f2eb;   /* чуть глубже чем раньше */
  --bg-alt:       #ece7da;   /* альтернативные секции */
  --surface:      #ffffff;
  --text:         #111111;
  --text-muted:   #3d3d3d;
  --text-subtle:  #6d6a5e;
  --border:       #d9d3c2;
  --border-subtle:#e3dece;
  --accent:       #1f3a5f;
  --accent-hover: #2c4e7d;
  --accent-warm:  #6b4227;

  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-md: 0 1px 3px rgba(17, 17, 17, 0.06), 0 4px 12px rgba(17, 17, 17, 0.04);
  --shadow-lg: 0 1px 3px rgba(17, 17, 17, 0.08), 0 8px 24px rgba(17, 17, 17, 0.06);

  --radius: 2px;           /* острые углы для editorial, но не 0 */
  --radius-lg: 4px;

  --serif: 'Fraunces', 'Georgia', 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          'Roboto', 'Helvetica Neue', Arial, sans-serif;

  --container: 1120px;
  --container-text: 780px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* учёт sticky хедера */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overflow-wrap: break-word;
}

p, h1, h2, h3, h4, td, dd, li, figcaption {
  overflow-wrap: break-word;
}


img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variation-settings: 'opsz' 48, 'SOFT' 30;
}

h1 {
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  line-height: 0.98;
  margin: 0 0 1rem;
  font-weight: 450;
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
}

h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  line-height: 1.1;
  margin: 0 0 2rem;
  font-weight: 450;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 72, 'SOFT' 30;
}

h3 {
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.3;
  font-weight: 500;
  margin: 0 0 0.625rem;
  font-variation-settings: 'opsz' 32, 'SOFT' 20;
}

p { margin: 0 0 1.25rem; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}
.container-text { max-width: var(--container-text); }

/* ============= HEADER ============= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
  background: rgba(245, 242, 235, 0.75);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: border-color 0.2s, background 0.2s;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border-subtle);
}

.header-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  min-height: 40px;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
  letter-spacing: -0.005em;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--text);
  transition: width 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover::after {
  width: 100%;
}

/* Гамбургер */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============= HERO ============= */

.hero {
  padding: 5rem 0 4.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 360px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-content h1 { margin-bottom: 1.25rem; }

.hero-title {
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  color: var(--text-muted);
  margin: 0 0 2rem;
  line-height: 1.5;
  font-weight: 400;
}

.hero-subtitle {
  color: var(--text-subtle);
  font-size: 0.95em;
}

.hero-summary {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--text);
  line-height: 1.7;
  margin: 0;
  max-width: 640px;
}

/* ============= SECTIONS ============= */

.section-block {
  padding: 6rem 0;
}

.section-alt { background: var(--bg-alt); }

.featured {
  background: var(--bg-alt);
  padding: 5rem 0;
}

.section-block h2 {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--text);
}

.section-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 640px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent-warm);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* ============= FEATURED ============= */

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

.featured-card {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  border: 1px solid transparent;
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.featured-card .publisher {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.featured-card h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
  margin-bottom: 0.875rem;
}

.featured-card .meta {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  flex: 1;
}

.arrow-link {
  font-size: 0.875rem;
  color: var(--accent);
  align-self: flex-start;
  font-weight: 500;
  transition: color 0.15s;
}

.arrow-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============= BIOGRAPHY ============= */

#bio p {
  font-size: 1.0625rem;
  color: var(--text);
  line-height: 1.75;
}

/* ============= CAREER ============= */

.career-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.career-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 720px;
}

.career-table thead th {
  text-align: left;
  padding: 0 1.25rem 0.875rem 0;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.7rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}

.career-table tbody td {
  padding: 1.125rem 1.25rem 1.125rem 0;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  line-height: 1.55;
}

.career-table tbody tr:last-child td { border-bottom: none; }

.career-table td:first-child {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 120px;
  font-size: 0.875rem;
  font-weight: 500;
}

.career-table td:nth-child(2) {
  font-weight: 500;
  color: var(--text);
  width: 22%;
}

.career-table td:nth-child(3) {
  color: var(--text-muted);
  width: 24%;
}

.career-table td:nth-child(4) {
  color: var(--text);
}

/* ============= ACHIEVEMENTS ============= */

.achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.achievement-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.875rem 1.75rem 1.625rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.achievement-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.achievement-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--accent-warm);
  margin-bottom: 0.875rem;
  font-weight: 600;
}

.achievement-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.achievement-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ============= CASES (Ключевые кейсы) ============= */

.cases-list {
  display: flex;
  flex-direction: column;
}

.case-item {
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
}

.case-item:first-child {
  padding-top: 0.5rem;
  border-top: none;
}

.case-item:last-child {
  padding-bottom: 0.5rem;
}

.case-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--accent-warm);
  margin-bottom: 0.875rem;
  font-weight: 600;
}

.case-item h3 {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  line-height: 1.25;
  font-weight: 450;
  letter-spacing: -0.015em;
  margin: 0 0 1.75rem;
  color: var(--text);
  font-variation-settings: 'opsz' 48, 'SOFT' 25;
}

.case-section {
  margin-bottom: 1.5rem;
}

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

.case-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--text-subtle);
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.case-section p {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .case-item {
    padding: 2rem 0;
  }
  .case-item:first-child {
    padding-top: 0;
  }
  .case-section {
    margin-bottom: 1.25rem;
  }
}

/* ============= SPEAKING ============= */

.speaking-list {
  display: flex;
  flex-direction: column;
}

.speaking-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.speaking-item.with-photo {
  grid-template-columns: 150px 280px 1fr;
}

.speaking-item:first-child {
  border-top: 1px solid var(--border-subtle);
}

.speaking-date .date-main {
  font-family: var(--serif);
  font-size: 1.1875rem;
  color: var(--text);
  font-weight: 500;
  font-variation-settings: 'opsz' 32, 'SOFT' 20;
}

.speaking-date .date-sub {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.speaking-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  align-self: start;
}

.speaking-photo a {
  display: block;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.speaking-photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.speaking-photo:hover img {
  transform: scale(1.03);
}

.speaking-content h3 {
  margin-bottom: 0.625rem;
  font-size: 1.1875rem;
}

.speaking-context {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 0.875rem;
  line-height: 1.6;
}

/* ============= PUBLICATIONS ============= */

.pub-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.pub-filters a {
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  transition: all 0.15s;
}

.pub-filters a:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.pub-group-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 3rem 0 1.25rem;
  font-weight: 450;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
  font-variation-settings: 'opsz' 48, 'SOFT' 25;
}

.pub-group-title:first-of-type { margin-top: 0; }

.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.pub-item:last-child { border-bottom: none; }

.pub-meta {
  color: var(--text-subtle);
  font-size: 0.8125rem;
  font-feature-settings: 'tnum';
}

.pub-meta .publisher {
  color: var(--accent-warm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.7rem;
  margin-right: 0.35rem;
}

.pub-title a {
  color: var(--text);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

.pub-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ============= CONTACTS ============= */

.contacts-list {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem 2.5rem;
  margin: 0;
  font-size: 1.0625rem;
}

.contacts-list dt {
  color: var(--text-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-top: 4px;
}

.contacts-list dd {
  margin: 0;
  color: var(--text);
}

.contacts-list a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  font-weight: 500;
}

.contacts-list a:hover {
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.email-placeholder {
  display: inline;
  opacity: 0.6;
  font-style: italic;
}

/* ============= FOOTER ============= */

.site-footer {
  padding: 2.5rem 0;
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-subtle);
  font-size: 0.8125rem;
}

.site-footer p { margin: 0; }

/* ============= RESPONSIVE ============= */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
  }
  .hero-photo img { max-width: 280px; }

  .featured-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .achievements-grid { grid-template-columns: 1fr; }

  .pub-item { grid-template-columns: 200px 1fr; gap: 1.25rem; }
}

@media (max-width: 720px) {

  /* НАВИГАЦИЯ: скрыть меню, показать гамбургер */
  .nav-toggle {
    display: flex;
  }

  .site-header {
    padding: 0.5rem 0;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .site-header.nav-open .site-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
  }

  .site-nav a:last-child { border-bottom: none; }
  .site-nav a::after { display: none; }

  /* HERO */
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }

  .hero-photo {
    max-width: 260px;
  }

  .hero-photo img { max-width: 260px; }

  /* SECTIONS */
  .section-block, .featured {
    padding: 3.5rem 0;
  }

  .container { padding: 0 1.25rem; }

  /* FEATURED на мобайле — одна колонка */
  .featured-grid { grid-template-columns: 1fr; }

  /* CAREER — превращаем в карточки */
  .career-wrap { overflow: visible; }
  .career-table { min-width: 0; }
  .career-table, .career-table thead, .career-table tbody,
  .career-table tr, .career-table td { display: block; width: 100%; }
  .career-table thead { display: none; }
  .career-table tbody tr {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 0.75rem;
    margin-bottom: 1rem;
    border: none;
    box-shadow: var(--shadow-sm);
  }
  .career-table tbody tr:last-child { margin-bottom: 0; }
  .career-table tbody td {
    padding: 0.5rem 0;
    border: none;
    width: 100% !important;
  }
  .career-table td::before {
    content: attr(data-label);
    display: block;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.09em;
    color: var(--text-subtle);
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  .career-table td:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding-top: 0;
  }

  /* SPEAKING — столбцом */
  .speaking-item,
  .speaking-item.with-photo {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }
  .speaking-date {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
  }
  .speaking-date .date-main {
    font-size: 1.0625rem;
  }
  .speaking-photo {
    margin: 0.25rem 0 0.5rem;
  }

  /* PUBLICATIONS */
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1rem 0;
  }

  /* CONTACTS */
  .contacts-list {
    grid-template-columns: 1fr;
    gap: 0.35rem 0;
  }
  .contacts-list dt {
    margin-top: 1.25rem;
    padding-top: 0;
  }
  .contacts-list dt:first-child { margin-top: 0; }

  /* Typography size */
  body { font-size: 16px; }
  #bio p, .hero-summary { font-size: 1rem; }
  .speaking-context, .achievement-card p { font-size: 0.9375rem; }
}

@media (max-width: 420px) {
  .hero-grid { gap: 1.5rem; }
  .hero-photo, .hero-photo img { max-width: 220px; }
  .pub-filters a {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
  }
}

/* ============= PRINT ============= */

@media print {
  .site-header, .site-footer { display: none; }
  .hero { padding: 0 0 2rem; }
  a { color: var(--text); text-decoration: none; }
  .featured-card, .achievement-card { break-inside: avoid; }
}

/* ============= ACCESSIBILITY ============= */

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============= LIGHTBOX ============= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(12, 12, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 5rem;
  cursor: zoom-out;
  animation: lb-fade 0.18s ease-out;
}

.lightbox[hidden] { display: none; }

@keyframes lb-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: default;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #1a1a1c;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  max-width: 56rem;
  padding: 0 1rem;
}

.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.75rem;
  font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  font-weight: 300;
  padding-bottom: 0.25rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }

.lightbox-counter {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.lightbox-counter[hidden] { display: none; }

@media (max-width: 720px) {
  .lightbox {
    padding: 3rem 0.5rem 4rem;
  }
  .lightbox-img {
    max-height: calc(100vh - 7rem);
  }
  .lightbox-prev,
  .lightbox-next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  .lightbox-caption {
    font-size: 0.8125rem;
  }
}

/* ============================================================
   Back-to-top button
   ============================================================ */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.to-top:hover,
.to-top:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  outline: none;
}
.to-top:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.25), var(--shadow-md);
}
.to-top svg {
  display: block;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .to-top {
    right: 1rem;
    bottom: 1rem;
    padding: 0.75rem;
    border-radius: 50%;
    width: 2.75rem;
    height: 2.75rem;
    justify-content: center;
  }
  .to-top-label {
    /* На мобиле оставляем только иконку, текст скрываем визуально */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: opacity 0.01ms;
    transform: none;
  }
}
