/* ════════════════════════════════════════════════════════════════
   EXPERIMENTAL PROJECT SHOWCASE — MagicBento + page layout
   Self-contained — delete this folder anytime.
   ════════════════════════════════════════════════════════════════ */

:root {
  --mb-bg: #edf1e8;
  --mb-fg: #141414;
  --mb-accent: 237, 106, 90;
  --mb-card-bg: #120F17;
  --mb-border: #2F293A;
  --mb-white: #ffffff;
  --hue: 27;
  --sat: 69%;
}

/* ── Page layout ── */
.mb-page {
  background: var(--mb-bg);
  color: var(--mb-fg);
  font-family: "formula-narrow", sans-serif;
  min-height: 100vh;
  padding-bottom: 4em;
}

.mb-header {
  padding: 2.5em clamp(1.25em, 3vw, 2.5em);
  color: var(--mb-fg);
}

.mb-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
  display: block;
  margin-bottom: 0.5em;
}

.mb-title {
  font-family: "rader", sans-serif;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 4rem);
  text-transform: uppercase;
  line-height: 0.9;
  margin: 0;
}

/* ── Card grid ── */
.card-grid {
  display: grid;
  gap: 0.5em;
  padding: 0.75em;
  max-width: 64em;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
  margin: 0 auto;
}

.magic-bento-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 200px;
  width: 100%;
  padding: 1.25em;
  border-radius: 20px;
  border: 1px solid var(--mb-border);
  background: var(--mb-card-bg);
  background-size: cover;
  background-position: center;
  font-weight: 300;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;

  --glow-x: 50%;
  --glow-y: 50%;
  --glow-intensity: 0;
  --glow-radius: 200px;
}

.magic-bento-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.magic-bento-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 15, 23, 0.65) 0%, rgba(18, 15, 23, 0.15) 35%, transparent 55%);
  z-index: 0;
  pointer-events: none;
}

.magic-bento-card__header,
.magic-bento-card__content {
  display: flex;
  position: relative;
  color: var(--mb-white);
  z-index: 1;
}

.magic-bento-card__header {
  gap: 0.75em;
  justify-content: space-between;
  align-items: flex-start;
}

.magic-bento-card__content {
  flex-direction: column;
}

.magic-bento-card__label {
  font-family: "supply-mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  line-height: 1;
}

.magic-bento-card__title {
  font-family: "rader", sans-serif;
  font-style: italic;
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 0.25em;
  font-weight: 500;
  color: var(--mb-white);
}

.magic-bento-card__description {
  font-family: "formula-narrow", sans-serif;
  font-size: 0.65rem;
  line-height: 1.3;
  opacity: 0.7;
  margin: 0;
  color: var(--mb-white);
}

.magic-bento-card--text-autohide .magic-bento-card__title,
.magic-bento-card--text-autohide .magic-bento-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.magic-bento-card--text-autohide .magic-bento-card__title {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.magic-bento-card--text-autohide .magic-bento-card__description {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* ── Last card (CTA) ── */
.magic-bento-card:last-child {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgb(237, 106, 90), rgb(200, 70, 50)) !important;
  border-color: rgb(237, 106, 90);
}

.magic-bento-card:last-child .magic-bento-card__title {
  font-family: "formula-narrow", sans-serif;
  font-style: normal;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  text-transform: none;
  margin-bottom: 0.3em;
}

.magic-bento-card:last-child .magic-bento-card__description {
  font-size: 0.7rem;
  max-width: 80%;
  margin: 0 auto;
}

.magic-bento-card:last-child .magic-bento-card__label {
  display: none;
}

/* ── Border glow effect ── */
.magic-bento-card--border-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 6px;
  background: radial-gradient(
    var(--glow-radius) circle at var(--glow-x) var(--glow-y),
    rgba(var(--mb-accent), calc(var(--glow-intensity) * 0.8)) 0%,
    rgba(var(--mb-accent), calc(var(--glow-intensity) * 0.4)) 30%,
    transparent 60%
  );
  border-radius: inherit;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.magic-bento-card--border-glow:hover {
  box-shadow: 0 4px 20px rgba(46, 24, 78, 0.4), 0 0 30px rgba(var(--mb-accent), 0.2);
}

/* ── Particle container ── */
.mb-particle-container .magic-bento-card__header,
.mb-particle-container .magic-bento-card__content {
  z-index: 2;
}

.mb-particle-container:hover {
  box-shadow: 0 4px 20px rgba(46, 24, 78, 0.2), 0 0 30px rgba(var(--mb-accent), 0.2);
}

.mb-particle {
  position: absolute;
}

.mb-particle::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: rgba(var(--mb-accent), 0.2);
  border-radius: 50%;
  z-index: -1;
}

/* ── Global spotlight ── */
.mb-global-spotlight {
  mix-blend-mode: screen;
  will-change: transform, opacity;
  z-index: 200 !important;
  pointer-events: none;
}

/* ── Bento section ── */
.mb-bento-section {
  position: relative;
  user-select: none;
}

/* ── Grid breakpoints ── */
@media (max-width: 599px) {
  .card-grid {
    grid-template-columns: 1fr;
    width: 90%;
    margin: 0 auto;
    padding: 0.5em;
  }

  .magic-bento-card {
    width: 100%;
    min-height: 180px;
  }

  .magic-bento-card:last-child {
    grid-column: 1;
    grid-row: auto;
  }
}

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

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

  .magic-bento-card:nth-child(3) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .magic-bento-card:nth-child(4) {
    grid-column: 1 / span 2;
    grid-row: 2 / span 2;
  }

  .magic-bento-card:nth-child(6) {
    grid-column: 4;
    grid-row: 3;
  }
}

@media (min-width: 1400px) {
  .card-grid {
    max-width: 76em;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .magic-bento-card,
  .magic-bento-card *,
  .mb-particle {
    transition: none !important;
    animation: none !important;
  }

  .magic-bento-card::after,
  .mb-global-spotlight {
    display: none !important;
  }

  .magic-bento-card:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  .mb-particle-container:hover {
    box-shadow: none;
  }
}
