:root {
  color-scheme: dark;
  --bg: #0b0e11;
  --panel: rgba(15, 19, 24, 0.82);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f7f8;
  --muted: #a8b3b8;
  --teal: #4fd1c5;
  --red: #ff4d5f;
  --amber: #ffc857;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: linear-gradient(180deg, rgba(5, 7, 9, 0.78), rgba(5, 7, 9, 0));
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: clamp(46px, 4.6vw, 58px);
  height: auto;
}

nav {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
}

nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  padding: 120px clamp(18px, 4vw, 56px) 48px;
  overflow: hidden;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  background-image: url("/assets/hero-tuning-garage.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(4, 7, 9, 0.92) 0%, rgba(4, 7, 9, 0.54) 42%, rgba(4, 7, 9, 0.84) 100%),
    linear-gradient(180deg, rgba(4, 7, 9, 0.1) 0%, rgba(4, 7, 9, 0.96) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
  padding-bottom: 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 20px;
  font-size: clamp(3rem, 8vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.hero-copy {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1rem, 2vw, 1.28rem);
}

.hero-actions,
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.button.primary {
  border-color: color-mix(in srgb, var(--red) 65%, white 10%);
  background: var(--red);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
}

.telemetry-panel {
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  bottom: 42px;
  z-index: 3;
  width: min(400px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.telemetry-top,
.telemetry-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.telemetry-top {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.telemetry-top strong {
  color: var(--amber);
}

.dyno-image {
  display: block;
  width: 72%;
  max-width: 72%;
  aspect-ratio: 1088 / 675;
  margin: 14px auto;
  border-radius: 4px;
  background: #fff url("/assets/e63-tuned-dyno.png?v=2") center / contain no-repeat;
  pointer-events: none;
  user-select: none;
}

.telemetry-panel svg {
  display: block;
  width: 100%;
  height: auto;
  padding: 12px 16px 0;
}

.dyno-chart {
  color: #0f1418;
}

.chart-bg {
  fill: rgba(244, 247, 248, 0.9);
}

.grid {
  fill: none;
}

.grid.minor {
  stroke: rgba(15, 20, 24, 0.28);
  stroke-dasharray: 3 4;
  stroke-width: 0.8;
}

.grid.major,
.axis,
.axis.right {
  stroke: rgba(15, 20, 24, 0.46);
  stroke-width: 1;
}

.power-stock,
.power-tuned,
.torque-stock,
.torque-tuned {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.power-stock {
  stroke: rgba(126, 40, 52, 0.86);
  stroke-width: 1.7;
}

.power-tuned {
  stroke: #8e2f3d;
  stroke-width: 3;
}

.torque-stock {
  stroke: rgba(0, 34, 180, 0.82);
  stroke-width: 1.5;
  stroke-dasharray: 8 5;
}

.torque-tuned {
  stroke: #061eb9;
  stroke-width: 2.6;
  stroke-dasharray: 10 5;
}

.axis-title,
.axis-label {
  fill: #0f1418;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
}

.power-title {
  fill: #8e2f3d;
}

.torque-title {
  fill: #061eb9;
}

.axis-label.rpm {
  font-weight: 700;
}

.telemetry-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.telemetry-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.telemetry-legend i {
  display: block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.legend-power-stage {
  background: #8e2f3d;
}

.legend-power-stock {
  background: rgba(126, 40, 52, 0.72);
}

.legend-torque-stage {
  background: #061eb9;
}

.legend-torque-stock {
  background: rgba(0, 34, 180, 0.62);
}

.telemetry-metrics {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.telemetry-metrics strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.section {
  padding: clamp(58px, 9vw, 108px) clamp(18px, 4vw, 56px);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.section-intro {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 36px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.service-grid article {
  min-height: 245px;
  padding: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    #101419;
}

.icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 54px;
  border-radius: 8px;
  background: rgba(79, 209, 197, 0.14);
  color: var(--teal);
  font-weight: 900;
}

.service-grid p,
.process span {
  color: var(--muted);
}

.process {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 44px;
  background:
    radial-gradient(circle at 8% 20%, rgba(79, 209, 197, 0.14), transparent 30%),
    linear-gradient(180deg, #0b0e11, #101114);
}

.process ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.process li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.process strong {
  color: var(--amber);
}

.portal,
.contact {
  justify-content: space-between;
}

.portal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  background: #f3f5f5;
  color: #0f1418;
}

.portal .eyebrow,
.contact .eyebrow {
  color: #b51f31;
}

.portal h2 {
  max-width: 900px;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button.dark {
  border-color: #0f1418;
  background: #0f1418;
  color: #fff;
}

.contact {
  background: #101419;
}

.contact .button.primary {
  min-width: min(100%, 260px);
}

@media (max-width: 860px) {
  .site-header {
    position: absolute;
  }

  nav {
    display: none;
  }

  .hero {
    min-height: 980px;
    align-items: start;
  }

  .hero-content {
    padding-top: 80px;
    padding-bottom: 0;
  }

  .telemetry-panel {
    right: 18px;
    bottom: 28px;
  }

  .section-intro,
  .portal,
  .process {
    display: block;
  }

  .portal-actions {
    margin-top: 26px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .process ol {
    margin-top: 34px;
  }

  .process li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .hero {
    min-height: 900px;
    padding-inline: 16px;
  }

  .hero-actions .button,
  .portal-actions .button,
  .contact .button {
    width: 100%;
  }

  .telemetry-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}
