/* Panels: the bento of features and the "who runs it" slices. */

/* Cards light their border under the cursor (--mx / --my are set by js/effects.js). */
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgb(108 240 200 / 0.6), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Bento: 4 columns x 3 rows, every cell filled. Murph 2x2, "needs a person" 2x1, the lobby 2x1, four singles. */
.inside {
  padding-block: clamp(100px, 16vh, 200px);
}

.inside-heading {
  max-width: 15ch;
  margin-bottom: clamp(40px, 7vh, 72px);
}

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(280px, auto);
  grid-auto-flow: dense;
  gap: 16px;
}

.cell {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(108 240 200 / 0.07), transparent 55%),
    var(--surface);
}

.cell > .cell-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}

.cell:hover > .cell-bg {
  transform: scale(1.05);
}

.cell:has(> .cell-bg)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(6 8 11 / 0.96) 12%, rgb(6 8 11 / 0.45) 55%, rgb(6 8 11 / 0.05));
}

.cell-copy h3 {
  margin: 14px 0 8px;
}

.cell-copy p {
  max-width: 40ch;
  color: var(--muted);
  font-size: 0.98rem;
}

.cell-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.cell-icon.wait {
  color: var(--wait);
}

.cell-mark {
  position: absolute;
  top: 28px;
  left: 28px;
  width: 56px;
  height: 56px;
  color: var(--accent);
  filter: drop-shadow(0 0 22px var(--accent-glow));
}

.cell-murph {
  grid-column: span 2;
  grid-row: span 2;
}

.cell-murph h3 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.cell-person,
.cell-meet {
  grid-column: span 2;
}

.cell-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px;
}

/* Real panels from the office, shown as cards inside their cells. */
.cell-card {
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7);
  transition: transform 1s var(--ease-out);
}

.cell-person .cell-card {
  align-self: center;
  width: 100%;
  max-width: 300px;
  justify-self: end;
  transform: rotate(2deg);
}

.cell-person:hover .cell-card {
  transform: rotate(0deg) translateY(-4px);
}

.cell-away .cell-card {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: -2;
  width: 72%;
  transform: translateX(-50%);
}

.cell-away::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, var(--surface) 30%, rgb(13 17 23 / 0.2) 75%);
}

.cell-away:hover .cell-card {
  transform: translateX(-50%) translateY(-8px);
}

/* The phone screenshot peeks out of its cell like a handset on a desk. */
.cell-phone > .cell-bg {
  inset: 24px auto auto 50%;
  width: 46%;
  height: auto;
  border: 5px solid #1b212b;
  border-radius: 26px;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.6);
  transform: translateX(-50%) rotate(-7deg);
}

.cell-phone:hover > .cell-bg {
  transform: translateX(-50%) rotate(-3deg) translateY(-6px);
}

/* Who runs it: three slices; the open one is wide. */
.who {
  padding-block: clamp(100px, 16vh, 200px);
}

.who h2 {
  max-width: 17ch;
  margin-bottom: clamp(40px, 7vh, 72px);
}

.slices {
  display: flex;
  gap: 12px;
  height: clamp(440px, 64vh, 640px);
}

.slice {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: flex 0.9s var(--ease-out), border-color 0.4s;
}

.slice.is-open {
  flex: 3.2;
  border-color: rgb(108 240 200 / 0.3);
}

.slice img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: saturate(0.4);
  transition: opacity 0.9s, filter 0.9s, transform 1.6s var(--ease-out);
}

.slice.is-open img {
  opacity: 0.95;
  filter: none;
  transform: scale(1.03);
}

.slice::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(6 8 11 / 0.95) 8%, rgb(6 8 11 / 0.3) 60%, rgb(6 8 11 / 0.1));
}

.slice-title {
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.slice-body {
  display: block;
  max-width: 38ch;
  max-height: 0;
  overflow: hidden;
  color: var(--muted);
  opacity: 0;
  transition: max-height 0.8s var(--ease-out), opacity 0.6s, margin 0.8s var(--ease-out);
}

.slice.is-open .slice-body {
  max-height: 7em;
  margin-top: 10px;
  opacity: 1;
}

@media (max-width: 1100px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cell-murph {
    grid-row: span 1;
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .slices {
    flex-direction: column;
    height: auto;
  }

  .slice,
  .slice.is-open {
    flex: none;
    min-height: 300px;
  }

  .slice img {
    opacity: 0.9;
    filter: none;
  }

  .slice-body {
    max-height: none;
    margin-top: 10px;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .cell-murph,
  .cell-person,
  .cell-meet {
    grid-column: auto;
  }

  .cell-person {
    grid-template-columns: 1fr;
  }

  .cell {
    min-height: 300px;
  }

  .cell-phone {
    min-height: 460px;
  }

  .cell-phone > .cell-bg {
    width: 52%;
  }
}
