/* =============================================================
   FORMULA.CSS — "The Brace Life Formula" section
============================================================= */

#formula {
  position: relative;
  min-height: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--section-pad-v) var(--section-pad-h);
  overflow: visible;
}

.formula-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.5s ease;
  opacity: 0;
}

.formula-bg--default     { background-image: url('../images/formula 1.jpg'); opacity: 1; }
.formula-bg--restoration { background-image: url('../images/formula 2.jpg'); opacity: 0; }
.formula-bg--connection  { background-image: url('../images/LPYeTCXA.jpg');  opacity: 0; }
.formula-bg--resilience  { background-image: url('../images/formula 4.jpg'); opacity: 0; }

.formula-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.formula-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 1040px;
}

.formula-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 56px;
}

.formula-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 0;
}

.formula-op {
  color: var(--white);
  font-size: 52px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  padding-top: 80px;
  text-shadow: 0 0 12px rgba(0,0,0,0.4);
}

.formula-card {
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 40px 32px 48px;
  text-align: left;
  cursor: default;
  background: rgba(200, 195, 185, 0.35);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-sizing: border-box;
  /* fixed resting height — tallest card (Connection) sets the size */
  height: 300px;
  overflow: hidden;
  transition: height 0.4s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

.formula-card:hover {
  height: 350px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.formula-card h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--white);
  transition: color 0.3s, border-color 0.3s;
  width: 100%;
}

.formula-card:hover h3 {
  color: var(--dark);
  border-bottom-color: rgba(0, 0, 0, 0.15);
}

.formula-card p {
  font-size: 12px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s;
  margin-top: 20px;
}

.formula-card:hover p { color: var(--mid); }

.formula-stat {
  margin-top: 32px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--dark);
  opacity: 0;
  transition: opacity 0.3s ease 0.15s;
}

.formula-card:hover .formula-stat {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #formula { padding: 60px 24px; }
  .formula-cards { grid-template-columns: 1fr; }
  .formula-card { height: auto; }
  .formula-card:hover { height: auto; }
  .formula-op { padding: 8px 0; font-size: 36px; }
}