@import url("case-fonts.css");
@import url("touch-controls.css");

* { box-sizing: border-box; }
body { margin: 0; background: #3a3a3a; color: white; font-family: Winston, Arial, sans-serif; font-weight: 300; }
a { color: inherit; text-decoration: none; }
a:hover { color: #ff6b8a; }
.photos > img, .case-lead > img, .video-still { border-radius: clamp(8px, .75vw, 14px); }
.video-still { overflow: hidden; }
main { background: #3a3a3a; }
.stage { max-width: 1920px; margin: auto; aspect-ratio: 1920/933; position: relative; container-type: inline-size; }
h1 { position: absolute; top: 9.65%; left: 6.25%; display: flex; align-items: center; margin: 0; text-transform: uppercase; font-size: 4.167cqw; font-weight: 900; line-height: 1.08; letter-spacing: normal; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.photo, .brand, .copy { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: auto; }
.laptop img { display: block; width: 100%; height: auto; }
.laptop .jardin-screen { position: absolute; left: 12.25%; top: 5.06%; width: 76.04%; }
/* Полоса корпуса под экраном в экспорте Figma размером 1103 × 633. */
.laptop::after {
  content: "";
  position: absolute;
  left: 47.8%;
  top: 92.10%;
  width: 4.4%;
  height: 1.4%;
  background: #1a202c;
}
.copy { font-size: .9375cqw; line-height: 1.2; }
.copy p { margin: 0 0 1.2em; }
.case-nav {
  position: absolute; right: 3.9%; bottom: 9.32%; width: auto; gap: .5rem;
  display: flex; justify-content: space-between;
}
.case-nav a { display: grid; place-items: center; width: 44px; min-height: 44px; border: 1px solid #ffffff50; border-radius: 50%; }
.case-nav a::before { content: "←"; }
.case-nav a:last-child::before { content: "→"; }
.case-nav a:hover { border-color: #ff9cb2; }
.case-nav a:focus-visible { outline: 2px solid #f27699; }
.video-still img { width: 100%; height: auto; display: block; }
.video-still::after { content: ""; position: absolute; inset: 0; background: url("assets/cases/2086-9159.png") center / 26.5% auto no-repeat; pointer-events: none; }

.back-to-cases, .case-nav span { display: none; }
.case-lead, .case-story, .case-gallery { display: contents; }

@media (max-width: 68.75rem) {
  body { --gutter: clamp(1rem, 5.55vw, 2.5rem); }
  .back-to-cases { display: inline-flex; align-self: flex-start; align-items: center; order: -2; min-height: 44px; color: #ff9cb2; font-weight: 500; }
  .stage {
    display: flex; flex-direction: column; aspect-ratio: auto;
    max-width: 48rem; padding: clamp(1.75rem, 5vw, 3rem) var(--gutter) 2rem;
    gap: clamp(1.25rem, 4vw, 2rem);
  }
  h1, .brand, .photo, .copy, .case-nav { position: static; }
  h1 {
    display: block; font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
    line-height: 1.01; letter-spacing: -.025em; text-transform: none;
    overflow-wrap: anywhere; text-wrap: balance;
  }
  h1 > span:first-child { display: none; }
  h1 .case-title { position: static; width: auto; height: auto; clip-path: none; overflow: visible; }
  .brand { order: -1; width: auto; max-width: 42%; height: 2rem; object-fit: contain; object-position: left; align-self: flex-start; }
  .brand-jardin { width: clamp(6.5rem, 30vw, 8rem); height: auto; }
  .case-lead, .case-gallery {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center; gap: clamp(.5rem, 2vw, 1rem);
  }
  .case-lead > :only-child { grid-column: 1/-1; }
  .photo { width: 100%; }
  .laptop, .video-still { position: relative; inset: auto; }
  .case-story { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1em; overflow-wrap: anywhere; }
  .copy { width: 100%; max-width: 62ch; font-size: clamp(1.0625rem, 1rem + .35vw, 1.1875rem); line-height: 1.48; }
  .copy p { margin: 0; }
  .copy p + p { margin-top: .8em; }
  .copy br { display: none; }
  .devices { justify-content: center; grid-template-columns: repeat(2, minmax(0, 12rem)); }
  .devices > :only-child { grid-column: 1/-1; width: min(65%, 14.875rem); justify-self: center; }
  .photos > img:last-child:nth-child(odd) { grid-column: 1/-1; width: auto; max-width: 100%; max-height: 25rem; justify-self: center; }
  .case-nav {
    width: 100%; aspect-ratio: auto; background: none; flex-wrap: wrap;
    padding-top: 1rem; border-top: 1px solid #ffffff35; gap: 1rem;
  }
  .case-nav a { display: inline-flex; align-items: center; min-height: 48px; width: auto; padding: 0 .25rem; }
  .case-nav a::before { display: none; }
  .case-nav a { padding-inline: 1.15rem; border: 1px solid #ffffff45; border-radius: 999px; }
  .case-nav a:last-child { background: #ff6b8a; border-color: transparent; color: #23181c; }
  .case-nav span { display: inline; font-size: 1rem; font-weight: 500; }
}
