:root {
  --text-primary: #ffffff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
}

/* Background image is placed in a separate div to not crop it */
.page-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('photo_1_2026-05-01_11-39-06.jpg') no-repeat center center;
  background-size: cover;
  z-index: -1;
}

.app-wrapper {
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Ensure it scrolls nicely */
  padding: 40px 20px;
}

.bento-container {
  width: 100%;
  max-width: 440px;
  background-color: #000000;
  border-radius: 32px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  /* The layout adapts to the images natural aspect ratios */
}

/* Header Section */
.bento-header {
  width: 100%;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: #111; /* fallback */
}

.header-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.header-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
  width: 100%;
  padding: 40px 16px 20px;
  text-align: center;
}

.name {
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.5px;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start; /* Each card takes the height of its image naturally */
}

.bento-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: filter 0.2s ease, transform 0.2s ease;
  background-color: #111; /* fallback */
}

.bento-item-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.bento-item:hover {
  transform: scale(0.98);
  filter: brightness(1.1);
}

/* Gradient overlay to ensure text is readable */
.bento-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
  pointer-events: none;
}

.bento-item.large {
  grid-column: span 2;
}

.bento-icon-wrapper {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  overflow: hidden;
}

.bento-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bento-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  letter-spacing: -0.2px;
}

/* Animations for initial load */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.bento-container {
  animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
