@import url("cursor.css");

/* Design canvas: 1440 × 3680 */
:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-muted: #8a8a8a;
  --color-card: #f5f5f5;
  --color-tag-bg: #ffffff;

  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-playfair: "Playfair Display", "Instrument Serif", serif;

  --page-max: 1440px;
  --pad-x: 60px;
  --content: 1320px;
  --header-height: 64px;

  --radius-avatar: 24px;
  --radius-card: 20px;
  --radius-cover: 16px;
  --radius-tag: 24px;
  --radius-btn: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

.page :where(p, h1, h2, h3, li, figcaption, .project-card__desc, .case-block__text, .case-intro__lead, .case-meta__value, .states__message) {
  text-wrap: pretty;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  margin: 0 auto;
  max-width: var(--page-max);
  min-height: 100vh;
  padding-top: var(--header-height);
  width: 100%;
}

/* ─── Header — фиксированный ─── */
.header {
  align-items: center;
  background-color: transparent;
  box-sizing: border-box;
  display: flex;
  isolation: isolate;
  justify-content: space-between;
  left: 0;
  min-height: var(--header-height);
  padding: 24px var(--pad-x) 16px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 53;
}

.header::before {
  background-color: var(--color-bg);
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.25s ease;
  z-index: -1;
}

body.is-header-scrolled:not(.is-page-dimmed) .header::before {
  opacity: 1;
}

.header__brand {
  align-items: center;
  display: flex;
  gap: 8px;
}

.header__logo {
  align-items: center;
  background: var(--color-text);
  border-radius: 12px;
  display: flex;
  flex-shrink: 0;
  height: 24px;
  justify-content: center;
  overflow: hidden;
  width: 24px;
}

.header__logo img {
  flex-shrink: 0;
  height: 16px;
  max-width: none;
  object-fit: contain;
  width: 16px;
}

.header__name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
}

.header__right {
  align-items: center;
  display: flex;
  gap: 24px;
}

.header__lang {
  align-items: center;
  border-radius: var(--radius-btn);
  display: flex;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  gap: 4px;
  letter-spacing: -0.32px;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
}

.header__lang.btn-link {
  height: auto;
  padding: 0;
}

.header__lang img,
.btn-link img {
  display: block;
  flex-shrink: 0;
  height: 1em;
  max-width: none;
  object-fit: contain;
  width: 1em;
}

.header__location {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── Hero ─── */
.hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding-top: 132px; /* 156 - 24 header */
}

.hero__avatar {
  aspect-ratio: 1 / 1;
  background: var(--color-card);
  border-radius: var(--radius-avatar);
  flex-shrink: 0;
  height: 140px;
  width: 140px;
  display: block;
  overflow: hidden;
  object-fit: cover;
}

.hero__title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.32px;
  line-height: 1.45;
  margin-top: 40px; /* 336 - (156+140) */
  max-width: 800px;
  text-align: center;
  text-transform: uppercase;
  color: #A7A7A7;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px; /* 438 - (336+78) */
}

