/* ============================================
   CSS VARIABLES (Monochrome Grayscale Theme - More Gray)
   ============================================ */
:root {
  --bg-0: #1a1a1a; /* dark gray base */
  --bg-1: #252525; /* section background */
  --bg-2: #323232; /* cards, chips */
  --bg-alt: #2c2c2c; /* alternate sections */
  --text: #e8e8e8; /* по-сив от Apple white (#f5f5f7) */
  --text-muted: #a8a8a8; /* muted gray */
  --border: #404040; /* gray borders */
  --accent: #c8c8c8; /* по-тъмен сив accent */
  --accent-hover: #f0f0f0; /* светъл сив on hover (не чист бял) */
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --hero-gradient: radial-gradient(ellipse at center, rgba(10, 10, 10, 0.4) 0%, rgba(15, 15, 15, 0.4) 100%);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg-0);
  font: 300 14px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.02em;
}

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.center {
  text-align: center;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-gradient), url("https://images.unsplash.com/photo-1517336714731-489689fd1ca8?w=1920&q=80") center/cover;
  filter: grayscale(1) brightness(0.78) contrast(1.12); /* full grayscale - no color tints */
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-top: -10vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* още по-smooth, butter-like easing */
}

.avatar {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 3px solid var(--accent); /* light gray border */
  margin: 0 auto 20px;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.76) contrast(1.05);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* по-smooth */
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #e8e8e8; /* по-сив */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* по-smooth */
}

.subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--accent); /* light gray */
  margin: 0 0 56px;
  letter-spacing: 0.03em;
  filter: brightness(1.05);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* по-smooth */
}

/* ============================================
   VERTICAL NAVIGATION (in hero)
   ============================================ */
.nav-vertical {
  margin: 48px auto 0;
  max-width: 280px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease 0.3s backwards; /* fade-in анимация с 0.3s delay */
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list-vertical li {
  border-bottom: 1.5px solid rgba(200, 200, 200, 0.2); /* по-тъмни сиви borders */
  padding: 0 80px;
}

.nav-list-vertical li:first-child {
  border-top: none;
}

.nav-list-vertical li:last-child {
  border-bottom: 1.5px solid rgba(200, 200, 200, 0.2);
}

.nav-list-vertical a {
  display: inline-block;
  width: auto;
  margin: 0 auto;
  color: #d0d0d0; /* по-тъмен сив */
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  padding: 10px 0;
  text-align: center;
  position: relative;
  transition: color 0.3s ease;
}

.nav-list-vertical a::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-hover); /* white underline */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-list-vertical a:hover,
.nav-list-vertical a:focus {
  color: var(--accent-hover); /* white on hover */
}

.nav-list-vertical a:hover::after,
.nav-list-vertical a:focus::after {
  transform: scaleX(1);
}

/* ============================================
   HORIZONTAL STICKY NAVBAR (on scroll)
   ============================================ */
.nav-vertical.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  max-width: none;
  padding: 6px 0;
  background: #1a1a1a; /* solid color вместо rgba за да няма blur issues */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 2px solid #606060;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: slideDown 0.4s ease;
  /* Ensure no filters apply to text */
  filter: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Placeholder to preserve space when navbar becomes sticky */
.nav-vertical.sticky::before {
  content: "";
  display: block;
  height: 0; /* не заема място, само предотвратява shift */
}

/* Slide down when appearing */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide up when hiding */
.nav-vertical.sticky.hiding {
  animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.nav-vertical.sticky .nav-list-vertical {
  flex-direction: row;
  justify-content: center;
  gap: 40px;
  padding: 0 20px;
}

.nav-vertical.sticky .nav-list-vertical li {
  border-bottom: none;
  padding: 0;
}

.nav-vertical.sticky .nav-list-vertical a {
  padding: 4px 16px; /* ДРАСТИЧНО намален от 5px */
  margin: 0;
  font-size: 14px; /* намален от 15px за компактност */
  /* Ensure crisp text rendering */
  text-shadow: none;
  filter: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.nav-vertical.sticky .nav-list-vertical a::after {
  bottom: 4px;
}

/* Responsive: stack vertically on small screens even when sticky */
@media (max-width: 640px) {
  .nav-vertical.sticky .nav-list-vertical {
    flex-direction: row; /* запазва хоризонтално подреждане */
    gap: 16px; /* намален от 40px за повече място */
    flex-wrap: wrap; /* позволява wrap ако няма място */
    justify-content: center;
  }
  .nav-vertical.sticky {
    padding: 5px 0;
  }
  .nav-vertical.sticky .nav-list-vertical a {
    padding: 4px 8px; /* намален horizontal padding от 16px */
    font-size: 13px; /* намален от 14px */
  }
}

/* Extra small screens: further reduce */
@media (max-width: 400px) {
  .nav-vertical.sticky .nav-list-vertical {
    gap: 12px; /* още по-малък gap */
  }
  .nav-vertical.sticky .nav-list-vertical a {
    padding: 4px 6px; /* минимален padding */
    font-size: 12px; /* още по-малък */
  }
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
#skills,
#projects,
#certifications,
#contact {
  scroll-margin-top: 80px;
}

.section {
  margin: 32px 0;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#projects,
#contact {
  background: var(--bg-alt);
}

.section h2 {
  margin-top: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center; /* ensure section titles centered */
}

.section p {
  max-width: none; /* remove max-width for 2-column layout */
  margin-left: 0;
  margin-right: 0;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.75;
}

.subsection {
  margin-top: 32px;
}

.subsection h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--accent); /* consistent accent for both About and Skills */
  text-align: center; /* centered in both columns */
}

