@media (min-width: 1361px) {
  .hero-background {
    top: -132px;
    bottom: -44px;
  }
}

@media (min-width: 1361px) and (min-height: 830px) {
  .hero {
    min-height: calc(100svh - 180px);
  }

  .photo-wrap,
  .side-info {
    align-self: center;
  }
}

@media (max-width: 1360px) {
  nav {
    gap: 10px;
  }

  .menu {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
    font-size: 13px;
  }

  .menu a {
    padding: 9px 7px;
    white-space: nowrap;
  }

  .lang-switch button {
    width: 34px;
  }

  .nav-cta {
    padding-right: 17px;
    padding-left: 17px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
    min-height: auto;
  }

  .photo-wrap {
    width: min(100%, 470px);
    height: 520px;
  }

  .photo-wrap::before {
    width: auto;
    height: auto;
  }

  .photo-wrap::after {
    width: auto;
    height: auto;
  }

  .side-info {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-top: 0;
  }
}

@media (max-width: 1180px) {
  main > section[id] {
    scroll-margin-top: 148px;
  }

  nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .menu {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
  }

  .lang-switch {
    margin-left: auto;
  }

}

@media (max-width: 1100px) {
  .bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .hero > div:first-child {
    order: 1;
  }

  .photo-wrap {
    order: 2;
    height: 500px;
  }

  .photo {
    width: min(62vw, 370px);
  }

  .side-info {
    order: 3;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .experience,
  .strengths,
  .stats,
  .authorizations {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact .contact-card:first-child {
    grid-column: span 2;
  }

  .contact-method,
  .contact-location,
  .contact-social {
    grid-column: span 1;
  }

  h1 {
    font-size: 64px;
  }
}

@media (max-width: 900px) {
  body {
    padding: 18px;
  }

  nav {
    top: 8px;
    margin-bottom: 28px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding-top: 4px;
  }

  .hero-background {
    top: -28px;
    bottom: -18px;
  }

  .hero-background::before {
    background-position: 54% 50%;
    opacity: .88;
  }

  .hero-background-video {
    object-position: 54% 50%;
    opacity: 1;
  }

  .hero-background::after {
    background:
      linear-gradient(90deg, rgba(4,8,18,.78) 0%, rgba(5,9,20,.48) 54%, rgba(4,9,19,.68) 100%),
      linear-gradient(180deg, rgba(5,8,18,.46) 0%, rgba(5,9,19,.18) 54%, #08111d 100%);
  }

  .photo-wrap {
    height: 460px;
    min-height: 0;
  }

  .photo {
    width: min(62vw, 350px);
  }

  h1 {
    font-size: 58px;
    line-height: .95;
  }

  .hero-subtitle {
    font-size: 28px;
  }

  .diploma-head,
  .diploma-viewer {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .diploma-preview {
    height: 360px;
  }

  .quote-card {
    align-items: flex-start;
    gap: 18px;
    flex-direction: column;
  }

}

@media (max-width: 768px) {
  main > section[id] {
    scroll-margin-top: 92px;
  }

  nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    overflow: visible;
    background: rgba(5, 9, 20, .96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .logo {
    grid-column: 1;
    grid-row: 1;
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .nav-cta {
    display: none;
  }

  nav.menu-open .nav-cta {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    display: inline-flex;
  }

  .lang-switch {
    grid-column: 2;
    grid-row: 1;
    order: initial;
    margin-left: 0;
    justify-self: end;
  }

  .menu {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    width: 100%;
    max-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    padding: 0 8px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(4, 8, 20, .94);
    box-shadow: 0 18px 42px rgba(0,0,0,.28);
    transition: max-height .28s ease, opacity .22s ease, transform .22s ease, padding .22s ease, border-color .22s ease;
  }

  nav.menu-open .menu {
    max-height: 430px;
    padding: 10px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    border-color: rgba(var(--accent-rgb), .25);
  }

  .menu a {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 11px;
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.045);
    font-size: 14px;
    font-weight: 800;
  }

  .menu a::after {
    content: ">";
    color: var(--accent);
    font-weight: 900;
  }

  h1 {
    font-size: 48px;
    line-height: 1;
  }

  .hero-subtitle {
    font-size: 22px;
  }

  .hero p {
    font-size: 16px;
  }

  .photo-wrap {
    height: 420px;
  }

  .photo {
    width: min(72vw, 310px);
  }

  .side-info {
    display: none;
  }

  .experience,
  .strengths,
  .authorizations {
    grid-template-columns: 1fr;
  }

  .copy-toast {
    bottom: 24px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  nav {
    border-radius: 14px;
    padding: 10px;
  }

  .logo img {
    width: 42px;
    height: 42px;
  }

  .nav-cta {
    padding: 12px 14px;
    min-height: 42px;
    font-size: 13px;
  }

  .lang-switch button {
    width: 34px;
    height: 32px;
    font-size: 12px;
  }

  .menu {
    gap: 6px;
  }

  .menu a {
    padding: 9px 11px;
    font-size: 13px;
  }

  .tag {
    margin-bottom: 22px;
    font-size: 12px;
  }

  h1 {
    font-size: 42px;
    margin-bottom: 18px;
  }

  .hero-subtitle {
    font-size: 21px;
  }

  .hero-pills span {
    min-width: 0;
    padding: 9px 10px;
    font-size: 12px;
  }

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

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .actions .btn {
    width: 100%;
  }

  .stats.section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
    padding-top: 18px;
  }

  .stat {
    min-height: auto;
    padding: 16px;
  }

  .photo-wrap {
    height: clamp(350px, 100vw, 400px);
    margin-bottom: 10px;
  }

  .hero-background::before {
    background-position: 58% 50%;
    opacity: .8;
  }

  .hero-background-video {
    object-position: 58% 50%;
    opacity: 1;
  }

  .photo {
    width: min(76vw, 280px);
  }

  .photo-wrap::before {
    width: auto;
    height: auto;
  }

  .photo-wrap::after {
    width: auto;
    height: auto;
  }

  .card,
  .exp-card,
  .info-box,
  .contact-card,
  .diploma-info {
    border-radius: 10px;
    padding: 18px;
  }

  .experience-section > .section-title {
    margin-bottom: 10px;
  }

  .experience-disclosure {
    padding: 0;
  }

  .experience-disclosure summary {
    min-height: 0;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .experience-summary-icon {
    width: 42px;
    height: 42px;
  }

  .experience-summary-copy strong {
    font-size: 15px;
  }

  .experience-summary-action {
    grid-column: 2;
    min-width: 0;
    justify-content: flex-start;
    margin-top: 2px;
  }

  .experience-disclosure-body {
    padding: 12px;
  }

  .diploma-head h2 {
    font-size: 30px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .authorization-card {
    min-height: 0;
  }

  .diploma-head {
    gap: 16px;
  }

  .diploma-controls {
    width: 100%;
  }

  .diploma-controls button {
    flex: 1;
    min-height: 48px;
  }

  .diploma-preview {
    height: 300px;
    padding: 10px;
  }

  .diploma-thumbs {
    gap: 10px;
  }

  .diploma-thumbs img {
    height: 110px;
  }

  .quote-mark,
  .quote-logo {
    font-size: 42px;
  }

  .quote-card p {
    font-size: 16px;
  }

  .stat vk-icon,
  .contact-card > vk-icon {
    width: 24px;
    height: 24px;
  }

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

  .contact .contact-card:first-child,
  .contact-method,
  .contact-location,
  .contact-social {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  nav {
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .menu-toggle {
    width: 44px;
    padding: 0;
  }

  .menu-toggle-label {
    display: none;
  }

  .lang-switch {
    gap: 2px;
    padding: 3px;
  }

  .lang-switch button {
    width: 30px;
    height: 30px;
  }

  h1 {
    font-size: 38px;
  }

  .btn {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contact-method {
    grid-template-columns: 22px minmax(0, 1fr) 40px;
    gap: 8px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .contact-method > vk-icon {
    width: 22px;
    height: 22px;
  }

  .contact-email a {
    font-size: 13px;
    line-height: 1.25;
  }

  .contact-quick-copy {
    width: 40px;
    height: 40px;
  }

  .diploma-thumbs img {
    height: 96px;
  }

  .authorization-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .authorization-icon {
    width: 38px;
    height: 38px;
  }
}
