:root {
  --bg: #f1f1f1;
  --surface: #fff;
  --text: #1f1f1f;
  --blue: #0079e4;
  --folder-blue: #5594d7;
  --line: #d1d1d1;
  --shadow: 0 4px 4px rgba(0, 0, 0, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.05em;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
.page-shell { width: min(800px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0; }
.site-view[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 24px;
  position: sticky;
  top: 8px;
  z-index: 50;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.brand, .socials { display: flex; align-items: center; }
.brand { gap: 8px; font-size: 14px; letter-spacing: -0.04em; }
.brand img { width: 20px; height: 20px; }
.socials { gap: 16px; color: var(--blue); font-size: 16px; letter-spacing: -.5px; }
.socials a, .telegram-button { transition: opacity .2s ease, transform .2s ease; }
.socials a:hover { opacity: .62; }
.site-header.is-scrolled {
  background: rgba(245, 245, 245, .46);
  border-color: rgba(255, 255, 255, .62);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px) saturate(145%);
  backdrop-filter: blur(12px) saturate(145%);
}
.menu-toggle { display: none; }
.menu-backdrop { display: none; }

main { display: flex; flex-direction: column; gap: 24px; }
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.intro { padding: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: 36px; font-weight: 400; line-height: 1.1; letter-spacing: -0.056em; }
.intro h1 { font-size: 48px; }
.intro-title-break { display: block; }
.intro-grid { display: grid; grid-template-columns: 412px 248px; justify-content: space-between; align-items: end; margin-top: 40px; }
.intro-copy { min-height: 314px; display: flex; flex-direction: column; justify-content: flex-end; gap: 32px; }
.muted { opacity: .5; }
.label { line-height: 1.2; margin-bottom: 8px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { min-height: 34px; display: flex; align-items: center; justify-content: center; padding: 6px 14px; border: 1px solid var(--line); border-radius: 40px; line-height: 1.2; letter-spacing: -0.0625em; }
.about { display: flex; flex-direction: column; gap: 0; line-height: 1.2; letter-spacing: -0.03125em; }
.portrait { width: 248px; height: 314px; border-radius: 24px; object-fit: cover; }

.cases { display: grid; grid-template-columns: repeat(2, 380px); gap: 35px; margin-top: 32px; margin-bottom: 24px; }
.folder { position: relative; display: block; width: 380px; height: 366px; color: var(--folder-blue); overflow: visible; }
.folder-back { position: absolute; left: 9px; top: 48px; width: calc(100% - 18px); height: 190px; }
.folder-front { position: absolute; left: 0; bottom: 0; width: 100%; height: 240px; z-index: 4; }
.case-shot { position: absolute; width: 195px; height: 152px; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 12px rgba(46,52,55,.4); z-index: 2; transition: transform .35s ease; }
.shot-a1 { left: 157px; top: 24px; transform: rotate(-8deg); }
.shot-a2 { left: 24px; top: 25px; transform: rotate(8deg); }
.shot-a3 { left: 104px; top: 55px; transform: rotate(-4deg); z-index: 3; }
.shot-b1 { left: 157px; top: -3px; transform: rotate(8deg); border-radius: 8px; }
.shot-b2 { left: 25px; top: 8px; transform: rotate(-3deg); border-radius: 8px; }
.shot-b3 { left: 110px; top: 59px; border-radius: 8px; z-index: 3; }
.folder:hover .shot-a1 { transform: translateY(-8px) rotate(-10deg); }
.folder:hover .shot-a2 { transform: translateY(-7px) rotate(10deg); }
.folder:hover .shot-a3, .folder:hover .shot-b3 { transform: translateY(-10px); }
.folder:hover .shot-b1 { transform: translateY(-8px) rotate(10deg); }
.folder:hover .shot-b2 { transform: translateY(-7px) rotate(-5deg); }
.folder-title, .folder-count, .nda { position: absolute; z-index: 5; }
.folder-title { left: 21px; top: 147px; font-size: 24px; line-height: 1.1; letter-spacing: -1px; }
.folder-count { left: 20px; bottom: 12px; display: flex; align-items: center; letter-spacing: -0.06em; }
.folder:first-child .folder-count { min-height: 24px; line-height: 24px; }
.folder:nth-child(2) .folder-count { min-height: 26px; line-height: 26px; }
.nda { right: 12px; bottom: 12px; min-height: 32px; display: flex; align-items: center; gap: 5px; padding: 6px 12px 6px 9px; border-radius: 80px; background: #fff; color: var(--blue); font-size: 14px; letter-spacing: -.5px; }
.nda img { width: 18px; height: 18px; }

.experience { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.experience + .skills { margin-top: -8px; }
.job { min-height: 208px; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.company { display: flex; align-items: center; gap: 8px; }
.company img { width: 32px; height: 32px; }
.job-copy { display: flex; flex-direction: column; gap: 8px; line-height: 1.2; letter-spacing: -0.0625em; }
.skills { padding: 24px; }
h2 { font-size: 24px; font-weight: 400; line-height: 1.1; letter-spacing: -0.06em; margin-bottom: 24px; }
.skills h2 { letter-spacing: -1px; }
.contact-section { display: grid; grid-template-columns: 1.35fr .95fr; gap: 24px; }
.contact-card, .cv-card { min-height: 196px; padding: 20px; }
.contact-card { display: flex; flex-direction: column; align-items: flex-start; }
.contact-card h2, .cv-card h2 { font-size: 24px; letter-spacing: -1px; margin-bottom: 16px; }
.contact-links { display: flex; gap: 16px; letter-spacing: -1px; }
.contact-links a:hover { color: var(--blue); }
.telegram-button { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; background: #dceeff; border-radius: 80px; color: var(--blue); font-size: 16px; letter-spacing: -.5px; }
.telegram-button img { width: 20px; height: 20px; }
.telegram-button:hover { background: #c8e5ff; transform: translateY(-2px); }
.contact-card .telegram-button { margin-top: auto; }
.cv-card { position: relative; overflow: hidden; display: flex; justify-content: space-between; }
.cv-card > div:first-child { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; }
.cv-card p { margin-bottom: 16px; }
.cv-card .cv-button { margin-top: auto; }
.cv-sheet { position: absolute; right: -8px; bottom: -24px; width: 130px; height: 166px; padding: 28px 20px; border-radius: 16px; background: #fff; transform: rotate(-4deg); box-shadow: 0 8px 28px rgba(31,31,31,.12); }
.cv-sheet i { display: block; height: 6px; margin-bottom: 10px; border-radius: 8px; background: #d7d7d7; }
.cv-sheet i:nth-child(1) { width: 58%; background: #bdbdbd; }
.cv-sheet i:nth-child(2) { width: 84%; }
.cv-sheet i:nth-child(3) { width: 72%; }
.cv-sheet i:nth-child(4) { width: 82%; }
.cv-sheet i:nth-child(5) { width: 45%; }
footer { min-height: 64px; padding: 16px 24px 24px; padding-top: 16px; display: flex; justify-content: space-between; align-items: flex-end; color: rgba(31,31,31,.5); font-size: 16px; }
footer img { width: 24px; height: 24px; opacity: .5; }

.case-page-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.case-feature,
.case-list-card {
  overflow: hidden;
  border-radius: 24px;
}
.case-feature {
  grid-column: 1 / -1;
  min-height: 311px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.case-feature-copy {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-feature h1 {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.5px;
}
.case-feature > img {
  width: calc(100% - 16px);
  height: calc(100% - 32px);
  margin: 16px 16px 16px 0;
  border-radius: 16px;
  object-fit: cover;
}
.case-description {
  color: rgba(31, 31, 31, .5);
  line-height: 1.2;
  letter-spacing: -.5px;
}
.case-list-card {
  min-height: 428px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.case-list-card > img {
  width: 100%;
  aspect-ratio: 712 / 560;
  object-fit: cover;
  border-radius: 16px;
}
.case-list-copy {
  padding: 16px 8px 8px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.case-list-copy h2 {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.5px;
  margin: 0;
}
.case-page-main .card { transition: box-shadow 300ms ease, transform .3s ease; }

.product-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.product-case-card {
  min-height: 556px;
  padding: 16px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow 300ms ease, transform .3s ease;
}
.product-cover {
  width: 100%;
  height: 280px;
  border-radius: 16px;
  object-fit: cover;
  overflow: hidden;
}
.product-case-copy { padding: 24px 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.product-case-copy h2 { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.2; letter-spacing: -.5px; }
.product-case-copy p { color: rgba(31,31,31,.5); font-size: 18px; line-height: 1.2; letter-spacing: -.5px; }
.product-case-copy p { overflow-wrap: normal; word-break: normal; hyphens: none; text-wrap: pretty; }
.no-break { white-space: nowrap; }
.product-nda { align-self: flex-start; min-height: 24px; padding: 4px 8px 4px 6px; display: inline-flex; align-items: center; gap: 4px; color: var(--blue); background: #c8e5ff; border-radius: 80px; font-size: 13px; letter-spacing: -.5px; }
.product-nda img { width: 16px; height: 16px; }

.case-study-main { gap: 24px; }
.case-study-intro {
  padding: 32px;
  border-radius: 24px;
  box-shadow: none;
}
.case-study .case-study-intro.card { box-shadow: none; }
.case-study-intro h1 {
  margin-bottom: 18px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -1px;
}
.case-study-tags {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-study-tags li {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 40px;
  line-height: 1.2;
  letter-spacing: -.5px;
}
.case-study-lead,
.case-study-intro section p {
  color: rgba(31, 31, 31, .5);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.5px;
}
.case-study-lead + .case-study-lead { margin-top: 10px; }
.case-study-intro section { margin-top: 24px; }
.case-study-intro section h2 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -.5px;
}
.case-study-intro section p + p { margin-top: 10px; }
.case-study-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: visible;
}
.case-study-gallery img { width: 100%; height: auto; border-radius: 12px; }
.case-back,
.case-more-toggle {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 16px;
  letter-spacing: -.5px;
  cursor: pointer;
}
.case-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; transition: opacity .2s ease; }
.case-back span { font-size: 22px; }
.case-back:hover { opacity: .62; }
.case-more-toggle { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; }
.case-more-toggle i { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; }
.case-more-toggle[aria-expanded="true"] i { transform: rotate(225deg) translate(-2px, -2px); }
.case-more-toggle:hover { opacity: .65; }
.case-hero-media { width: 100%; height: auto; margin-top: 28px; border-radius: 12px; object-fit: cover; }
.case-study-topline { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.case-study-topline .case-back { margin-bottom: 0; }
.study-nda { position: relative; min-height: 24px; display: inline-flex; align-items: center; gap: 7px; padding: 0; color: var(--blue); background: transparent; font-size: 16px; letter-spacing: -.5px; white-space: nowrap; cursor: help; }
.study-nda img { width: 18px; height: 18px; }
.nda-tooltip {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(280px, calc(100vw - 40px));
  padding: 9px 12px;
  border-radius: 8px;
  background: #1f1f1f;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.25px;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.study-nda:hover .nda-tooltip,
.study-nda:focus-visible .nda-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.study-nda:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
.case-more[hidden] { display: none; }
.case-more strong { color: var(--text); font-weight: 400; }

.testimonial {
  padding: 0;
  display: block;
  background: transparent;
  box-shadow: none;
}
.testimonial video { display: block; width: 100%; height: auto; border-radius: 12px; background: #111; }

.brand,
.socials,
.tags li,
.folder-title,
.folder-count,
.nda,
.company,
.telegram-button,
.case-study-tags li,
.product-nda,
.study-nda,
.case-back,
.case-more-toggle { font-weight: 500; }

.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(3px);
  transition: opacity .65s ease, transform .65s cubic-bezier(.22, 1, .36, 1), filter .65s ease;
}
.reveal-ready .case-page-main .card[data-reveal],
.reveal-ready .product-case-grid .card[data-reveal] {
  transition: opacity .65s ease, transform .65s cubic-bezier(.22, 1, .36, 1), filter .65s ease, box-shadow 300ms ease;
}
.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (hover: hover) and (pointer: fine) {
  .case-page-main .card:hover,
  .product-case-card:hover { box-shadow: 0 4px 4px rgba(0, 0, 0, 0); }
}

@media (max-width: 840px) {
  .page-shell { width: min(100% - 24px, 480px); padding-top: 12px; }
  .site-header { top: 6px; padding: 0 12px; margin-bottom: 12px; }
  .site-header.menu-open { z-index: 110; }
  .site-header .brand,
  .site-header .menu-toggle { position: relative; z-index: 3; }
  .site-header .socials {
    position: fixed;
    z-index: 2;
    top: 0;
    left: 0;
    right: auto;
    width: 100vw;
    min-width: 0;
    min-height: 112px;
    padding: 64px 24px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 10vw, 48px);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 0 0 24px 24px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(31,31,31,.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transform-origin: top center;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  }
  .site-header.menu-open .socials { opacity: 1; visibility: visible; transform: translateY(0); }
  .menu-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block;
    background: rgba(15,20,24,.26);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
  }
  .menu-backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
  body.menu-modal-open { overflow: hidden; }
  .menu-toggle { width: 40px; height: 40px; padding: 0; display: grid; place-content: center; gap: 6px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
  .menu-toggle i { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .22s ease; }
  .menu-toggle[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
  main { gap: 16px; }
  .intro { padding: 18px; }
  h1 { font-size: clamp(27px, 8.2vw, 36px); }
  .intro h1 { font-size: clamp(27px, 8.2vw, 36px); }
  h1 br { display: none; }
  .intro-grid { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 24px; margin-top: 28px; }
  .portrait { width: 100%; height: auto; aspect-ratio: 4 / 3; object-position: center 38%; }
  .intro-copy { min-height: 0; gap: 28px; }
  .cases { grid-template-columns: 1fr; gap: 34px; margin: 24px auto 16px; width: 100%; }
  .folder { width: 100%; max-width: 380px; height: auto; aspect-ratio: 380 / 366; margin: auto; }
  .folder-back { top: 13.1%; height: 51.9%; }
  .folder-front { height: 65.6%; }
  .case-shot { width: 51.3%; height: auto; aspect-ratio: 195 / 152; }
  .shot-a1, .shot-b1 { left: 41.3%; }
  .shot-a2, .shot-b2 { left: 6.4%; }
  .shot-a3, .shot-b3 { left: 28.9%; }
  .folder-title { top: 40.2%; font-size: clamp(21px, 6.2vw, 24px); }
  .experience { grid-template-columns: 1fr; gap: 16px; }
  .experience + .skills { margin-top: 0; }
  .job { min-height: 0; }
  .desktop-only { display: none; }
  .contact-section { grid-template-columns: 1fr; gap: 16px; }
  .contact-card, .cv-card { min-height: 196px; }
  .contact-links { flex-direction: column; gap: 8px; }
  .contact-card .telegram-button { width: auto; justify-content: center; }
  .case-page-main { grid-template-columns: 1fr; }
  .case-feature { grid-column: auto; grid-template-columns: 1fr; }
  .case-feature-copy { min-height: 0; gap: 24px; }
  .case-feature h1 br,
  .case-description br,
  .case-list-copy h2 br { display: none; }
  .case-feature > img { aspect-ratio: 712 / 560; height: auto; }
  .case-feature > img { width: calc(100% - 32px); margin: 0 16px 16px; }
  .product-case-grid { grid-template-columns: 1fr; gap: 16px; }
  .product-case-card { min-height: 0; }
  .product-case-card:hover,
  .case-page-main .card:hover { box-shadow: var(--shadow); transform: none; }
  .case-study-intro { padding: 20px; }
  .case-study-intro h1 { font-size: 26px; }
  .case-study-tags li { font-size: 14px; }
  .case-study-lead,
  .case-study-intro section p { font-size: 16px; }
  .case-study-gallery { gap: 16px; }
  .case-study-gallery img,
  .case-hero-media { border-radius: 8px; }
  .case-hero-media { margin-top: 22px; }
  .case-study-topline { margin-bottom: 20px; }
  .testimonial { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; filter: none; }
}
