:root {
  --blue: #008cff;
  --blue-btn: #2189ff;
  --blue-light: #98d0ff;
  --black: #000000;
  --gray-text: #7b7b7b;
  --dark-gray: #1a1a1a;
  --card-bg: #f4f6f8;
  --card-grad: linear-gradient(0deg, #f4f6f8 0%, #f9fafb 100%);
  --avatar-bg: #d9d9d9;
  --border-light: #d8d8d8;
  --r-lg: 60px;
  --r-md: 40px;
  --r-sm: 20px;
  --r-pill: 999px;
  --content-w: 860px;
  --font-head: "Inter", "GraphikTT", Arial, sans-serif;
  --font-body: "Roboto", "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-head);
  color: var(--black);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: var(--content-w);
  max-width: calc(100% - 48px);
  margin: 0 auto;
}

a { text-decoration: none; color: inherit; }
ul { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

main { padding-bottom: 0; }

/* ---------- Shared type ---------- */
.section-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 40px;
  line-height: 37px;
  margin: 0;
  text-align: center;
  letter-spacing: -0.5px;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill-blue {
  height: 29px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--black);
  color: #fff;
  font-size: 12px;
  line-height: 13px;
}
.pill-solid {
  height: 27px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--black);
  color: #fff;
  font-size: 12px;
  line-height: 11px;
}

/* ---------- Hero ---------- */
.hero { padding: 26px 0 143px; }
.hero-card {
  background: var(--card-grad);
  border-radius: var(--r-lg);
  padding: 45px 40px 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 28px;
  line-height: 26px;
  margin: 0 0 12px;
}
.hero-socials {
  display: flex;
  gap: 24px;
  margin-bottom: 66px;
}
.hero-socials a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 20px;
  line-height: 18px;
  color: var(--blue);
  text-decoration: none;
  padding-bottom: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
}
.hero-socials a { transition: color .2s ease; }
.hero-socials a:hover { color: #5cb4ff; }
.hero-text {
  width: 765px;
  max-width: 100%;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 40px;
  line-height: 46px;
  color: var(--black);
  margin: 0;
  letter-spacing: normal;
}
.hero-text .accent { color: var(--blue); }

/* ---------- Projects ---------- */
.projects { padding: 0 0 60px; }
.projects .section-title { margin-bottom: 40px; }
.projects-title-pet { margin-top: 100px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 40px;
  row-gap: 60px;
}
.project-card { display: flex; flex-direction: column; align-items: flex-start; }
.project-media {
  width: 100%;
  aspect-ratio: 500 / 370;
  background: var(--card-bg);
  border-radius: var(--r-md);
  overflow: hidden;
}
.project-media-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
}
/* Card cover: the whole rectangle grows a little, as if you can dive into it */
.project-media, .other-media { transition: transform .45s cubic-bezier(.25,.8,.25,1); }
.project-card:hover .project-media, .other-card:hover .other-media { transform: scale(1.03); }
.project-card .pill-blue { margin-top: 40px; }
.project-card > .project-media + .project-title { margin-top: 40px; }
.project-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  line-height: 22px;
  letter-spacing: -0.5px;
  margin: 30px 0 0;
}
.project-desc {
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  color: var(--black);
  margin: 16px 0 0;
}
.project-skills {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 22px;
  color: var(--dark-gray);
  margin: 30px 0 0;
}

