/* ─── MagicBento — vanilla port ─────────────────────────────────
   Prefixed mb- to avoid conflicts with page styles.
────────────────────────────────────────────────────────────────── */

/* ── Section heading ──────────────────────────────────────────── */
.mb-section-heading {
  text-align: center;
  padding: 0 0 48px;
}
.mb-section-heading h2 {
  font-size: clamp(30px, 3.8vw, 50px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--white);
  margin-top: 10px;
}

/* ── Grid ─────────────────────────────────────────────────────── */
.mb-card-grid {
  display: grid;
  gap: 0.5em;
  padding: 0.75em;
  max-width: 1100px;
  margin: 48px auto 0;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
  grid-template-columns: 1fr;
}

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

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

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

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

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

/* ── Card ─────────────────────────────────────────────────────── */
.mb-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 100px;
  width: 100%;
  padding: 1.25em;
  border-radius: 20px;
  border: 1px solid #2F293A;
  background: #120F17;
  overflow: hidden;
  cursor: default;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  --glow-x: 50%;
  --glow-y: 50%;
  --glow-intensity: 0;
  --glow-radius: 200px;
  --glow-color: 132, 0, 255;
}

.mb-card {
  cursor: pointer;
}

.mb-card:not(.mb-card--expanded):hover {
  transform: translateY(-2px);
}

.mb-card--expanded {
  transform: none !important;
  cursor: default !important;
}

/* description hidden on grid cards — revealed only in expanded overlay */
.mb-card-grid .mb-card__description {
  display: none;
}

/* ── Card content ─────────────────────────────────────────────── */
.mb-card__header,
.mb-card__content {
  display: flex;
  position: relative;
  color: #fff;
  z-index: 2;
}

.mb-card__header {
  justify-content: space-between;
  align-items: flex-start;
}

.mb-card__content {
  flex-direction: column;
}

.mb-card__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.mb-card__title {
  font-weight: 700;
  font-size: clamp(15px, 1.5vw, 22px);
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 0.3em;
}

.mb-card__description {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
}

/* text-autohide via line-clamp */
.mb-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.mb-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ── Border glow ──────────────────────────────────────────────── */
.mb-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(132, 0, 255, calc(var(--glow-intensity) * 0.8)) 0%,
    rgba(132, 0, 255, 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;
  z-index: 1;
}

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

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

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mb-card { transition: none !important; }
  .mb-card::after { transition: none !important; }
  .mb-spotlight { display: none !important; }
}

/* ── Morph slider inside cards ────────────────────────────────── */
[data-morph-slides] {
  justify-content: flex-start;
}


.mb-card__visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 8, 18, 0.72) 0%, transparent 38%);
  z-index: 1;
  pointer-events: none;
}

.ms-slide-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  pointer-events: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mb-card-expand-arrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  pointer-events: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ms-indicators {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 4;
  display: flex;
  gap: 5px;
  align-items: center;
  pointer-events: none;
}

.ms-dot {
  pointer-events: auto;
  width: 5px;
  height: 5px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition:
    width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.5s ease;
}

.ms-dot--active {
  width: 16px;
  background: rgba(255, 255, 255, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .ms-dot { transition: none; }
}

/* ── iPhone / TikTok card ────────────────────────────────────── */
.mb-card--iphone {
  overflow: hidden;
}

.iphone-duo {
  position: absolute;
  bottom: -10%;
  right: 10%;
  width: 80%;
  height: 90%;
  pointer-events: none;
  z-index: 0;
}

.iphone-mock {
  position: absolute;
  width: 46%;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.7));
}

.iphone-mock--tiktok {
  right: 0;
  bottom: 0;
  z-index: 1;
  transform: rotate(6deg);
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.5));
}

.iphone-mock--linkedin {
  right: 38%;
  bottom: 4%;
  z-index: 2;
  transform: rotate(-4deg);
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.8));
}

.iphone-shell {
  background: #111;
  border-radius: 36px;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 6px #1a1a1a,
    0 0 0 7px rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
}

.iphone-screen {
  width: 100%;
  aspect-ratio: 9/16;
  overflow: hidden;
  position: relative;
  background: #000;
  display: block;
}

.iphone-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.iphone-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  height: 14px;
  background: #111;
  border-radius: 999px;
  z-index: 2;
}

