/* Optical responsive pass: phones, tablets, desktops, and wide displays. */
.site-header,
main,
footer {
  width: min(1680px, calc(100% - clamp(48px, 7vw, 120px)));
}

.site-header {
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
}

.hero-copy h1 {
  font-size: clamp(64px, 6.2vw, 112px);
  max-width: 10ch;
}

.hero-copy h1 em {
  display: inline-block;
}

.mode-hero {
  min-height: clamp(620px, 50vw, 760px);
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(48px, 6vw, 110px);
}

.pixel-cat {
  width: 340px;
  height: 340px;
}

.pixel-cat .ear {
  transform-origin: top center;
}

.portrait-art,
.sticker-art {
  width: min(100%, 620px);
  justify-self: center;
}

.maker {
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr);
}

.tool-heading h2 {
  font-size: clamp(39px, 3vw, 52px);
}

.mode-nav button,
.language-picker,
.hero-button,
.upload-button,
.actions button {
  min-height: 44px;
}

.mode-nav {
  gap: 2px;
}

html[lang="ru"] .hero-copy h1 em {
  word-spacing: -.12em;
}

.language-links {
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 1800px) {
  .site-header {
    height: 104px;
  }

  .mode-hero {
    min-height: 720px;
  }

  .pixel-cat {
    transform: rotate(3deg) scale(1.18);
  }

  .lead {
    max-width: 650px;
    font-size: 19px;
  }

  .mode-nav button {
    padding-inline: 20px;
    font-size: 13px;
  }

  .maker {
    margin-bottom: 120px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .site-header,
  main,
  footer {
    width: calc(100% - 64px);
  }

  .site-header {
    grid-template-columns: 150px 1fr 150px;
  }

  .mode-nav button {
    padding-inline: 10px;
  }

  .mode-hero {
    min-height: 570px;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    gap: 34px;
  }

  .hero-copy h1 {
    font-size: clamp(60px, 7vw, 82px);
    letter-spacing: -5px;
  }

  .pixel-cat {
    width: 300px;
    height: 300px;
    transform: rotate(3deg) scale(.88);
  }

  .maker {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr);
  }
}

@media (max-width: 900px) {
  .site-header,
  main,
  footer {
    width: calc(100% - 40px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .mode-nav button {
    min-height: 46px;
  }

  .mode-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 52px 0;
    gap: 28px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .pixel-hero-art {
    min-height: 370px;
  }

  .pixel-cat {
    width: 340px;
    height: 340px;
    transform: rotate(3deg) scale(.84);
  }

  .portrait-art,
  .sticker-art {
    width: min(100%, 520px);
  }

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

  footer {
    padding-block: 24px;
    gap: 16px;
    flex-wrap: wrap;
  }
}

@media (max-width: 540px) {
  .site-header,
  main,
  footer {
    width: calc(100% - 28px);
  }

  .site-header {
    padding-block: 12px;
    gap: 10px;
  }

  .language-picker {
    min-height: 40px;
    padding-inline: 4px;
  }

  .mode-nav {
    overflow: hidden;
  }

  .mode-nav button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 4px;
  }

  .mode-nav button b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mode-hero {
    padding: 38px 0 42px;
    gap: 18px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: clamp(44px, 13.5vw, 56px);
    line-height: .9;
    letter-spacing: -3.5px;
  }

  .hero-copy h1 em {
    letter-spacing: -3px;
  }

  body[data-mode="portrait"] .hero-copy h1,
  body[data-mode="stickers"] .hero-copy h1 {
    font-size: clamp(43px, 11.8vw, 48px);
    line-height: .94;
  }

  .lead {
    margin: 20px 0;
    font-size: 15px;
  }

  .hero-button {
    width: 100%;
    justify-content: space-between;
    padding-left: 20px;
  }

  .pixel-hero-art {
    min-height: 290px;
  }

  .pixel-cat {
    width: 320px;
    height: 320px;
    transform: rotate(3deg) scale(.68);
  }

  .tool-heading {
    grid-template-columns: 36px 1fr;
    padding-top: 46px;
  }

  .tool-heading h2 {
    font-size: clamp(27px, 8vw, 34px);
    letter-spacing: -1.5px;
  }

  .preview-panel {
    padding: 12px;
  }

  .controls {
    padding: 22px 16px;
  }

  .palettes {
    gap: 9px;
  }

  .palette {
    min-height: 62px;
  }

  .actions {
    position: sticky;
    bottom: 8px;
    z-index: 3;
    padding-top: 6px;
    background: var(--panel);
  }

  .future-cta {
    margin-bottom: 60px;
  }

  footer {
    align-items: flex-start;
  }

  footer .language-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 14px;
  }

  .language-picker select {
    max-width: 92px;
  }

  .mode-nav button b {
    font-size: 8px;
  }

  .hero-copy h1 {
    font-size: 44px;
  }
}