/* ---------- Experience ---------- */
.experience { padding: 68px 0 73px; }
.experience .section-title { margin-bottom: 40px; }
.timeline { display: flex; flex-direction: column; gap: 20px; }
.job {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 40px;
  border-radius: var(--r-lg);
  background: var(--card-bg);
}
.job-current { background: var(--card-grad); }
.job-side { display: flex; flex-direction: column; align-items: flex-start; }
.job-side .pill { margin-bottom: 28px; }
.job-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 28px;
  line-height: 26px;
  letter-spacing: -0.5px;
  margin: 0 0 16px;
}
.job-role {
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  color: var(--black);
  margin: 0;
}
.timeline-more { display: flex; flex-direction: column; gap: 20px; }
.timeline-more[hidden] { display: none; }
.timeline-toggle {
  display: flex;
  align-items: center;
  margin: 40px auto 0;
  height: 52px;
  padding: 0 34px;
  border: 0;
  border-radius: 41px;
  background: var(--card-bg);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 18px;
  color: var(--black);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.timeline-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s ease;
}
.timeline-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.timeline-toggle:hover { background: #e3e9ee; color: var(--black); }
.job-body ul { padding-left: 20px; list-style: disc; }
.job-body li {
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  color: var(--black);
}

/* ---------- Education ---------- */
.education { padding: 68px 0 99px; }
.education .section-title { margin-bottom: 90px; }
.education-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 307px));
  justify-content: start;
  gap: 40px;
  text-align: center;
}
.education-item { display: flex; flex-direction: column; align-items: center; }
.edu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--avatar-bg);
  background-size: cover;
  background-position: center;
  margin-bottom: 20px;
}
.education-item h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  line-height: 26px;
  letter-spacing: -0.5px;
  margin: 0 0 22px;
}
.education-item p {
  font-size: 18px;
  font-weight: 500;
  line-height: 25px;
  color: var(--black);
  margin: 0 0 22px;
}
.edu-date {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: var(--dark-gray);
}

/* ---------- Why me ---------- */
.why-me { padding: 63px 0 67px; }
.why-me .section-title { margin-bottom: 60px; }
.why-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.why-row:last-child { margin-bottom: 0; }
.why-row-a { grid-template-columns: 41fr 61fr; }
.why-row-b { grid-template-columns: 61fr 41fr; }
.why-cell {
  position: relative;
  min-height: 260px;
  padding: 40px;
  border-radius: var(--r-md);
  background: var(--card-bg);
}
.why-cell-card { background: var(--card-bg); }
.why-cell h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  line-height: 26px;
  letter-spacing: -0.5px;
  margin: 0;
  max-width: 300px;
}
.why-cell p {
  position: absolute;
  top: 144px;
  left: 40px;
  right: 40px;
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  color: var(--black);
  margin: 0;
  max-width: 314px;
}
.why-illustration {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 258px;
  height: 239px;
  object-fit: cover;
  object-position: bottom right;
  pointer-events: none;
}
.why-process {
  position: absolute;
  left: 257px;
  top: 40px;
  width: 313px;
  height: 59px;
  pointer-events: none;
}

