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

html,
body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background-color: #121212;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 16px 20px;
  overflow: hidden;
}

.container {
  background: #1e1e1e;
  padding: 20px 24px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --projects-head-height: 72px;
}

.page-header {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 10px;
}

.lang-btn {
  font-size: 12px;
  color: #64b5f6;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}

.lang-btn.is-active {
  color: #121212;
  background: #64b5f6;
  border-color: #64b5f6;
  font-weight: 600;
}

.price-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  text-align: left;
}

.price-links .price-link {
  margin-top: 0;
}

.price-links__sep {
  color: #666;
  font-weight: 600;
}

.avatar {
  border-radius: 50%;
  margin-bottom: 12px;
  width: 110px;
  height: 110px;
  object-fit: cover;
}

h1 {
  color: #ffffff;
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.subtitle {
  color: #a0a0a0;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.skills {
  text-align: left;
  margin-top: 0;
}

.skills h2 {
  margin-bottom: 6px;
}

.skills li {
  padding: 4px 0;
}

.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  text-align: left;
  padding-right: 4px;
  margin-top: 0;
  -webkit-overflow-scrolling: touch;
}

.page-scroll::-webkit-scrollbar {
  width: 6px;
}

.page-scroll::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 999px;
}

.projects,
.contact {
  text-align: left;
  margin-top: 0;
}

.projects-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(#1e1e1e 70%, rgba(30, 30, 30, 0.92));
  padding: 14px 0 10px;
  border-bottom: 1px solid #333;
  transition: box-shadow 0.3s ease;
}

.projects-head.is-stuck {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.projects-intro {
  color: #a0a0a0;
  font-size: 13px;
  margin: 0;
  line-height: 1.45;
}

.project-block {
  padding-bottom: 8px;
}

.project-card {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.project-card h3 {
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-card h3 svg {
  color: #64b5f6;
  flex-shrink: 0;
}

.project-card p {
  color: #cccccc;
  margin-bottom: 12px;
  line-height: 1.45;
}

.project-card p code {
  font-size: 12px;
  color: #90caf9;
}

.projects-category {
  position: sticky;
  top: var(--projects-head-height);
  z-index: 3;
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0 0 10px;
  padding: 10px 0 8px;
  background: #1e1e1e;
  border-bottom: 1px solid #2f2f2f;
  transition: box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.projects-category.is-stuck {
  background: #232323;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

.contact-title {
  font-size: 18px;
  font-weight: normal;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.project-tags span {
  font-size: 11px;
  color: #a0a0a0;
  border: 1px solid #333;
  background: #1e1e1e;
  border-radius: 6px;
  padding: 3px 8px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64b5f6;
  text-decoration: none;
  border: 1px solid #333;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 7px 12px;
}

.project-btn:hover {
  color: #90caf9;
  border-color: #4a4a4a;
}

.project-btn--primary {
  color: #121212;
  background: #64b5f6;
  border-color: #64b5f6;
  font-weight: 600;
}

.project-btn--primary:hover {
  color: #121212;
  background: #90caf9;
  border-color: #90caf9;
}

h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #e0e0e0;
}

ul {
  list-style: none;
}

li {
  padding: 6px 0;
  border-bottom: 1px solid #333;
  color: #cccccc;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64b5f6;
  text-decoration: none;
  margin-top: 8px;
  width: fit-content;
}

.social-link:hover {
  color: #90caf9;
  text-decoration: underline;
}

.contact {
  padding-bottom: 12px;
}

.contact p {
  color: #cccccc;
  margin-bottom: 8px;
}

/* Mobile: document scroll — nested overflow often breaks touch scrolling */
@media (max-width: 768px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow: auto;
    overflow-x: hidden;
    align-items: flex-start;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .container {
    max-height: none;
    height: auto;
    overflow: visible;
  }

  .page-scroll {
    flex: none;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
  }

  .projects-head,
  .projects-category {
    /* stick to viewport while the page itself scrolls */
    position: sticky;
  }
}

@media (max-height: 720px) {
  .avatar {
    width: 84px;
    height: 84px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .subtitle {
    margin-bottom: 10px;
  }

  .container {
    padding: 14px 16px 10px;
  }
}
