/* Fonts */
@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Variables */
:root {
  --color-black: #0B0B0B;
  --color-white: #fff;
  --color-placeholder: rgba(11, 11, 11, 0.2);
  --columns: 3;
  --gap: 64px;
  --padding: 64px;
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Base */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  background: var(--color-white);
  color: var(--color-black);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */
.navigation {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 144px;
  padding: 0 var(--padding);
}

.navigation nav {
  display: flex;
  gap: 40px;
}

.logo {
  flex-shrink: 0;
}

.logo img {
  width: 90px;
  height: 20px;
}

.nav-link {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  opacity: 0.8;
}

/* Masonry Grid */
.masonry {
  position: relative;
  width: calc(100% - var(--padding) * 2);
  margin: 0 var(--padding) var(--padding);
  transition: height var(--transition);
}

/* Items */
.item,
.item-link {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-link {
  display: block;
}

.item-link .item {
  position: relative;
  transform: none !important;
}

/* Image */
.image {
  width: 100%;
  min-height: 100px;
  background: var(--color-placeholder);
  overflow: hidden;
}

.image img {
  width: 100%;
  height: auto;
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.05);
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}

.image img.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Hover */
.item:hover .image img.loaded,
.item-link:hover .image img.loaded {
  transform: scale(1.05);
}

/* Data */
.data {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
}

.title {
  font-weight: 400;
}

.description {
  opacity: 0.5;
}

/* Loading */
.loading-indicator {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-indicator.visible {
  opacity: 1;
}

.loading-indicator::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-placeholder);
  border-top-color: var(--color-black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  :root {
    --columns: 2;
    --gap: 40px;
    --padding: 40px;
  }
  
  .navigation {
    height: 120px;
    gap: 32px;
  }
  
  .navigation nav {
    gap: 32px;
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  :root {
    --columns: 1;
    --gap: 32px;
    --padding: 24px;
  }
  
  .navigation {
    height: 96px;
    gap: 24px;
  }
  
  .navigation nav {
    gap: 24px;
  }
  
  .nav-link {
    font-size: 16px;
  }
}