/* ---------- Telegram CTA ---------- */
.telegram-cta { padding: 61px 0 60px; }
.cta-card {
  position: relative;
  height: 307px;
  background: var(--card-bg);
  border-radius: var(--r-lg);
  padding: 60px;
  overflow: hidden;
}
.cta-text h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 40px;
  line-height: 37px;
  margin: 0 0 20px;
  letter-spacing: -0.5px;
}
.cta-text p {
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  margin: 0;
  width: 433px;
  max-width: 100%;
}
.cta-btn {
  position: absolute;
  left: 60px;
  top: 195px;
  width: 160px;
  height: 52px;
  border-radius: 41px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.cta-btn { transition: background .2s ease; }
.cta-btn:hover { background: #4aabff; }
.cta-image {
  position: absolute;
  top: 0;
  right: 89px;
  width: 373px;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* ---------- Footer ---------- */
.site-footer { padding: 63px 0 200px; text-align: center; }
.footer-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background-size: cover;
  background-position: 50% 25%;
  background-color: var(--avatar-bg);
}
.footer-title { margin-bottom: 61px; line-height: 50px; }
.footer-lead {
  font-size: 20px;
  font-weight: 400;
  line-height: 27px;
  color: var(--black);
  margin: 0 0 61px;
}
.contact-card-outer {
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.contact-card {
  background: var(--card-bg);
  border-radius: var(--r-md);
  height: 187px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.contact-card:hover { transform: scale(1.04); }
.contact-card-solid { background: var(--blue); }
.contact-icon { width: 40px; height: 40px; margin-bottom: 28px; }
.contact-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 25px;
  color: var(--black);
}
.contact-value {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 25px;
  margin-top: 5px;
  color: var(--black);
}
.contact-card-solid .contact-label,
.contact-card-solid .contact-value { color: #fff; }
.contact-value-link { color: var(--blue); }

/* ---------- Floating bottom bar ---------- */
.float-bar {
  --bar-h: 72px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 24px;
}
.float-pill {
  display: flex;
  align-items: center;
  height: var(--bar-h);
  padding: 0 35px 0 6px;
  gap: 20px;
  background: #fff;
  border-radius: var(--r-pill);
  box-shadow: 0 6px 20px rgba(49, 49, 49, 0.1);
}
.float-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 3px;
  display: block;
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.float-pill a:hover .float-logo { transform: scale(1.05); }
.float-pill a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 17px;
  color: #050505;
  white-space: nowrap;
  transition: color .2s ease;
}
.float-pill a:hover { color: var(--gray-text); }
.float-pill .float-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  margin-left: 3px;
  margin-right: -17px;
  border-radius: var(--r-pill);
  background: var(--card-bg);
  color: var(--gray-text);
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: background .2s ease, color .2s ease;
}
.float-pill .float-lang:hover { background: #e6edf3; color: var(--black); }
.float-cta {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--bar-h);
  padding: 0 72px 0 22px;
  border-radius: var(--r-pill);
  background: var(--blue-btn);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 17px;
  box-shadow: 0 0 5px rgba(143, 5, 0, 0.2);
  transition: transform .2s ease;
}
.float-cta:hover { transform: translateY(-2px); }
.float-cta-icon {
  position: absolute;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.float-cta::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: url('assets/images/bar-tg-icon-hover.jpg') center / cover no-repeat;
  opacity: 0;
  transition: opacity .2s ease;
}
.float-cta:hover::after { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .job { grid-template-columns: 280px 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; row-gap: 48px; }
  .why-row-a, .why-row-b { grid-template-columns: 1fr; }
  .why-cell p { position: static; margin-top: 24px; max-width: none; }
  .why-illustration { display: none; }
  .education-grid { grid-template-columns: 1fr; gap: 48px; }
  .job { grid-template-columns: 1fr; gap: 24px; padding: 32px; }
  .cta-card { height: auto; padding: 40px; text-align: center; }
  .cta-btn { position: static; margin: 28px auto 0; }
  .cta-text p { margin-left: auto; margin-right: auto; }
  .cta-image {
    position: static;
    width: min(320px, 100%);
    height: auto;
    aspect-ratio: 373 / 307;
    margin: 28px auto 0;
    border-radius: var(--r-md);
  }
  .contact-card-outer { grid-template-columns: 1fr; }
  .contact-card { height: auto; }
}
@media (max-width: 640px) {
  .wrap { max-width: calc(100% - 36px); }
  .section-title { font-size: 30px; line-height: 34px; }
  .hero { padding-bottom: 80px; }
  .hero-card { padding: 36px 22px 60px; border-radius: 40px; }
  .hero-text { font-size: 26px; line-height: 32px; }
  .education .section-title { margin-bottom: 48px; }
  .experience { padding: 48px 0 40px; }
  .education { padding: 48px 0 40px; }
  .why-me { padding: 48px 0 40px; }
  .telegram-cta { padding: 20px 0 40px; }
  .cta-text h2 { font-size: 30px; line-height: 34px; }
  .job-title { font-size: 24px; line-height: 26px; }
  .job-role,
  .job-body li,
  .education-item p,
  .project-desc,
  .cta-text p { font-size: 16px; line-height: 23px; }
  .project-skills { margin-top: 12px; }
  .contact-card { align-items: center; text-align: center; }
  .footer-title { margin-bottom: 28px; }
  .site-footer { padding: 40px 0 104px; }
  main { padding-bottom: 0; }
  .float-bar { --bar-h: 60px; bottom: 16px; gap: 12px; flex-wrap: wrap; }
  .float-pill { padding: 0 20px 0 6px; gap: 14px; }
  .float-logo { width: 48px; height: 48px; }
  .float-pill .float-lang { height: 32px; padding: 0 12px; margin-right: -8px; font-size: 13px; }
  .float-pill a { font-size: 15px; }
  .float-cta { width: auto; padding: 0 60px 0 20px; font-size: 15px; }
  .float-cta-icon { width: 44px; height: 44px; }
}
/* Narrow screens: the Telegram button keeps only its round icon, the label is hidden.
   Everything in the bar scales with the screen width, so the menu never squeezes its content. */
@media (max-width: 760px) {
  .float-bar { --bar-h: clamp(42px, 14vw, 60px); flex-wrap: nowrap; gap: clamp(5px, 2.2vw, 12px); padding: 0 clamp(4px, 2.6vw, 24px); }
  .float-pill { flex: none; padding: 0 clamp(8px, 3.4vw, 20px) 0 4px; gap: clamp(3px, 2.1vw, 14px); }
  .float-pill a { flex: none; font-size: clamp(10px, 3.75vw, 15px); }
  .float-logo { width: calc(var(--bar-h) - 10px); height: calc(var(--bar-h) - 10px); margin-right: 0; }
  .float-pill .float-lang { height: calc(var(--bar-h) * .52); padding: 0 clamp(6px, 2.4vw, 12px); margin-right: -4px; font-size: clamp(10px, 3.2vw, 13px); }
  .float-cta { width: var(--bar-h); padding: 0; font-size: 0; line-height: 0; justify-content: center; border-radius: 50%; flex: none; }
  .float-cta-icon, .float-cta::after { right: auto; left: 50%; top: 50%; width: calc(var(--bar-h) - 12px); height: calc(var(--bar-h) - 12px); transform: translate(-50%, -50%); }
  html:lang(en) .float-pill a { font-size: clamp(9.5px, 3.35vw, 15px); }
}
.float-pill a { flex: none; }

/* =====================================================
   Project case-study pages
   ===================================================== */
.case-page { padding: 30px 0 0; }
.case-wrap {
  width: 960px;
  max-width: calc(100% - 48px);
  margin: 0 auto;
}
.case-cover {
  width: 100%;
  display: block;
  border-radius: 32px;
  background-color: var(--card-bg);
}
.case-h1,
.case-h2,
.case-text {
  width: 760px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.case-h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 52px;
  line-height: 60.84px;
  letter-spacing: normal;
  margin-top: 64px;
  margin-bottom: 0;
}
.case-h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 32px;
  line-height: 39.36px;
  letter-spacing: normal;
  margin-top: 60px;
  margin-bottom: 45px;
}
.case-text {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 400;
  line-height: 27.9px;
  color: var(--black);
  margin-top: 0;
  margin-bottom: 0;
}
.case-text a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s ease;
}
.case-text a:hover { color: #5cb4ff; }
.case-text p { margin: 0 0 27.9px; }
.case-text p:last-child { margin-bottom: 0; }
.case-text ul,
.case-text ol { padding-left: 22px; margin: 0; }
.case-text ul { list-style: disc; }
.case-text ol { list-style: decimal; }
.case-text strong { font-weight: 600; }
.case-text em { font-style: italic; }

.case-figure { margin: 30px 0 0; }
.case-figure img {
  width: 100%;
  display: block;
  border-radius: 32px;
  background: var(--card-bg);
  cursor: zoom-in;
  transition: opacity .2s ease;
}
.case-figure img:hover { opacity: .92; }
.case-caption {
  width: 760px;
  max-width: 100%;
  margin: 34px auto 0;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 300;
  font-style: italic;
  line-height: 24.8px;
  color: #686868;
}
.case-figure + .case-figure { margin-top: 59px; }
.case-figure + .case-text { margin-top: 59px; }

.case-gallery {
  width: 100%;
  margin-top: 30px;
  column-gap: 10px;
}
.case-gallery-3 { column-count: 3; }
.case-figure-gallery .case-gallery { margin-top: 0; }

.case-gallery img {
  width: 100%;
  display: block;
  border-radius: 30px;
  margin-bottom: 10px;
  break-inside: avoid;
  background: var(--card-bg);
  cursor: zoom-in;
  transition: opacity .2s ease;
}
.case-gallery img:hover { opacity: .92; }
.case-gallery + .case-text { margin-top: 59px; }

.case-video {
  width: 100%;
  height: 540px;
  border: 0;
  display: block;
  border-radius: 32px;
  margin-top: 31px;
  background: var(--card-bg);
}

.other-projects { margin-top: 180px; padding-bottom: 160px; }
.other-projects .case-h2 { margin-bottom: 40px; }
.other-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.other-card { display: block; }
.other-media {
  aspect-ratio: 500 / 370;
  border-radius: 32px;
  margin-bottom: 20px;
  overflow: hidden;
  background: var(--card-bg);
}
.other-media-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
}
.other-card h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  line-height: 26px;
  letter-spacing: -0.5px;
  margin: 0;
}

