:root {
  --bg: #0f1720;
  --card: #0b1220;
  --muted: #9aa6b2;
  --accent: #7dd3fc;
  --glass: rgba(255, 255, 255, 0.03);
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  color: #e6eef6;
  background: linear-gradient(180deg, var(--bg), #07101a);
  -webkit-font-smoothing: antialiased;
  padding-top: 140px;
}

.card {
  max-width: 900px;
  margin: 40px auto;
  padding: 28px;
  background: linear-gradient(180deg, var(--card), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.03)
}

.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 12px
}

.media {
  display: flex;
  justify-content: center;
  margin-bottom: 18px
}

.media img {
  max-width: 360px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04)
}

.name {
  margin: 0 0 8px 0;
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: -0.02em
}

.desc {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px
}

.math-list h4 a {
  color: var(--accent);
  text-decoration: none;
}

.math-list h4 a:hover {
  text-decoration: underline;
}

.sources {
  color: var(--muted)
}

.sources a {
  color: var(--accent);
  text-decoration: none
}

.card audio {
  width: 100%;
  margin: 14px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px
}

/* Index grid */
.index-header {
  text-align: center;
  margin: 36px 0 0 0;
  color: var(--muted)
}

.index-header h1 {
  color: var(--accent);
  margin: .2rem 0
}

.grid {
  list-style: none;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 12px auto
}

.grid li {
  background: var(--glass);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  text-align: center
}

.grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px
}

.grid a {
  color: inherit;
  text-decoration: none
}

.grid span {
  display: block;
  color: var(--muted);
  font-weight: 600
}

@media (max-width:540px) {
  .card {
    margin: 18px;
    padding: 18px
  }

  .name {
    font-size: 1.5rem
  }

  .media img {
    max-width: 240px
  }
}