:root {
  color-scheme: light;
  --neutral-cnt: #222222;
  --grey-cnt: #767676;
  --neutral-bg-base: #f5f5f5;
  --neutral-bg-top-default: #ffffff;
  --neutral-bg-top-hover: #f5f5f5;
  --neutral-bg-top-pressed: #ebebeb;
  --neutral-stroke: #d7d7d7;
  --accent-bg-top-default: #2c6bff;
  --accent-bg-top-hover: #2963eb;
  --accent-bg-top-pressed: #255ad6;
  --accent-cnt: #ffffff;
  --radius: 12px;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--neutral-bg-top-default);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--neutral-cnt);
  background: var(--neutral-bg-top-default);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* Inline SVG-иконки наследуют цвет компонента через currentColor. */
.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.main-page {
  min-height: 100vh;
  padding: 0 32px;
}

.main-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 0;
}

.profile-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 32px;
}

.profile-identity {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-start;
  gap: 20px;
}

.avatar {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.profile-heading {
  width: 100%;
  font-weight: 600;
}

.profile-heading h1 {
  font-size: 24px;
  line-height: 36px;
}

.profile-heading p {
  font-size: 20px;
  line-height: 32px;
}

.tag-list,
.overlay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.tag {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--neutral-bg-base);
  color: var(--neutral-cnt);
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
}

.tag--outlined {
  border: 1px solid var(--neutral-stroke);
  padding: 5px 11px;
  background: var(--neutral-bg-top-default);
}

.button {
  display: inline-flex;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.button .icon {
  width: 24px;
  height: 24px;
}

.button--secondary {
  border: 1px solid var(--neutral-stroke);
  padding: 7px 15px 7px 11px;
  background: var(--neutral-bg-top-default);
}

.button--secondary:hover {
  background: var(--neutral-bg-top-hover);
}

.button--secondary:active {
  background: var(--neutral-bg-top-pressed);
}

.description-block {
  padding-bottom: 32px;
}

.description-block p {
  max-width: 624px;
}

.contact-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-top: 1px solid var(--neutral-stroke);
  padding: 16px 0 64px;
}

.mail-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  color: var(--grey-cnt);
  background: transparent;
  cursor: pointer;
}

.mail-button .icon {
  width: 24px;
  height: 24px;
}

.mail-button:hover {
  color: var(--neutral-cnt);
}

.social-links {
  display: flex;
  gap: 20px;
  color: var(--grey-cnt);
}

.social-links a:hover {
  color: var(--neutral-cnt);
  text-decoration: underline;
}

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

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius);
}

.product-visual {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--neutral-bg-base);
}

.product-shot {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 84%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  transform: translateY(-50%);
  transition: left 300ms ease-out, width 300ms ease-out;
}

.product-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card:hover .product-shot,
.product-card:focus-visible .product-shot {
  left: 6%;
  width: 88%;
}

.overlay-tags {
  position: absolute;
  top: 16px;
  right: 16px;
  justify-content: flex-end;
}

.product-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-copy strong {
  font-weight: 400;
  line-height: 24px;
}

.product-copy > span {
  overflow: hidden;
  color: var(--grey-cnt);
  font-size: 14px;
  line-height: 20.16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent-bg-top-default);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* Case pages */

.case-page {
  min-height: 100vh;
  padding: 0 32px;
}

.case-shell {
  width: 100%;
  max-width: 1304px;
  margin: 0 auto;
  padding: 80px 0;
}

.case-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.case-back {
  margin-bottom: 64px;
}

.back-link,
.next-case-link {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--grey-cnt);
}

.back-link {
  margin-left: -12px;
  padding: 7px 12px;
}

.back-link .icon,
.next-case-link .icon {
  width: 24px;
  height: 24px;
}

.back-link:hover {
  color: var(--neutral-cnt);
}

.back-link:active {
  color: var(--neutral-cnt);
}

.case-header {
  padding-bottom: 64px;
}

.read-time {
  margin-bottom: 32px;
  color: var(--grey-cnt);
  font-size: 14px;
  line-height: 24px;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  list-style: none;
}

.company-tag {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 4px;
  border-radius: 999px;
  background: var(--neutral-bg-base);
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
}

