:root{
  --ff:-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',system-ui,sans-serif;
  --ff-body:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',system-ui,sans-serif;
  --max-w:1200px;
  --gut:clamp(20px,4vw,56px);
  --nav-h:60px;
  --ease:cubic-bezier(.16,1,.3,1);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{
  scroll-behavior:smooth;-webkit-font-smoothing:antialiased;
  height:100%;
}
::selection{background:#000;color:#fff}
body{
  background:#fff;color:#000;
  font-family:var(--ff-body);
  font-size:16px;line-height:1.6;
  overflow-x:hidden;
  min-height:100%;
  min-height:100svh;
  min-height:100dvh;
  /* Pointer cursor */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M5 3L19 12 12 13 8 20Z' fill='%23000' stroke='%23fff' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") 5 3, default;
}
body.mode-pencil, body.mode-pencil *{
  /* Pencil cursor */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l1.5-4.5L16 5a2.121 2.121 0 0 1 3 3L8.5 18.5Z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 7l3 3' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5.5 15.5l3 3' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 4 20, crosshair;
}
body.mode-eraser, body.mode-eraser *{
  cursor: none !important;
}

/* Круглый курсор ластика как в Photoshop */
#eraser-cursor{
  position:fixed;
  pointer-events:none;
  z-index:99999;
  border:1.5px solid #000;
  border-radius:50%;
  background:rgba(255,255,255,0.3);
  transform:translate(-50%,-50%);
  display:none;
  transition:width .1s,height .1s;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
ul,ol{list-style:none}
button{font-family:inherit;border:none;background:none;}

/* ── PAGE WRAPPER for absolute canvas ── */
#page-wrap{
  position:relative;
  z-index:0;
  overflow-x:hidden;
  /* Sticky footer: fill at least one viewport so footer isn’t mid-screen on tall displays */
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-height:100svh;
  min-height:100dvh;
}
/* main must NOT flex-grow — otherwise empty space appears *inside* main below contacts */
#page-wrap > main{
  flex:0 1 auto;
  min-width:0;
}
#page-wrap > header.hero{flex-shrink:0}
#page-wrap > #main-footer{
  flex-shrink:0;
  margin-top:auto;
}

/* Inner pages (legal, case stubs): short content still fills viewport */
body:not(.page-home){
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-height:100dvh;
}
body:not(.page-home) > main.page-main{
  flex:0 1 auto;
  width:100%;
}
body:not(.page-home) > section.contacts{
  flex-shrink:0;
  width:100%;
}
body:not(.page-home) > #main-footer{
  flex-shrink:0;
  margin-top:auto;
}

/* ── DRAW CANVAS — absolute inside page-wrap ── */
#drawing-canvas{
  position:absolute;
  top:0;left:0;
  width:100%;
  max-width:100%;
  display:block;
  pointer-events:none;
  z-index:200;
}
body.mode-pencil #drawing-canvas{pointer-events:all;}

/* ── LAYOUT ── */
.wrap{width:100%;max-width:var(--max-w);margin:0 auto;padding:0 var(--gut)}

.nav{
  position:fixed;top:0;left:0;right:0;height:var(--nav-h);
  z-index:1000;
}
.nav__inner{
  height:100%;max-width:var(--max-w);margin:0 auto;padding:0 var(--gut);
  display:flex;align-items:center;justify-content:space-between;
}
.nav__logo{
  display:flex;align-items:center;flex-shrink:0;
}
/* SVG пути уже чёрные в HTML — difference позаботится об инверсии */

/* Правая часть nav — ссылки + CV */
.nav__right{
  display:flex;align-items:center;gap:24px;
}

/* Ссылки меню — отдельный класс, чёрные */
.nav__links{
  display:flex;align-items:center;gap:36px;
  font-family:var(--ff);font-size:14px;font-weight:500;letter-spacing:.02em;
  list-style:none;
}
.nav__link{
  color:#000;
  position:relative;
}
.nav__link::after{ display:none; }

/* CV кнопка — isolation:isolate выводит её из blend-mode.
   Сохраняет свои цвета независимо от difference на nav. */
