/* ==========================================================================
   NIRVANI-TILE - Verbatim copy of nirvani.ai .tile-grid--jw-glass + .tile
   Customize ONLY --tile-warm, --tile-accent, --tile-cream on .mk-tile-grid.
   ========================================================================== */

.mk-tile-grid {
  --tile-radius: 14px;
  --tile-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tile-accent: #4FC3F7;          /* electric cyan icon + chevron */
  --tile-cream:  #00E5FF;          /* bright cyan hover brackets */
  --tile-warm:   192, 200, 215;    /* cool platinum chrome RGB */
}

.mk-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
  align-items: start;
  perspective: 1200px;
}
@media (max-width: 1024px) { .mk-tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .mk-tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .mk-tile-grid { grid-template-columns: repeat(2, 1fr); } }

.mk-tile-grid--equal { align-items: stretch; }
.mk-tile-grid--equal .mk-tile { align-self: stretch; min-height: 130px; }
.mk-tile-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .mk-tile-grid--cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .mk-tile-grid--cols-3 { grid-template-columns: repeat(2, 1fr); } }

.mk-tile {
  --mx: 50%;
  --my: 50%;
  position: relative;
  background: rgba(10, 10, 10, 0.4);
  border: 1px solid rgba(var(--tile-warm), 0.45);
  border-radius: var(--tile-radius);
  padding: 24px 22px;
  cursor: pointer;
  transition: all 0.4s var(--tile-ease);
  overflow: hidden;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 0 10px rgba(var(--tile-warm), 0.12),
    0 0 25px rgba(var(--tile-warm), 0.06);
  align-self: start;
  transform-style: preserve-3d;
  will-change: transform;
  background-image: radial-gradient(
    600px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.07),
    transparent 40%
  );
}
.mk-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0.5;
  transition: opacity 0.4s ease;
  background: linear-gradient(90deg, transparent, var(--tile-accent), #FFFFFF, var(--tile-accent), transparent);
}
.mk-tile::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.15;
  transition: opacity 0.4s ease;
  pointer-events: none;
  background: radial-gradient(ellipse at top center, rgba(255,255,255,0.06), transparent 70%);
}
.mk-tile:hover, .mk-tile.active {
  border-color: rgba(var(--tile-warm), 0.70);
  transform: translateY(-4px);
  box-shadow:
    0 0 14px rgba(var(--tile-warm), 0.18),
    0 0 30px rgba(var(--tile-warm), 0.08),
    inset 0 0 20px rgba(var(--tile-warm), 0.05);
  background: rgba(255, 255, 255, 0.05);
}
.mk-tile:hover::before, .mk-tile.active::before { opacity: 1; }
.mk-tile:hover::after,  .mk-tile.active::after  { opacity: 1; }