@media (max-width: 900px) {
  .case-h1 { font-size: 34px; line-height: 40px; margin-top: 40px; }
  .case-h2 { font-size: 24px; line-height: 30px; margin-top: 44px; margin-bottom: 28px; }
  .case-video { height: 320px; }

  .case-figure { margin-top: 24px; }
  .case-figure + .case-figure { margin-top: 40px; }
  .case-figure + .case-text { margin-top: 40px; }
}
@media (max-width: 900px) {
  .case-gallery { width: 100%; max-width: 100%; left: 0; transform: none; column-count: 2; }
}
@media (max-width: 640px) {
  .case-wrap { max-width: calc(100% - 36px); }
  .case-gallery { column-count: 1; }
  .case-cover, .case-figure img, .case-video, .other-media { border-radius: 22px; }
  .other-grid { grid-template-columns: 1fr; }
  .other-projects { padding-bottom: 104px; }
}

/* ---------- NDA case blocks ---------- */

.case-nda-note {
  width: 760px;
  max-width: 100%;
  margin: 40px auto 0;
  padding: 24px 28px;
  border-radius: 24px;
  background: var(--card-bg);
  font-size: 16px;
  line-height: 24px;
  color: var(--dark-gray);
}
.case-nda-note strong { font-weight: 600; color: var(--black); }
.case-body { position: relative; }
.case-facts {
  display: block;
  width: 760px;
  max-width: 100%;
  margin: 40px auto 0;
}
.case-facts-in {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 20px;
}
.case-facts-in > div { font-size: 16px; line-height: 24px; }
.case-facts-in span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gray-text);
  margin-bottom: 6px;
}
.case-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.case-flow div {
  position: relative;
  padding: 28px 28px 28px 28px;
  border-radius: 24px;
  background: var(--card-bg);
  font-size: 16px;
  line-height: 24px;
}
.case-flow div b {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 8px;
}
.case-flow div i {
  position: absolute;
  top: 24px;
  right: 24px;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
}

