/* Approved Lenta direction. Overrides are scoped to this concept only. */
.lenta {
  --section-heading: 44px;
  --item-heading: 28px;
  --text-body: 20px;
  --text-secondary: 18px;
  --text-label: 16px;
  --feature-duration: 240ms;
  font-size: var(--text-body);
  line-height: 1.5;
}
.lenta .site-header nav a { font-size: 18px; }
.lenta .site-header .mode-switch { flex-shrink: 0; margin-left: auto; }
.lenta .site-header .brand { display: inline-flex; align-items: center; min-height: 44px; }
.lenta .site-header .brand img { display: block; width: 256px; max-width: 100%; height: auto; }
.lenta .reader-footer .brand-wordmark img { display: block; width: 6.5em; height: auto; }
.lenta .section-label, .lenta .feature-heading { font-size: var(--text-secondary); }
.lenta .intro p { font-size: var(--text-body); }
.lenta .intro .intro-foot { font-size: var(--text-label); }
.lenta .action { font-size: 18px; }
.lenta .reader-footer, .lenta .scroll-hint, .lenta .mobile-hint { font-size: var(--text-label); }
.lenta .text-panel, .lenta .contact-panel { padding-block: 36px; }
.lenta .text-panel h2, .lenta .contact-panel h2 { max-width: none; font-size: var(--section-heading); }
.lenta .text-panel .section-label { margin-bottom: 20px; }
.lenta .text-panel .lead { font-size: var(--text-body); color: var(--ink); }
.lenta .service-grid { gap: 40px; margin-top: 28px; }
.lenta .service-grid h3 { font-size: var(--item-heading); }
.lenta .service-grid p, .lenta .service-grid ul, .lenta .approach-copy p { font-size: var(--text-body); }
.lenta .service-grid li { padding-block: 10px; }
.lenta .approach-columns { grid-template-columns: 1.1fr 1fr; gap: 52px; margin-top: 32px; }
.lenta .approach-copy p + p { margin-top: 20px; }
.lenta .stats { gap: 32px 28px; }
.lenta .stat__val { font-size: var(--section-heading); line-height: 1.1; font-weight: 700; letter-spacing: -.04em; }
.lenta .stat__val sup { margin-top: 12px; font-size: 22px; line-height: 1.3; letter-spacing: -.02em; }
.lenta .stat__label { margin-top: 12px; font-size: 18px; line-height: 1.4; }
.lenta .tech__name { font-size: 26px; }
.lenta .tech__cat { font-size: var(--text-label); }
.lenta .catalog-note { font-size: var(--text-body); line-height: 1.5; color: var(--ink); max-width: none; margin-top: 16px; }
.lenta .catalog-list { gap: 0 36px; margin-top: 16px; }
.lenta .catalog-list a { min-height: 56px; gap: 20px; padding-block: 3px; }
.lenta .catalog-list b { font-size: 22px; line-height: 1.25; }
.lenta .catalog-list small { display: block; font-size: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.lenta .catalog-list .catalog-category { font-size: var(--text-label); text-align: right; }
.lenta .contact-panel .contact-sub { font-size: var(--text-body); }
.lenta .contact-channels { font-size: var(--text-body); }
.lenta .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.lenta .contact-button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 24px; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); font-size: 18px; font-weight: 500; line-height: 1.4; text-decoration: none; transition: background-color .18s, color .18s, border-color .18s; }
.lenta .contact-button:hover { background: var(--bg); }
.lenta .contact-button--telegram { background: var(--accent); border-color: var(--accent); color: #fff; }
.lenta .contact-button--telegram:hover { background: #2334a9; border-color: #2334a9; }
.lenta .legal { font-size: var(--text-label); }
.lenta .case__text { font-size: var(--text-body); }
.lenta .case__label, .lenta .case__tag, .lenta .case__meta, .lenta .case__caption { font-size: var(--text-label); }
.lenta .case__tags { gap: 10px; }
.lenta .case__tag { padding: 5px 12px; }
.lenta .case__id { font-size: var(--text-label); }
.lenta .case__foot { display: flex; flex-wrap: wrap; gap: 12px; }
.lenta .case__foot a {
  min-height: 48px; padding: 10px 16px; align-items: center; justify-content: center;
  border: 1px solid var(--ink); border-radius: 2px;
  font-size: var(--text-secondary); text-align: center; text-decoration: none;
}
.lenta .case__foot a:hover { background: var(--bg); }
.lenta .case__foot .btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.lenta .case__foot .btn--primary:hover { background: #2334a9; border-color: #2334a9; }
.lenta .case__head { position: sticky; top: 0; z-index: 2; background: var(--surface); }

.lenta .featured-works { --feature-padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); }
.lenta .featured-works > * { grid-column: 1; }
.lenta .featured-works [data-feature-slot="1"] { grid-row: 1; }
.lenta .featured-works [data-feature-slot="2"] { grid-row: 2; }
.lenta .featured-works [data-feature-slot="3"] { grid-row: 3; }
.lenta .featured-controls {
  position: sticky; top: 0; z-index: 1; align-self: start; grid-row: 1 / 4;
  display: flex; justify-content: flex-end;
  padding: var(--feature-padding) var(--gutter) 0; pointer-events: none;
}
.lenta .featured-controls:has(button[hidden]) { display: none; }
.lenta .rotation-toggle:not([hidden]) {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 1px solid var(--line); border-radius: 50%;
}
.lenta .featured-controls .rotation-toggle {
  pointer-events: auto; background: var(--bg); color: var(--ink);
}
.lenta .rotation-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lenta .rotation-toggle .play-icon { display: none; fill: currentColor; }
.lenta .rotation-toggle[data-paused='true'] .pause-icon { display: none; }
.lenta .rotation-toggle[data-paused='true'] .play-icon { display: block; }
.lenta .rail-controls .rotation-toggle { margin-right: 8px; }

/* Large projects: the screenshot itself reaches both edges of its plane. */
.lenta .project-feature {
  --ink: var(--feature-ink, #202339);
  --muted: var(--feature-muted, #5b6072);
  --accent: var(--feature-ink, #202339);
  background: var(--feature-bg, #e3e6f2);
  color: var(--ink);
  padding: var(--feature-padding) 0; gap: 8px; justify-content: flex-start; scrollbar-width: thin;
}
.lenta .feature-heading { padding-inline: var(--gutter); min-height: 44px; display: flex; align-items: center; flex: 0 0 44px; }
.lenta .feature-heading > span { font-size: var(--text-label); line-height: 1.35; overflow-wrap: anywhere; }
.lenta .project-feature .project-cover { flex: 0 0 auto; width: 100%; aspect-ratio: 16/9; margin: 0; }
.lenta .project-feature .project-cover img { object-fit: contain; }
.lenta .project-caption { padding-inline: var(--gutter); flex: 0 0 96px; min-height: 96px; display: block; }
.lenta .project-caption h2 { font-size: var(--section-heading); line-height: 1.15; max-width: none; }
.lenta .project-caption p { font-size: var(--text-secondary); line-height: 1.45; margin-top: 10px; max-width: 52ch; }

.lenta .work-gallery { background: var(--surface); }
.lenta .gallery-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 24px; }
.lenta .gallery-heading h2 { max-width: none; font-size: var(--section-heading); }
.lenta .gallery-heading > span { font-size: var(--text-label); }
.lenta .gallery-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 36px 28px; }
.lenta .gallery-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lenta .gallery-cover { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: transparent; }
.lenta .gallery-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.lenta .gallery-caption h3 { font-size: var(--item-heading); line-height: 1.3; }
.lenta .gallery-caption h3 a { display: inline-flex; align-items: center; min-height: 44px; }
.lenta .gallery-category { color: var(--muted); font-size: var(--text-label); line-height: 1.4; margin-top: 4px; }

/* Snap only image frames to whole CSS pixels; no resize or animation JS. */
@supports (height: round(nearest, 1.5px, 1px)) {
  .lenta .gallery-card { container-type: inline-size; }
  .lenta .gallery-cover {
    width: round(nearest, 100cqw, 1px);
    height: round(nearest, calc(100cqw * 9 / 16), 1px);
    aspect-ratio: auto;
  }
}

@media (min-width:1100px) and (min-height:650px) and (prefers-reduced-motion:no-preference) {
  .lenta .project-feature { flex-basis: 64vw; }
  .lenta .featured-works { display: contents; }
  .lenta .featured-controls { display: none; }
  .lenta .reader-footer .scroll-hint { display: none; }
  .lenta .text-panel { flex-basis: min(1240px,96vw); }
  .lenta .catalog-panel { flex-basis: 1240px; }
  .lenta .catalog-panel { padding-block: 16px; }
  .lenta .catalog-panel .section-label { margin-bottom: 8px; }
  .lenta .work-gallery { flex: 0 0 auto; width: max-content; height: 100%; padding: 24px var(--gutter) 28px; display: flex; flex-direction: column; overflow: visible; }
  .lenta .gallery-heading { flex: 0 0 auto; }
  .lenta .gallery-grid { flex: 1; min-height: 0; grid-template-columns: none; grid-template-rows: repeat(2,minmax(0,1fr)); grid-auto-flow: column; grid-auto-columns: 400px; gap: 24px 32px; }
  .lenta .gallery-card { min-height: 0; }
  .lenta .gallery-cover { flex: 1; min-height: 0; aspect-ratio: auto; }
  .lenta .gallery-caption { flex: 0 0 80px; }
  @supports (height: round(nearest, 1.5px, 1px)) {
    .lenta .gallery-card { display: grid; grid-template-rows: minmax(0,1fr) 80px; }
    .lenta .gallery-cover { flex: none; height: round(nearest, 100%, 1px); align-self: start; }
  }
}
@media (min-width:1100px) and (min-height:650px) and (max-height:780px) and (prefers-reduced-motion:no-preference) {
  .lenta .intro h1 { font-size: clamp(48px,4.6vw,66px); }
  .lenta .gallery-grid { grid-template-rows: minmax(0,1fr); grid-auto-columns: 400px; }
}
/* Short horizontal screens gain columns instead of a nested vertical scroll. */
@media (min-width:1100px) and (min-height:650px) and (max-height:899px) and (prefers-reduced-motion:no-preference) {
  .lenta .catalog-panel { flex-basis: 1760px; }
  .lenta .catalog-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width:1100px) and (min-height:650px) and (max-height:799px) and (prefers-reduced-motion:no-preference) {
  .lenta .catalog-panel { flex-basis: 2400px; }
  .lenta .catalog-list { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width:741px) and (max-width:1099px) {
  .lenta .site-header { gap: 20px; }
  .lenta .site-header nav { gap: 18px; }
  .lenta .site-header nav a { font-size: 16px; }
  .lenta .approach-columns { gap: 32px; }
}
@media (max-width:1099px), (max-height:649px) {
  .lenta .featured-works { --feature-padding: 28px; }
  .lenta .project-feature { gap: 20px; }
  .lenta .project-caption { min-height: 0; flex-basis: auto; padding-bottom: 12px; }
  .lenta .intro .intro-foot { display: none; }
}
@media (min-width:741px) and (max-width:1099px) {
  .lenta .site-header .brand img { width: 128px; }
}
@media (max-width:740px) {
  .lenta { --text-body: 18px; --text-secondary: 18px; --gutter: 20px; --section-heading: 34px; }
  .lenta .site-header { padding-block: 18px 10px; }
  .lenta .site-header nav { gap: 16px; }
  .lenta .site-header nav a { font-size: 16px; }
  .lenta .site-header .brand { font-size: 30px; max-width: calc(100% - 219px); min-width: 0; }
  .lenta .site-header .brand img { width: 208px; }
  .lenta .text-panel h2 { line-height: 1.15; }
  .lenta .text-panel, .lenta .contact-panel { padding-block: 44px; }
  .lenta .section-label { font-size: 18px; }
  .lenta .service-grid { grid-template-columns: 1fr; gap: 36px; }
  .lenta .service-grid li { flex-wrap: wrap; gap: 6px 16px; }
  .lenta .service-grid li b { text-align: left; }
  .lenta .approach-columns { grid-template-columns: 1fr; gap: 40px; }
  .lenta .stats { gap: 32px 20px; }
  .lenta .stat__val sup { font-size: 20px; }
  .lenta .stat__label { font-size: 18px; }
  .lenta .catalog-list { grid-template-columns: 1fr; gap: 0; }
  .lenta .catalog-list a { align-items: flex-start; flex-direction: column; gap: 8px; }
  .lenta .catalog-list b { font-size: 22px; }
  .lenta .catalog-list .catalog-category { text-align: left; }
  .lenta .tech__name { font-size: 21px; }
  .lenta .tech-grid { gap: 0 16px; }
  .lenta .gallery-grid { grid-template-columns: 1fr; gap: 32px; }
  .lenta .feature-heading { padding-inline: var(--gutter); }
  .lenta .work-gallery { padding-block: 44px; }
  .lenta .gallery-heading { gap: 16px; }
  .lenta .contact-button { width: 100%; }
  .lenta .contact-channels { gap: 16px 24px; }
  .lenta .reader-footer { align-items: flex-start; }
  .lenta .reader-footer > a { font-size: 16px; }
  .lenta .case__head, .lenta .case__body, .lenta .case__foot { padding: 20px; }
  .lenta .case__title { font-size: 28px; }
  .lenta .case__foot a { width: 100%; }
}
@media (max-width:379px) {
  .lenta .site-header { gap: 8px; }
  .lenta .site-header .brand { font-size: 28px; }
}
@media (max-width:359px) {
  .lenta { --gutter: 16px; }
  .lenta .site-header { padding-inline: 8px; }
  .lenta .site-header .brand { font-size: 24px; max-width: none; }
  .lenta .site-header .brand img { width: 192px; }
  .lenta .stats { gap: 28px 16px; }
  .lenta .feature-heading { gap: 10px; }
}
@media (prefers-reduced-motion:reduce) {
  .lenta .featured-works { --feature-padding: 24px; }
  .lenta .project-caption { flex-basis: auto; min-height: 0; }
}
@media print { .lenta .featured-controls { display: none; } }
