/* CSS Variables for easy customization */
:root {
  /* Colors */
  --accent: #ff1461; /* Bright pink accent color */
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-accent: #fff5f8;
  --border-light: #e0e0e0;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 30px rgba(0, 0, 0, 0.15);

  /* Layout widths - easy to change */
  --container-max-width: 1600px; /* Main container max width */
  --case-max-width: 800px; /* Case study page max width */

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;

  /* Typography */
  --font-family: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-body: clamp(16px, 2.5vw, 16px);
  --font-size-h1: clamp(32px, 5vw, 56px);
  --font-size-h2: clamp(24px, 4vw, 40px);
  --font-size-h3: clamp(24px, 3vw, 32px);

  /* Border radius */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  /* Breakpoints */
  --breakpoint-tablet: 640px;
  --breakpoint-desktop: 1024px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes dots-drift {
  from { background-position: 0 0; }
  to   { background-position: -20px 0; }
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle, #e8e8e8 1px, transparent 1px);
  background-size: 20px 20px;
  animation: dots-drift 2s linear infinite;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}

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

/* Адаптивная загрузка изображений */
img[data-src] {
  opacity: 0;
  transition: opacity 0.6s ease-in-out, filter 0.6s ease-in-out;
  filter: blur(10px);
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

img[data-src].loaded {
  opacity: 1;
  filter: blur(0);
}

img[data-src].load-error {
  opacity: 0.5;
  filter: blur(0);
  background: var(--bg-secondary);
}

/* Анимация скелетона для загружающихся изображений */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Оптимизация для изображений с aspect-ratio */
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder для изображений */
.image-wrapper {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.image-wrapper::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loading 1.5s infinite;
}

.image-wrapper.loaded::before {
  display: none;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: all 0.3s ease;
}

a:hover, a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Container system */
.container {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.case-container {
  max-width: var(--case-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

@media (min-width: 640px) {
  .container,
  .case-container {
    padding: 0 var(--spacing-lg);
  }
}

/* Header and Navigation */
.header {
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  left: 0;
  right: 0;
}

.nav {
  padding: var(--spacing-sm) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  position: relative;
}

@media (min-width: 1101px) {
  .nav-container {
    gap: 240px;
  }
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.logo {
  display: inline-block;
}

.theme-switch {
  display: inline-flex;
  border: 1.5px solid var(--accent);
  overflow: hidden;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.theme-switch-item {
  padding: 0;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border: none;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.theme-switch-item:not(:last-child) {
  border-right: 1.5px solid var(--accent);
}

.theme-switch-item[data-value="light"] {
  background: #ffffff;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.12);
}

.theme-switch-item[data-value="dark"] {
  background: #ffffff;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.12);
}

.theme-switch-item:hover {
  opacity: 0.75;
}

:root:not([data-theme]) .theme-switch-item[data-value="light"],
:root[data-theme="light"] .theme-switch-item[data-value="light"] {
  background: var(--accent);
  pointer-events: none;
  opacity: 1;
}

:root[data-theme="dark"] .theme-switch-item[data-value="dark"] {
  background: var(--accent);
  pointer-events: none;
  opacity: 1;
}

.logo a {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.logo span::after {
  content: "антон костылев";
  color: white;
}

/* Адаптивные изменения в порядке приоритета */

/* 1. Сначала убираем "скачать" (остаётся "↓ резюме") при ≤1000px */
@media (max-width: 1000px) {
  .btn-text-short {
    display: inline;
  }

  .btn-text-full {
    display: none;
  }
}

/* 2. Потом логотип меняется на "ak" при ≤1100px */
@media (max-width: 1100px) {
  .logo span::after {
    content: "ak";
  }
}

/* 3. Потом убираем "канал в" (остаётся "tg") при ≤700px */
/* Стили уже применены в пункте 1 */

.logo a:hover, .logo a:focus {
  outline: none;
  opacity: 0.9;
}

.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.burger-menu span {
  display: block;
  width: 100%;
  height: 4px;
  background: var(--accent);
  transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-buttons-wrapper {
  display: flex;
  flex-shrink: 0;
  min-width: 0;
}

.nav-buttons {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.nav-buttons > * {
  flex-shrink: 0;
}

.logo {
  flex-shrink: 0;
}


@media (min-width: 640px) {
  .nav {
    padding: var(--spacing-md) 0;
  }

  .nav-buttons {
    gap: var(--spacing-sm);
  }
}

@media (max-width: 1100px) {
  .burger-menu {
    display: flex;
  }

  .nav-buttons-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-buttons-wrapper.active {
    right: 0;
  }

  .nav-buttons {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 100px 24px 40px;
    flex-wrap: nowrap;
    min-height: 100%;
    width: 100%;
    max-width: 320px;
    gap: var(--spacing-sm);
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    align-self: stretch;
  }

  .nav-buttons .btn-secondary {
    align-self: stretch;
  }
}

@media (min-width: 1101px) {
  .burger-menu {
    display: none !important;
  }

  .nav-buttons-wrapper {
    position: static !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .nav-buttons {
    position: static !important;
    width: auto !important;
    height: auto !important;
    flex-direction: row !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover, .btn:focus {
  box-shadow: var(--shadow-hover);
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #e60050;
}

.btn-secondary {
  background: white;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.nav-buttons .btn-secondary {
  flex-shrink: 0;
  order: 2;
}

.nav-buttons .nav-links {
  order: 1;
}

.btn-text {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-weight: 500;
}

.btn-text:hover {
  opacity: 0.8;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  padding: var(--spacing-xs) var(--spacing-sm);
  min-width: 40px;
  background: transparent;
  color: var(--accent);
  font-size: 16px;
  border: none;
  font-weight: 500;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-icon:hover {
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.lang-switch {
  display: inline-flex;
  border: 1.5px solid var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

.lang-switch-item {
  padding: 0 9px;
  height: 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-switch-item:not(:last-child) {
  border-right: 1.5px solid var(--accent);
}

.lang-switch-item--active {
  background: var(--accent);
  color: white;
  cursor: default;
  pointer-events: none;
}

.lang-switch-item:not(.lang-switch-item--active):hover {
  background: var(--bg-accent);
}

.btn-large {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 16px;
}

.btn-text-short {
  display: none;
}

.btn-text-full {
  display: inline;
}


@media (max-width: 800px) {
  .btn {
    padding: var(--spacing-xs);
    font-size: 14px;
    white-space: nowrap;
  }

  .btn:not(.btn-icon) {
    padding: var(--spacing-xs) 8px;
  }

  .btn-text {
    font-size: 14px;
    padding: var(--spacing-xs) 4px;
  }

  .btn-secondary {
    padding: var(--spacing-xs) 8px;
    font-size: 14px;
  }

  .nav-buttons {
    gap: 4px;
  }

  .social-buttons {
    gap: 4px;
  }
}

/* Main content */
.main {
  min-height: calc(100vh - 80px);
}

/* Hero section */
.hero {
  padding: var(--spacing-md) 0 0;
  padding-bottom: var(--spacing-md);
  background: transparent;
  overflow: hidden;
}

@media (min-width: 503px) {
  .hero {
    padding-bottom: 0;
  }
}

@media (min-width: 503px) {
  .hero {
    padding: var(--spacing-xxl) 0 0;
  }
}

.hero-content {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: flex-end;
  text-align: left;
  min-height: 320px;
}

.hero-image {
  order: 1;
  flex-shrink: 0;
  align-self: flex-end;
  line-height: 0;
  display: flex;
  align-items: flex-end;
  gap: 56px;
}

.avatar-stack {
  position: relative;
  width: 340px;
  flex-shrink: 0;
}

.avatar-png {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  display: block;
}

.avatar-inside {
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: auto;
  z-index: 0;
  display: block;
  object-fit: contain;
}

.avatar-svg {
  position: absolute;
  bottom: 0;
  left: -24px;
  width: 100%;
  height: auto;
  z-index: 1;
  display: block;
}

@media (min-width: 1024px) {
  .avatar-stack {
    width: 460px;
  }
}

.hero-text {
  flex: 1;
  align-self: center;
  padding-bottom: var(--spacing-xl);
  display: flex;
  flex-direction: column;
}

/* FigmaJam sticky note */
.figma-note {
  background: #fff9b1;
  padding: 48px 54px;
  box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.12);
  align-self: center;
  flex-shrink: 0;
  max-width: 450px;
  line-height: 1.5;
  font-size: 24px;
  color: #1a1a1a;
}

.figma-note p:first-child {
  margin-bottom: 24px;
  font-weight: 600;
}

.figma-note p {
  margin: 0;
  font-size: 23px;
  color: #444;
}

@media (max-width: 639px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
    min-height: unset;
  }

  .hero-text {
    padding-bottom: 0;
  }

  .hero-image {
    order: -1;
  }
}

.hero-greeting {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0;
}

.hero-text h1 {
  font-size: var(--font-size-h1);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
  justify-content: flex-start;
}

.hero-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: var(--spacing-lg);
}

.hero-links__row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.hero-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.hero-link:hover {
  opacity: 0.7;
}

.hero-link--icon {
  display: flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .hero-tags {
    justify-content: center;
  }
}

.hero-tag {
  display: inline-block;
  background: var(--bg-accent);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.5;
}

.hero-tag-break {
  flex-basis: 100%;
  height: 0;
  width: 0;
}

.hero-text p {
  font-size: clamp(16px, 2.5vw, 24px);
  color: var(--text-secondary);
  max-width: 600px;
}

/* Projects section */
.projects {
  padding: var(--spacing-xxl) 0;
  background: var(--bg-secondary);
}

.projects h2 {
  font-size: var(--font-size-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  text-transform: lowercase;
  color: var(--accent);
}

.projects h2::before {
  content: "[ ";
}

.projects h2::after {
  content: " ]";
}

.projects-grid {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

@media (min-width: 1600px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
}

/* Project cards with hover animation */
.project-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
}

.project-card:hover .project-title {
  color: var(--accent);
}

.project-card:hover, .project-card:focus {
  outline: none;
}

@media (min-width: 800px) {
  .project-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.project-image {
  flex-shrink: 0;
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

@media (min-width: 800px) {
  .project-image {
    width: 50%;
    height: 100%;
    min-height: auto;
  }

  .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.project-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.project-tag {
  display: inline-block;
  background: var(--bg-accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.5;
}

.project-title {
  font-size: var(--font-size-h3);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  font-size: 16px;
}

.project-link {
  color: var(--accent);
  font-weight: 500;
  font-size: 16px;
  margin-top: auto;
}

.project-link:hover {
  text-decoration: underline;
}

/* Works section */
.works {
  padding: var(--spacing-md) 0;
  background: var(--bg-secondary);
}

@media (min-width: 503px) {
  .works {
    padding: var(--spacing-xxl) 0;
  }
}

.works h2 {
  font-size: var(--font-size-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  text-transform: lowercase;
  color: var(--accent);
}

.works h2::before {
  content: "[ ";
}

.works h2::after {
  content: " ]";
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

@media (min-width: 503px) {
  .works-list {
    gap: var(--spacing-md);
  }
}

.work-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--bg-primary);
  transition: background 0.3s ease;
  cursor: pointer;
}

.work-item:hover,
.work-item:focus {
  outline: none;
}

.work-item:hover .work-title {
  color: var(--accent);
  text-decoration: underline;
}

.work-item--disabled {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

@media (min-width: 503px) {
  .work-item {
    flex-direction: row;
    min-height: 220px;
  }
}

@media (min-width: 800px) {
  .work-item {
    min-height: 340px;
  }
}

.work-info {
  flex: 1;
  padding: var(--spacing-xs) var(--spacing-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-width: 0;
}

@media (min-width: 503px) {
  .work-info {
    padding: var(--spacing-lg);
  }
}

@media (min-width: 800px) {
  .work-info {
    padding: var(--spacing-xl);
  }
}


.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

@media (min-width: 503px) {
  .work-tags {
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
  }
}

.work-tag {
  display: inline-block;
  background: var(--bg-accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.work-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

@media (min-width: 503px) {
  .work-title {
    font-size: clamp(44px, 6vw, 72px);
    margin-bottom: var(--spacing-md);
  }
}

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

@media (min-width: 503px) {
  .work-meta {
    gap: 6px;
    margin-bottom: var(--spacing-lg);
  }
}

.work-meta-row {
  display: flex;
  gap: var(--spacing-sm);
  font-size: 14px;
  line-height: 1.4;
}

.work-meta-label {
  color: var(--text-light);
  font-weight: 500;
  min-width: 100px;
  flex-shrink: 0;
}

.work-meta-value {
  color: var(--text-secondary);
}

.work-link {
  color: var(--accent);
  font-weight: 500;
  font-size: 15px;
}

.work-image {
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}

@media (max-width: 502px) {
  .work-image {
    display: none;
  }
}

@media (min-width: 503px) {
  .work-image {
    width: 40%;
  }
}

.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
  display: block;
}

.work-logo {
  width: auto !important;
  height: auto !important;
  max-width: 60%;
  max-height: 50%;
  object-fit: contain !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.work-item:hover .work-image img:not(.work-logo) {
  transform: scale(1.04);
}

.work-image--placeholder {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-light) 100%);
}

/* Contact section */
.next-project {
  padding: var(--spacing-xxl) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.next-project-link {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
}

.next-project-link:hover .next-project-title {
  color: var(--accent);
}

.next-project-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.next-project-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.next-arrow {
  display: inline-block;
  position: relative;
  width: 0.7em;
  height: 0.08em;
  background: currentColor;
  vertical-align: middle;
}

.next-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.28em;
  height: 0.28em;
  border-right: 0.08em solid currentColor;
  border-top: 0.08em solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.contact {
  padding: var(--spacing-xxl) 0;
  background: transparent;
  text-align: center;
}

.contact-content h2 {
  font-size: var(--font-size-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  text-align: center;
  text-transform: lowercase;
  color: var(--accent);
}

.contact-content h2::before {
  content: "[ ";
}

.contact-content h2::after {
  content: " ]";
}

.contact-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: var(--spacing-xl) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.footer-links a:hover, .footer-links a:focus {
  color: var(--accent);
  outline: none;
}

.footer-privacy {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.footer-privacy:hover {
  opacity: 0.7;
}

@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .footer-links {
    flex-direction: row;
    gap: var(--spacing-lg);
  }
}

/* Case study specific styles */
.breadcrumbs {
  padding: var(--spacing-lg) 0 var(--spacing-md);
  background: var(--bg-secondary);
}

.breadcrumb-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.case-hero {
  padding: var(--spacing-xl) 0 var(--spacing-xxl);
  background: var(--bg-secondary);
}

.case-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.case-tag {
  display: inline-block;
  background: var(--bg-accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
}

.case-title {
  font-size: var(--font-size-h1);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.case-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.case-content {
  padding: var(--spacing-xxl) 0;
}

.case-section {
  margin-bottom: var(--spacing-xxl);
}

.case-section h2 {
  font-size: var(--font-size-h2);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

.case-section h3 {
  font-size: var(--font-size-h3);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: var(--spacing-xl) 0 var(--spacing-md);
  color: var(--text-primary);
}

.case-section p {
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
  font-weight: 500;
}

.case-section ul {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.case-section li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.7;
}

/* Case gallery grid */
.case-gallery {
  margin-bottom: var(--spacing-xxl);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.gallery-grid.gallery-grid--1 { grid-template-columns: 1fr; }
.gallery-grid.gallery-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 639px) {
  .gallery-grid,
  .gallery-grid.gallery-grid--3 {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-secondary);
}

.gallery-item img.lb-trigger {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img.lb-trigger {
  transform: scale(1.03);
}

.gallery-item figcaption {
  font-size: 13px;
  color: var(--text-light);
  padding: 8px 0 0;
  line-height: 1.4;
}

/* ── Lightbox ───────────────────────────────────────────── */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 72px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lb-overlay.lb-visible {
  opacity: 1;
  pointer-events: auto;
}

.lb-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.lb-close:hover { color: #fff; }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 52px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 20px;
  transition: color 0.15s;
  user-select: none;
}

.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { color: #fff; }

.lb-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-family: var(--font-family);
}

.case-gallery h2 {
  font-size: var(--font-size-h2);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.gallery-row {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .gallery-row {
    grid-template-columns: 1fr 1fr;
  }
}

.gallery-item img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.gallery-caption {
  text-align: center;
  margin-top: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.gallery-banner {
  margin-bottom: var(--spacing-xl);
}

.gallery-banner img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

/* Case metrics */
.case-metrics {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: 1fr;
  background: var(--bg-secondary);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
  .case-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--spacing-xs);
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Case CTA */
.case-cta {
  background: var(--bg-accent);
  padding: var(--spacing-xxl);
  border-radius: var(--radius-lg);
  text-align: center;
}

.cta-content h2 {
  font-size: var(--font-size-h2);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
}

.cta-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Experience section */
.experience {
  padding: var(--spacing-xxl) 0;
  background: var(--bg-primary);
}

.experience h2 {
  font-size: var(--font-size-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  text-transform: lowercase;
  color: var(--accent);
}

.experience h2::before {
  content: "[ ";
}

.experience h2::after {
  content: " ]";
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  max-width: 680px;
  margin: 0 auto;
}

.experience-item {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--spacing-lg);
}

.experience-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.experience-period {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
  font-variant-numeric: tabular-nums;
}

.experience-title {
  font-size: var(--font-size-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.experience-company {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.experience-company-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.5;
}

.experience-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  text-transform: lowercase;
}

.experience-description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.experience-description li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.5em;
}

.experience-description li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-secondary);
}

/* Case tags */
.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--spacing-xxl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-light);
}

.case-tags .tag {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.case-tags .tag:hover {
  background: var(--accent);
  color: white;
}

/* Print styles */
@media print {
  .header,
  .footer,
  .case-cta {
    display: none;
  }

  .main {
    margin: 0;
  }

  * {
    background: white !important;
    color: black !important;
  }
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --text-primary:  #f0f0f0;
  --text-secondary: #999;
  --text-light:    #555;
  --bg-primary:    #111111;
  --bg-secondary:  #1a1a1a;
  --bg-accent:     #1f0a12;
  --border-light:  #272727;
  --shadow:        0 2px 20px rgba(0, 0, 0, 0.5);
  --shadow-hover:  0 4px 30px rgba(0, 0, 0, 0.7);
}

/* Плавный переход для ключевых элементов */
body,
.header,
.nav-buttons-wrapper,
.work-item,
.works,
.experience,
.contact,
.footer,
.btn-secondary,
.logo a {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] body {
  background-color: #111111;
  background-image: radial-gradient(circle, #1e1e1e 1px, transparent 1px);
}

[data-theme="dark"] .header {
  background: #111111;
}

[data-theme="dark"] .nav {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .nav-buttons-wrapper {
  background: #111111;
}

[data-theme="dark"] .btn-secondary {
  background: transparent;
}

[data-theme="dark"] .btn-text,
[data-theme="dark"] .btn-icon {
  color: var(--accent);
}

[data-theme="dark"] .work-item {
  background: #1a1a1a;
  border: 1px solid var(--accent);
}

[data-theme="dark"] .work-image {
  background: #222;
}

[data-theme="dark"] .experience-item {
  border-color: #272727;
}

[data-theme="dark"] .footer {
  background: #0a0a0a;
}

[data-theme="dark"] .footer-links a {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .hero-tag,
[data-theme="dark"] .work-tag {
  border: 1px solid var(--accent);
}