.math-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.math-hero {
  background: linear-gradient(135deg, #fff7fa, #ffffff);
  border: 1px solid #f2c9d1;
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 28px;
}

.math-eyebrow {
  margin: 0 0 10px;
  color: #c12d4c;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.math-hero h1 {
  margin: 0 0 12px;
  color: #1f2937;
  font-size: 38px;
}

.math-intro,
.math-card p,
.math-content-card p {
  color: #4b5563;
  line-height: 1.7;
  font-size: 16px;
}

.math-grid,
.math-link-grid {
  display: grid;
  gap: 16px;
}

.math-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 30px;
}

.math-link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.math-card,
.math-content-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.math-card {
  display: block;
  padding: 24px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.math-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
  border-color: #f0a8b6;
}

.math-card-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d9485f 0%, #ff6b81 100%);
  color: #ffffff;
  font-size: 1.25rem;
}

.math-card h2,
.math-content-card h2 {
  color: #111827;
  margin-bottom: 12px;
}

.math-content-card {
  padding: 28px;
  margin-top: 24px;
}

.math-content-card a,
.math-card h2 {
  overflow-wrap: anywhere;
}

.math-content-card a,
.math-link-grid a {
  color: #c12d4c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.math-link-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff4f6;
  border: 1px solid #f8c8d2;
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.math-link-grid a i {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  color: #d9485f;
}

.math-link-grid a:hover {
  transform: translateY(-3px);
  background: #d9485f;
  border-color: #d9485f;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(217, 72, 95, 0.22);
}

.math-link-grid a:hover i {
  color: #d9485f;
}

@media (max-width: 900px) {
  .math-grid,
  .math-link-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .math-shell {
    padding: 24px 16px 40px;
  }

  .math-hero,
  .math-content-card {
    padding: 22px;
  }

  .math-grid,
  .math-link-grid {
    grid-template-columns: 1fr;
  }

  .math-hero h1 {
    font-size: 30px;
  }
}
