/* ==========================================================================
   MURZIN NIKITA — MINIMALIST EDITORIAL PORTFOLIO
   Clean #FFFFFF background, crisp typography, responsive layout.
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: #ffffff;
  color: #000000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #ffffff;
  color: #000000;
  padding: 60px 24px 100px;
}

.page-container {
  max-width: 1040px;
  margin: 0 auto;
}

/* Typography & Links */
a {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.7;
}

.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 56px 0;
}

/* Intro */
.intro-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

.role {
  font-size: 18px;
  color: #555555;
  margin-top: -8px;
  margin-bottom: 4px;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

/* Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background-color: #000000;
  color: #ffffff;
  border: 1px solid #000000;
}

.btn-primary:hover {
  background-color: #222222;
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  opacity: 1;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  gap: 6px;
}

/* Skills */
.skills-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 36px;
  row-gap: 8px;
  font-size: 14px;
  color: #222222;
}

.skills-list li {
  position: relative;
  padding-left: 16px;
  line-height: 1.45;
}

.skills-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #888888;
}

/* Case Studies */
.case-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.case-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #888888;
}

.case-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.case-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

.case-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background-color: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: #444444;
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  max-width: 860px;
}

.facts-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.6;
}

.facts-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #000000;
}

.facts-list strong {
  font-weight: 600;
}

/* Case Images */
.case-images {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 8px;
}

.grid-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.image-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-box.full-width {
  grid-column: 1 / -1;
}

.image-box img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fafafa;
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.image-box img:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.08);
}

.caption {
  font-size: 12px;
  color: #777777;
  font-family: 'JetBrains Mono', monospace;
}

/* Lightbox & Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-wrapper {
  position: relative;
  z-index: 10000;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.is-active .modal-wrapper {
  transform: scale(1);
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-content img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
  background-color: #111111;
}

.modal-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #f3f4f6;
  text-align: center;
  max-width: 800px;
  line-height: 1.4;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.modal-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Dedicated CV Modal — Floating white bar above the image */
.cv-modal-wrapper {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  max-width: 95vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cv-modal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.cv-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background-color: #f3f4f6;
  color: #000000;
  border-color: #cbd5e1;
}

.cv-modal-body {
  overflow: hidden;
  padding: 0;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cv-image {
  max-height: calc(88vh - 65px);
  max-width: 92vw;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #666666;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-alt {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Responsive / Mobile Optimization */
@media (max-width: 768px) {
  body {
    padding: 32px 16px 56px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 12px;
  }

  .skills-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .grid-images {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .divider {
    margin: 36px 0;
  }

  .name {
    font-size: 26px;
  }

  .role {
    font-size: 16px;
  }

  .contacts {
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
  }

  .case-meta {
    gap: 8px;
  }

  .case-title {
    font-size: 22px;
  }

  .case-body {
    gap: 18px;
  }

  .facts-list {
    font-size: 14px;
    gap: 8px;
  }

  .modal {
    padding: 12px;
  }

  .modal-close {
    top: -38px;
    font-size: 28px;
  }

  .modal-content img {
    max-width: 95vw;
    max-height: 72vh;
  }

  .modal-caption {
    font-size: 12px;
  }

  .cv-modal-header {
    width: 100%;
    padding: 8px 12px;
  }

  .cv-modal-title {
    font-size: 11px;
  }

  .cv-image {
    max-height: calc(88vh - 60px);
    max-width: 95vw;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

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

/* Clean Print / PDF Mode */
@media print {
  body {
    padding: 0;
  }
  
  .case-section {
    page-break-inside: avoid;
  }

  .divider {
    margin: 32px 0;
  }

  .modal {
    display: none !important;
  }
}