.company-tag > img {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
}

.case-heading {
  display: flex;
  max-width: 624px;
  flex-direction: column;
  gap: 12px;
}

.case-heading h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 36px;
}

.case-role {
  font-weight: 600;
  line-height: 24px;
}

.case-lead {
  line-height: 24px;
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.case-section > h2,
.author-cta__copy h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 32px;
}

.case-section > h2 {
  margin-bottom: 24px;
}

.case-copy {
  display: flex;
  max-width: 624px;
  flex-direction: column;
  gap: 16px;
}

.case-copy ul,
.case-copy ol {
  padding-left: 24px;
}

.case-copy li {
  padding-left: 0;
}

.section-subtitle {
  font-weight: 400;
}

.solutions-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.solution-block {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.screenshots {
  width: 100%;
}

.screenshots--stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.screenshots--mobile-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.screenshots--forms-pair {
  display: grid;
  grid-template-columns: minmax(0, 2.08fr) minmax(0, 1fr);
  gap: 32px;
}

.screen-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0;
  border: 1px solid var(--neutral-stroke);
  border-radius: var(--radius);
  background: var(--neutral-bg-base);
}

.screen-frame--desktop {
  aspect-ratio: 4 / 3;
}

.screen-frame--wide {
  aspect-ratio: 8 / 5;
}

.screen-frame--mobile {
  aspect-ratio: 9 / 20;
}

.screen-frame--forms-desktop {
  min-height: 0;
  aspect-ratio: auto;
}

.screen-frame--signature {
  border-width: 2px;
}

.screen-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-cta {
  display: flex;
  min-height: 400px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 64px;
  border-radius: var(--radius);
  padding: 48px 24px;
  background: var(--neutral-bg-base);
  text-align: center;
}

.author-cta__copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-weight: 600;
}

.author-cta__copy p {
  font-size: 16px;
  line-height: 24px;
}

.button--primary {
  padding: 8px 12px 8px 16px;
  color: var(--accent-cnt);
  background: var(--accent-bg-top-default);
}

.button--primary:hover {
  background: var(--accent-bg-top-hover);
}

.button--primary:active {
  background: var(--accent-bg-top-pressed);
}

.case-footer {
  margin-top: 64px;
}

.next-case-link {
  width: 100%;
  border-color: var(--neutral-stroke);
  padding: 7px 12px;
  color: var(--neutral-cnt);
  background: var(--neutral-bg-top-default);
}

.next-case-link:hover {
  background: var(--neutral-bg-top-hover);
}

.next-case-link:active {
  background: var(--neutral-bg-top-pressed);
}

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

  .resume-button {
    align-self: flex-start;
  }

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

  .screenshots--forms-pair {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .case-page {
    padding: 0 16px;
  }

  .main-content {
    padding: 32px 0;
  }

  .case-shell {
    padding: 32px 0;
  }

  .case-back,
  .case-header {
    margin-bottom: 0;
    padding-bottom: 48px;
  }

  .back-link {
    margin-left: -12px;
  }

  .case-heading h1 {
    font-size: 22px;
    line-height: 32px;
  }

  .case-body,
  .solutions-list {
    gap: 48px;
  }

  .screenshots--stack,
  .screenshots--mobile-trio,
  .screenshots--forms-pair {
    gap: 16px;
  }

  .screenshots--mobile-trio,
  .screenshots--forms-pair {
    grid-template-columns: 1fr;
  }

  .screen-frame--forms-desktop {
    aspect-ratio: 4 / 3;
  }

  .author-cta {
    min-height: 360px;
    margin-top: 48px;
  }

  .case-footer {
    margin-top: 48px;
  }

  .profile-block,
  .profile-identity,
  .contact-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-block,
  .profile-identity {
    width: 100%;
  }

  .profile-heading p {
    font-size: 18px;
    line-height: 28px;
  }

  .contact-block {
    gap: 20px;
  }

  .overlay-tags {
    top: 12px;
    right: 12px;
  }

  .overlay-tags .tag {
    min-height: 30px;
    padding: 2px 8px;
    font-size: 13px;
    line-height: 24px;
  }

  .product-copy > span {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .product-shot {
    transition: none;
  }
}