.case-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.case-tags span {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}
.case-flow + .case-h2, .case-facts + .case-h2, .case-nda-note + .case-h2 { margin-top: 60px; }
@media (max-width: 900px) {
  .case-facts-in { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .case-flow { grid-template-columns: 1fr; }

}

.case-axis {
  width: 760px;
  max-width: 100%;
  margin: 90px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
.case-axis span {
  display: inline-flex;
  align-items: center;
  height: 29px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--black);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.case-axis h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 32px;
  line-height: 39.36px;
  letter-spacing: -0.5px;
  margin: 20px 0 0;
}
.case-axis p {
  font-size: 18px;
  line-height: 27.9px;
  color: var(--gray-text);
  margin: 14px 0 0;
}
.case-axis + .case-text { margin-top: 32px; }
.case-axis + .case-h2 { margin-top: 40px; }
@media (max-width: 900px) {
  .case-axis { margin-top: 60px; }
  .case-axis h2 { font-size: 24px; line-height: 30px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(10, 10, 10, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: scale(.96);
  transition: transform .25s ease;
  cursor: zoom-out;
}
.lightbox.is-open img { transform: scale(1); }
.lightbox-close {
  position: fixed;
  top: 28px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-close { top: 16px; right: 16px; width: 38px; height: 38px; }
}

/* Cards that stay within the text column */
.case-flow.is-text {
  width: 760px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.case-flow.is-text div { padding: 22px 22px 24px; font-size: 15px; line-height: 22px; }
.case-flow.is-text div b { font-size: 17px; }
.case-flow.is-two { grid-template-columns: repeat(2, 1fr); }
.case-text + .case-flow.is-text { margin-top: 30px; }
@media (max-width: 900px) { .case-flow.is-two { grid-template-columns: 1fr; } }

/* Work projects: one card per row, image on top */
.projects-grid.is-list { grid-template-columns: 1fr; row-gap: 60px; }
.is-list .project-info { display: flex; flex-direction: column; align-items: flex-start; }

/* Home: roomier spacing between sections and cards (desktop) */
@media (min-width: 901px) {
  .projects { padding-bottom: 100px; }
  .projects-title-pet { margin-top: 160px; }
  .projects-grid { column-gap: 60px; row-gap: 100px; }
  .projects-grid.is-list { row-gap: 100px; }
  .experience { padding: 110px 0 110px; }
  .timeline, .timeline-more { gap: 32px; }
  .education { padding: 110px 0 130px; }
  .education-grid { gap: 60px; }
  .why-me { padding: 100px 0 100px; }
  .why-row { gap: 32px; margin-bottom: 32px; }
  .telegram-cta { padding: 100px 0 100px; }
  .site-footer { padding-top: 100px; }
}

/* Hero: round photo, no card background */
.hero-card { background: none; padding: 45px 40px 40px; }
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
  display: block;
  margin-bottom: 21px;
}
.hero-name { margin-bottom: 20px; }
@media (max-width: 640px) { .hero-card { padding: 24px 0 20px; } }

/* Why-me cells re-fitted for the 860px column */
@media (min-width: 901px) {
  .why-illustration { width: 200px; height: 185px; }
  .why-row-a .why-cell-card h3,
  .why-row-a .why-cell-card p { max-width: calc(100% - 210px); }
  .why-process { left: auto; right: 40px; width: 220px; height: auto; }
}

/* Why-me: text pinned to the bottom with the same inset in every card */
.why-cell { display: flex; flex-direction: column; }
.why-cell p { position: static; margin-top: auto; padding-top: 24px; }
@media (max-width: 900px) { .other-projects { margin-top: 100px; } }

/* Case heading hierarchy: H1 52 → direction 40 → H2 28 → card titles 18.
   Headings sit close to their own text and far from the previous block. */
.case-h2 { font-size: 28px; line-height: 34px; margin-top: 88px; margin-bottom: 20px; }
.case-flow + .case-h2, .case-facts + .case-h2,
.case-nda-note + .case-h2, .case-figure + .case-h2 { margin-top: 88px; }
.case-axis { margin-top: 140px; }
.case-axis h2 { font-size: 40px; line-height: 46px; letter-spacing: -0.8px; }
.case-axis + .case-h2 { margin-top: 48px; }
.case-axis + .case-text { margin-top: 28px; }
.case-h2 + .case-flow { margin-top: 0; }
.other-projects .case-h2 { margin-top: 0; margin-bottom: 32px; }
@media (max-width: 900px) {
  .case-h2 { font-size: 22px; line-height: 28px; margin-top: 56px; margin-bottom: 16px; }
  .case-flow + .case-h2, .case-facts + .case-h2,
  .case-nda-note + .case-h2, .case-figure + .case-h2 { margin-top: 56px; }
  .case-axis { margin-top: 80px; }
  .case-axis h2 { font-size: 28px; line-height: 34px; }
  .case-axis + .case-h2 { margin-top: 32px; }
}
.case-text ul + p, .case-text ol + p, .case-text ul + .case-tags, .case-text ol + .case-tags { margin-top: 27.9px; }

/* Mobile: case body text drops to 16px, with the rhythm scaled to match */
@media (max-width: 640px) {
  .case-text { font-size: 16px; line-height: 24px; }
  .case-text p { margin-bottom: 24px; }
  .case-text ul + p, .case-text ol + p,
  .case-text ul + .case-tags, .case-text ol + .case-tags { margin-top: 24px; }
}

/* Sub-heading inside a case section (sits between H2 28px and card titles 18px) */
.case-h3 {
  width: 760px;
  max-width: 100%;
  margin: 56px auto 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 21px;
  line-height: 28px;
}
.case-h3 + .case-flow { margin-top: 20px; }
.case-axis { padding-top: 140px; }
@media (max-width: 900px) { .case-axis { padding-top: 80px; } }
@media (min-width: 901px) { .case-axis { margin-top: 100px; padding-top: 100px; } }

/* Concepts: card stack. Each card keeps its own proportions and is fitted
   into the same box (--bw × --bh), centred on top of the others. */
.card-stack {
  --bw: min(700px, calc(100vw - 60px));
  --bh: calc(var(--bw) * 0.75);
  position: relative;
  width: var(--bw);
  max-width: 100%;
  height: var(--bh);
  margin: 20px auto 0;
  perspective: 700px;
  touch-action: none;
  user-select: none;
  outline: none;
}
.cs-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(var(--bw), calc(var(--bh) * var(--r)));
  aspect-ratio: var(--r);
  translate: -50% -50%;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  transform-origin: 90% 90%;
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1);   /* spring-like overshoot */
  cursor: grab;
}
.cs-card.is-dragging { transition: none; cursor: grabbing; }
.cs-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cs-hint { margin: 40px 0 0; text-align: center; font-size: 15px; color: var(--gray-text); }

/* Vertical screens sit on a gray landscape card, with breathing room around them */
/* Same card ratio and insets as the Minions shot: screens take ~85% of the height,
   ~7% gap above and below (padding % is of the width, hence 4.85%) */
.cs-card.is-portrait {
  display: flex;
  justify-content: center;
  gap: 3.2%;
  padding: 4.85% 0;
  background: var(--card-bg);
}
.cs-card.is-portrait img { width: auto; height: 100%; flex: none; border-radius: 6.5% / 3%; }
@media (min-width: 901px) { .why-row-b .why-cell-card h3 { max-width: calc(100% - 260px); } }

/* One corner radius for every card and image; pills for buttons and badges */
:root { --r-card: 32px; }
.hero-card, .project-media, .job, .why-cell, .cta-card, .contact-card-outer, .contact-card,
.case-cover, .case-figure img, .case-gallery img, .case-video,
.other-media, .case-nda-note, .case-flow div, .cs-card { border-radius: var(--r-card); }
.pill-solid, .timeline-toggle, .cta-btn { border-radius: var(--r-pill); }
@media (max-width: 640px) { :root { --r-card: 22px; } }

/* Menu: frosted glass with a soft, layered shadow */
.float-pill {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .7),
    0 0 0 1px rgba(15, 23, 42, .06),
    0 1px 2px rgba(15, 23, 42, .06),
    0 8px 28px rgba(15, 23, 42, .08);
}
.float-pill .float-lang { background: rgba(15, 23, 42, .05); }
.float-pill .float-lang:hover { background: rgba(15, 23, 42, .09); }
.float-cta {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 1px 2px rgba(33, 137, 255, .25),
    0 8px 24px rgba(33, 137, 255, .28);
}