/* ─── Buttons / links ─── */
.btn-link {
  align-items: center;
  border-radius: var(--radius-btn);
  display: inline-flex;
  font-size: 16px;
  font-weight: 500;
  gap: 4px;
  height: 45px;
  letter-spacing: -0.32px;
  line-height: 1;
  padding: 12px;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.btn-link img {
  backface-visibility: hidden;
  transition: filter 0.4s ease;
  transform: translateZ(0);
}


.btn-link--cv {
  min-width: 147px;
}

.btn-link--telegram {
  min-width: 110px;
}

/* ─── Sections ─── */
.section {
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section__title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 40px;
}

.section--cases {
  margin-top: 140px; /* 623 - 483 (hero actions bottom) */
}

.section--cases .section__title {
  margin-bottom: 40px; /* 701 - 623 - 38 */
}

.section--experience {
  margin-top: 140px; /* 2877 - 2737 */
  padding-left: 0;
  padding-right: 0;
}

.section--experience .section__title {
  margin-bottom: 40px; /* 2955 - 2877 - 38 */
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.experience-scroll {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.experience-scroll::-webkit-scrollbar {
  display: none;
}

.experience-scroll:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

/* ─── Project cards ─── */
.projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  align-items: stretch;
  background: var(--color-card);
  border-radius: var(--radius-card);
  column-gap: 40px;
  display: grid;
  grid-template-columns: calc(664px + 20px) minmax(0, 1fr);
  min-height: auto;
  overflow: hidden;
  row-gap: 0;
  width: 100%;
}

.project-card--link {
  position: relative;
  transition: transform 0.28s ease;
}

.project-card--link:hover {
  transform: scale(1.03);
  z-index: 1;
}

.project-card__media {
  display: contents;
}

.project-card__cover {
  align-self: start;
  border-radius: var(--radius-cover);
  box-sizing: border-box;
  height: auto;
  margin: 20px 0 20px 20px;
  max-height: 460px;
  object-fit: contain;
  object-position: left top;
  width: 664px;
  max-width: calc(100% - 20px);
}

.project-card__body {
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  padding: 60px 60px 40px 0;
}

.project-card__title {
  font-family: var(--font-playfair);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
  max-width: 537px;
}

.project-card__desc {
  color: #A7A7A7;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.32px;
  line-height: 1.45;
  margin-top: 20px;
  max-width: 537px;
}

.project-card__tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.tag {
  align-items: center;
  background: var(--color-tag-bg);
  border-radius: var(--radius-tag);
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  gap: 6px;
  height: 35px;
  letter-spacing: -0.28px;
  padding: 8px;
  text-transform: lowercase;
  white-space: nowrap;
}

.tag__dot {
  background: var(--color-muted);
  border-radius: 50%;
  flex-shrink: 0;
  height: 2px;
  width: 2px;
}

/* ─── Experience — горизонтальный скролл только карточек ─── */
.experience {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 var(--pad-x);
  width: max-content;
}

.exp-card {
  align-items: center;
  background: var(--color-card);
  border-radius: var(--radius-card);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  height: 500px;
  justify-content: center;
  padding: 47px;
  text-align: center;
  width: 324px;
}

.exp-card__logo {
  height: 60px;
  object-fit: contain;
  width: 60px;
}

.exp-card__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  width: 230px;
}

.exp-card__company {
  font-family: var(--font-playfair);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.exp-card__role,
.exp-card__period {
  color: #A7A7A7;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.32px;
  line-height: 1.35;
}

.exp-card__role {
  white-space: nowrap;
}

/* ─── Footer ─── */
.footer {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  margin-top: 140px;
  padding: 0 var(--pad-x) 40px;
}

.footer__left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer__right {
  align-items: center;
  display: flex;
  gap: 12px;
}

.footer__love {
  align-items: center;
  background: none;
  border: none;
  color: inherit;
  display: flex;
  font: inherit;
  gap: 12px;
  padding: 0;
  text-align: left;
  transition: color 0.4s ease;
}

.footer__text {
  font-family: var(--font-playfair);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.footer__heart {
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  height: 32px;
  overflow: hidden;
  width: 32px;
}

.footer-hearts-burst {
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: fixed;
  z-index: 53;
}

.footer-heart-particle {
  animation: footer-heart-rise var(--duration, 1.4s) ease-out forwards;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.footer-heart-particle svg {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

@keyframes footer-heart-rise {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.55);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift-x, 0px)), calc(-50% - var(--rise, 120px)))
      rotate(var(--rotation, 0deg)) scale(0.35);
  }
}

/* Узкий десктоп: пропорционально уменьшаем превью */
@media (max-width: 1440px) and (min-width: 1201px) {
  .project-card {
    column-gap: 40px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  .project-card__cover {
    margin: 20px 0 20px 20px;
    max-height: min(460px, 36vw);
    width: 100%;
  }
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .project-card {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-template-columns: none;
    isolation: isolate;
    min-height: auto;
    overflow: hidden;
  }

  .project-card__media {
    display: block;
    flex-shrink: 0;
    padding-bottom: 20px;
    width: 100%;
  }

  .project-card__cover {
    align-self: stretch;
    border-radius: 0;
    display: block;
    flex-shrink: 0;
    height: auto !important;
    margin: 0;
    max-height: none;
    max-width: none;
    object-fit: contain;
    object-position: center top;
    width: 100%;
  }

  .project-card__body {
    align-self: auto;
    background: var(--color-card);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    flex-shrink: 0;
    gap: 20px;
    min-height: 0;
    padding: 0 40px 20px;
  }

  .project-card__title,
  .project-card__desc {
    max-width: none;
    width: 100%;
  }

  .project-card__desc {
    margin-top: 0;
  }

  .project-card__tags {
    margin-top: 0;
    padding-top: 0;
  }
}

/* ─── States / empty page (Figma 703:112, 1440×900) ─── */
.page--states {
  display: flex;
  flex-direction: column;
  min-height: 900px;
  min-height: 100vh;
}

.states {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 44px var(--pad-x) 0;
  text-align: center;
}

.states__image {
  border-radius: 12px;
  flex-shrink: 0;
  height: 266px;
  max-width: none;
  object-fit: cover;
  width: 400px;
}

.states__message {
  color: #a7a7a7;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.44px;
  line-height: 1.2;
  margin-top: 40px; /* отступ от картинки */
  max-width: 741px;
  text-transform: uppercase;
}

.states__cta {
  margin-bottom: 124px;
  margin-top: 16px;
}

.page--states .footer--states {
  margin-top: 0;
}

.header__lang--active {
  pointer-events: none;
}

@media (max-width: 768px) {
  .states__image {
    height: auto;
    max-width: 100%;
    width: 100%;
  }

  .states__message {
    font-size: 16px;
    letter-spacing: -0.32px;
  }

  .states {
    padding-top: 24px;
  }
}

@media (max-width: 768px) {
  :root {
    --pad-x: 24px;
  }

  .header__location {
    display: none;
  }

  .hero__title {
    font-size: 16px;
    max-width: 100%;
    color: #A7A7A7;
  }

  .hero__actions,
  .footer__left {
    flex-wrap: wrap;
    justify-content: center;
  }

  .project-card__body {
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
    padding-bottom: 20px;
  }

  .project-card__title {
    font-size: 28px;
  }

  .project-card--link:hover {
    transform: none;
  }

  .exp-card {
    height: 420px;
    padding: 32px;
    width: 280px;
  }

  .footer {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
}
