/* ==========================================================================
   PHASE 4 — Unique mid-page section identities
   ========================================================================== */

:root {
  --p4-ink: #0B1220;
  --p4-muted: #64748B;
  --p4-line: rgba(15, 23, 42, 0.1);
  --p4-glass: rgba(8, 17, 32, 0.55);
  --p4-accent: #1D4ED8;
  --p4-radius: 20px;
}

/* --- Full-bleed media band --- */
.p4-media-band {
  position: relative;
  min-height: clamp(280px, 42vh, 420px);
  overflow: hidden;
  background: var(--bg-dark-deep, #132238);
}

.p4-media-band img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  opacity: 0.88;
}

.p4-media-band-caption {
  color: #E2E8F0;
}

.p4-media-band-caption h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

/* --- Horizontal process rail --- */
.p4-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}

.p4-rail::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p4-line), transparent);
}

.p4-rail-step {
  text-align: center;
  padding: 0 0.75rem 1rem;
  position: relative;
}

.p4-rail-num {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(145deg, #1E3A8A, #0F172A);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 1;
}

.p4-rail-step h4 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.p4-rail-step p {
  font-size: 0.9rem;
  color: var(--p4-muted);
  margin: 0;
}

/* --- Vertical timeline --- */
.p4-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.p4-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: linear-gradient(180deg, var(--p4-accent), rgba(29, 78, 216, 0.1));
}

.p4-timeline-item {
  position: relative;
  padding: 0 0 2rem 1.25rem;
}

.p4-timeline-item:last-child {
  padding-bottom: 0;
}

.p4-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--p4-accent);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.p4-timeline-item .year {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p4-accent);
  margin-bottom: 0.35rem;
}

.p4-timeline-item h4 {
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.p4-timeline-item p {
  margin: 0;
  color: var(--p4-muted);
}

/* --- Comparison table --- */
.p4-compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--p4-radius);
  border: 1px solid var(--p4-line);
  background: #fff;
}

.p4-compare th,
.p4-compare td {
  padding: 1rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--p4-line);
  vertical-align: top;
}

.p4-compare thead th {
  background: #0B1220;
  color: #F8FAFC;
  font-weight: 650;
  font-size: 0.92rem;
}

.p4-compare tbody tr:last-child td {
  border-bottom: 0;
}

.p4-compare td:first-child {
  font-weight: 650;
  color: var(--p4-ink);
  width: 28%;
}

.p4-compare .ok {
  color: #047857;
}

/* --- Glass stats strip --- */
.p4-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.p4-stat-pill {
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.p4-stat-pill strong {
  display: block;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.p4-stat-pill span {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.78);
}

.p4-stat-strip--light .p4-stat-pill {
  background: #fff;
  border-color: var(--p4-line);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.p4-stat-strip--light .p4-stat-pill strong {
  color: var(--p4-ink);
}

.p4-stat-strip--light .p4-stat-pill span {
  color: var(--p4-muted);
}

/* --- Architecture / ecosystem diagram --- */
.p4-arch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.p4-arch-node {
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--p4-line);
  background: linear-gradient(180deg, #fff, #F8FAFC);
  text-align: center;
}

.p4-arch-node i {
  font-size: 1.35rem;
  color: var(--p4-accent);
  margin-bottom: 0.65rem;
}

.p4-arch-node h4 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.p4-arch-node p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--p4-muted);
}

.p4-arch-node--core {
  background: linear-gradient(145deg, #0B1220, #1E293B);
  border-color: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
}

.p4-arch-node--core h4 {
  color: #fff;
}

.p4-arch-node--core p {
  color: rgba(226, 232, 240, 0.72);
}

.p4-arch-node--core i {
  color: #93C5FD;
}

/* --- Masonry cards --- */
.p4-masonry {
  columns: 3;
  column-gap: 1.15rem;
}

.p4-masonry-card {
  break-inside: avoid;
  margin-bottom: 1.15rem;
  padding: 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--p4-line);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.p4-masonry-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.p4-masonry-card p {
  margin: 0;
  color: var(--p4-muted);
  font-size: 0.92rem;
}

.p4-masonry-card--tall {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.p4-masonry-card--accent {
  background: #0B1220;
  border-color: transparent;
  color: #E2E8F0;
}

.p4-masonry-card--accent h4 {
  color: #fff;
}

.p4-masonry-card--accent p {
  color: rgba(226, 232, 240, 0.72);
}

/* --- Image above text (Layout A) --- */
.p4-stack-block .p4-stack-media {
  border-radius: var(--p4-radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
  border: 1px solid var(--p4-line);
}

.p4-stack-block .p4-stack-media img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
}

/* --- Overlapping cards --- */
.p4-overlap {
  position: relative;
  min-height: 360px;
}

.p4-overlap-img {
  width: 72%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--p4-line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
}

.p4-overlap-img img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.p4-overlap-card {
  position: absolute;
  right: 0;
  bottom: 8%;
  width: min(340px, 48%);
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(8, 17, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  color: #E2E8F0;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.p4-overlap-card h4 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.p4-overlap-card p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(226, 232, 240, 0.78);
}

/* --- Quote band enhancement --- */
.quote-band cite {
  display: block;
  font-style: normal;
  font-size: 0.88rem;
  color: rgba(226, 232, 240, 0.65);
}

.quote-band--light {
  background: linear-gradient(135deg, #F8FAFC, #EEF2FF);
  color: var(--p4-ink);
  border: 1px solid var(--p4-line);
}

.quote-band--light blockquote {
  color: var(--p4-ink);
}

.quote-band--light cite {
  color: var(--p4-muted);
}

/* --- Workflow chips --- */
.p4-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.p4-flow-node {
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: #0B1220;
  color: #fff;
  font-weight: 650;
  font-size: 0.88rem;
}

.p4-flow-arrow {
  color: var(--p4-muted);
  font-size: 0.85rem;
}

/* --- Case story cards --- */
.p4-case-story {
  border-radius: var(--p4-radius);
  overflow: hidden;
  border: 1px solid var(--p4-line);
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.p4-case-story-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.p4-case-story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p4-case-story-body {
  padding: 1.5rem 1.6rem 1.75rem;
  flex: 1;
}

.p4-case-story-body .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p4-accent);
  margin-bottom: 0.5rem;
}

/* --- Dark SOC tint section --- */
.p4-soc-band {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.22), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(14, 165, 233, 0.12), transparent 45%),
    var(--bg-dark-deep, #132238);
  color: #E2E8F0;
}

.p4-soc-band .section-title {
  color: #fff;
}

/* --- Contact HQ strip --- */
.p4-hq-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: stretch;
}

.p4-hq-strip img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.p4-hq-panel {
  padding: 1.5rem;
  border-radius: 16px;
  background: #0B1220;
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.p4-hq-panel h4 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.p4-hq-panel p {
  margin: 0;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.92rem;
}

@media (max-width: 991px) {
  .p4-rail {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 0.5rem;
  }

  .p4-rail::before {
    display: none;
  }

  .p4-stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .p4-arch {
    grid-template-columns: 1fr;
  }

  .p4-masonry {
    columns: 2;
  }

  .p4-overlap-card {
    position: relative;
    width: 100%;
    bottom: auto;
    margin-top: -2.5rem;
  }

  .p4-overlap-img {
    width: 100%;
  }

  .p4-hq-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .p4-rail {
    grid-template-columns: 1fr;
  }

  .p4-stat-strip {
    grid-template-columns: 1fr;
  }

  .p4-masonry {
    columns: 1;
  }
}