/* Mobile: process icons used to stick out of the card and cause sideways scroll */
@media (max-width: 900px) {
  .why-process { position: static; display: block; width: 100%; max-width: 313px; height: auto; margin-top: 20px; }
}
html, body { overflow-x: clip; }

/* Simple table inside a case (scenario → variant) */
.case-table-wrap { width: 760px; max-width: 100%; margin: 0 auto; overflow-x: auto; }
.case-table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 23px; }
.case-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--gray-text); padding: 0 16px 12px 0; }
.case-table td { padding: 14px 16px 14px 0; border-top: 1px solid #e6e9ed; vertical-align: top; }
.case-table td:last-child, .case-table th:last-child { padding-right: 0; }

/* ---------- Perps animation ---------- */
.perps-anim {
  position: relative;
  width: 100%;
  aspect-ratio: 1484 / 1120;
  overflow: hidden;
  border-radius: 32px;
  background: #1e1a24;
}
.perps-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 30%;
}
.perps-phone {
  position: absolute;
  left: 50%;
  top: 0;
  width: 32%;
  will-change: transform, width;
}
.perps-phone-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
.perps-screen {
  position: absolute;
  overflow: hidden;
  border-radius: 9% / 4.2%;
  background: #fff;
}
.perps-screen svg { display: block; width: 100%; height: 100%; }
.project-media .perps-anim { height: 100%; aspect-ratio: auto; border-radius: 0; }
.perps-amount {
  font-family: var(--font-head);
  font-size: 145px;
  font-weight: 500;
  letter-spacing: -5px;
  fill: #000;
  font-variant-numeric: tabular-nums;
}

