/* ============================================================
   Egor — Portfolio
   ============================================================ */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #9a9a9a;
  --placeholder: #ededed;
  --line: #1a1a1a;

  --max-width: 1040px;
  --gutter: 28px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 80px;
}

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

.brand__logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: block;
}

.brand__logo.animating {
  animation: logo-color-cycle 8s ease-in-out infinite;
}

@keyframes logo-color-cycle {
  0% {
    filter: hue-rotate(0deg);
  }
  25% {
    filter: hue-rotate(200deg);
  }
  50% {
    filter: hue-rotate(120deg);
  }
  75% {
    filter: hue-rotate(280deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand__name {
  font-weight: 500;
  font-size: 14px;
}

.brand__role {
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 28px;
  font-weight: 500;
  font-size: 14px;
  padding-top: 4px;
}

.nav a {
  transition: opacity 0.2s ease;
}

.nav a:hover {
  opacity: 0.5;
}

/* ---------- Intro ---------- */
.intro {
  max-width: 560px;
  padding-bottom: 120px;
  position: relative;
}

.intro__text {
  margin: 0;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.28;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
}

.intro__gradient {
  position: absolute;
  top: -180px;
  right: -450px;
  width: 700px;
  height: 700px;
  pointer-events: none;
  overflow: visible;
  display: none;
}

.blob {
  animation: float 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.blob-1 {
  animation-delay: 0s;
  animation-duration: 7s;
}

.blob-2 {
  animation-delay: 1s;
  animation-duration: 8s;
}

.blob-3 {
  animation-delay: 2s;
  animation-duration: 9s;
}

.blob-4 {
  animation-delay: 3s;
  animation-duration: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -40px) scale(1.1);
  }
  50% {
    transform: translate(-20px, 30px) scale(0.95);
  }
  75% {
    transform: translate(40px, 20px) scale(1.05);
  }
}

.intro__link {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.intro__link:hover {
  opacity: 0.5;
}

/* ---------- Section label ---------- */
.section-label {
  margin: 0 0 28px;
  font-weight: 400;
  font-size: 15px;
  color: var(--muted);
}

.section-label .arrow {
  display: inline-block;
}

/* ---------- Work grid ---------- */
.work {
  padding-bottom: 120px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 24px;
  row-gap: 56px;
}

.project__media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  transition: border-radius 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:not(:nth-child(5)) .project__media:hover {
  border-radius: 32px;
}

.project:nth-child(5) .project__media:hover {
  transform: rotate(-3deg);
}

.coming-soon .project__media {
  cursor: default;
}

.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--placeholder);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Project colors on hover */
.project:nth-child(1) .project__media:hover .placeholder {
  background: #D9D7F0;
}

.project:nth-child(2) .project__media:hover .placeholder {
  background: #D7E3D0;
}

.project:nth-child(3) .project__media:hover .placeholder {
  background: #FDEAB9;
}

.project:nth-child(4) .project__media:hover .placeholder {
  background: #B4D6FD;
}

.project__media:hover .placeholder {
  transform: scale(1.03);
}

.project__meta {
  margin-top: 14px;
  max-width: 90%;
}

.project__title {
  margin: 0 0 2px;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.35;
}

.project__info {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.35;
}

.project__info strong {
  font-weight: 400;
  color: var(--text);
}

.nda {
  white-space: nowrap;
  font-size: 13px;
}

/* ---------- Contact ---------- */
.contact {
  padding-bottom: 140px;
}

.contact__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact__links li {
  margin-bottom: 4px;
}

.contact__links a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  font-size: 15px;
  transition: opacity 0.2s ease;
}

.contact__links a:hover {
  opacity: 0.5;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}


/* ---------- Case study pages ---------- */
.case-study {
  max-width: 680px;
}

.case-header {
  padding-bottom: 64px;
}

.back-btn {
  font-weight: 500;
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.back-btn:hover {
  opacity: 0.5;
}

.case-intro {
  padding-bottom: 48px;
}

.case-title {
  margin: 0 0 24px;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.case-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
}

.case-meta p {
  margin: 0;
}

.case-meta strong {
  font-weight: 400;
  color: var(--text);
}

.case-content {
  padding-bottom: 56px;
}

.case-description {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.case-gallery {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 100px;
}

.case-figure {
  margin: 0;
  padding: 0;
}

.case-figure .placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  border-radius: 16px;
}

.project-hypervision .case-figure .placeholder {
  border-radius: 28px;
}

.case-figure figcaption {
  font-size: 14px;
  color: var(--muted);
}

.case-section {
  margin-bottom: 56px;
}

.case-section-title {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.case-subsection-title {
  margin: 0 0 12px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
}

.case-text {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
  .intro__gradient {
    display: block;
  }
}

@media (max-width: 860px) {
  .intro__text {
    font-size: 28px;
  }

  .intro__gradient {
    display: none !important;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 48px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 24px 20px 48px;
  }

  .site-header {
    flex-direction: column;
    gap: 24px;
    padding-bottom: 56px;
  }

  .nav {
    gap: 22px;
    padding-top: 0;
  }

  .intro {
    padding-bottom: 80px;
  }

  .intro__text {
    font-size: 24px;
  }

  .work,
  .contact {
    padding-bottom: 80px;
  }

  .grid {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .case-title {
    font-size: 24px;
  }

  .case-header {
    padding-bottom: 48px;
  }

  .case-intro {
    padding-bottom: 40px;
  }

  .case-gallery {
    gap: 32px;
    padding-bottom: 80px;
  }
}
