/*
 * Tolsky Direct / Editorial redesign 2026
 * Visual layer only: templates, URLs and WordPress content remain intact.
 */

:root {
  --ink: #090a0b;
  --ink-soft: #0f1012;
  --ink-mid: #15171a;
  --ink-light: #1d2024;
  --ink-border: rgba(244, 239, 229, .13);
  --ink-border2: rgba(244, 239, 229, .065);
  --brass: #d89b42;
  --brass-light: #f0c171;
  --brass-pale: rgba(216, 155, 66, .13);
  --brass-glow: rgba(216, 155, 66, .08);
  --cream: #f4efe5;
  --cream-dim: #b9b4aa;
  --cream-ghost: #716e67;
  --white: #fffdf8;
  --ff-display: 'Unbounded', 'Arial Black', sans-serif;
  --ff-body: 'Manrope', Arial, sans-serif;
  --ff-mono: 'Manrope', Arial, sans-serif;
  --r-sm: 999px;
  --r-md: 18px;
  --r-lg: 26px;
  --ease-editorial: cubic-bezier(.215, .61, .355, 1);
  --section-space: clamp(80px, 9vw, 150px);
}

html {
  background: var(--ink);
}

body {
  background: var(--ink);
  color: var(--cream-dim);
  font-family: var(--ff-body);
  font-size: 16px;
  letter-spacing: -.01em;
}

