/* ============================================================
   TURTLE PYRAMIDING – professional muted indigo palette
   Clean, serious, corporate fintech dark mode – wider graph
============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  color: #f3f4f6;
  background: #0b132b;
}

/* Hero */
.detail-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 9rem;
  background: #0f172a;
  overflow: hidden;
}

.hero-bg-grain {
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.05"/></svg>');
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
}

.detail-hero h1 {
  font-size: clamp(3.2rem, 8vw, 5.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #4f46e5;
  margin-bottom: 1.4rem;
  text-shadow: 0 2px 12px rgba(79,70,229,0.12);
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: #818cf8;
  opacity: 0.94;
  max-width: 800px;
  margin: 0 auto;
  font-weight: 400;
}

/* Main Content */
.detail-content {
  padding: 6rem 2rem 10rem;
  max-width: 1320px;
  margin: 0 auto;
}

/* Formula Section – prominent rule boxes with completely different color */
.formula-section {
  margin-bottom: 7rem;
}

.formula-section h2 {
  font-size: 2.4rem;
  text-align: center;
  color: #818cf8;
  margin-bottom: 2rem;
}

.main-formula {
  background: rgba(79,70,229,0.05);
  border: 1px solid rgba(79,70,229,0.20);
  border-radius: 1.4rem;
  padding: 2.5rem;
  box-shadow: 0 6px 24px rgba(79,70,229,0.08);
}

.formula-main {
  font-size: 1.9rem;
  font-weight: 700;
  color: #818cf8;
  text-align: center;
  margin-bottom: 1.8rem;
  padding: 1.2rem;
  background: rgba(79,70,229,0.08);
  border-radius: 1rem;
}

.formula-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

/* Completely different color for rule boxes – muted charcoal + bronze */
.formula-breakdown {
  background: rgba(31,41,55,0.75);           /* dark charcoal base */
  border: 1px solid rgba(146,64,14,0.30);    /* muted bronze border */
  border-radius: 1rem;
  padding: 1.2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.formula-breakdown:hover,
.formula-breakdown:focus-within {
  background: rgba(31,41,55,0.90);
  border-color: #c2410c;                      /* stronger bronze on interaction */
  box-shadow: 0 4px 16px rgba(146,64,14,0.15);
}

.formula-breakdown .label {
  font-size: 0.95rem;
  color: #cbd5e1;
  display: block;
  margin-bottom: 0.6rem;
}

.formula-breakdown .value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #c2410c;                             /* bronze for values */
}

.formula-note {
  text-align: center;
  font-size: 1.05rem;
  color: #9ca3af;
  margin-top: 1.8rem;
  font-style: italic;
}

/* Example Section */
.example-section h2 {
  font-size: 2.4rem;
  text-align: center;
  color: #818cf8;
  margin-bottom: 2rem;
}

.example-intro {
  font-size: 1.25rem;
  text-align: center;
  color: #f3f4f6;
  max-width: 900px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

.scenario-flow {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.scenario-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #4f46e5;
  color: #f3f4f6;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(79,70,229,0.22);
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-size: 1.5rem;
  color: #818cf8;
  margin-bottom: 0.8rem;
}

.step-content p {
  font-size: 1.1rem;
  color: #d1d5db;
  line-height: 1.6;
}

/* Visual – Wider Pyramid SVG */
.visual-section h2 {
  font-size: 2.4rem;
  text-align: center;
  color: #818cf8;
  margin-bottom: 2rem;
}

.chart-wrapper {
  width: 100%;
  max-width: 1100px;
  height: auto;
  aspect-ratio: 9 / 4;
  margin: 0 auto 2.5rem;
  background: #0f172a;
  border-radius: 1.4rem;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.pyramid-chart {
  width: 100%;
  height: 100%;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Takeaway */
.chart-takeaway {
  text-align: center;
  font-size: 1.1rem;
  font-style: italic;
  color: #4338ca;
  background: rgba(79,70,229,0.07);
  border: 1px solid rgba(79,70,229,0.22);
  border-radius: 1rem;
  padding: 1.4rem 2rem;
  box-shadow: 0 4px 16px rgba(79,70,229,0.12);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 4rem auto;
}

/* Extra Info */
.extra-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-bottom: 7rem;
}

.info-item {
  background: rgba(30,41,59,0.75);
  border: 1px solid rgba(79,70,229,0.16);
  border-radius: 1.4rem;
  padding: 2.2rem;
  text-align: center;
  transition: all 0.45s ease;
}

.info-item:hover {
  transform: translateY(-6px);
  border-color: rgba(79,70,229,0.35);
}

.info-item i {
  font-size: 2.4rem;
  color: #4f46e5;
  margin-bottom: 1.2rem;
}

.info-item h4 {
  font-size: 1.45rem;
  color: #818cf8;
  margin-bottom: 0.9rem;
}

/* Back Link */
.back-link {
  text-align: center;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 2.5rem;
  background: rgba(79,70,229,0.14);
  border: 1px solid rgba(79,70,229,0.30);
  border-radius: 1.1rem;
  color: #818cf8;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.45s ease;
}

.btn-back:hover {
  background: rgba(79,70,229,0.22);
  transform: translateY(-3px);
  border-color: #4f46e5;
  box-shadow: 0 6px 20px rgba(79,70,229,0.20);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(35px);
  animation: fadeInUp 1s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .formula-details {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
  }
  .chart-wrapper {
    max-width: 950px;
  }
}

@media (max-width: 900px) {
  .detail-hero { padding: 6rem 1.5rem 8rem; }
  .detail-content { padding: 5rem 1.5rem 8rem; }
  .main-formula { padding: 2rem; }
  .chart-wrapper { aspect-ratio: 4 / 3; max-height: 380px; }
  .chart-takeaway { font-size: 1rem; padding: 1.2rem 1.6rem; margin-bottom: 3rem; }
}

@media (max-width: 640px) {
  .formula-details { grid-template-columns: 1fr 1fr; }
  .scenario-step { flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
  .step-number { margin-bottom: 0.5rem; }
}

.takeaway-main {
  font-size: 1.2rem;
  font-weight: 700;
  color: #4338ca;
  text-align: center;
  margin-bottom: 1.8rem;
  padding: 1.2rem;
  background: rgba(79,70,229,0.09);
  border-radius: 1rem;
}