/*
 * Services panel, round 3 (30 Nov 2026, architecture restore, workstream C).
 * Loaded by includes/header-e.php after hx.css. Wide screens only (hx.css hides .hx-mega below 1024px).
 * Six photographic tiles in two rows (two-voice name over a neutral photograph, darkened for legibility,
 * slow zoom and brighten on hover or keyboard focus) and one quiet side panel with a single CTA.
 */

/* An invisible bridge over the gap between "Services" and the panel, so the pointer can travel down into it. */
.hx-mega::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; }

.r3m {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(250px, 23vw, 340px);
  gap: 14px;
  max-width: 1416px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 30px;
  background: #0E0E0E;
  box-shadow: inset 0 0 0 1px var(--x-line), 0 50px 90px -30px rgba(0, 0, 0, .85);
  animation: hx-drop .5s var(--x-ease);
}

/* ---------- the six tiles ---------- */
.r3m__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.r3m__grid > li { display: flex; min-width: 0; }
.r3m__tile {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 132px;
  overflow: hidden;
  border-radius: 18px;
  background: #1A1A1A;
  color: var(--x-white);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--x-line);
}
.r3m__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.74) saturate(.92);
  transform: scale(1.001);
  transition: transform 1.6s cubic-bezier(.2, .7, .2, 1), filter .7s ease;
}
/* The overlay: darkest behind the name (top left), lighter elsewhere, so every photograph keeps its character. */
.r3m__tile::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(158deg, rgba(6, 6, 6, .78) 0%, rgba(6, 6, 6, .42) 34%, rgba(6, 6, 6, .06) 62%, rgba(6, 6, 6, .3) 100%);
  transition: opacity .7s ease;
}
.r3m__name {
  position: absolute; left: clamp(16px, 1.6vw, 22px); top: clamp(14px, 1.4vw, 20px); right: 16px;
  display: grid;
  font: 600 clamp(18px, 1.55vw, 23px)/1.02 var(--x-d);
  letter-spacing: -.025em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .35);
}
.r3m__name b { font-weight: 600; }
.r3m__name em {
  font-family: var(--x-s);
  font-style: italic;
  font-weight: 400;
  font-size: 1.12em;
  letter-spacing: -.01em;
  color: rgba(241, 240, 236, .9);
}
.r3m__go {
  position: absolute; right: 14px; bottom: 14px;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(241, 240, 236, .14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--x-white);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity .45s ease, transform .6s var(--x-ease), background-color .3s;
}
.r3m__go svg { width: 15px; height: 15px; }

.r3m__tile:hover .r3m__img,
.r3m__tile:focus-visible .r3m__img { transform: scale(1.06); filter: brightness(.94) saturate(1); }
.r3m__tile:hover::after,
.r3m__tile:focus-visible::after { opacity: .82; }
.r3m__tile:hover .r3m__go,
.r3m__tile:focus-visible .r3m__go { opacity: 1; transform: none; background: var(--x-acc); background-image: var(--x-acc-grad); color: #0A0A0A; }
.r3m__tile:focus-visible { outline: 2px solid var(--x-acc); outline-offset: 3px; }

/* ---------- the side panel ---------- */
.r3m__side {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(20px, 2vw, 30px);
  overflow: hidden;
  border-radius: 18px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--x-line);
}
.r3m__side::before {
  content: '';
  position: absolute; z-index: -1;
  right: -30%; bottom: -40%;
  width: 120%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 136, .2), rgba(192, 132, 252, .08) 55%, transparent 75%);
  pointer-events: none;
}
.r3m__h {
  display: grid;
  margin: 0 0 22px;
  font: 600 clamp(24px, 2.15vw, 32px)/1.04 var(--x-d);
  font-stretch: 88%;
  letter-spacing: -.035em;
  color: var(--x-white);
}
.r3m__h em { font-family: var(--x-s); font-style: italic; font-weight: 400; font-stretch: normal; letter-spacing: -.01em; font-size: 1.08em; }
.r3m__also { width: 100%; margin-top: auto; padding-top: 22px; }
.r3m__k { margin: 0 0 6px; font: 500 12px/1 var(--x-d); letter-spacing: .14em; text-transform: uppercase; color: var(--x-grey); }
.r3m__also ul { margin: 0; padding: 0; list-style: none; }
.r3m__also a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--x-line);
  color: var(--x-soft);
  font: 400 14px/1.3 var(--x-d);
  text-decoration: none;
  transition: color .25s, padding-left .35s var(--x-ease);
}
.r3m__also li:last-child a { border-bottom: 0; }
.r3m__also a:hover { color: var(--x-white); padding-left: 4px; }

/* ---------- widths ---------- */
@media (max-width: 1279px) {
  .r3m { gap: 12px; padding: 12px; border-radius: 26px; }
  .r3m__grid { gap: 12px; }
  .r3m__go { width: 30px; height: 30px; right: 10px; bottom: 10px; }
  .r3m__also a { padding: 6px 0; font-size: 13.5px; }
}
/* Short screens: keep the whole panel within the window. */
@media (max-height: 700px) and (min-width: 1024px) {
  .r3m__tile { aspect-ratio: 16 / 8.5; }
  .r3m__h { margin-bottom: 16px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .r3m { animation: none; }
  .r3m__img, .r3m__go, .r3m__tile::after { transition: none; }
  .r3m__tile:hover .r3m__img, .r3m__tile:focus-visible .r3m__img { transform: none; }
}
html.motion-off .r3m { animation: none; }
