/* Clickable service tiles and illustrated detail window */

.card[data-service] {
  cursor: pointer;
  position: relative;
  pointer-events: auto;
}

a.card[data-service] {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.card[data-service]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.service-card[data-service] .service-more,
.detail-card[data-service] .service-more,
.card[data-service] .service-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 26px 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.page-hero--services + .section .grid-3 > .card[data-service] .service-more {
  margin: 8px 0 0;
  color: #9af5f1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .9);
}

.card[data-service] .service-more::after {
  content: "→";
  transition: transform .2s ease;
}

.card[data-service]:hover .service-more::after,
.card[data-service]:focus-visible .service-more::after {
  transform: translateX(4px);
}

body.service-modal-open {
  overflow: hidden;
}

.service-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 28px);
  background: rgba(1, 8, 16, .82);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.service-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.service-modal {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  border: 1px solid rgba(82, 224, 234, .28);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(82, 224, 234, .12), transparent 32%),
    linear-gradient(165deg, rgba(14, 32, 50, .98), rgba(6, 16, 26, .98));
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  color: var(--text);
}

.service-modal-close {
  position: sticky;
  top: 14px;
  z-index: 3;
  float: right;
  width: 44px;
  height: 44px;
  margin: 14px 14px 0 0;
  border: 1px solid rgba(170, 207, 235, .22);
  border-radius: 14px;
  background: rgba(7, 16, 26, .72);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.service-modal-close:hover,
.service-modal-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.service-modal-hero {
  position: relative;
  min-height: 280px;
  margin-top: -58px;
  overflow: hidden;
}

.service-modal-hero img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}

.service-modal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 13, 22, .12) 0%, rgba(5, 13, 22, .28) 38%, rgba(6, 16, 26, .92) 100%);
}

.service-modal-hero-copy {
  position: absolute;
  right: 36px;
  bottom: 28px;
  left: 36px;
  z-index: 1;
}

.service-modal-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: #9af5f1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.service-modal-hero-copy h2 {
  max-width: 820px;
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.03em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.service-modal-hero-copy p {
  max-width: 760px;
  margin: 0;
  color: #d7e4f0;
  font-size: 17px;
  line-height: 1.65;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .55);
}

.service-modal-body {
  display: grid;
  gap: 34px;
  padding: 8px 36px 36px;
}

.service-modal-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .75fr);
  gap: 28px;
  align-items: center;
}

.service-modal-section:nth-child(even) {
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.15fr);
}

.service-modal-section:nth-child(even) .service-modal-copy {
  order: 2;
}

.service-modal-section.no-image {
  grid-template-columns: 1fr;
}

.service-modal-section h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.service-modal-section p,
.service-modal-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.75;
}

.service-modal-copy p:last-child {
  margin-bottom: 0;
}

.service-modal-figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0a1624;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.service-modal-figure img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.service-modal-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.service-modal-list {
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .03);
}

.service-modal-list h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.service-modal-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-modal-list li {
  position: relative;
  padding: 8px 0 8px 26px;
  color: var(--muted);
  line-height: 1.55;
}

.service-modal-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}

.service-modal-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.service-modal-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0a1624;
}

.service-modal-gallery img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.service-modal-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(82, 224, 234, .28);
  border-radius: 20px;
  background: radial-gradient(circle at 8% 0%, rgba(82, 224, 234, .16), transparent 42%), rgba(255, 255, 255, .03);
}

.service-modal-cta h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.service-modal-cta p {
  margin: 0;
  color: var(--muted);
}

.service-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 820px) {
  .service-modal {
    max-height: 100dvh;
    border-radius: 20px;
  }

  .service-modal-hero img {
    height: 250px;
  }

  .service-modal-hero-copy,
  .service-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .service-modal-hero-copy {
    right: 20px;
    bottom: 20px;
    left: 20px;
  }

  .service-modal-section,
  .service-modal-section:nth-child(even),
  .service-modal-lists,
  .service-modal-gallery {
    grid-template-columns: 1fr;
  }

  .service-modal-section:nth-child(even) .service-modal-copy {
    order: 0;
  }

  .service-modal-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .service-modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .service-modal-backdrop {
    padding: 0;
  }

  .service-modal {
    width: 100%;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .service-card[data-service] .service-more {
    margin-left: 26px;
    margin-right: 26px;
  }
}
