:root {
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --bg-color: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 50%, #f0f1f3 100%);
  --text-main: #111827;
  --text-muted: #305940;
  --radius: 1.75rem;
  --gap: 1.25rem;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  opacity: 0; 
  animation: fadeInBody 0.8s ease-out forwards;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 50%;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 50%;
  pointer-events: none;
}

@keyframes fadeInBody {
  from { opacity: 0; }
  to { opacity: 1; }
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.profile-section {
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 20;
}

.avatar {
  width: 9rem;
  height: 9rem;
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  border: 4px solid white;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.avatar:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 30px 60px -15px rgba(0,0,0,0.2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.avatar:hover img {
  transform: scale(1.1);
}

.profile-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
  line-height: 1;
  background: linear-gradient(135deg, #20381C, #335718);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-desc {
  font-size: 1.25rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-width: 20rem;
  line-height: 1.7;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-section {
  padding: 1rem;
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile default */
  gap: var(--gap);
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  padding-bottom: 2rem;
}

.grid-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: block;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.03);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger Animations via nth-child logic handled roughly by pure css or via js delay injection if needed. 
   Here we use a simple generic delay sequence for up to 12 items */
.grid-tile:nth-child(1) { animation-delay: 0.1s; }
.grid-tile:nth-child(2) { animation-delay: 0.15s; }
.grid-tile:nth-child(3) { animation-delay: 0.2s; }
.grid-tile:nth-child(4) { animation-delay: 0.25s; }
.grid-tile:nth-child(5) { animation-delay: 0.3s; }
.grid-tile:nth-child(6) { animation-delay: 0.35s; }
.grid-tile:nth-child(7) { animation-delay: 0.4s; }
.grid-tile:nth-child(8) { animation-delay: 0.45s; }

.grid-tile:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 24px 40px -8px rgba(0, 0, 0, 0.15), 0 8px 16px -6px rgba(0, 0, 0, 0.08);
  z-index: 10;
  filter: brightness(1.05);
}

.grid-tile:active {
  transform: scale(0.98);
}

.grid-tile.no-hover:hover {
  transform: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  cursor: default;
}

/* Inner Content Layouts */
.content-wrapper {
  padding: 1.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  align-self: flex-end;
}

.block-title {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.block-sub {
  opacity: 0.8;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  font-weight: 500;
}

.show-desktop { display: inline; }
.show-mobile { display: none; }

/* Specific Types */
.type-text { justify-content: center; }
.type-text h3 { font-size: 1.75rem; margin-bottom: 0.5rem; letter-spacing: -0.03em; }

.full-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.grid-tile:hover .full-img { transform: scale(1.08); }

/* Responsive */
/* Mobile: Reset grid positioning to stack blocks naturally */
@media (max-width: 639px) {
  .grid-tile {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .profile-section {
    padding: 2rem 1.25rem 3rem;
  }
  .grid-section {
    padding: 0 0.75rem 2rem;
  }
  .content-wrapper {
    padding: 1.25rem;
  }
  .avatar {
    width: 6rem;
    height: 6rem;
  }
  .profile-name {
    font-size: 1.75rem;
  }
  .grid {
    grid-auto-rows: 140px;
  }
  .card-mask {
    max-height: 220px;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  }
  .show-desktop { display: none; }
  .show-mobile { display: inline; }
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .profile-section {
    width: 100%;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 6rem 2rem 7rem;
  }
  .grid-section { padding: 0 4rem 4rem; }
  .avatar { width: 12rem; height: 12rem; }
  .profile-name { font-size: 3rem; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
