/* Interactive card hover — shared across the site.
   Image cards (.product-panel): tilt, glare, border light, HUD brackets, scan line.
   Text cards (.metric-card, .principle-card, .why-card, .pd-info): light lift, glare and border light.
   Kept cheap: only transform/opacity animate, and nothing loops unless the card is hovered.
   Layers (.dp-*) are added by cards.js. */
@property --dp-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.product-panel, .metric-card, .principle-card, .why-card, .pd-info {
  --dp-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  --dp-orange: var(--accent-orange, #FF5A00);
  position: relative;
  overflow: hidden;
  transition: transform .6s var(--dp-ease), translate .8s var(--dp-ease), opacity .4s ease,
              border-color .3s ease, box-shadow .4s ease;
}

.product-panel:hover {
  transform: translateY(-8px);
  transition: transform .15s ease-out, translate .8s var(--dp-ease), opacity .4s ease,
              border-color .3s ease, box-shadow .4s ease;
  border-color: rgba(255, 90, 0, 0.55);
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.85), 0 0 40px -12px rgba(255, 90, 0, 0.45);
}
.metric-card:hover, .principle-card:hover, .why-card:hover, .pd-info:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 90, 0, 0.5);
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.8), 0 0 30px -14px rgba(255, 90, 0, 0.4);
}
.pd-info:hover { border-color: rgba(255, 90, 0, 0.5) !important; }

/* Dim the other image cards in the same row (class toggled by cards.js) */
.dp-dim > .product-panel:not(:hover) { opacity: 0.6; }

/* Scroll-in reveal (cards are only hidden once cards.js is running) */
html.dp-ready .dp-card:not(.dp-in) { opacity: 0; translate: 0 40px; }

/* Light running around the border — animates only while hovered */
.product-panel::after, .metric-card::after, .principle-card::after, .why-card::after, .pd-info::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--dp-angle), transparent 0 68%, rgba(255, 90, 0, 0.9) 84%, #FFC08A 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: 6;
}
.product-panel:hover::after, .metric-card:hover::after, .principle-card:hover::after, .why-card:hover::after, .pd-info:hover::after {
  opacity: 1;
  animation: dp-border-spin 3.2s linear infinite;
}
@keyframes dp-border-spin { to { --dp-angle: 360deg; } }

/* Image zoom (the pointer parallax offset is applied inline by cards.js) */
.product-panel .product-media {
  transform: scale(1.04);
  transition: transform .8s var(--dp-ease), opacity .4s ease;
}
.product-panel:hover .product-media {
  transform: scale(1.12);
  transition: transform .3s ease-out, opacity .4s ease;
  opacity: 1;
}
.product-panel .product-gradient-overlay { transition: opacity .4s ease; }
.product-panel:hover .product-gradient-overlay { opacity: .8; }

/* Injected decoration layers */
.dp-glare, .dp-scan, .dp-corners, .dp-num { position: absolute; pointer-events: none; }

.dp-glare {
  inset: 0;
  z-index: 3;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 130, 50, 0.16), transparent 45%);
  transition: opacity .3s ease;
}
.metric-card .dp-glare, .principle-card .dp-glare, .why-card .dp-glare, .pd-info .dp-glare {
  z-index: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 110, 30, 0.12), transparent 55%);
}
:hover > .dp-glare { opacity: 1; }

.dp-scan {
  left: 0; right: 0; top: 0;
  height: 40%;
  z-index: 2;
  opacity: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 90, 0, 0.07) 85%, rgba(255, 140, 60, 0.5) 100%);
  transform: translateY(-100%);
}
.product-panel:hover > .dp-scan { opacity: 1; animation: dp-scan 2.6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes dp-scan { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

/* HUD targeting brackets (image cards) */
.dp-corners {
  inset: 14px;
  z-index: 4;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .3s ease, transform .45s var(--dp-ease);
  --c: rgba(255, 90, 0, 0.95); --l: 20px; --t: 2px;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) left top / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) right top / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) right top / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) left bottom / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) right bottom / var(--t) var(--l);
  background-repeat: no-repeat;
}
.product-panel:hover > .dp-corners { opacity: 1; transform: scale(1); }

/* Large outlined number (image cards) */
.dp-num {
  right: 26px;
  bottom: 70px;
  z-index: 2;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 6.5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  transform: translateY(14px);
  transition: transform .5s var(--dp-ease), -webkit-text-stroke-color .35s ease;
}
.product-panel:hover .dp-num { -webkit-text-stroke-color: rgba(255, 90, 0, 0.55); transform: none; }

/* Text & CTA (image cards) */
.product-panel .product-card-body { z-index: 5; }
.product-card-body > div:not(.product-top-meta) { transition: transform .45s var(--dp-ease); }
.product-panel:hover .product-card-body > div:not(.product-top-meta) { transform: translateY(-6px); }

.product-panel .product-name::after {
  content: '';
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--dp-orange), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--dp-ease);
}
.product-panel:hover .product-name::after { transform: scaleX(1); }

