/* =========================================================
   denvm.ru вЂ” Layout, section blocks & responsive
   ========================================================= */

/* --- Reusable content blocks --------------------------------- */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.about-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 48px;
  align-items: start;
}

.about-block__text .btn {
  margin-top: 26px;
}

.skills-block {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 48px;
  align-items: start;
}

.skills-block__left .btn {
  margin-top: 32px;
}

.skills-block__right .services-grid,
.skills-block__right .btn {
  margin-top: 30px;
}

.projects-block .projects-grid,
.blog-block .posts-grid {
  margin-top: 34px;
}

.projects-block > .btn,
.blog-block > .btn {
  margin-top: 32px;
}

.resume-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  align-items: start;
}

.contacts-block {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 40px;
  align-items: start;
}

.contacts-block .form {
  margin-top: 30px;
}

/* --- Detail page: photo + full section content ---------------- */

/* Definition list used on project detail pages */
.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 44px;
  margin: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.fact-row__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.fact-row__label {
  color: var(--muted);
  font-size: 13px;
}

.fact-row__value {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
}

.project-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.project-detail .prose {
  margin-top: 28px;
}

.prose {
  max-width: 68ch;
}

.prose p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.8;
}

.prose__h {
  margin: 34px 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.prose__h:first-child {
  margin-top: 0;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 52px;
  align-items: start;
}

.detail__media {
  position: sticky;
  top: 108px;
  aspect-ratio: 4 / 4.7;
}

.detail__media--wide {
  aspect-ratio: 16 / 10;
}

.detail__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* Inside a detail column the block grids collapse to one/two columns */
.detail__body .about-block,
.detail__body .skills-block,
.detail__body .resume-block,
.detail__body .contacts-block {
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
}

.detail__body .about__facts,
.detail__body .services-grid,
.detail__body .projects-grid,
.detail__body .posts-grid,
.detail__body .stat-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail__body .about-block__text .about__text {
  max-width: none;
}

.detail__body .about-block--page {
  gap: 40px;
}

/* breathing room between the heading rule and the first paragraph */
.detail__body .about-block--page .prose {
  margin-top: 28px;
}

.detail__body .slider__slide {
  flex-basis: 100%;
}

/* --- Stacks ---------------------------------------------------- */

.stack {
  min-width: 0;
}

.stack > * + * {
  margin-top: 20px;
}

.resume-block .stack > * + * {
  margin-top: 24px;
}

/* Placeholder shown on the certificates page until photos are added. */
.resume-note {
  margin: 0;
  padding: 20px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

/* --- Utilities -------------------------------------------------- */

.mt-0 {
  margin-top: 0;
}
.mt-2 {
  margin-top: 20px;
}
.mt-3 {
  margin-top: 30px;
}
.mt-4 {
  margin-top: 40px;
}
.mb-3 {
  margin-bottom: 30px;
}
.text-accent {
  color: var(--accent);
}
.text-ink {
  color: var(--ink);
}
.text-muted {
  color: var(--muted);
}
.text-center {
  text-align: center;
}
.lead {
  font-size: 16.5px;
  line-height: 1.75;
}
.title-sm {
  font-size: 23px;
  font-weight: 600;
}
.italic {
  font-style: italic;
}
.rot-up {
  transform: rotate(-90deg);
}

.list-check {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.list-check li {
  position: relative;
  padding-left: 32px;
  font-size: 14.5px;
}

.list-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-50)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a66c2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 12px 12px no-repeat;
}

.divider {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--body);
  font-size: 13px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-dark);
}

/* --- Responsive -------------------------------------------------- */

/* Header switches to the burger before the nav gets cramped */
@media (max-width: 1200px) {
  .header__inner {
    min-height: 72px;
  }

  .burger {
    display: block;
  }

  .header__actions .btn {
    display: none;
  }

  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    justify-self: auto;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    margin: 0;
    padding: 12px var(--gutter) 26px;
    background: var(--brand);
    border-bottom: 1px solid var(--on-brand-line);
    box-shadow: 0 18px 40px rgba(4, 32, 60, 0.35);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav__link {
    padding: 13px 12px;
    font-size: 16px;
    border-radius: 10px;
  }

  .nav__link::after {
    left: 12px;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 20px;
    transform: translateY(-50%) scaleY(0);
  }

  .nav__link.is-active {
    background: rgba(255, 255, 255, 0.12);
  }

  .nav__link.is-active::after {
    transform: translateY(-50%) scaleY(1);
  }
}

@media (max-width: 1080px) {
  :root {
    --gutter: 22px;
  }

  .about-block,
  .skills-block,
  .resume-block,
  .contacts-block,
  .detail,
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-block,
  .skills-block,
  .contacts-block {
    gap: 36px;
  }


  .hero__media {
    max-width: 460px;
    aspect-ratio: 4 / 3.6;
  }

  .hero__body {
    padding-bottom: 0;
  }

  .hero__inner {
    padding-bottom: 0;
  }

  .detail__media {
    position: static;
    aspect-ratio: 16 / 11;
  }

  .about__facts,
  .services-grid,
  .projects-grid,
  .posts-grid,
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Once the grid narrows, six labels no longer fit on one line, so let the
     menu wrap instead of overflowing the column. */
  .footer__links {
    flex-wrap: wrap;
  }

  .section {
    padding: 60px 0;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 18px;
  }

  body {
    font-size: 14.5px;
  }

  .section {
    padding: 48px 0;
  }

  .section__title {
    font-size: 23px;
  }

  .about__facts,
  .services-grid,
  .projects-grid,
  .posts-grid,
  .stat-row,
  .detail__body .about__facts,
  .detail__body .services-grid,
  .detail__body .projects-grid,
  .detail__body .posts-grid,
  .form__row,
  .footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__inner {
    padding-block: 20px 44px;
  }

  .hero__actions {
    gap: 10px;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .timeline-item__top {
    flex-direction: column;
    gap: 2px;
  }

  .quote {
    padding: 24px 20px;
  }

  /* Lightbox: stack from the top and reserve a row at the bottom for nav,
     so the caption never lands under the buttons */
  .lightbox {
    place-items: start center;
    padding: 58px 16px 92px;
  }

  .lightbox__img,
  .lightbox__video {
    max-width: 100%;
    max-height: calc(100vh - 210px);
  }

  .lightbox__btn--prev,
  .lightbox__btn--next {
    top: auto;
    bottom: 18px;
    margin-top: 0;
  }

  .lightbox__btn--prev {
    left: calc(50% - 98px);
  }

  .lightbox__btn--next {
    left: calc(50% + 54px);
    right: auto;
  }

  .lightbox__btn--close {
    top: 12px;
    right: 12px;
  }

  .contact-list {
    padding: 8px 20px;
  }

  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .footer {
    padding-top: 52px;
  }
}
