The structure is where it needs to be. The philosophy, the scheme, the teaching.

Apparently the problem is in the execution — which has been, in a word, ugly.

For the better part of 6 seasons.

“You’ve got to feel like you have the right people in the building,” USC coach Lincoln Riley said during Media Day. “I fully believe we have that.”

Meanwhile, we give you USC defensive coordinator Alex Grinch, whose unit finished 93rd in the nation in scoring defense in 2022 — giving up 29.2 points per game in the lone blemish of Riley’s remarkable 1 season turnaround.

“I think you’re coaching for your job all the time,” Grinch said last month during USC’s Media Day.

Let’s not sugarcoat it: If the USC defense can’t get off the field more times than not and the scoring defense doesn’t drastically change in 2023, the Trojans aren’t winning the suddenly strong Pac-12 — and aren’t advancing to the Playoff.

And Grinch will most certainly be the fall guy.

At some point, the ugly overshadows the pretty. Heisman Trophies and big numbers on offense will only take you so far.

The reality is, when Riley left Oklahoma after the 2021 season for USC, he had earned the reputation of a coach whose focus was offense — and he just needed the ball last to make it all work.

Was that fair? Of course not.

But when your defenses consistently rank among the lower tier in the nation — not the Big 12 or Pac-12, but the nation — those criticisms stick a lot easier.

When you score 48 points in the 2017 Playoff semifinal and lose.

When you give up 49 points in the 1st half of the 2019 Playoff semifinal loss.

When your defense is 106th in the nation in total defense in 2022, and gives up more than 500 yards 5 times. When your defense gives up 93 points in 2 losses to finish the season — 47 to Utah in the Pac-12 Championship Game and 46 to Tulane in the Cotton Bowl.

When you’re 109th in the nation in 3rd-down defense (43% of attempts converted), and you give up 75 plays of 20+ yards. When your defenses, since 2017, have given up at least 40 points 15 times.

When, since your 1st season at Oklahoma in 2017, the defense has ranked 68th, 101st, 64th, 24th in the COVID season, 58th and 93rd in the nation scoring — never giving up less than 25.8 ppg. in every season but the outlier pandemic season (21.7).

That’s not how you win a national championship.

For all the good Riley has accomplished on offense at Oklahoma and USC — the All-American players, the 3 Heisman Trophy winners and 2 runners-up, the 2 No. 1 overall NFL Draft selections (and 1 on the way) — he won’t win big at USC until he figures out how to play solid defense.

Not exceptional defense, or even among the top 10 in the nation. Just a top-25 defense that gives up somewhere in the low 20s points per game, and gets off the field on 3rd down in the high 60s percent of the time.

USC won big under Pete Carroll because it consistently recruited top-100 defensive players. In Riley’s 2 recruiting classes at USC, he has signed 3 defensive players ranked in the top 100: CB Domani Jackson, S Zion Branch and edge Braylan Shelby — and none of the 3 is a projected starter in 2023.

Riley has instead reloaded through the transfer portal, landing elite Pac-12 cornerback Christian Roland-Wallace (Arizona) and 5 more impact starters. Among the group: former 5-star recruits DE Anthony Lucas (Texas A&M) and DT Bear Alexander (Georgia).

He did the same thing in 2022, signing 12 defensive players from the portal. That group was mostly hit and miss, and only 2 starters remain.

It can’t be that way this time around. The Trojans will again have the best offense in college football. They’ll go up and down the field at will, like all of Riley’s offenses — and are a Playoff favorite.

But if quarterback Caleb Williams doesn’t win the Heisman, if he doesn’t become only the 2nd player in college football history to win the award in back-to-back seasons, it won’t be because of a lack of production.

It will be because the USC defense — and this should have nothing to do with voting on the award, but it will — struggled again and dragged down a potential Playoff season.

In the era of quarterback is everything and pass offense rules all, no one coaches offense like Riley. He has an answer for every defense — and but for Williams injuring his hamstring early in last year’s Pac-12 Championship, the Trojans could have outscored Utah and advanced to the Playoff.

But maybe that loss is the best thing that could’ve happened to USC. Utah scored 43 and 47 points in its 2 wins over the Trojans last season. USC is a year from moving to the Big Ten, where defenses are drastically better and the defensive line is everything.

You can’t hope to win championships in the Big Ten when your defense relies on turnovers to give the offense more possessions. USC forced 28 turnovers in 2022, 6th-best in the nation, and that big number won’t consistently happen.

It must start on the line of scrimmage, where it’s dirty and nasty and nothing like the pretty poetry that plays out at the skill positions.

When USC had it rolling under Carroll, it was more than the flash and dash of Reggie Bush and all of those elite skill players and Heisman Trophies. The Trojans had 13 defensive players selected in the first 2 rounds of the NFL Draft, and 7 of them were defensive linemen or edge players (5 were 1st-round picks).

There’s not a player on this roster who looks like a Day 1 pick. Alexander and Lucas have the size and athleticism, but they’re young and must be developed.

Riley believes he has the right plan in place. The right coach, the right system.

The ugly must change. Or all of that pretty on offense eventually becomes a sideshow.