/* ============================================
   CHIPS (Skills tags)
   ============================================ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
}

.chips li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.card a {
  margin-top: auto;
  color: var(--accent); /* light gray */
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s ease;
}

.card a:hover {
  color: var(--accent-hover); /* white on hover */
  text-decoration: underline;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tags li {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

/* ============================================
   CERTIFICATIONS LIST
   ============================================ */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  padding: 0px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: 0;
}

/* ============================================
   CONTACT LINKS
   ============================================ */
.links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.links a {
  color: var(--accent); /* light gray */
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.links a:hover {
  color: var(--accent-hover); /* white on hover */
  text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  color: var(--text-muted);
  padding: 24px 0 48px;
  font-size: 14px;
}

/* ============================================
   UNDER CONSTRUCTION OVERLAY
   ============================================ */
.uc-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.uc-overlay.show {
  display: flex;
}

.uc-card {
  width: min(560px, 92vw);
  padding: 32px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.uc-card h2 {
  margin-top: 0;
}

.uc-card p {
  color: var(--text-muted);
}

/* ============================================
   TWO-COLUMN LAYOUT (for sections)
   ============================================ */
.two-column {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | divider | right */
  gap: 40px;
  align-items: start;
  text-align: left;
}

.two-column.centered {
  text-align: center;
}

.column {
  min-width: 0;
}

.column-divider {
  width: 1px;
  height: 100%;
  min-height: 200px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  align-self: stretch;
}

/* Two-column centered: truly center inner content in each column */
.two-column.centered .column {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers form and social block */
}

/* In section paragraphs inside two columns: allow full width in column */
.section .two-column p {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

/* Contact form fixes */
.contact-form {
  max-width: 460px; /* keep it tidy */
  margin: 0 auto; /* center inside the column */
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 520px; /* keep tidy width */
  margin: 0 auto; /* center inside column */
  align-items: stretch; /* inputs and button stretch full width */
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  display: block;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;

  min-width: 0;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 200, 200, 0.12);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button {
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg-0);
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  align-self: stretch; /* full-width button to avoid misalignment */
}

.contact-form button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224, 224, 224, 0.15);
}

/* Social icons: bigger spacing and labels under icons */
.social-icons {
  display: flex;
  gap: 32px; /* increased spacing */
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.icon-link {
  color: var(--accent);
  display: inline-flex;
  flex-direction: column; /* icon above, label below */
  align-items: center;
  gap: 8px; /* space between icon and label */
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.icon-link .icon-label {
  font-size: 12px;
  color: var(--text-muted);
}

.icon-link:hover {
  color: var(--accent-hover);
  transform: translateY(-2px);
}

/* Mobile: keep it clean */
@media (max-width: 768px) {
  .social-icons {
    gap: 24px;
  }
  .contact-form {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 64px 20px;
  }
  .hero-content {
    margin-top: -8vh;
    min-height: 75vh;
  }
  .hero h1 {
    font-size: 36px;
  }
  .subtitle {
    font-size: 16px;
    margin-bottom: 48px;
  }
  .section {
    padding: 18px;
  }
  .avatar {
    width: 100px;
    height: 100px;
  }
  .nav-list-vertical li {
    padding: 0 60px;
  }
}

@media (max-width: 400px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .hero {
    padding: 56px 12px;
  }
  .hero-content {
    margin-top: -6vh;
    min-height: 70vh;
  }
  .hero h1 {
    font-size: 32px;
  }
  .subtitle {
    font-size: 15px;
    margin-bottom: 40px;
  }
  .section {
    padding: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .nav-list-vertical li {
    padding: 0 50px;
  }
  .nav-vertical {
    margin-top: 40px;
  }
}

/* ============================================
   RESPONSIVE (consolidated)
   ============================================ */
@media (max-width: 768px) {
  /* Two-column layout → single column */
  .two-column {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }

  .column-divider {
    display: none;
  }

  .section {
    text-align: center;
  }

  /* Hero */
  .hero {
    padding: 64px 20px;
  }

  .hero-content {
    margin-top: -8vh;
  }

  .hero h1 {
    font-size: 36px;
  }

  .subtitle {
    font-size: 16px;
    margin-bottom: 48px;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  .nav-list-vertical li {
    padding: 0 60px;
  }

  /* Certifications */
  .cert-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .cert-left {
    gap: 10px;
  }

  .cert-thumb {
    width: 50px;
    height: 35px;
    padding: 3px;
  }

  .cert-body h4 {
    font-size: 12px; /* slightly smaller */
    line-height: 1.15; /* a bit tighter */
    -webkit-line-clamp: 2; /* enforce 2 lines on mobile */
    line-clamp: 2;
    white-space: normal; /* make sure it's allowed to wrap */
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .cert-arrow {
    display: none;
  }

  .pdf-viewer-container,
  .cert-pdf-viewer {
    min-height: 340px;
  }

  /* Skills & Contact */
  .chips li {
    font-size: 11px;
    padding: 5px 8px;
  }

  .social-icons {
    gap: 20px;
  }

  .contact-form {
    max-width: 100%;
  }

  /* UI elements */
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 400px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    padding: 56px 12px;
  }

  .hero-content {
    margin-top: -6vh;
  }

  .hero h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 40px;
  }

  .section {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .nav-list-vertical li {
    padding: 0 50px;
  }

  .nav-holder {
    height: calc(var(--hero-nav-h) + 12px);
  }

  .cert-item {
    padding: 6px 8px;
  }

  .cert-thumb {
    width: 44px;
    height: 30px;
  }

  .cert-body h4 {
    font-size: 11.5px; /* tiny adjustment for very narrow screens */
    line-height: 1.12;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
  }

  .pdf-viewer-container,
  .cert-pdf-viewer {
    min-height: 280px;
  }
}

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

  .card:hover {
    transform: none;
  }
}

/* ============================================
   CERTIFICATIONS CARDS (borderless, high contrast)
   ============================================ */
#certs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0px 0px; /* drastically reduced from 4px */
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cert-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cert-item.active {
  background: rgba(255, 255, 255, 0.08);
}

/* Left: thumb + text */
.cert-left {
  display: flex;
  align-items: center; /* ensure vertical centering */
  gap: 6px; /* намален от 8px */
  flex: 1;
  min-width: 0;
}

.cert-thumb {
  width: 96px;
  height: 66px;
  border-radius: 16px; /* увеличен от 8px на 16px за по-видимо заобляне */
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: inherit;
}

.cert-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
}

/* Right: arrow (hidden on mobile) */
.cert-arrow {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.3; /* много subtle по default */
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.cert-item:hover .cert-arrow {
  color: var(--accent);
  opacity: 0.7; /* по-видима на hover */
}

.cert-item.active .cert-arrow {
  color: var(--accent);
  opacity: 1; /* пълна opacity когато е selected */
}

/* PDF viewer */
.pdf-viewer-container {
  position: relative;
  width: 100%;
  min-height: 420px;
  background: #000;
  border-radius: 12px; /* по-голям радиус на PDF viewer-а */
  overflow: hidden;
  border: 1px solid var(--border);
}

.pdf-viewer-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  background: #000;
}

.pdf-viewer-placeholder.hidden {
  display: none;
}

.cert-pdf-viewer {
  width: 100%;
  min-height: 420px;
  height: 100%;
  border: 0;
  display: none;
  background: #111;
}

.cert-pdf-viewer.active {
  display: block;
}

/* Horizontal Overlay Navbar */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #1a1a1a; /* solid to keep text crisp */
  border-bottom: 2px solid #606060; /* visible separator */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 200;
  padding: 6px 0; /* thin bar */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay-list {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
}
.nav-overlay-list a {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 14px;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-overlay-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-overlay-list a:hover {
  color: var(--accent-hover);
}
.nav-overlay-list a:hover::after {
  transform: scaleX(1);
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, color 0.2s ease;
  z-index: 200;
}

.back-to-top.show {
  opacity: 0.9;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cert-body h4 {
  margin: 0;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.1; /* намален за по-компактен вид */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
