.detail-page {
  min-height: calc(100vh - 74px);
  background: var(--surface);
}

.detail-hero {
  color: #ffffff;
  background-image: linear-gradient(90deg, rgba(20, 33, 38, 0.9), rgba(20, 33, 38, 0.42)), var(--detail-image);
  background-position: center;
  background-size: cover;
}

.detail-hero-inner {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0;
}

.detail-back {
  width: fit-content;
  margin-bottom: 28px;
  padding: 9px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-weight: 900;
}

.detail-hero h1 {
  max-width: 820px;
  margin: 10px 0 16px;
  font-size: 3.6rem;
  line-height: 1.02;
}

.detail-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.08rem;
}

.detail-tags span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.detail-body {
  padding: 72px 0;
}

.detail-gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 12px;
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  background: var(--line);
  border-radius: var(--radius);
}

.detail-gallery img:first-child {
  grid-row: span 2;
  min-height: 492px;
}

.detail-system-head {
  margin-top: 42px;
}

.detail-system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.detail-system-card {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  margin: 0;
  color: #ffffff;
  background: var(--panel-dark);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(20, 33, 38, 0.13);
}

.detail-system-card img {
  width: 100%;
  height: 100%;
  min-height: 270px;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 420ms ease, opacity 220ms ease, filter 220ms ease;
}

.detail-system-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(12, 22, 27, 0.04), rgba(12, 22, 27, 0.82));
  pointer-events: none;
}

.detail-system-card figcaption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.24;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.detail-system-card:hover img {
  filter: saturate(1.12);
  opacity: 1;
  transform: scale(1.04);
}

.detail-cta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 26px;
  color: #ffffff;
  background: var(--panel-dark);
  border-radius: var(--radius);
}

.detail-cta h2 {
  margin: 0 0 8px;
}

.detail-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 900px) {
  .detail-hero h1 {
    font-size: 2.6rem;
  }

  .detail-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .detail-gallery img:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 320px;
  }

  .detail-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .detail-hero-inner {
    min-height: 360px;
    padding: 54px 0;
  }

  .detail-hero h1 {
    margin: 8px 0 12px;
    font-size: clamp(1.86rem, 9.2vw, 2.24rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .detail-hero p {
    font-size: 0.96rem;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }

  .detail-gallery img,
  .detail-gallery img:first-child {
    min-height: 220px;
  }

  .detail-system-grid {
    grid-template-columns: 1fr;
  }

  .detail-system-card,
  .detail-system-card img {
    min-height: 220px;
  }

  .detail-body {
    padding: 48px 0;
  }

  .detail-cta {
    gap: 14px;
    padding: 18px;
  }

  .detail-cta h2 {
    font-size: 1.22rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .detail-cta p {
    font-size: 0.94rem;
  }
}

.detail-hero {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(96deg, rgba(11, 17, 19, 0.94), rgba(8, 88, 82, 0.58), rgba(52, 95, 116, 0.32)),
    var(--detail-image);
}

.detail-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  opacity: 0.42;
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
}

.detail-back {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.detail-back:hover,
.detail-back:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.detail-gallery img {
  box-shadow: 0 14px 32px rgba(20, 33, 38, 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.detail-gallery img:hover {
  filter: saturate(1.12);
  box-shadow: var(--shadow-strong);
  transform: translateY(-5px);
}

.detail-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--panel-dark), var(--panel-teal));
  box-shadow: var(--shadow-strong);
}

.detail-cta::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.detail-cta:hover::before {
  transform: translateX(120%);
}
