/* ============================================
   KOMMS-HAUS — BENTO
   Editorial feature grid: each cell carries an
   image or video ground with HTML set over it.
   Generous overall; judicious in proportion —
   one dominant cell, two mediums, three minors.
   ============================================ */

.bento-section {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--ink-10);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(250px, 32vh, 350px);
  gap: var(--grid-gap);
  margin-top: 48px;
}

/* --- the cell ---------------------------------------------------------- */

.bento-cell {
  position: relative;
  grid-column: span var(--span, 4);
  grid-row: span var(--rows, 1);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: var(--w-100);
  background: var(--black);
  /* entrance: rises once, staggered by --i */
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s var(--ease-expo),
    transform 0.7s var(--ease-expo);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.bento-cell.in {
  opacity: 1;
  transform: none;
}

/* Media ground: <img> or <video>, object-fit cover, slow drift. */
.bento-media {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bento-media img,
.bento-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease-expo);
}

@keyframes bento-drift {
  from { transform: scale(1.02) translateX(0); }
  to   { transform: scale(1.08) translateX(-1.5%); }
}

.bento-cell.in .bento-media > * {
  animation: bento-drift 22s ease-in-out infinite alternate;
}

.bento-cell:hover .bento-media > *,
.bento-cell:focus-visible .bento-media > * {
  animation-play-state: paused;
  transform: scale(1.06);
}

/* Legibility scrim over media grounds. */
.bento-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 35%, rgba(0, 0, 0, 0.62) 100%);
  pointer-events: none;
}

/* --- superimposed content ---------------------------------------------- */

.bento-content {
  position: relative;
  z-index: 2;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 46ch;
}

.bento-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.8);
}

.bento-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-fast) var(--ease-standard);
}

.bento-cell:hover .bento-title,
.bento-cell:focus-visible .bento-title {
  text-decoration-color: var(--signal);
}

.bento-cell--dominant .bento-title {
  font-size: clamp(28px, 3.4vw, 48px);
}

.bento-sub {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(250, 250, 247, 0.86);
  margin: 0;
}

.bento-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.68);
  margin-top: 6px;
}

.bento-cell:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* --- type-only cells: they sit on the page, not on media --------------- */

.bento-cell--type {
  background: transparent;
  border: 1px solid var(--ink-10);
  color: var(--ink-100);
  align-items: stretch;
}

.bento-cell--type .bento-content {
  justify-content: space-between;
  height: 100%;
  max-width: none;
}

.bento-cell--type .bento-kicker { color: var(--ink-40); }
.bento-cell--type .bento-sub { color: var(--ink-60); }
.bento-cell--type .bento-meta { color: var(--ink-40); }
.bento-cell--type .bento-title { color: var(--ink-100); }

.bento-figure {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.6vw, 72px);
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-100);
}

.bento-figure b {
  font-weight: 700;
  color: var(--signal);
}

/* Signal cell: the one loud tile. */
.bento-cell--signal {
  background: var(--signal);
  color: #ffffff;
}

.bento-cell--signal .bento-kicker { color: rgba(255, 255, 255, 0.7); }
.bento-cell--signal .bento-sub { color: rgba(255, 255, 255, 0.82); }
.bento-cell--signal .bento-title { color: #ffffff; }
.bento-cell--signal:hover .bento-title { text-decoration-color: #ffffff; }

/* --- proportions at smaller widths ------------------------------------- */

@media (max-width: 1024px) {
  .bento-cell { grid-column: span 6 !important; grid-row: span 1 !important; }
  .bento-cell--dominant { grid-column: span 12 !important; }
}

@media (max-width: 640px) {
  .bento { grid-auto-rows: clamp(220px, 40vh, 300px); }
  .bento-cell { grid-column: span 12 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .bento-cell { opacity: 1; transform: none; transition: none; }
  .bento-cell.in .bento-media > * { animation: none; }
  .bento-media img, .bento-media video { transition: none; }
}