body::before {
  background-size: 200px 200px;
  opacity: .055;
  mix-blend-mode: soft-light;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: .22;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

h1, h2, h3, h4,
.nav-logo-name,
.footer-brand-name {
  font-family: var(--ff-display);
  letter-spacing: -.01em;
  text-wrap: balance;
}

p {
  color: var(--cream-dim);
  line-height: 1.72;
}

.container,
.container--narrow {
  width: min(100%, 1560px);
  max-width: 1560px;
  padding-inline: clamp(20px, 3vw, 48px);
}

.container--narrow {
  width: min(100%, 980px);
}

.sec,
.services-archive,
.case-library,
.case-story,
.case-related,
.case-calculator,
.case-contact,
.service-section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.sec--sm {
  padding-top: clamp(72px, 7vw, 112px);
  padding-bottom: clamp(72px, 7vw, 112px);
}

.section-overline,
.about-overline,
.case-kicker,
.case-chapter__label,
.footer-col-title,
.svc-price,
.hero-eyebrow-text {
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.section-h2,
.services-archive__head h1,
.case-archive-hero h1,
.case-library__head h2,
.case-archive-cta h2,
.case-single-hero h1,
.case-chapter h2,
.case-contact h2,
.case-calculator__heading h2,
.case-related__head h2 {
  font-size: clamp(3rem, 6.3vw, 7.4rem);
  line-height: .94;
  letter-spacing: -.035em;
}

.section-h2 span,
.services-archive__head h1 span,
.case-archive-hero h1 span,
.case-library__head h2 span,
.case-single-hero h1 span,
.case-chapter h2 span,
.case-calculator__heading h2 span,
.case-related__head h2 span {
  color: var(--brass-light);
  background: linear-gradient(100deg, #f4d39a 0%, #d78d2d 68%, #936022 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn,
.nav-cta-btn,
.case-filter,
button,
input[type='submit'] {
  border-radius: 999px;
  transition:
    transform .3s var(--ease-editorial),
    background-color .3s var(--ease-editorial),
    border-color .3s var(--ease-editorial),
    color .3s var(--ease-editorial),
    box-shadow .5s var(--ease-editorial);
}

.btn {
  min-height: 48px;
  padding: 14px 24px;
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.btn:hover,
.nav-cta-btn:hover,
.case-filter:hover {
  transform: translateY(-2px);
}

.btn-brass,
.btn-calculator,
.nav-cta-btn {
  color: #17120b !important;
  background: var(--brass-light);
  border-color: var(--brass-light);
  box-shadow: none;
}

.btn-brass:hover,
.btn-calculator:hover,
.nav-cta-btn:hover {
  background: #ffe0a7;
  box-shadow: 0 16px 40px rgba(216, 155, 66, .18);
}

.btn-outline {
  color: var(--cream) !important;
  border-color: rgba(244, 239, 229, .3);
  background: rgba(9, 10, 11, .38);
  backdrop-filter: blur(10px);
}

/* Header / pill navigation */
.site-header {
  top: 14px;
  padding-inline: 14px;
  z-index: 1600;
  isolation: isolate;
}

.site-header .container {
  max-width: 1540px;
  padding-inline: 10px;
}

.nav-wrap {
  height: 64px;
  padding: 8px 10px 8px 18px;
  border: 1px solid rgba(244, 239, 229, .12);
  border-radius: 999px;
  background: rgba(10, 11, 12, .76);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 45px rgba(0,0,0,.24);
}

.site-header.scrolled {
  background: transparent;
  border: 0;
}

.nav-logo-name {
  font-size: 14px;
  letter-spacing: -.01em;
}

.nav-logo-sep {
  height: 18px;
  background: rgba(244,239,229,.28);
}

.nav-logo-role,
.nav-links a {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}

.nav-links {
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(244, 239, 229, .09);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
}

.nav-links a::after {
  display: none;
}

.nav-links a:hover,
.nav-links a.current {
  color: var(--cream);
  background: rgba(244, 239, 229, .09);
}

.nav-cta-btn {
  padding: 11px 20px;
}

/* Full-screen hero */
.hero.hero--editorial {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  grid-template-rows: minmax(650px, 1fr) auto;
  min-height: 100svh;
  overflow: hidden;
  padding-top: 92px;
  background: #090a0b;
}

.hero-technical {
  position: absolute;
  inset: 92px 0 0;
  z-index: 4;
  pointer-events: none;
}

.hero-technical__top,
.hero-technical__side {
  position: absolute;
  color: rgba(244,239,229,.38);
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .15em;
}

.hero-technical__top {
  top: 24px;
  right: 32px;
}

.hero-technical__side {
  right: 18px;
  top: 48%;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hero-technical__grid {
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(244,239,229,.08);
  border-bottom: 1px solid rgba(244,239,229,.08);
  background:
    linear-gradient(90deg, transparent calc(45% - 1px), rgba(244,239,229,.11) 45%, transparent calc(45% + 1px)),
    linear-gradient(rgba(244,239,229,.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 96px;
}

.hero-left,
.hero-right {
  position: relative;
  min-width: 0;
}

.hero-left {
  z-index: 6;
  display: flex;
  align-items: center;
  padding: clamp(80px, 10vh, 140px) clamp(24px, 3vw, 56px) 48px clamp(24px, 4vw, 72px);
}

.hero-content {
  width: 100%;
  max-width: 650px;
}

.hero-bg-number {
  top: 42px;
  left: clamp(24px, 4vw, 72px);
  color: rgba(244,239,229,.05);
  font-family: var(--ff-display);
  font-size: clamp(8rem, 14vw, 15rem);
  font-weight: 700;
  line-height: .8;
}

.hero-eyebrow {
  margin-bottom: clamp(24px, 4vh, 44px);
}

.hero-eyebrow-line {
  width: 36px;
  background: var(--brass-light);
}

.hero-h1 {
  margin: 0;
  color: var(--cream);
  max-width: 100%;
  font-size: clamp(3.2rem, 5vw, 6.5rem);
  font-weight: 600;
  line-height: .84;
  letter-spacing: -.01em;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: normal;
}

.hero-h1 > span,
.hero-h1 > em {
  display: block;
  width: max-content;
  max-width: 100%;
  font-style: normal;
  word-break: normal;
}

.hero-h1 > em {
  color: var(--brass-light);
  background: linear-gradient(100deg, #f5d9a7 0%, #d78d2d 68%, #8f5c1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 570px;
  margin-top: clamp(24px, 3.5vh, 38px);
  font-size: clamp(16px, 1.05vw, 19px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(36px, 5vh, 64px);
  padding-top: 0;
  border: 0;
}

.hero-stat {
  min-width: 0;
  padding: 20px 16px 18px;
  border: 1px solid rgba(244,239,229,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
}

.hero-stat + .hero-stat {
  border-left: 1px solid rgba(244,239,229,.12);
}

.hero-stat-n {
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(28px, 2.6vw, 48px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
}

.hero-stat-l {
  margin-top: 10px;
  color: var(--cream-ghost);
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.hero-right {
  z-index: 2;
  min-height: 650px;
  overflow: hidden;
  background: #0d0e10;
}

.hero-right::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, #090a0b 0%, rgba(9,10,11,.68) 11%, transparent 30%),
    linear-gradient(0deg, rgba(9,10,11,.42), transparent 35%);
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
  filter: saturate(.9) contrast(1.04);
  transform: scale(1.02);
  animation: heroReveal .6s var(--ease-editorial) both;
}

.hero-art__status,
.hero-proof-stack span,
.hero-person {
  border: 1px solid rgba(244,239,229,.16);
  border-radius: 999px;
  background: rgba(9,10,11,.68);
  backdrop-filter: blur(16px);
}

.hero-art__status {
  position: absolute;
  z-index: 5;
  top: 34px;
  left: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.hero-proof-stack {
  position: absolute;
  z-index: 5;
  right: 40px;
  bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
}

.hero-proof-stack span {
  padding: 11px 15px;
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-person {
  position: absolute;
  z-index: 5;
  left: 34px;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
}

.hero-person__photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-wide-title {
  grid-column: 1 / -1;
  position: relative;
  z-index: 7;
  overflow: hidden;
  padding: 12px clamp(18px, 2.5vw, 40px) 18px;
  border-top: 1px solid rgba(244,239,229,.13);
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(3.8rem, 8vw, 9.4rem);
  font-weight: 600;
  line-height: .82;
  letter-spacing: -.01em;
  text-align: center;
  white-space: nowrap;
}

.hero-wide-title span {
  color: var(--brass-light);
}

@keyframes heroReveal {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1.02); }
}

.anim-up {
  animation-duration: .6s;
  animation-timing-function: var(--ease-editorial);
}

.ticker-wrap {
  border-color: rgba(244,239,229,.1);
  background: var(--brass-light);
}

.ticker-item,
.ticker-sep {
  color: #17120b;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
}

/* Cards / strict grids */
.calculator-teaser__card,
.svc-card,
.af-item,
.case-featured__card,
.case-editorial,
.case-stat-grid > div,
.case-related__grid > a,
.calculator-home__shell,
.case-single-hero__metric,
.service-price-card,
.audit-card,
.contact-card {
  border: 1px solid rgba(244,239,229,.12);
  border-radius: 22px;
  background: rgba(255,255,255,.025);
  box-shadow: none;
}

.calculator-teaser {
  padding: clamp(80px, 8vw, 130px) 0;
  background: var(--ink);
}

.calculator-teaser__card {
  gap: 30px;
  padding: clamp(30px, 4vw, 62px);
  background:
    linear-gradient(120deg, rgba(216,155,66,.11), transparent 34%),
    rgba(255,255,255,.025);
}

.calculator-teaser__content h2 {
  font-size: clamp(2.5rem, 4.2vw, 5.6rem);
  letter-spacing: -.03em;
}

.analytics-img-wrap {
  max-width: 1560px;
  margin-inline: auto;
  border: 1px solid rgba(244,239,229,.12);
  border-radius: 26px !important;
  overflow: hidden;
}

.analytics-copy {
  padding-inline: clamp(24px, 5vw, 80px) !important;
}

.about-grid,
.home-process-grid,
.case-archive-hero__grid,
.case-single-hero__grid,
.case-contact__inner,
.case-archive-cta__inner {
  gap: clamp(40px, 7vw, 110px) !important;
}

.about-h2 {
  font-size: clamp(3rem, 6vw, 7rem);
  letter-spacing: -.035em;
}

.about-body { min-width: 0; }

.about-overline--trust {
  margin: 8px 0 20px;
}

.about-body p ~ .about-overline--trust { margin-top: 34px; }

.about-features--trust { margin-top: 0; }

.about-features--trust .af-item {
  display: grid;
  align-content: start;
  min-height: 190px;
}

.about-features--trust .af-label {
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 11px;
  line-height: 1.45;
}

.about-features--trust .af-desc { margin-top: 4px; }

.cert-chip,
.hip-cert,
.case-filter {
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.about-features,
.services-grid,
.case-stat-grid,
.case-related__grid {
  gap: 16px;
}

.af-item,
.svc-card {
  padding: 30px;
  transition:
    transform .5s var(--ease-editorial),
    border-color .3s var(--ease-editorial),
    background-color .3s var(--ease-editorial);
}

.af-item:hover,
.svc-card:hover,
.case-related__grid > a:hover {
  transform: translateY(-6px);
  border-color: rgba(240,193,113,.42);
  background: rgba(216,155,66,.06);
}

.af-num,
.svc-num,
.case-featured__number,
.case-editorial__number,
.case-stat-grid strong,
.case-featured__metric strong,
.case-editorial__result strong {
  font-family: var(--ff-display);
  font-size: clamp(28px, 3vw, 54px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
}

/* Service archive and service pages */
.services-archive {
  padding-top: clamp(150px, 14vw, 230px);
  background:
    linear-gradient(rgba(244,239,229,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,229,.025) 1px, transparent 1px),
    var(--ink);
  background-size: 96px 96px;
}

.services-archive__head {
  max-width: 1200px;
  margin-bottom: clamp(58px, 7vw, 100px);
}

.services-grid--archive {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.svc-title {
  font-size: clamp(1.25rem, 1.8vw, 2.2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.svc-desc { overflow-wrap: anywhere; }

.svc-link,
.case-text-link,
.case-related__head > a {
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.service-hero {
  min-height: 100svh;
}

.service-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9,10,11,.95) 0%, rgba(9,10,11,.7) 48%, rgba(9,10,11,.24) 100%),
    linear-gradient(0deg, rgba(9,10,11,.78), transparent 55%);
}

.service-hero .container,
.service-hero-inner {
  position: relative;
  z-index: 2;
}

.service-hero h1 {
  max-width: 100%;
  font-size: clamp(3.25rem, 5.25vw, 7rem);
  line-height: .91;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Cases */
.case-archive-hero,
.case-single-hero {
  padding-top: clamp(170px, 15vw, 240px);
  background:
    radial-gradient(circle at 76% 20%, rgba(216,155,66,.11), transparent 26%),
    linear-gradient(rgba(244,239,229,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,229,.025) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 96px 96px, 96px 96px, auto;
}

.case-featured__card {
  padding: clamp(30px, 5vw, 72px);
}

.case-filters {
  gap: 8px;
}

.case-filter {
  padding: 11px 16px;
}

.case-editorial {
  overflow: hidden;
}

.case-editorial > a {
  min-height: 180px;
  padding: 30px;
  gap: 24px;
}

.case-story__rail span {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.case-chapter {
  padding-bottom: clamp(80px, 9vw, 140px);
}

.case-stat-grid > div {
  padding: 26px;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(244,239,229,.12);
  background: #070809;
}

.footer-inner {
  gap: 30px;
}

.footer-brand-name {
  font-size: clamp(2rem, 4vw, 5rem);
  letter-spacing: -.02em;
}

.footer-brand-role,
.footer-copy,
.footer-legal {
  font-family: var(--ff-body);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.footer-legal { color: var(--cream-ghost); }

@media (max-width: 1180px) {
  .nav-links {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .hero.hero--editorial {
    grid-template-columns: minmax(0, 47%) minmax(0, 53%);
  }

  .hero-technical__grid {
    background:
      linear-gradient(90deg, transparent calc(47% - 1px), rgba(244,239,229,.11) 47%, transparent calc(47% + 1px)),
      linear-gradient(rgba(244,239,229,.035) 1px, transparent 1px);
    background-size: 100% 100%, 100% 96px;
  }

  .hero-h1 {
    font-size: clamp(2.7rem, 4.5vw, 5.3rem);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
  }

  .hero-stat-l {
    margin-top: 0;
  }

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

@media (max-width: 760px) {
  body::before,
  body::after { display: none; }

  .site-header {
    top: 8px;
    padding-inline: 8px;
  }

  .mobile-menu {
    top: 74px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    border: 1px solid rgba(244,239,229,.14);
    border-radius: 18px;
    box-shadow: 0 22px 64px rgba(0,0,0,.62);
  }

  .nav-wrap {
    height: 58px;
    padding-left: 14px;
  }

  .nav-burger {
    pointer-events: auto;
  }

  .nav-logo-role,
  .nav-logo-sep,
  .nav-cta-btn {
    display: none;
  }

  .hero.hero--editorial {
    display: block;
    min-height: 0;
    padding-top: 78px;
  }

  .hero-h1 {
    font-size: clamp(2.6rem, 11.8vw, 4.4rem);
    letter-spacing: -.025em;
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero-h1 > span,
  .hero-h1 > em {
    width: 100%;
    white-space: nowrap;
  }

  .hero-technical {
    inset: 78px 0 0;
  }

  .hero-technical__top,
  .hero-technical__side {
    display: none;
  }

  .hero-technical__grid {
    background: linear-gradient(rgba(244,239,229,.03) 1px, transparent 1px);
    background-size: 100% 72px;
  }

  .hero-left {
    min-height: auto;
    padding: 92px 20px 52px;
  }

  .hero-bg-number {
    top: 32px;
    left: 20px;
    font-size: 8rem;
  }

  .hero-h1 {
    font-size: clamp(2.6rem, 11.8vw, 4.4rem);
    line-height: .86;
  }

  .hero-desc {
    max-width: 34rem;
  }

  .hero-actions .btn {
    flex: 1 1 190px;
    justify-content: center;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-stat {
    display: block;
    padding: 14px 10px;
    border-radius: 14px;
  }

  .hero-stat-n {
    font-size: 26px;
  }

  .hero-stat-l {
    margin-top: 8px;
    font-size: 8px;
    letter-spacing: .1em;
  }

  .hero-right {
    min-height: 62svh;
    border-top: 1px solid rgba(244,239,229,.12);
  }

  .hero-right::before {
    background: linear-gradient(0deg, rgba(9,10,11,.52), transparent 48%);
  }

  .hero-art {
    object-position: 62% center;
  }

  .hero-art__status {
    top: 18px;
    left: 18px;
  }

  .hero-proof-stack {
    right: 16px;
    bottom: 18px;
    left: 16px;
    justify-content: flex-start;
  }

  .hero-person {
    display: none;
  }

  .hero-wide-title {
    padding: 16px 10px 20px;
    font-size: clamp(1.6rem, 8.1vw, 4rem);
  }

  .section-h2,
  .services-archive__head h1,
  .case-archive-hero h1,
  .case-library__head h2,
  .case-single-hero h1,
  .case-chapter h2,
  .case-featured__copy h2,
  .case-calculator__heading h2,
  .case-related__head h2,
  .case-contact h2,
  .case-archive-cta h2,
  .about-h2,
  .service-hero h1 {
    font-size: clamp(2rem, 11.5vw, 4.6rem);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .analytics-img-wrap {
    border-radius: 18px !important;
  }

  .analytics-copy {
    padding-inline: 22px !important;
  }

  .services-grid--archive {
    grid-template-columns: 1fr;
  }

  .cases-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
  }

  .cases-header > *,
  .cases-header .btn {
    width: 100%;
    min-width: 0;
  }

  .cases-header .btn {
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .cases-header .section-h2 {
    max-width: 100%;
    font-size: clamp(2.1rem, 10.8vw, 4.2rem);
    overflow-wrap: anywhere;
  }

  .cases-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .case-item {
    width: 100%;
    min-width: 0;
    padding: 26px 22px;
  }

  .case-niche,
  .case-desc,
  .case-item .tag {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .case-metric { font-size: clamp(42px, 14vw, 56px); }
  .case-bg-label { right: 4px; font-size: 64px; }

  .case-editorial > a {
    min-height: 0;
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .hero-left {
    padding-top: 78px;
  }

  .hero-h1 {
    font-size: clamp(2.4rem, 11.8vw, 3.15rem);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 8px;
  }

  .hero-stat-l {
    margin-top: 0;
  }

  .hero-right {
    min-height: 54svh;
  }

  .hero-proof-stack span:nth-child(3) {
    display: none;
  }

  .hero-wide-title {
    font-size: 8.1vw;
  }
}

/* Stories / a compact trust route */
.stories-section {
  position: relative;
  overflow: hidden;
  padding: clamp(80px, 8vw, 130px) 0;
  border-bottom: 1px solid rgba(244,239,229,.09);
  background:
    radial-gradient(circle at 84% 18%, rgba(216,155,66,.1), transparent 28%),
    var(--ink-soft);
}

.stories-section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: clamp(30px, 7vw, 110px);
  margin-bottom: clamp(36px, 5vw, 70px);
}

.stories-section__head h2 {
  margin-top: 14px;
  color: var(--cream);
  font-size: clamp(2.8rem, 5vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.035em;
}

.stories-section__head h2 span { color: var(--brass-light); }
.stories-section__head p {
  max-width: 390px;
  color: var(--cream-dim);
  font-size: 16px;
  line-height: 1.7;
}

.stories-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
}

.story-trigger {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.story-trigger-wrap { min-width: 0; }

.story-trigger__visual {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(244,239,229,.16);
  border-radius: 22px;
  background: #071327;
  transition: transform .5s var(--ease-editorial), border-color .3s var(--ease-editorial);
}

.story-trigger__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  background: linear-gradient(145deg, var(--brass-light), transparent 45%, #376fb9) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .68;
  pointer-events: none;
}

.story-trigger:hover .story-trigger__visual,
.story-trigger:focus-visible .story-trigger__visual {
  transform: translateY(-7px);
  border-color: rgba(240,193,113,.55);
}

.story-trigger.is-viewed .story-trigger__visual::after { opacity: .24; }
.story-trigger.is-viewed .story-trigger__label { color: var(--cream-ghost); }

.story-trigger:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 6px; border-radius: 20px; }
.story-trigger__visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.story-trigger__label {
  display: block;
  padding: 13px 4px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.story-trigger__graphic {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 35%, rgba(216,155,66,.2), transparent 38%),
    #071327;
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.story-trigger__graphic .tolsky-icon { width: 52px; height: 52px; color: var(--brass-light); }
.story-trigger__graphic strong { font-family: var(--ff-display); font-size: clamp(30px, 3vw, 54px); color: var(--cream); }

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 12px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s var(--ease-editorial), visibility .3s;
}

.story-viewer.is-open { visibility: visible; opacity: 1; }
.story-viewer__backdrop { position: absolute; inset: 0; background: rgba(2,4,8,.9); backdrop-filter: blur(12px); }
.story-viewer__frame {
  position: relative;
  overflow: hidden;
  width: min(430px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - 24px));
  border: 1px solid rgba(244,239,229,.2);
  border-radius: 26px;
  background: #071327;
  box-shadow: 0 34px 100px rgba(0,0,0,.75);
  outline: none;
  transform: translateY(18px) scale(.985);
  transition: transform .5s var(--ease-editorial);
}

.story-viewer.is-open .story-viewer__frame { transform: translateY(0) scale(1); }
.story-progress {
  position: absolute;
  z-index: 8;
  top: 14px;
  left: 14px;
  right: 58px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.story-progress > span { height: 3px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.28); }
.story-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; }
.story-progress i.is-complete { width: 100%; }
.story-progress i.is-running { animation: storyProgress 7s linear forwards; }
.story-viewer.is-paused .story-progress i.is-running { animation-play-state: paused; }

@keyframes storyProgress { from { width: 0; } to { width: 100%; } }

.story-viewer__close {
  position: absolute;
  z-index: 10;
  top: 25px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.42);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.story-viewer__pause {
  position: absolute;
  z-index: 10;
  top: 25px;
  right: 56px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.42);
  font-size: 12px;
  cursor: pointer;
}

.story-viewer__nav {
  position: absolute;
  z-index: 7;
  top: 64px;
  bottom: 120px;
  width: 30%;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
}
.story-viewer__nav--prev { left: 0; text-align: left; }
.story-viewer__nav--next { right: 0; text-align: right; }
.story-viewer__nav span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .3s;
}
.story-viewer__nav:hover span,
.story-viewer__nav:focus-visible span { opacity: 1; }

.story-slides, .story-slide { position: absolute; inset: 0; }
.story-slide { visibility: hidden; opacity: 0; transform: translateX(16px); transition: opacity .3s var(--ease-editorial), transform .5s var(--ease-editorial), visibility .3s; }
.story-slide.is-active { visibility: visible; opacity: 1; transform: translateX(0); }
.story-slide__image { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.story-slide__generated {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 54px 38px 230px;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    radial-gradient(circle at 70% 30%, rgba(216,155,66,.2), transparent 34%),
    #071327;
  background-size: 52px 52px, 52px 52px, auto, auto;
}
.story-slide__generated .tolsky-icon { width: 76px; height: 76px; margin-bottom: 28px; color: var(--brass-light); }
.story-slide__generated strong { color: var(--cream); font-family: var(--ff-display); font-size: clamp(76px, 16vh, 146px); line-height: .9; letter-spacing: -.04em; }
.story-slide__generated > span:not(.story-slide__technical) { max-width: 270px; margin-top: 18px; color: var(--cream-dim); font-size: 14px; font-weight: 700; letter-spacing: .12em; line-height: 1.5; text-transform: uppercase; }
.story-slide__technical { position: absolute; top: 66px; left: 38px; color: rgba(244,239,229,.52); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.story-slide__caption {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 78px 28px 28px;
  background: linear-gradient(transparent, rgba(3,8,17,.94) 38%, #030811 100%);
}
.story-slide__caption > span { color: var(--brass-light); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.story-slide__caption h3 { margin-top: 9px; color: #fff; font-family: var(--ff-body); font-size: clamp(22px, 4vh, 34px); line-height: 1.05; letter-spacing: -.03em; }
.story-slide__caption p { margin-top: 10px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.45; }
.story-slide--image .story-slide__caption { padding-top: 54px; }
.story-slide--image .story-slide__caption p { display: none; }
.story-slide__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 999px;
  color: #17120b;
  background: var(--brass-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.story-slide__cta:hover { color: #17120b; background: #f5cb82; }
.story-slide__cta span { font-size: 20px; }
.story-is-open { overflow: hidden; }

/* Niche visuals / generated from each service */
.svc-card { overflow: hidden; }
.service-visual {
  position: relative;
  overflow: hidden;
  color: var(--cream);
  background:
    linear-gradient(rgba(244,239,229,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,229,.055) 1px, transparent 1px),
    radial-gradient(circle at 72% 45%, rgba(216,155,66,.2), transparent 33%),
    #101722;
  background-size: 34px 34px, 34px 34px, auto, auto;
}
.service-visual::after {
  content: '';
  position: absolute;
  right: -18%;
  bottom: -52%;
  width: 76%;
  aspect-ratio: 1;
  border: 1px solid rgba(240,193,113,.32);
  border-radius: 50%;
}
.service-visual--card {
  width: calc(100% + 60px);
  height: 176px;
  margin: -30px -30px 26px;
  border-bottom: 1px solid rgba(244,239,229,.12);
}
.service-visual__code {
  position: absolute;
  top: 18px;
  left: 20px;
  color: rgba(244,239,229,.48);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}
.service-visual__icon { position: absolute; left: 22px; bottom: 24px; }
.service-visual__icon .tolsky-icon { width: 66px; height: 66px; color: var(--brass-light); stroke-width: 1.35; }
.service-visual__label {
  position: absolute;
  right: 20px;
  bottom: 24px;
  max-width: 46%;
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
}
.service-hero__niche-art { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.service-visual--hero {
  position: absolute;
  top: 16%;
  right: 1%;
  width: min(45vw, 680px);
  height: min(66vh, 620px);
  border: 1px solid rgba(244,239,229,.12);
  border-radius: 34px;
  opacity: .7;
  transform: rotate(2deg);
}
.service-visual--hero .service-visual__code { top: 34px; left: 38px; font-size: 11px; }
.service-visual--hero .service-visual__icon { left: 48px; bottom: 66px; }
.service-visual--hero .service-visual__icon .tolsky-icon { width: clamp(110px, 13vw, 210px); height: clamp(110px, 13vw, 210px); }
.service-visual--hero .service-visual__label { right: 42px; bottom: 58px; font-size: 12px; }

@media (max-width: 980px) {
  .stories-rail {
    grid-template-columns: repeat(7, 148px);
    overflow-x: auto;
    margin-inline: calc(var(--container-pad, 20px) * -1);
    padding: 8px var(--container-pad, 20px) 18px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .story-trigger-wrap { scroll-snap-align: start; }
  .service-visual--hero { right: -18%; width: 72vw; opacity: .4; }
}

@media (max-width: 760px) {
  .stories-section__head { grid-template-columns: 1fr; gap: 20px; }
  .stories-section__head p { font-size: 15px; }
  .stories-rail { grid-template-columns: repeat(7, 124px); }
  .story-trigger__label { font-size: 10px; }
  .story-viewer { padding: 0; }
  .story-viewer__frame { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .story-viewer__nav span { display: none; }
  .story-progress { top: max(12px, env(safe-area-inset-top)); }
  .story-viewer__close { top: max(22px, calc(env(safe-area-inset-top) + 10px)); }
  .story-viewer__pause { top: max(22px, calc(env(safe-area-inset-top) + 10px)); }
  .story-slide__caption { padding-right: 22px; padding-bottom: max(24px, env(safe-area-inset-bottom)); padding-left: 22px; }
  .story-slide__generated { padding-right: 26px; padding-left: 26px; }
  .service-visual--hero { top: 24%; right: -34%; width: 96vw; height: 52vh; opacity: .28; }
  .service-visual--card { height: 154px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-progress i.is-running { animation: none; width: 0; }
  .story-viewer__frame,
  .story-slide,
  .story-trigger__visual { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Additions / portrait, reputation, certificates, video and service grouping */
.hero-art.hero-art--portrait {
  inset: auto 3% 0 auto;
  width: 82%;
  height: 88%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(.78) contrast(1.08) brightness(.9);
  transform: none;
  transform-origin: center bottom;
}

.hero-right:has(.hero-art--portrait)::before {
  background:
    linear-gradient(90deg, #090a0b 0%, rgba(9,10,11,.73) 11%, transparent 34%),
    linear-gradient(0deg, rgba(9,10,11,.54), transparent 44%),
    linear-gradient(180deg, rgba(9,10,11,.14), transparent 30%);
}

.trust-platforms {
  padding: clamp(72px, 8vw, 120px) 0;
  border-bottom: 1px solid rgba(244,239,229,.1);
  background: var(--ink-soft);
}

.trust-platforms__head,
.certificates-section__head,
.rutube-section__head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: end;
  gap: clamp(40px, 7vw, 110px);
  margin-bottom: clamp(42px, 6vw, 82px);
}

.trust-platforms__head h2,
.certificates-section__head h2,
.rutube-section__head h2 {
  margin-top: 14px;
  color: var(--cream);
  font-size: clamp(3rem, 6.2vw, 7.3rem);
  line-height: .94;
  letter-spacing: -.035em;
}

.trust-platforms__head h2 span,
.certificates-section__head h2 span,
.rutube-section__head h2 span {
  color: var(--brass-light);
  background: linear-gradient(100deg, #f4d39a 0%, #d78d2d 68%, #936022 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.platform-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 152px;
  padding: 28px 68px 28px 28px;
  border: 1px solid rgba(244,239,229,.13);
  border-radius: 22px;
  background: rgba(255,255,255,.025);
  color: var(--cream);
  transition: transform .5s var(--ease-editorial), border-color .3s var(--ease-editorial), background-color .3s var(--ease-editorial);
}

.platform-card:hover {
  opacity: 1;
  transform: translateY(-5px);
  border-color: rgba(240,193,113,.42);
  background: rgba(216,155,66,.055);
}

.platform-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(244,239,229,.12);
  border-radius: 20px;
  background: rgba(255,255,255,.04);
}

.platform-mark--avito i {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.platform-mark--avito i:nth-child(1) { transform: translate(-12px,-12px); background:#00aaff; }
.platform-mark--avito i:nth-child(2) { transform: translate(12px,-12px); background:#ff6163; }
.platform-mark--avito i:nth-child(3) { transform: translate(-12px,12px); background:#97cf26; }
.platform-mark--avito i:nth-child(4) { transform: translate(12px,12px); background:#a169f7; }

.platform-mark--kwork {
  color: #151b12;
  background: #9be25d;
  font-family: var(--ff-display);
  font-size: 30px;
  font-weight: 700;
}

.platform-mark--profi {
  color: #fff;
  background: #376cff;
  font-family: var(--ff-display);
  font-size: 27px;
  font-weight: 700;
}

.platform-mark--yandex {
  color: #111;
  background: #ffd633;
  font-family: var(--ff-display);
  font-size: 27px;
  font-weight: 700;
}

.platform-card__body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.platform-card__name {
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 600;
  line-height: 1;
}

.platform-card__meta {
  color: var(--cream-ghost);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.platform-card__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brass-light);
}

.platform-card__rating strong {
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(34px, 4vw, 62px);
  font-weight: 600;
  line-height: 1;
}

.platform-card__rating > span { font-size: 18px; }

.platform-card__arrow,
.certificate-card__arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--cream-ghost);
  font-size: 18px;
}

.certificates-section {
  border-top: 1px solid rgba(244,239,229,.1);
  border-bottom: 1px solid rgba(244,239,229,.1);
  background: var(--ink-soft);
}

.certificate-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}

.certificate-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(244,239,229,.13);
  border-radius: 22px;
  background: rgba(255,255,255,.025);
  color: var(--cream);
  font: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
  flex: 1 1 320px;
  width: 100%;
  max-width: calc((100% - 32px) / 3);
  transition: transform .5s var(--ease-editorial), border-color .3s var(--ease-editorial);
}

.certificate-card:hover {
  opacity: 1;
  transform: translateY(-6px);
  border-color: rgba(240,193,113,.42);
}

.certificate-card__visual {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #fff;
}

.certificate-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .6s var(--ease-editorial);
}

.certificate-card:hover .certificate-card__visual img { transform: scale(1.025); }

.certificate-card__copy {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 170px;
  padding: 24px 52px 26px 24px;
  min-width: 0;
}

.certificate-card__index,
.certificate-card__copy > span:last-child {
  color: var(--cream-ghost);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.certificate-card__copy strong {
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(19px, 1.55vw, 27px);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.certificate-card__arrow {
  top: auto;
  bottom: 24px;
}

.certificate-card:focus-visible,
.case-item:focus-visible {
  outline: 2px solid var(--brass-light);
  outline-offset: 4px;
}

/* Certificate stories stay inside the current page. */
.certificate-viewer {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s var(--ease-editorial), visibility .3s var(--ease-editorial);
}

.certificate-viewer.is-open {
  visibility: visible;
  opacity: 1;
}

.certificate-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,5,6,.9);
  backdrop-filter: blur(14px);
}

.certificate-viewer__frame {
  position: relative;
  width: min(920px, 92vw);
  height: min(88dvh, 900px);
  overflow: hidden;
  border: 1px solid rgba(244,239,229,.18);
  border-radius: 26px;
  background: #101214;
  box-shadow: 0 35px 100px rgba(0,0,0,.65);
  transform: translateY(18px) scale(.985);
  transition: transform .5s var(--ease-editorial);
}

.certificate-viewer.is-open .certificate-viewer__frame { transform: none; }

.certificate-viewer__progress {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 68px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.certificate-viewer__progress span {
  height: 3px;
  border-radius: 99px;
  background: rgba(244,239,229,.24);
}

.certificate-viewer__progress span.is-active { background: var(--brass-light); }

.certificate-viewer__close,
.certificate-viewer__nav {
  position: absolute;
  z-index: 7;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244,239,229,.2);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(9,10,11,.75);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.certificate-viewer__close {
  top: 34px;
  right: 18px;
  width: 38px;
  height: 38px;
  font-size: 25px;
}

.certificate-viewer__nav {
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 20px;
  transform: translateY(-50%);
}

.certificate-viewer__nav--prev { left: 18px; }
.certificate-viewer__nav--next { right: 18px; }
.certificate-viewer__nav[disabled] { opacity: .25; cursor: default; }

.certificate-viewer__slides,
.certificate-viewer__slide {
  width: 100%;
  height: 100%;
}

.certificate-viewer__slide {
  position: absolute;
  inset: 0;
  display: none;
  margin: 0;
  padding: 54px 72px 86px;
}

.certificate-viewer__slide.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
}

.certificate-viewer__slide img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #fff;
}

.certificate-viewer__slide figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  color: var(--cream);
}

.certificate-viewer__slide figcaption strong {
  font-family: var(--ff-display);
  font-size: clamp(16px, 2vw, 24px);
}

.certificate-viewer__slide figcaption span {
  color: var(--cream-ghost);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.certificate-is-open { overflow: hidden; }

/* A link occupies the full case card and keeps the original visual style. */
a.case-item {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* System guardrails for long Russian headings and narrow grid columns. */
.hero-left,
.hero-content,
.calculator-teaser__content,
.service-hero-grid > *,
.trust-platforms__head > *,
.certificates-section__head > *,
.rutube-section__head > * {
  min-width: 0;
}

.calculator-teaser__content h2,
.services-archive__head h1,
.service-hero h1,
.calculator-page__heading h1 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero-h1 {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

.calculator-teaser__content h2 {
  font-size: clamp(2.35rem, 3.7vw, 4.7rem);
  line-height: .95;
}

/* Legal pages / concise, readable and consistent with the editorial system. */
.legal-page {
  min-height: 70vh;
  padding: clamp(140px, 12vw, 190px) 0 clamp(80px, 9vw, 140px);
  background:
    linear-gradient(rgba(244,239,229,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,229,.025) 1px, transparent 1px),
    var(--ink);
  background-size: 96px 96px;
}

.legal-page__layout {
  display: grid;
  grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr);
  gap: clamp(42px, 8vw, 130px);
  align-items: start;
}

.legal-page__aside { position: sticky; top: 120px; }

.legal-page__nav {
  display: grid;
  gap: 2px;
  margin-top: 24px;
}

.legal-page__nav a {
  padding: 12px 0;
  border-bottom: 1px solid rgba(244,239,229,.1);
  color: var(--cream-ghost);
  font-size: 12px;
  line-height: 1.45;
}

.legal-page__nav a:hover,
.legal-page__nav a.is-current { color: var(--brass-light); opacity: 1; }

.legal-page__owner {
  display: grid;
  gap: 6px;
  margin-top: 34px;
  padding: 20px;
  border: 1px solid rgba(244,239,229,.11);
  border-radius: 16px;
  color: var(--cream-ghost);
  font-size: 12px;
  line-height: 1.5;
}

.legal-page__owner strong { color: var(--cream); }
.legal-page__owner a { color: var(--brass-light); }

.legal-page__content {
  width: min(100%, 900px);
  min-width: 0;
  color: var(--cream-dim);
}

.legal-page__content h1 {
  margin: 0 0 14px;
  color: var(--cream);
  font-size: clamp(2.7rem, 5vw, 6.2rem);
  line-height: .97;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.legal-page__date {
  margin-bottom: clamp(34px, 5vw, 64px) !important;
  color: var(--brass-light) !important;
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.legal-page__content h2 {
  margin: 42px 0 12px;
  color: var(--cream);
  font-family: var(--ff-display);
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.2;
}

.legal-page__content p,
.legal-page__content li {
  color: var(--cream-dim);
  font-size: 15px;
  line-height: 1.85;
}

.legal-page__content p + p { margin-top: 14px; }
.legal-page__content ul { display: grid; gap: 8px; padding-left: 22px; }
.legal-page__content a { color: var(--brass-light); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 1181px) and (max-height: 850px) {
  .hero.hero--editorial { grid-template-rows: minmax(560px, 1fr) auto; }
  .hero-left { padding-top: 60px; padding-bottom: 30px; }
  .hero-h1 { font-size: clamp(3.5rem, 5.7vw, 7rem); }
  .hero-desc { margin-top: 20px; }
  .hero-stats { margin-top: 28px; }
}

.rutube-section {
  background:
    linear-gradient(rgba(244,239,229,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,229,.025) 1px, transparent 1px),
    var(--ink-soft);
  background-size: 96px 96px;
}

.rutube-section__intro {
  display: grid;
  justify-items: start;
  gap: 22px;
}

.rutube-section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rutube-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}

.rutube-card {
  flex: 1 1 320px;
  width: 100%;
  max-width: calc((100% - 32px) / 3);
  overflow: hidden;
  border: 1px solid rgba(244,239,229,.13);
  border-radius: 22px;
  background: rgba(255,255,255,.025);
}

.rutube-card__video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #050506;
}

.rutube-card__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.rutube-card__copy {
  min-height: 150px;
  padding: 24px;
}

.rutube-card__copy span {
  color: var(--brass-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.rutube-card__copy h3 {
  margin-top: 14px;
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: clamp(18px, 1.6vw, 25px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.services-archive__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.services-archive__nav a {
  padding: 11px 16px;
  border: 1px solid rgba(244,239,229,.16);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255,255,255,.025);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.services-group + .services-group { margin-top: clamp(100px, 11vw, 180px); }

.services-group__title {
  display: grid;
  grid-template-columns: minmax(90px, 14vw) 1fr;
  align-items: end;
  gap: 24px;
  margin-bottom: clamp(42px, 6vw, 82px);
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(244,239,229,.13);
}

.services-group__title > span {
  color: rgba(244,239,229,.12);
  font-family: var(--ff-display);
  font-size: clamp(54px, 9vw, 130px);
  font-weight: 600;
  line-height: .72;
}

.services-group__title h2 {
  margin-top: 10px;
  color: var(--cream);
  font-size: clamp(2.5rem, 5vw, 6.2rem);
  line-height: .95;
  letter-spacing: -.035em;
}

.services-letter-group {
  display: grid;
  grid-template-columns: minmax(90px, 14vw) 1fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid rgba(244,239,229,.08);
}

.services-letter-group__letter {
  position: sticky;
  top: 105px;
  align-self: start;
  color: var(--brass-light);
  font-family: var(--ff-display);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 600;
  line-height: .8;
}

.services-letter-group .services-grid--archive {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.services-grid--cities { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1180px) {
  .certificate-grid,
  .rutube-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certificate-card:last-child,
  .rutube-card:last-child { grid-column: span 2; }
  .certificate-card,
  .rutube-card { max-width: calc((100% - 16px) / 2); }
  .services-grid--cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hero-art.hero-art--portrait {
    inset: auto 0 0;
    width: 100%;
    height: 94%;
    object-position: center bottom;
  }
  .trust-platforms__head,
  .certificates-section__head,
  .rutube-section__head { grid-template-columns: 1fr; gap: 24px; }
  .trust-platforms__head h2,
  .certificates-section__head h2,
  .rutube-section__head h2 { font-size: clamp(1.8rem, 9vw, 4.5rem); overflow-wrap: normal; }
  .stories-section__head h2 { font-size: clamp(2rem, 10.5vw, 4.2rem); }
  .calculator-teaser__content h2 { font-size: clamp(1.8rem, 8.5vw, 3.2rem); overflow-wrap: normal; }
  .platform-grid,
  .certificate-grid,
  .rutube-grid,
  .services-grid--cities { grid-template-columns: 1fr; }
  .certificate-card:last-child,
  .rutube-card:last-child { grid-column: auto; }
  .certificate-card,
  .rutube-card { max-width: 100%; }
  .platform-card { grid-template-columns: auto 1fr; gap: 16px; padding: 22px 52px 22px 20px; }
  .platform-mark { width: 56px; height: 56px; border-radius: 16px; }
  .platform-card__rating { grid-column: 1 / -1; padding-top: 15px; border-top: 1px solid rgba(244,239,229,.1); }
  .services-group__title,
  .services-letter-group { grid-template-columns: 64px 1fr; gap: 16px; }
  .services-letter-group .services-grid--archive { grid-template-columns: 1fr; }
  .rutube-section__actions,
  .rutube-section__actions .btn { width: 100%; }
  .certificate-viewer { padding: 0; }
  .certificate-viewer__frame { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .certificate-viewer__slide { padding: 58px 18px 90px; }
  .certificate-viewer__nav { top: auto; bottom: 22px; }
  .certificate-viewer__nav--prev { left: 18px; }
  .certificate-viewer__nav--next { right: 18px; }
  .certificate-viewer__slide figcaption { display: grid; gap: 5px; padding: 0 54px; text-align: center; }
  .certificate-viewer__slide figcaption strong,
  .certificate-viewer__slide figcaption span { overflow-wrap: anywhere; }
  .legal-page__layout { grid-template-columns: 1fr; gap: 42px; }
  .legal-page__aside { position: static; }
  .legal-page__content h1 { font-size: clamp(2.45rem, 12vw, 4.6rem); }
}

@media (max-width: 430px) {
  .hero-art.hero-art--portrait { object-position: center bottom; }
  .services-group__title,
  .services-letter-group { grid-template-columns: 1fr; gap: 18px; }
  .services-letter-group__letter { font-size: 42px; }
  .services-letter-group__letter { position: static; }
}

/* Keep these guards after all dialog layouts. A visible child can override a
   hidden ancestor; opacity alone does not prevent invisible hit targets. */
.story-viewer:not(.is-open),
.certificate-viewer:not(.is-open) { display: none !important; pointer-events: none; }
.story-viewer[hidden],
.certificate-viewer[hidden] { display: none !important; }