.mk-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 35% 30%, rgba(var(--tile-warm), 0.18) 0%, rgba(0,0,0,0.6) 70%);
  border: 1px solid rgba(var(--tile-warm), 0.4);
  transition: all 0.4s ease;
  color: var(--tile-accent);
  box-shadow:
    0 0 10px rgba(var(--tile-warm), 0.25),
    0 0 22px rgba(var(--tile-warm), 0.12),
    inset 0 0 10px rgba(var(--tile-warm), 0.06);
}
.mk-tile:hover .mk-tile-icon, .mk-tile.active .mk-tile-icon {
  background: radial-gradient(circle at 35% 30%, rgba(var(--tile-warm), 0.28) 0%, rgba(0,0,0,0.35) 70%);
  border-color: rgba(var(--tile-warm), 0.45);
  box-shadow: 0 0 28px rgba(var(--tile-warm), 0.25), inset 0 0 14px rgba(var(--tile-warm), 0.08);
}
.mk-tile-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mk-tile-name {
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.92);
}
.mk-tile:hover .mk-tile-name, .mk-tile.active .mk-tile-name { color: #fff; }

.mk-tile-desc {
  position: relative;
  z-index: 1;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease,
              margin-top 0.4s ease;
  opacity: 0;
  margin-top: 0;
}
.mk-tile.active .mk-tile-desc {
  max-height: 400px;
  opacity: 1;
  margin-top: 12px;
}
.mk-tile-desc p {
  font-family: inherit;
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.62);
}
.mk-tile-desc a {
  color: var(--tile-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--tile-warm), 0.45);
  padding-bottom: 1px;
}
.mk-tile-desc a:hover { color: #fff; border-color: #fff; }

.mk-tile-expand {
  position: absolute;
  bottom: 10px;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: all 0.3s ease;
  z-index: 1;
}
.mk-tile.active .mk-tile-expand { transform: rotate(180deg); }
.mk-tile-expand svg {
  width: 14px;
  height: 14px;
  stroke: var(--tile-accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.6))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.mk-tile-grid--jw-glass { align-items: stretch; }
.mk-tile-grid--jw-glass .mk-tile {
  align-self: stretch;
  min-height: 210px;
  justify-content: center;
  padding: 30px 22px 28px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--tile-radius);
  overflow: hidden;
  background:
    radial-gradient(600px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) top    12px left  12px / 22px 1px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) top    12px left  12px / 1px 22px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) top    12px right 12px / 22px 1px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) top    12px right 12px / 1px 22px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) bottom 12px left  12px / 22px 1px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) bottom 12px left  12px / 1px 22px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) bottom 12px right 12px / 22px 1px no-repeat,
    linear-gradient(rgba(var(--tile-warm), 0.55), rgba(var(--tile-warm), 0.55)) bottom 12px right 12px / 1px 22px no-repeat,
    linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(10, 10, 10, 0.96));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 8px 30px rgba(0, 0, 0, 0.6);
  transition:
    transform 460ms var(--tile-ease),
    background 460ms var(--tile-ease),
    border-color 460ms var(--tile-ease),
    box-shadow 460ms var(--tile-ease);
  transform-origin: center center;
}
.mk-tile-grid--jw-glass .mk-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  height: auto; width: auto;
  background: linear-gradient(115deg,
    transparent 32%,
    rgba(240, 232, 206, 0.18) 50%,
    transparent 68%);
  background-size: 220% 100%;
  background-position: -100% 0;
  opacity: 1;
  transition: background-position 1100ms var(--tile-ease);
  pointer-events: none;
  z-index: 0;
}
.mk-tile-grid--jw-glass .mk-tile::after { display: none; }
.mk-tile-grid--jw-glass .mk-tile > * { position: relative; z-index: 1; }
.mk-tile-grid--jw-glass .mk-tile:hover,
.mk-tile-grid--jw-glass .mk-tile.active {
  transform: perspective(1000px) translateY(-6px) rotateX(2.5deg);
  border-color: rgba(var(--tile-warm), 0.65);
  background:
    linear-gradient(var(--tile-cream), var(--tile-cream)) top    12px left  12px / 32px 1px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) top    12px left  12px / 1px 32px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) top    12px right 12px / 32px 1px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) top    12px right 12px / 1px 32px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) bottom 12px left  12px / 32px 1px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) bottom 12px left  12px / 1px 32px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) bottom 12px right 12px / 32px 1px no-repeat,
    linear-gradient(var(--tile-cream), var(--tile-cream)) bottom 12px right 12px / 1px 32px no-repeat,
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(var(--tile-warm), 0.10), transparent 70%),
    radial-gradient(600px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(180deg, rgba(28, 28, 28, 0.98), rgba(14, 14, 14, 0.98));
  box-shadow:
    0 0 0 1px rgba(var(--tile-warm), 0.35),
    0 0 20px rgba(var(--tile-warm), 0.20),
    0 0 50px rgba(var(--tile-warm), 0.12),
    0 16px 50px rgba(0, 0, 0, 0.6);
}
.mk-tile-grid--jw-glass .mk-tile:hover::before,
.mk-tile-grid--jw-glass .mk-tile.active::before {
  background-position: 200% 0;
}
@media (prefers-reduced-motion: reduce) {
  .mk-tile-grid--jw-glass .mk-tile:hover,
  .mk-tile-grid--jw-glass .mk-tile.active { transform: translateY(-2px); }
}
.mk-tile-grid--jw-glass .mk-tile .mk-tile-expand {
  bottom: 6px;
  right: 50%;
  transform: translateX(50%);
  width: 22px;
  height: 22px;
}
.mk-tile-grid--jw-glass .mk-tile.active .mk-tile-expand {
  transform: translateX(50%) rotate(180deg);
}