/* ---------- ROLLOUT swipe animation ---------- */
.swipe-anim {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #8a8a8a;
}
.swipe-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swipe-phone { position: absolute; left: 50%; top: 0; width: 52%; }
.swipe-frame { position: relative; z-index: 3; display: block; width: 100%; height: auto; }
.swipe-screen {
  position: absolute;
  overflow: hidden;
  border-radius: 9% / 4.2%;
  background: #0a0a0a;
}
.swipe-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; will-change: transform; }

/* ---------- Laptop covers: CRM scroll, store loading ---------- */
.laptop-anim { position: relative; width: 100%; height: 100%; overflow: hidden; background: #8fa6f5; }
.lap-stage { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 2526 / 1917; transform: translateY(-50%); }
.lap-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lap-screen { position: absolute; overflow: hidden; background: #f4f5fa; }
.lap-fill { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.lap-window {
  position: absolute;
  container-type: inline-size;
  border-radius: 1.3cqw;
  box-shadow: 0 1.2cqw 3cqw rgba(20, 30, 90, .25);
}
.lap-window > .lap-fill { border-radius: inherit; }
.lap-window-full { border-radius: 0; box-shadow: none; }
.lap-card {
  position: absolute;
  border-radius: 1.16cqw;           /* 22px of the 1897px layout, same as the cards */
  overflow: hidden;
  transform-origin: 50% 100%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  will-change: transform, left, top;
}
.lap-time {
  position: absolute;
  font-family: var(--font-head);
  font-size: 0.66cqw;
  font-weight: 400;
  line-height: 1;
  color: #7f818e;
  white-space: nowrap;
}
.lap-ghost {
  position: absolute;
  border-radius: 1.16cqw;
  border: 0.11cqw dashed rgba(57, 51, 218, .45);
  background: rgba(57, 51, 218, .04);
  opacity: 0;
}
.lap-zone { border-style: solid; border-color: rgba(57, 51, 218, .35); background: rgba(57, 51, 218, .08); }
.lap-scrollbar {
  position: absolute;
  right: 0.35%;
  width: 0.5%;
  height: 22%;
  border-radius: 99px;
  background: rgba(30, 32, 60, .35);
  opacity: 0;
}
.lap-long { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: #fff; container-type: inline-size; will-change: transform, opacity; }
.lap-piece { position: absolute; background-repeat: no-repeat; opacity: 0; will-change: transform, opacity; }
.lap-progress {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  height: 0.45%;
  min-height: 2px;
  width: 0;
  background: #0d47e6;
  box-shadow: 0 0 6px rgba(13, 71, 230, .5);
}
.lap-scrollbar-page { right: 0.4%; width: 0.45%; height: 20%; transition: opacity .2s ease; }
