/* ================================================================
   M45 AUTOMOTIVE — PERFORMANCE PAGE DARK THEME
   Applied when <body class="page-performance"> is set.
   Overrides main style.css for the performance page aesthetic:
   near-black background, high-contrast typography, aggressive accents.
================================================================ */

/* ---- BASE OVERRIDES ---- */
body.page-performance {
  background: #07101a;
  color: rgba(255,255,255,0.78);
}

/* Keep nav dark even when scrolled */
body.page-performance .nav.is-scrolled {
  background: rgba(7,16,26,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
}

body.page-performance .nav.is-scrolled .nav__link,
body.page-performance .nav.is-scrolled .nav__link--dropdown,
body.page-performance .nav.is-scrolled .nav__phone {
  color: rgba(255,255,255,0.85);
}

body.page-performance .nav.is-scrolled .nav__link--dropdown:hover,
body.page-performance .nav.is-scrolled .nav__link:hover { color: #fff; }

body.page-performance .nav.is-scrolled .nav__toggle span {
  background: rgba(255,255,255,0.9);
}

/* Mega menu stays light (white panel on dark page is correct) */
body.page-performance .nav__dropdown { color: var(--c-text); }

/* ---- TYPOGRAPHY ---- */
body.page-performance h1,
body.page-performance h2,
body.page-performance h3,
body.page-performance h4 { color: #fff; }

body.page-performance p { color: rgba(255,255,255,0.65); }

body.page-performance .eyebrow { color: var(--c-silver); }

/* ---- SECTIONS ---- */
body.page-performance .section {
  background: #07101a;
}

body.page-performance .section--alt {
  background: #0c1724;
}

body.page-performance .section-header p {
  color: rgba(255,255,255,0.55);
}

body.page-performance .section-label::before {
  background: var(--c-red);
}

/* ---- PERFORMANCE HERO ---- */
.perf-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #07101a;
  overflow: hidden;
}

.perf-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
  z-index: 0;
  opacity: 0.45;
}

.perf-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(7,16,26,0.92) 0%,
    rgba(7,16,26,0.65) 50%,
    rgba(26,50,100,0.3) 100%
  );
  z-index: 1;
}

/* Dramatic red-line accent */
.perf-hero__line {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent 0%, var(--c-red) 30%, var(--c-red) 70%, transparent 100%);
  z-index: 3;
  opacity: 0.8;
}

.perf-hero__content {
  position: relative;
  z-index: 2;
  padding-top: 88px;
  padding-bottom: var(--sp-2xl);
}

.perf-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}

.perf-cert {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.625rem;
  border-radius: 2px;
}

.perf-cert__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-red);
  flex-shrink: 0;
}

.perf-hero__headline {
  font-size: clamp(4rem, 11vw, 9rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: #fff;
  margin-bottom: var(--sp-md);
}

.perf-hero__headline .outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.35);
}

.perf-hero__headline .accent {
  color: var(--c-red);
}

.perf-hero__sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.6);
  max-width: 52ch;
  margin-bottom: var(--sp-lg);
  line-height: 1.65;
}

/* ---- CERT STRIP ---- */
.cert-strip {
  background: #0c1724;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: var(--sp-md) 0;
}

.cert-strip__inner {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.cert-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-sm) var(--sp-sm);
  border-right: 1px solid rgba(255,255,255,0.07);
}

.cert-item:last-child { border-right: none; }

.cert-item__value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.cert-item__label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 0.375rem;
}

/* ---- TUNING SECTION ---- */
.tuning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.tuning-card {
  background: #0c1724;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}

.tuning-card:hover {
  border-color: rgba(26,79,160,0.5);
}

.tuning-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-blue), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.tuning-card:hover::before { opacity: 1; }

.tuning-card__icon {
  width: 44px; height: 44px;
  background: rgba(26,79,160,0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-blue);
  margin-bottom: var(--sp-sm);
}

.tuning-card__icon i[class*="fa-"] {
  font-size: 22px;
}

.tuning-card h3 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: var(--sp-xs);
}

.tuning-card p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  max-width: none;
}

.tuning-card__specs {
  margin-top: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tuning-card__spec {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: rgba(255,255,255,0.65);
}

.tuning-card__spec::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--c-red);
  flex-shrink: 0;
}

/* ---- BUILD SECTION (engine/machine shop) ---- */
.build-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  align-items: center;
}

.build-split__img {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.build-split__img img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.build-split__img::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  pointer-events: none;
}

.build-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: var(--sp-sm);
}

.build-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.build-item__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-red);
  flex-shrink: 0;
  margin-top: 0.45em;
}

.build-item__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.build-item__desc {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-top: 0.1rem;
}

/* ---- SUSPENSION / MODS GRID ---- */
.mods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--sp-md);
}

.mod-item {
  background: #0c1724;
  padding: var(--sp-sm) var(--sp-sm);
  transition: background var(--transition);
}

.mod-item:hover { background: #111f30; }

.mod-item__cat {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: 0.375rem;
}

.mod-item h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.3rem;
}

.mod-item ul {
  list-style: none;
  padding: 0;
}

.mod-item ul li {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  padding: 0.15rem 0;
  padding-left: 0.75rem;
  position: relative;
}

.mod-item ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(255,255,255,0.2);
  font-size: 0.7rem;
}

/* ---- DYNO IMAGE BREAK ---- */
.dyno-break {
  position: relative;
  height: clamp(260px, 32vw, 480px);
  overflow: hidden;
  background: #030810;
}

.dyno-break img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.55;
}

.dyno-break__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(7,16,26,0.85) 0%, transparent 55%);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
}

.dyno-break__stat {
  font-family: var(--font-display);
}

.dyno-break__stat .num {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  display: block;
}

.dyno-break__stat .label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  display: block;
}

/* ---- PERFORMANCE CTA ---- */
.perf-cta {
  background: linear-gradient(135deg, #0d1e35 0%, #0c1521 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: var(--sp-xl) 0;
  text-align: center;
}

.perf-cta h2 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}

.perf-cta p {
  color: rgba(255,255,255,0.55);
  font-size: 1.05rem;
  margin: 0 auto var(--sp-md);
  max-width: 52ch;
}

/* ---- RESPONSIVE — performance page ---- */
@media (max-width: 1024px) {
  .tuning-grid      { grid-template-columns: 1fr; }
  .build-split      { grid-template-columns: 1fr; }
  .build-split__img { order: -1; }
  .mods-grid        { grid-template-columns: repeat(2, 1fr); }
  .cert-strip__inner { flex-wrap: wrap; }
  .cert-item        { flex: 0 0 50%; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .cert-item:nth-child(even) { border-right: none; }
}

@media (max-width: 767px) {
  .perf-hero__headline { font-size: clamp(3.5rem, 14vw, 6rem); }
  .mods-grid        { grid-template-columns: 1fr; }
  .cert-item        { flex: 0 0 100%; border-right: none; }
  .perf-hero__line  { display: none; }
}