.nav__cv{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 14px;
  font-size:13px;font-weight:600;font-family:var(--ff);
  border:2px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  background:#000;
  color:#fff;
  isolation:isolate;
  transition:background .2s,border-color .2s;
}
.nav__cv:hover{ background:#333; border-color:#333; }

.nav__burger{
  display:none;flex-direction:column;gap:5px;padding:8px;
  width:40px;height:40px;align-items:center;justify-content:center;
  color:#000;
}
.nav__burger span{
  display:block;width:22px;height:1.5px;background:#000;
  transition:transform .3s var(--ease),opacity .3s;transform-origin:center;
}
.nav__burger.active{opacity:0;pointer-events:none}

/* Mobile menu */
.nav__mobile{
  position:fixed;inset:0;background:#fff;z-index:9500;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px;
  transform:translateX(100%);transition:transform .45s var(--ease);
}
.nav__mobile.open{transform:translateX(0)}
.nav__mobile a{
  font-family:var(--ff);font-size:clamp(28px,6vw,48px);font-weight:700;
  letter-spacing:-.02em;color:#000;
  text-decoration:none;
}
.nav__mobile a:hover{ text-decoration:none; }
/* CV кнопка в мобильном меню — как на десктопе */
.nav__mobile .nav__mobile-cv{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 28px;
  font-size:16px;font-weight:600;font-family:var(--ff);
  border:2px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  background:#000;color:#fff;
  text-decoration:none !important;
}
.nav__mobile .nav__mobile-cv:hover{background:#333;border-color:#333}
/* Кнопка закрытия мобильного меню */
.nav__mobile-close{
  position:absolute;top:20px;right:20px;
  width:44px;height:44px;
  border:1.5px solid #000;border-radius:2px;
  background:#fff;color:#000;
  display:flex;align-items:center;justify-content:center;
  font-size:20px;
  cursor:pointer;
  z-index:1;
  transition:background .2s,color .2s;
}
.nav__mobile-close:hover{background:#000;color:#fff}

/* ── REVEAL ── */
.reveal{opacity:0;transform:translateY(20px);transition:opacity .7s var(--ease),transform .7s var(--ease)}
.reveal.visible{opacity:1;transform:translateY(0)}
.reveal-d1{transition-delay:.12s}.reveal-d2{transition-delay:.24s}.reveal-d3{transition-delay:.36s}

/* ── BUTTONS ── */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 22px;
  font-family:var(--ff);font-size:14px;font-weight:600;letter-spacing:.02em;
  border:2px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  transition:background .22s,color .22s,transform .15s;
  white-space:nowrap;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:#000;color:#fff}
.btn-primary:hover{background:#222;border-color:#222}
.btn-ghost{background:transparent;color:#000}
.btn-ghost:hover{background:#000;color:#fff}

/* ── HERO ── */
.hero{
  padding:calc(var(--nav-h) + 64px) 0 60px;
}
.hero .wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:clamp(20px,4vw,60px);
  align-items:center;
}
.hero__left{display:flex;flex-direction:column;gap:22px;min-width:0}
.hero__illustration{min-width:0}
.hero__headline{
  font-family:var(--ff);
  font-size:clamp(28px,3.2vw,40px);
  font-weight:800;letter-spacing:-.03em;line-height:1.08;
}
.hero__headline em{font-style:italic;font-weight:300}
.hero__desc{font-size:15px;line-height:1.7;color:#444;max-width:460px}
.hero__desc strong{color:#000}
.hero__cta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.hero__illustration{
  display:flex;align-items:center;justify-content:center;
}
/* Match ~hero.png scale: cap height so tall SVGs don’t dominate (esp. mobile full-bleed) */
.hero__illustration img{
  width:auto;
  max-width:min(380px, 92%);
  max-height:min(400px, 44vh);
  height:auto;
  object-fit:contain;
  object-position:center bottom;
  display:block;
  margin:0 auto;
}

/* ── HEADINGS ── */
.section-header{margin-bottom:clamp(28px,3.5vw,48px)}
.section-header h2, h2{
  font-family:var(--ff);
  font-size:32px;
  font-weight:800;letter-spacing:-.02em;line-height:1.1;
}
h3{
  font-family:var(--ff);
  font-size:24px;
  font-weight:700;letter-spacing:-.01em;
}

/* ── CASES ── */
.cases{padding:clamp(64px,8vw,112px) 0}
.cases__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.case-card{
  display:block;position:relative;
  background:#f5f5f5;aspect-ratio:4/3;overflow:hidden;
  border-radius:4px;border:1.5px solid transparent;
  transition:border-color .2s;
}
.case-card__thumb{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;z-index:0;
  transition:transform .45s var(--ease);
}
.case-card:hover .case-card__thumb{transform:scale(1.03)}
.case-card:hover{border-color:#000}
.case-card__num{
  position:absolute;top:16px;left:20px;
  font-family:var(--ff);font-size:11px;font-weight:600;letter-spacing:.08em;color:#aaa;z-index:2;
}
.case-card__overlay{
  position:absolute;inset:0;display:flex;align-items:flex-end;padding:24px;
  background:linear-gradient(to top,rgba(0,0,0,.65) 0%,transparent 55%);
  opacity:0;transition:opacity .3s;z-index:2;
}
.case-card:hover .case-card__overlay{opacity:1}
.case-card__cat{font-size:11px;letter-spacing:.07em;color:rgba(255,255,255,.7);margin-bottom:4px}
.case-card__title{
  font-family:var(--ff);font-size:18px;font-weight:700;color:#fff;
  display:flex;align-items:center;gap:6px;
}
.case-card__soon{font-weight:600;opacity:.88;font-size:.88em}

/* ── SERVICES ── */
.services{padding:clamp(64px,8vw,112px) 0}
.services__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.service-card{
  padding:28px 22px;
  border:1.5px solid #e0e0e0;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  opacity:0;transform:translateY(24px);
  transition:opacity .6s var(--ease),transform .6s var(--ease),background .2s,border-color .2s,color .2s;
}
.service-card.fly-in{opacity:1;transform:translateY(0)}
.service-card:nth-child(2){transition-delay:.1s}
.service-card:nth-child(3){transition-delay:.2s}
.service-card:nth-child(4){transition-delay:.3s}
.service-card:hover{background:#000;color:#fff;border-color:#000}
.service-card__icon{font-size:22px;margin-bottom:14px;display:block}
.service-card h3{font-size:15px;font-weight:700;margin-bottom:8px;letter-spacing:-.01em;line-height:1.3}
.service-card p{font-size:13px;line-height:1.65;opacity:.7}
.service-card:hover p{opacity:.85}

/* ── ABOUT ── */
.about{padding:clamp(64px,8vw,112px) 0}
.about__inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(40px,6vw,80px)}
.about__label{font-size:11px;letter-spacing:.1em;font-weight:600;text-transform:uppercase;color:#999;margin-bottom:12px}
.about__name{
  font-size:clamp(32px,4vw,52px);
  font-family:var(--ff);font-weight:800;letter-spacing:-.03em;line-height:1;margin-bottom:24px;
}
.about__bio{font-size:15px;line-height:1.75;color:#444;margin-bottom:12px}
.about__stats{
  display:flex;margin-bottom:24px;
  border:1.5px solid #e0e0e0;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  overflow:hidden;
}
.about__stat{
  flex:1;padding:14px 18px;border-right:1.5px solid #e0e0e0;
  transition:background .2s,color .2s;
}
.about__stat:hover{background:#000;color:#fff}
.about__stat:hover .about__stat-label{color:rgba(255,255,255,.6)}
.about__stat:last-child{border-right:none}
.about__stat-num{font-family:var(--ff);font-size:22px;font-weight:800;letter-spacing:-.02em;margin-bottom:2px}
.about__stat-label{font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:#999}
.about__toolkit-label{font-size:10px;letter-spacing:.08em;font-weight:600;text-transform:uppercase;color:#999;margin-bottom:8px}
.about__tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:24px}
.about__tag{
  font-size:12px;font-weight:500;
  border:1.5px solid #e0e0e0;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  padding:4px 11px;
  transition:background .2s,color .2s,border-color .2s;
}
.about__tag:hover{background:#000;color:#fff;border-color:#000}
.about__gallery-label{font-size:10px;letter-spacing:.08em;font-weight:600;text-transform:uppercase;color:#999;margin-bottom:10px}
.about__slider{
  position:relative;overflow:hidden;
  border:1.5px solid #e0e0e0;border-radius:4px;
  aspect-ratio:4/3;margin-bottom:12px;
}
.about__slides{display:flex;height:100%;transition:transform .5s var(--ease)}
.about__slide{
  min-width:100%;height:100%;position:relative;
  background:#f0f0f0;
}
.about__slide-thumb{
  width:100%;height:100%;margin:0;padding:0;border:none;display:block;
  cursor:zoom-in;background:#f5f5f5;
  transition:opacity .2s;
}
.about__slide-thumb:hover{opacity:.94}
.about__slide-thumb:focus-visible{outline:2px solid #000;outline-offset:-2px}
.about__slide-thumb img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.about__slide-num{position:absolute;bottom:10px;right:12px;font-family:var(--ff);font-size:10px;font-weight:600;letter-spacing:.06em;color:rgba(255,255,255,.85);text-shadow:0 0 8px rgba(0,0,0,.35);z-index:1;pointer-events:none}
.about__slider-nav{display:flex;align-items:center;justify-content:space-between}
.about__slider-dots{display:flex;gap:5px}
.about__slider-dot{width:16px;height:2px;background:#e0e0e0;transition:background .2s,width .2s}
.about__slider-dot.active{background:#000;width:24px}
.about__slider-arrows{display:flex;gap:6px}
.about__slider-btn{
  width:32px;height:32px;
  border:1.5px solid #e0e0e0;border-radius:2px;
  display:flex;align-items:center;justify-content:center;font-size:14px;
  color:#000;
  transition:background .2s,color .2s,border-color .2s;
}
.about__slider-btn:hover{background:#000;color:#fff;border-color:#000}

/* ── GARDEN ── */
.garden{padding:clamp(64px,8vw,112px) 0}
.garden__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.garden__item{
  position:relative;aspect-ratio:4/3;overflow:hidden;
  background:#f5f5f5;border-radius:4px;
  border:1.5px solid transparent;transition:border-color .2s;
}
.garden__item:hover{border-color:#000}
.garden__num{position:absolute;top:10px;left:12px;font-family:var(--ff);font-size:10px;font-weight:600;letter-spacing:.07em;color:rgba(255,255,255,.9);text-shadow:0 0 6px rgba(0,0,0,.25);z-index:2}
.garden__thumb{position:absolute;inset:0;z-index:0;background:#f0f0f0}
.garden__thumb img{
  width:100%;height:100%;object-fit:contain;object-position:center;
  display:block;transition:transform .4s var(--ease),opacity .25s;
}
.garden__item:hover .garden__thumb img{transform:scale(1.04);opacity:.96}
.garden__overlay{
  position:absolute;inset:0;display:flex;align-items:flex-end;padding:12px;
  background:linear-gradient(to top,rgba(0,0,0,.7) 0%,transparent 60%);
  opacity:0;transition:opacity .3s;z-index:2;
}
.garden__item:hover .garden__overlay{opacity:1}
.garden__label{font-family:var(--ff);font-size:11px;font-weight:600;color:#fff;display:flex;align-items:center;gap:4px}

/* ── LIGHTBOX ── */
.lightbox{
  position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:9000;
  display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .3s;
}
.lightbox.open{opacity:1;pointer-events:all}
.lightbox__close,.lightbox__nav{
  position:absolute;width:42px;height:42px;
  border:1.5px solid rgba(255,255,255,.3);color:#fff;font-size:17px;
  display:flex;align-items:center;justify-content:center;
  border-radius:2px;transition:border-color .2s,background .2s;
}
.lightbox__close:hover,.lightbox__nav:hover{border-color:#fff;background:rgba(255,255,255,.1)}
.lightbox__close{top:18px;right:18px}
.lightbox__prev{top:50%;left:18px;transform:translateY(-50%)}
.lightbox__next{top:50%;right:18px;transform:translateY(-50%)}
.lightbox__content{
  width:min(920px,94vw);max-height:88vh;background:#1a1a1a;
  display:flex;align-items:center;justify-content:center;
  padding:clamp(16px,3vw,28px);border-radius:4px;
}
.lightbox__img{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:14px;max-width:100%;
}
.lightbox__photo{
  max-width:100%;max-height:min(75vh,82vw);
  width:auto;height:auto;object-fit:contain;display:block;
}
.lightbox__caption{
  font-family:var(--ff);font-size:12px;letter-spacing:.06em;
  color:rgba(255,255,255,.55);text-align:center;max-width:42ch;line-height:1.35;
}

/* ── CONTACTS ── */
.contacts{padding:clamp(100px,12vw,160px) 0;text-align:center}
.contacts__headline{
  font-family:var(--ff);font-size:clamp(48px,9vw,120px);
  font-weight:800;letter-spacing:-.04em;line-height:1;margin-bottom:18px;
}
.contacts__quote{font-size:clamp(14px,1.6vw,18px);color:#888;margin-bottom:44px}
.btn-email{font-size:clamp(13px,1.3vw,16px);padding:13px 34px;margin-bottom:36px}
.contacts__social{display:flex;align-items:center;justify-content:center;gap:10px}
.social-link{
  width:42px;height:42px;
  border:1.5px solid #e0e0e0;border-radius:2px;
  display:flex;align-items:center;justify-content:center;font-size:17px;
  transition:background .2s,color .2s,border-color .2s;
}
.social-link:hover{background:#000;color:#fff;border-color:#000}

/* ── FOOTER ── */
#main-footer{padding:24px 0}
.footer__inner{display:flex;align-items:center;justify-content:space-between}
.footer__copy{font-size:12px;color:#bbb;font-family:var(--ff)}
.footer__links{display:flex;align-items:center;gap:16px}
.footer__link{font-size:12px;color:#bbb;transition:color .2s}
.footer__link:hover{color:#000}
.footer__sep{width:1px;height:10px;background:#e8e8e8}

/* ── TOASTS ── */
#copy-toast,#draw-toast{
  position:fixed;bottom:88px;left:50%;
  transform:translateX(-50%) translateY(12px);
  background:#000;color:#fff;
  padding:10px 20px;
  font-family:var(--ff);font-size:12px;font-weight:500;letter-spacing:.03em;
  display:flex;align-items:center;gap:6px;
  opacity:0;pointer-events:none;
  transition:opacity .3s,transform .3s;
  z-index:8000;border-radius:2px;
  white-space:nowrap;
}
#copy-toast.show,#draw-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ── GLITCH ── */
.glitch-h2{position:relative}
.glitch-h2::before,.glitch-h2::after{content:attr(data-text);position:absolute;top:0;left:0;right:0;opacity:0;pointer-events:none}
.glitch-h2.glitching::before{opacity:.8;clip-path:polygon(0 20%,100% 20%,100% 40%,0 40%);transform:translate(-4px,0)}
.glitch-h2.glitching::after{opacity:.6;clip-path:polygon(0 60%,100% 60%,100% 80%,0 80%);transform:translate(4px,0)}

/* ── DRAW TOOLBAR ── */
#draw-toolbar{
  position:fixed;bottom:24px;left:50%;
  transform:translateX(-50%);
  z-index:600;
  display:flex;align-items:stretch;
  background:#fff;
  border:1.5px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  overflow:hidden;
  box-shadow:0 4px 20px rgba(0,0,0,.14);
  transition:transform .5s var(--ease),opacity .5s var(--ease);
}
#draw-toolbar.hidden{
  transform:translateX(-50%) translateY(100px);
  opacity:0;pointer-events:none;
}
/* Hotkeys are keyboard-only — hide help on phones / tablets */
@media(max-width:1023px){
  #tool-info{display:none!important}
  #hotkey-popup{display:none!important}
}
.dtb{
  width:52px;height:52px;
  display:flex;align-items:center;justify-content:center;
  font-size:19px;color:#000;background:#fff;
  border-right:1px solid #e0e0e0;
  transition:background .2s,color .2s;
}
.dtb:last-child{border-right:none}
.dtb.on{background:#000;color:#fff}
.dtb:hover:not(.on){background:#f5f5f5}
#draw-clear-btn{
  padding:0 18px;
  font-family:var(--ff);font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  background:#fff;color:#000;
  border-right:1px solid #e0e0e0;
  white-space:nowrap;
  transition:background .2s,color .2s;
}
#draw-clear-btn:hover{background:#000;color:#fff}

/* ── HOTKEY POPUP ── */
#hotkey-popup{
  position:fixed;bottom:88px;left:50%;
  transform:translateX(-50%) translateY(6px);
  background:#fff;
  border:1.5px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  padding:16px 20px;
  z-index:601;
  opacity:0;pointer-events:none;
  transition:opacity .2s,transform .2s;
  box-shadow:0 4px 20px rgba(0,0,0,.12);
  min-width:180px;
}
#hotkey-popup.show{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:all}
.hk-row{
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  font-family:var(--ff);font-size:12px;color:#000;
  padding:4px 0;
}
.hk-row:not(:last-child){border-bottom:1px solid #f0f0f0}
.hk-row kbd{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;
  border:1.5px solid #000;
  border-radius:4px;
  font-family:var(--ff);font-size:11px;font-weight:700;
  background:#f5f5f5;
}
.hk-row span{color:#555;font-size:12px}

/* ── INNER PAGES (legal, project stubs) ── */
.page-main{padding-bottom:clamp(48px,8vw,80px)}
.inner-hero{
  padding:calc(var(--nav-h) + 28px) 0 clamp(32px,5vw,48px);
  border-bottom:1.5px solid #e8e8e8;
}
.inner-hero__top{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;
  gap:12px 20px;margin-bottom:clamp(20px,3vw,28px);
}
.inner-back{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--ff);font-size:13px;font-weight:600;
}
.inner-back i{font-size:16px}
.inner-hero__title{
  font-family:var(--ff);font-size:clamp(28px,4vw,44px);
  font-weight:800;letter-spacing:-.03em;line-height:1.1;margin-bottom:10px;
}
.inner-hero__subtitle{font-size:15px;color:#666;max-width:520px;line-height:1.6}
.inner-hero__soon{font-weight:600;font-size:.55em;letter-spacing:0}
.content-prose{
  padding-top:clamp(40px,6vw,64px);
  max-width:720px;
}
.content-prose h2{
  font-family:var(--ff);font-size:22px;font-weight:800;
  letter-spacing:-.02em;margin:clamp(40px,5vw,56px) 0 16px;
  padding-top:8px;border-top:1.5px solid #eee;
}
.content-prose h2:first-child{margin-top:0;padding-top:0;border-top:none}
.content-prose p,.content-prose li{font-size:15px;line-height:1.75;color:#444;margin-bottom:14px}
.content-prose ul{margin:12px 0 16px;padding-left:1.2em;list-style:disc}
.content-prose li{margin-bottom:8px}
.content-prose strong{color:#000}
.content-prose a{color:#000;text-decoration:underline;text-underline-offset:3px}
.content-prose a:hover{opacity:.7}
.content-prose .lede{font-size:16px;color:#333;margin-bottom:20px}
.stub-note{
  margin-top:24px;padding:20px 22px;border:1.5px solid #e0e0e0;
  border-radius:4px;font-size:15px;color:#666;line-height:1.65;
}

/* 404 — tall drawable area; contacts/footer below the fold on most screens */
body.layout-404 #page-wrap{
  min-height:100vh;
  min-height:100dvh;
}
/* 404 — home shell + canvas; centered message */
body.layout-404 #page-wrap > main.main-404{
  display:flex;
  flex-direction:column;
  flex:0 1 auto;
  min-height:0;
  position:relative;
  z-index:1; /* under #drawing-canvas (z-index 200); matches home — pass-through in cursor mode */
}
.error-404{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:calc(var(--nav-h) + 32px) var(--gut) clamp(40px,6vw,64px);
  text-align:center;
  min-height:min(90vh,920px);
  min-height:min(90dvh,920px);
}
.error-404__inner{
  max-width:36rem;
  margin:0 auto;
}
.error-404__code{
  font-family:var(--ff);
  font-size:clamp(72px,16vw,128px);
  font-weight:800;
  letter-spacing:-.04em;
  line-height:1;
  margin-bottom:clamp(12px,2vw,20px);
}
.error-404__msg{
  font-size:clamp(16px,2.2vw,18px);
  color:#666;
  line-height:1.5;
  margin-bottom:clamp(28px,4vw,40px);
}
.error-404__actions{
  display:flex;
  justify-content:center;
}
body.layout-404 #page-wrap > main.main-404 > .contacts{flex-shrink:0}

/* ── CASE STUDY (project pages) ── */
.case-study{padding-bottom:clamp(64px,10vw,100px)}
.case-study__kicker{
  font-family:var(--ff);font-size:11px;font-weight:700;letter-spacing:.12em;
  text-transform:uppercase;color:#999;margin-bottom:10px;
}
.case-study__hero{
  padding:calc(var(--nav-h) + 20px) 0 clamp(28px,4vw,40px);
  border-bottom:1.5px solid #e8e8e8;
}
.case-study__hero .inner-hero__top{margin-bottom:clamp(16px,2.5vw,22px)}
.case-study__title{
  font-family:var(--ff);font-size:clamp(28px,4.2vw,48px);
  font-weight:800;letter-spacing:-.03em;line-height:1.08;margin:0 0 12px;
}
.case-study__lede{
  font-size:clamp(15px,1.2vw,17px);line-height:1.65;color:#444;
  max-width:640px;margin:0 0 clamp(20px,3vw,28px);
}
.case-study__cover{
  margin-top:clamp(8px,2vw,16px);
  border-radius:6px;overflow:hidden;border:1.5px solid #e8e8e8;
  background:#f5f5f5;line-height:0;
}
.case-study__cover img{
  width:100%;height:auto;vertical-align:middle;display:block;
}
.case-study__meta{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px;background:#e0e0e0;border:1.5px solid #e0e0e0;
  border-radius:6px;overflow:hidden;margin:clamp(28px,4vw,40px) 0;
}
.case-study__meta-cell{
  background:#fff;padding:clamp(16px,2.2vw,22px) clamp(14px,2vw,20px);
}
.case-study__meta-label{
  font-family:var(--ff);font-size:10px;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:#999;margin-bottom:6px;
}
.case-study__meta-value{
  font-family:var(--ff);font-size:14px;font-weight:600;color:#111;line-height:1.4;
}
.case-study__section{
  padding:clamp(40px,6vw,72px) 0;
  border-top:1.5px solid #eee;
}
.case-study__section:first-of-type{border-top:none;padding-top:clamp(8px,2vw,16px)}
.case-study__h2{
  font-family:var(--ff);font-size:clamp(20px,2.2vw,26px);
  font-weight:800;letter-spacing:-.02em;margin:0 0 clamp(14px,2vw,20px);
}
.case-study__h3{
  font-family:var(--ff);font-size:15px;font-weight:700;margin:clamp(22px,3vw,28px) 0 10px;
}
.case-study__h4{
  font-family:var(--ff);font-size:13px;font-weight:700;letter-spacing:.02em;
  color:#555;margin:clamp(18px,2.5vw,24px) 0 8px;
}
.case-study__prose{
  max-width:720px;
}
.case-study__prose--intro{margin-bottom:clamp(20px,3vw,28px)}
.case-study__prose--tight{max-width:640px;font-size:14px;line-height:1.65;color:#555}
.case-study__card-grid + .case-study__prose--after-cards{margin-top:clamp(18px,2.5vw,24px)}

/* OpenOSI-style narrative (usable on any case page) */
.case-study__pills{
  display:flex;flex-wrap:wrap;gap:8px;margin:0 0 clamp(14px,2vw,18px);
}
.case-study__pill{
  font-family:var(--ff);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  padding:7px 14px;border-radius:999px;border:1.5px solid #e4e4e4;background:#fafafa;color:#333;
}
.case-study__statusline{
  max-width:720px;margin:0;font-size:14px;line-height:1.65;color:#555;
}
.case-study__lede--inbody{
  font-size:clamp(16px,1.25vw,18px);line-height:1.6;color:#333;
  max-width:640px;margin:0;font-weight:500;
}
.case-study__band{
  margin:clamp(8px,2vw,12px) 0 clamp(36px,5vw,52px);
  padding:clamp(24px,4vw,40px) clamp(18px,3vw,32px);
  border-radius:10px;
  border:1.5px solid #dbe8e0;
  background:linear-gradient(145deg,#f7fbf8 0%,#f3f8fc 48%,#f9faf7 100%);
  box-shadow:0 1px 0 rgba(255,255,255,.8) inset;
}
.case-study__h2--inband{margin-top:0;margin-bottom:clamp(16px,2.5vw,22px)}
.case-study__split--brand{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(160px,240px);
  gap:clamp(20px,4vw,36px);
  align-items:center;
}
.case-study__band-text{margin:0 0 14px;font-size:15px;line-height:1.68;color:#383838;max-width:520px}
.case-study__band-text:last-of-type{margin-bottom:12px}
.case-study__swatches{
  list-style:none;margin:16px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:14px 20px;
}
.case-study__swatch{
  display:flex;align-items:center;gap:10px;
  font-family:var(--ff);font-size:12px;font-weight:600;color:#444;
}
.case-study__swatch-dot{
  width:26px;height:26px;border-radius:7px;
  border:1.5px solid rgba(0,0,0,.1);flex-shrink:0;
}
.case-study__band-actions{
  margin-top:clamp(18px,2.5vw,22px);
  font-family:var(--ff);font-size:13px;font-weight:600;
}
.case-study__band-actions a{color:#000;text-decoration:underline;text-underline-offset:3px}
.case-study__band-actions a:hover{opacity:.7}
.case-study__brand-hero{
  margin:0;text-align:center;
}
.case-study__brand-hero img{
  width:min(200px,42vw);height:auto;display:block;margin:0 auto;
}
.case-study__h4--band{margin-top:clamp(22px,3vw,28px)}
.case-study__mosaic{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;margin-top:12px;
}
.case-study__mosaic img{
  width:100%;height:auto;display:block;border-radius:5px;
  border:1px solid rgba(0,0,0,.08);background:#fff;
}
.case-study__mosaic-note{
  margin:10px 0 0;font-size:12px;line-height:1.45;color:#888;
}
.case-study__card-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(12px,2vw,16px);
  margin-top:clamp(16px,2.5vw,22px);
}
.case-study__card{
  border:1.5px solid #e8e8e8;border-radius:10px;padding:clamp(16px,2vw,20px) clamp(14px,2vw,18px);
  background:#fff;
  transition:border-color .2s,box-shadow .2s;
}
.case-study__card:hover{border-color:#ccc;box-shadow:0 6px 24px rgba(0,0,0,.05)}
.case-study__card-ic{
  display:block;font-size:22px;line-height:1;margin-bottom:10px;color:#2d6a3a;
}
.case-study__card-title{
  font-family:var(--ff);font-size:14px;font-weight:800;margin:0 0 8px;letter-spacing:-.01em;
}
.case-study__card p{
  margin:0;font-size:13px;line-height:1.58;color:#5a5a5a;
}
.case-study__pull{
  font-family:var(--ff);font-size:clamp(15px,1.2vw,17px);
  font-weight:600;font-style:normal;line-height:1.55;color:#222;
  margin:clamp(18px,2.5vw,26px) 0;
  padding:14px 0 14px 18px;border-left:3px solid #7BC143;
  max-width:640px;
}
@media(max-width:900px){
  .case-study__split--brand{grid-template-columns:1fr}
  .case-study__brand-hero{order:-1}
  .case-study__brand-hero img{width:min(160px,50vw)}
  .case-study__card-grid{grid-template-columns:1fr}
  .case-study__mosaic{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:480px){
  .case-study__mosaic{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Case study — thumbnail grid → lightbox */
.case-lb-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(10px,1.8vw,14px);
  margin-top:clamp(12px,2vw,18px);
}
.case-lb-grid:has(> .case-lb-item:only-child){
  grid-template-columns:1fr;
  max-width:260px;
}
.case-lb-item{
  margin:0;padding:clamp(8px,1.2vw,12px);
  border:1.5px solid #e8e8e8;border-radius:6px;
  background:#fafafa;
  cursor:zoom-in;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;text-align:center;
  font-family:var(--ff);
  transition:border-color .2s,background .2s;
  min-height:0;
}
.case-lb-item:hover,.case-lb-item:focus-visible{
  border-color:#000;background:#fff;
  outline:none;
}
.case-lb-item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #000}
.case-lb-item__frame{
  width:100%;min-height:100px;max-height:160px;
  display:flex;align-items:center;justify-content:center;
  background:#f0f0f0;border-radius:4px;overflow:hidden;
}
.case-lb-item img{
  display:block;max-width:100%;max-height:140px;width:auto;height:auto;
  object-fit:contain;
}
.case-lb-cap{
  font-size:11px;font-weight:600;color:#555;line-height:1.35;padding:0 4px;
}
.case-lb-item--svg .case-lb-item__frame{
  min-height:120px;padding:clamp(12px,2vw,20px);
  background:linear-gradient(145deg,#f6faf7 0%,#f0f4fb 100%);
}
.case-lb-item--svg img{max-height:100px}

/* Scroll to top — border like .nav__cv */
.scroll-top-btn{
  position:fixed;right:clamp(14px,3vw,26px);bottom:clamp(18px,4vw,30px);
  z-index:8400;
  width:50px;height:50px;padding:0;
  display:flex;align-items:center;justify-content:center;
  border:2px solid #000;
  border-radius:30px 2px 30% 3px / 4px 10px 3px 30px;
  background:#000;color:#fff;
  font-size:22px;line-height:1;
  cursor:pointer;
  isolation:isolate;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .25s,visibility .25s,background .2s,border-color .2s,transform .2s;
}
.scroll-top-btn.is-visible{opacity:1;visibility:visible;pointer-events:auto}
.scroll-top-btn:hover{background:#333;border-color:#333}
.scroll-top-btn:active{transform:scale(.96)}
.case-study__prose p,.case-study__prose li{
  font-size:15px;line-height:1.75;color:#444;margin:0 0 14px;
}
.case-study__prose ul{margin:12px 0 18px;padding-left:1.15em;list-style:disc}
.case-study__prose li{margin-bottom:8px;font-size:15px;line-height:1.75;color:#444}
.case-study__prose strong{color:#000}
.case-study__prose a{color:#000;text-decoration:underline;text-underline-offset:3px}
.case-study__prose a:hover{opacity:.7}
.case-study__list-num{
  list-style:none;padding-left:0;margin:16px 0 20px;
  counter-reset:case-li;
}
.case-study__list-num li{
  position:relative;padding-left:36px;margin-bottom:14px;
  font-size:15px;line-height:1.65;color:#444;
  counter-increment:case-li;
}
.case-study__list-num li::before{
  content:counter(case-li);
  position:absolute;left:0;top:0;
  width:24px;height:24px;border-radius:50%;
  background:#000;color:#fff;font-family:var(--ff);font-size:11px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}
.case-study__note{
  margin-top:clamp(18px,2.5vw,24px);
  padding:16px 18px;background:#f7f7f7;border-radius:4px;
  border-left:3px solid #000;font-size:14px;line-height:1.65;color:#555;
}
.case-study__polls{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(16px,2.5vw,24px);margin-top:clamp(24px,4vw,36px);
  max-width:min(920px,100%);margin-left:auto;margin-right:auto;
}
.case-study__poll{
  border:1.5px solid #e8e8e8;border-radius:6px;padding:clamp(18px,2.5vw,24px);
  background:#fafafa;
}
.case-study__poll-title{
  font-family:var(--ff);font-size:12px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:#666;margin-bottom:16px;
}
.case-study__poll-lede{
  font-size:13px;line-height:1.55;color:#666;margin:0 0 14px;
}
.case-study__poll-row{
  display:flex;align-items:flex-start;gap:14px;padding:12px 0;
  border-bottom:1px solid #e8e8e8;
}
.case-study__poll-row:last-child{border-bottom:none;padding-bottom:0}
.case-study__poll-pct{
  flex-shrink:0;min-width:3.2ch;
  font-family:var(--ff);font-size:22px;font-weight:800;letter-spacing:-.02em;
}
.case-study__poll-text{font-size:14px;line-height:1.5;color:#444;margin:0}
.case-study__figures{margin-top:clamp(28px,4vw,44px)}
.case-study__figure{
  margin:0 0 clamp(28px,4vw,40px);
}
.case-study__figure:last-child{margin-bottom:0}
.case-study__figure img{
  width:100%;height:auto;display:block;
  border:1.5px solid #e8e8e8;border-radius:6px;background:#f5f5f5;
}
.case-study__caption{
  margin-top:10px;font-size:13px;color:#777;line-height:1.5;
}
.case-study__grid-3{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(10px,1.5vw,14px);
}
.case-study__grid-2{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(10px,1.5vw,14px);
}
.case-study__grid-4{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(10px,1.5vw,14px);
}
@media(max-width:900px){
  .case-study__meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .case-study__polls{grid-template-columns:1fr}
  .case-study__grid-3,.case-study__grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .case-lb-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:600px){
  .case-study__meta{grid-template-columns:1fr}
  .case-study__grid-3,.case-study__grid-2,.case-study__grid-4{grid-template-columns:1fr}
  .case-lb-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* ── RESPONSIVE ── */

/* 1080px: services 2x2 */
@media(max-width:1080px){
  .services__grid{grid-template-columns:repeat(2,1fr)}
}

/* 900px: бургер вместо links */
@media(max-width:900px){
  .nav__right{display:none}
  .nav__burger{display:flex}
}

/* < 768px: одна колонка */
@media(max-width:767px){
  .inner-hero__top{flex-direction:column;align-items:flex-start;gap:10px}
  .inner-back{align-self:flex-start}
  .hero{padding:calc(var(--nav-h) + 8px) 0 24px}
  .hero .wrap{grid-template-columns:1fr;gap:0}
  .hero__headline br{display:none}
  .hero__headline{
    white-space:nowrap;
    font-size:clamp(14px,4.1vw,23px);
    letter-spacing:-.03em;
  }
  /* Illustration stays inside .wrap padding (no full-bleed negative margins) */
  .hero__illustration{
    order:-1;
    width:100%;
    display:flex;
    justify-content:flex-start;
    align-items:flex-end;
    line-height:0;
    min-height:min(28vh,240px);
  }
  .hero__illustration img{
    width:auto;
    max-width:min(280px, 100%);
    max-height:min(28vh, 240px);
    margin:0;
    object-fit:contain;
    object-position:left bottom;
    display:block;
  }
  .hero__left{gap:12px;padding-top:20px;position:relative;z-index:9999}
  /* Keep CTA row + wrap — two buttons sit side by side when width allows */
  .hero__cta{flex-direction:row;flex-wrap:wrap;align-items:center}
  .cases__grid{grid-template-columns:1fr}
  .services__grid{grid-template-columns:1fr}
  .about__inner{grid-template-columns:1fr}
  .about__stats{flex-direction:column}
  .about__stat{border-right:none;border-bottom:1.5px solid #e0e0e0}
  .about__stat:last-child{border-bottom:none}
  .garden__grid{grid-template-columns:repeat(2,1fr)}
  #draw-toolbar{bottom:16px}
  #draw-clear-btn{padding:0 12px;font-size:10px}
  .dtb{width:44px;height:44px}
}