.iphone-home-bar {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 99px;
  z-index: 2;
}

/* ── Mac window card ─────────────────────────────────────────── */
.mb-card--browser {
  justify-content: space-between;
  overflow: hidden;
}

.mac-window {
  position: absolute;
  bottom: -6%;
  right: -6%;
  width: 80%;
  border-radius: 10px;
  background: #1c1a24;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 4px 16px rgba(0,0,0,0.4);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  transform: rotate(3deg);
}

.mac-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #2a2733;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: relative;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mac-dot--red    { background: #ff5f57; }
.mac-dot--yellow { background: #ffbd2e; }
.mac-dot--green  { background: #28c840; }

.mac-urlbar {
  flex: 1;
  margin: 0 8px;
  height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.mac-screen {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  display: flex;
}

.mac-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

/* ── Mobile: one column — all cards keep 4/3 frame, descriptions hidden
   Base rules already handle both: aspect-ratio: 4/3 on .mb-card and
   display: none on .mb-card-grid .mb-card__description. */

/* ── DESIGN-TOOL UI (Grafik & Design) ── */
.mb-card--design {
  overflow: hidden;
}
.design-ui {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12%;
  pointer-events: none;
  z-index: 0;
}
.design-ui svg {
  display: block;
  width: 78%;
  height: auto;
}

/* ── MIC VISUAL ── */
.mb-card--podcast {
  overflow: hidden;
}
.mic-visual {
  position: absolute;
  bottom: -6%;
  left: -6%;
  width: 86%;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.45)) drop-shadow(0 0 20px rgba(123,47,255,0.25));
}
.mic-visual svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ── POLAROID STACK ── */
.mb-card--photo {
  overflow: hidden;
}
.polaroid-stack {
  position: absolute;
  bottom: -10%;
  right: -4%;
  width: 54%;
  height: 74%;
  pointer-events: none;
  z-index: 0;
}

.polaroid {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: #201b30;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8% 8% 24%;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.4),
    0 14px 36px rgba(0,0,0,0.55);
}

.polaroid--back {
  transform: rotate(-10deg) translate(-9px, 5px);
  background: #16121f;
}

.polaroid--mid {
  transform: rotate(-4deg) translate(-4px, 2px);
  background: #1b1728;
}

.polaroid--front {
  transform: rotate(5deg);
}

/* the single "photo" window on the top card — abstract portrait */
.polaroid-photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
  background:
    radial-gradient(120% 95% at 50% 20%,
      rgba(160,107,255,0.55) 0%,
      rgba(90,31,204,0.30) 45%,
      #100b20 100%);
}

/* shoulders */
.polaroid-photo::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: 68%;
  height: 46%;
  transform: translateX(-50%);
  border-radius: 46% 46% 0 0 / 72% 72% 0 0;
  background: #0f0a1c;
}

/* head */
.polaroid-photo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16%;
  width: 34%;
  height: 40%;
  transform: translateX(-50%);
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  background: #0f0a1c;
}

/* ── DOC STACK ── */
.doc-stack {
  position: absolute;
  bottom: -8%;
  right: -6%;
  width: 72%;
  height: 60%;
  pointer-events: none;
  z-index: 0;
}

.doc {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: #2a2840;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.35),
    0 8px 28px rgba(0,0,0,0.45);
  overflow: hidden;
}

.doc--back {
  transform: rotate(-8deg) translate(-10px, 6px);
  background: #221f35;
}

.doc--mid {
  transform: rotate(-4deg) translate(-5px, 3px);
  background: #26243a;
}

.doc--front {
  transform: rotate(3deg);
  display: flex;
  flex-direction: column;
  background: #2e2b48;
  border-color: rgba(123,47,255,0.25);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.3),
    0 12px 36px rgba(0,0,0,0.5);
}

/* violet accent strip at top */
.doc-accent-strip {
  height: 4px;
  flex-shrink: 0;
  background: #7b2fff;
}

/* body area */
.doc-body {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-line {
  border-radius: 2px;
  height: 5px;
  width: 100%;
  background: rgba(255,255,255,0.1);
}
.doc-line--title {
  width: 50%;
  height: 8px;
  background: rgba(255,255,255,0.2);
  margin-bottom: 2px;
}
.doc-line--short { width: 55%; }

.doc-gap { height: 6px; }