.product-panel .product-one-liner { transition: color .3s ease; }
.product-panel:hover .product-one-liner { color: #E6ECF5; }

.product-panel .product-category-tag { transition: background .3s ease, color .3s ease; }
.product-panel:hover .product-category-tag { background: rgba(255, 90, 0, 0.25); color: #FFFFFF; }

.product-panel .product-cta-btn {
  align-self: flex-start;
  padding: 9px 0;
  border-radius: var(--radius-full, 999px);
  transition: background .3s ease, color .3s ease, padding .3s var(--dp-ease);
}
.product-panel:hover .product-cta-btn {
  padding: 9px 18px;
  background: var(--dp-orange);
  color: #0B0F14;
}
.dp-arrow { display: inline-block; transition: transform .35s var(--dp-ease); }
.product-panel:hover .dp-arrow { transform: translateX(5px); }

/* Text cards: keep content above the glare */
.metric-card > *:not(.dp-glare),
.principle-card > *:not(.dp-glare),
.why-card > *:not(.dp-glare),
.pd-info > *:not(.dp-glare) { position: relative; z-index: 1; }
.metric-card .metric-number { transition: color .3s ease; }

@media (prefers-reduced-motion: reduce) {
  .product-panel, .metric-card, .principle-card, .why-card, .pd-info { transform: none !important; }
  .product-panel::after, .metric-card::after, .principle-card::after, .why-card::after, .pd-info::after, .dp-scan { display: none; }
}

/* ---------- Feature cards (icon + number + title + text) ---------- */
.feat-card, .flow-step {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 60%), var(--bg-card, #11161D);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-xl, 18px);
}
.feat-card { padding: 26px 26px 28px; }
.feat-card::before, .flow-step::before {      /* accent bar that grows along the top on hover */
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, var(--dp-orange), rgba(255, 90, 0, 0));
  transform: scaleX(.12);
  transform-origin: left;
  transition: transform .6s var(--dp-ease);
}
.feat-card:hover::before, .flow-step:hover::before { transform: scaleX(1); }
.feat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.feat-icon, .flow-icon {
  display: grid;
  place-items: center;
  color: var(--dp-orange);
  background: rgba(255, 90, 0, 0.08);
  border: 1px solid rgba(255, 90, 0, 0.25);
  transition: transform .45s var(--dp-ease), background .3s ease, color .3s ease;
}
.feat-icon { width: 48px; height: 48px; border-radius: 14px; }
.feat-icon svg { width: 24px; height: 24px; }
.feat-card:hover .feat-icon, .flow-step:hover .flow-icon { background: var(--dp-orange); color: #0B0F14; transform: rotate(-6deg) scale(1.06); }
.feat-num {
  font-family: var(--font-mono, monospace);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
  transition: -webkit-text-stroke-color .3s ease;
}
.feat-card:hover .feat-num { -webkit-text-stroke-color: rgba(255, 90, 0, 0.75); }
.feat-title { font-family: var(--font-display, sans-serif); font-size: 1.12rem; line-height: 1.3; color: var(--text-primary, #F5F5F2); margin: 0 0 8px; }
.feat-text { font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary, #8A94A6); margin: 0; transition: color .3s ease; }
.feat-card:hover .feat-text, .flow-step:hover p { color: #D5DDE8; }

/* ---------- Step flow ("How we deliver / procure") ---------- */
.flow {
  --gap: 20px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 26px;
}
.flow-line {
  position: absolute;
  z-index: 2;                          /* above the step boxes, below the number nodes */
  top: 26px;
  left: 44px;
  right: calc((100% - (var(--steps, 5) - 1) * var(--gap)) / var(--steps, 5) - 44px);
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}
.flow-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--dp-orange), #FFB37A);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--dp-ease) .2s;
}
.flow.is-in .flow-line span { transform: scaleX(1); }
.flow-step { padding: 38px 22px 24px; overflow: visible; }
.flow-node {
  position: absolute !important;
  top: -20px; left: 24px;
  z-index: 3 !important;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dp-orange);
  background: #0E141B;
  border: 1px solid rgba(255, 90, 0, 0.45);
  box-shadow: 0 0 0 5px var(--bg-base, #0A0D12);
  transition: background .3s ease, color .3s ease, transform .4s var(--dp-ease);
}
.flow-step:hover .flow-node { background: var(--dp-orange); color: #0B0F14; transform: scale(1.1); }
.flow-icon { position: absolute !important; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 11px; }
.flow-icon svg { width: 19px; height: 19px; }
.flow-step h4 { font-family: var(--font-display, sans-serif); font-size: 1.02rem; line-height: 1.3; color: var(--text-primary, #F5F5F2); margin: 10px 46px 8px 0; }
.flow-step p { font-size: 0.84rem; line-height: 1.6; color: var(--text-secondary, #8A94A6); margin: 0; transition: color .3s ease; }

/* Narrower screens: the flow runs vertically */
@media (max-width: 1100px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 0 0 34px; }
  .flow-line { top: 22px; bottom: 22px; left: 19px; right: auto; width: 2px; height: auto; }
  .flow-line span { transform: scaleY(0); transform-origin: top; }
  .flow.is-in .flow-line span { transform: scaleY(1); }
  .flow-step { padding: 22px 22px 22px 34px; }
  .flow-node { top: 18px; left: -35px; }
  .flow-step h4 { margin-top: 0; }
}
