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

:root {
  --bg: #abe6a4;
  --banner-bg: #93c393;
  --text: #000099;
  --accent: #e26c5f;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.page {
  max-width: 1728px;
  margin: 0 auto;
  padding: 24px 31px 48px;
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.header-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.header-avatar {
  width: 287px;
  height: 63px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.header-avatar.placeholder {
  background: #9acb96;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hero {
  display: block;
  position: relative;
  text-align: center;
  margin-bottom: 40px;
}

.hero-text {
  text-align: center;
}

.hero .socials {
  position: absolute;
  right: 0;
  top: 0;
  margin-left: 0;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero .socials {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 24px;
    order: -1;
  }

  .hero .socials [data-action="twitter"] { order: 1; }
  .hero .socials .telegram-disabled { order: 2; }
  .hero .socials [data-action="help"] { order: 3; }

  .telegram-note { display: none; }

  .help-nav + .socials {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

.hero-title {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
}

.hero-title .highlight {
  color: var(--accent);
  font-weight: 700;
}

.hero-title .help-link {
  cursor: pointer;
}

.hero-item {
  font-size: 18px;
  margin-bottom: 4px;
}

.banner {
  background-color: var(--banner-bg);
  padding: 24px 52px;
  margin: 0 auto 48px;
  max-width: 1436px;
  line-height: 1.6;
  font-size: 16px;
}

.cta {
  text-align: center;
  margin-bottom: 64px;
  font-size: 18px;
}

.cta .contact-link {
  font-weight: 700;
  cursor: pointer;
}

.cta .contact-link:hover {
  text-decoration: underline;
}

.projects {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.projects-sidebar {
  flex: 0 0 280px;
}

.projects-title {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 40px;
}

.meme-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meme-list a {
  display: block;
  font-size: 16px;
  padding: 2px 0;
  cursor: pointer;
}

.meme-list a[href]:hover {
  text-decoration: underline;
}

.project-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  column-gap: 28px;
  row-gap: 25px;
}

.project-card {
  display: block;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
  aspect-ratio: 425 / 223;
}

.project-card:hover {
  opacity: 0.85;
}

.project-card img,
.project-image-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-image-placeholder {
  background: #9acb96;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.terms-trigger {
  margin-top: 72px;
  font-size: 16px;
}

.terms-trigger a {
  cursor: pointer;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 2px solid var(--text);
  padding: 32px;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: 2px solid var(--text);
  color: var(--text);
  font-size: 16px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
}

.modal-close:hover {
  background: var(--text);
  color: var(--bg);
}

.modal-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--banner-bg);
  border: 1px solid var(--text);
}

.modal-copy {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 8px 24px;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.modal-copy:hover {
  opacity: 0.85;
}

.site-footer {
  text-align: right;
  padding-top: 24px;
  font-size: 14px;
  color: #2d6a2e;
}

.help-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.socials {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-bottom: 32px;
  width: fit-content;
}

.socials a {
  font-size: 16px;
}

.help-back {
  font-size: 18px;
  font-weight: 400;
}

.telegram-disabled {
  color: var(--text);
  opacity: 0.6;
  cursor: not-allowed;
  font-size: 16px;
  background: none;
  border: none;
  font-family: inherit;
  text-align: center;
  padding: 0;
}

.help-section {
  margin-bottom: 32px;
}

.help-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.help-section p {
  margin-bottom: 12px;
  max-width: 640px;
}

.help-section .contact-link {
  font-weight: 700;
  cursor: pointer;
}

.help-section .terms-trigger {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .projects {
    flex-direction: column;
    gap: 24px;
  }

  .projects-sidebar {
    flex: none;
  }

  .terms-trigger {
    margin-top: 24px;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 20px;
  }

  .project-card:nth-child(1) { grid-column: 1; }
  .project-card:nth-child(2) { grid-column: 2; }
  .project-card:nth-child(3) { grid-column: 1; }
  .project-card:nth-child(4) { grid-column: 2; }
  .project-card:nth-child(5) { grid-column: 1; }
  .project-card:nth-child(6) { grid-column: 2; }
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  .header {
    flex-wrap: wrap;
  }

  .header-avatar {
    width: 180px;
    height: 40px;
  }

  .banner {
    padding: 16px;
  }

  .projects {
    flex-direction: column-reverse;
  }

  .project-grid {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 10px;
    row-gap: 10px;
  }

  .project-card:nth-child(n) {
    grid-column: auto;
  }

  .help-nav {
    flex-direction: column;
    gap: 16px;
  }

  .modal-content {
    padding: 20px;
    width: 95%;
  }

  .meme-list a {
    padding: 8px 0;
  }

  .terms-trigger {
    margin-top: 16px;
  }

  .projects .terms-trigger {
    text-align: center;
  }
}
