:root {
  --bg: #050608;
  --panel: rgba(18, 20, 23, 0.86);
  --panel-strong: rgba(26, 31, 36, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #9ca3af;
  --purple: #8b5cf6;
  --purple-deep: #5b21b6;
  --green: #22c55e;
  --orange: #f97316;
  --blue: #2563eb;
  --red: #ef4444;
  --yellow: #facc15;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 14%, rgba(139, 92, 246, 0.26), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(249, 115, 22, 0.14), transparent 26%),
    radial-gradient(circle at 62% 72%, rgba(37, 99, 235, 0.14), transparent 30%),
    linear-gradient(135deg, #050608 0%, #0b0d11 48%, #030405 100%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 76%);
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar,
.dash-main,
.system-card,
.roles-panel,
.lap-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(16px);
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 16px;
  border-radius: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand small,
.nav-actions a,
.eyebrow,
.hero-text,
.system-card p {
  color: var(--muted);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-actions a,
.button {
  min-height: 40px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 116px);
  padding: 56px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.9;
}

.hero-text {
  max-width: 650px;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.module-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.module-rail span {
  padding: 10px 12px;
  border: 1px solid rgba(139, 92, 246, 0.36);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button.primary {
  border-color: rgba(139, 92, 246, 0.75);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.96), rgba(37, 99, 235, 0.78));
  color: #ffffff;
  font-weight: 800;
}

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

.dash-main {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  padding: 22px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(26, 31, 36, 0.96), rgba(5, 6, 8, 0.86)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 9px);
}

.dash-main::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -80px 130px rgba(0, 0, 0, 0.45);
}

.dash-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.rpm-strip {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 30px 0 24px;
}

.led {
  height: 9px;
  border-radius: 99px;
  opacity: 0.95;
  box-shadow: 0 0 14px currentColor;
}

.blue { color: var(--blue); background: var(--blue); }
.green { color: var(--green); background: var(--green); }
.yellow { color: var(--yellow); background: var(--yellow); }
.red { color: var(--red); background: var(--red); }
.purple { color: var(--purple); background: var(--purple); }

.gauge-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
}

.gear-dial {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--green);
  border-right-color: var(--orange);
  border-radius: 50%;
}

.gear {
  font-family: "OCR A Extended", "Bahnschrift SemiCondensed", Consolas, monospace;
  font-size: 88px;
  font-weight: 900;
  line-height: 0.9;
}

.gear-dial small,
.speed-block .label,
.speed-block .sub,
.metric-grid span,
.card-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.speed-block strong {
  display: block;
  font-family: "OCR A Extended", "Bahnschrift SemiCondensed", Consolas, monospace;
  font-size: 72px;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 26px;
}

.metric-grid div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-family: "OCR A Extended", "Bahnschrift SemiCondensed", Consolas, monospace;
  font-size: 24px;
}

.systems {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.system-card {
  min-height: 210px;
  padding: 20px;
  border-radius: 16px;
}

.system-card h2 {
  margin: 24px 0 10px;
  font-size: 22px;
}

.system-card {
  border-top: 3px solid var(--purple);
}

.accent-green { border-top-color: var(--green); }
.accent-orange { border-top-color: var(--orange); }
.accent-blue { border-top-color: var(--blue); }
.accent-purple { border-top-color: var(--purple); }

.roles-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 20px;
}

.roles-panel h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.role-card {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 10%, rgba(139, 92, 246, 0.26), transparent 42%),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.role-card::before {
  display: block;
  margin-bottom: 8px;
  color: var(--purple);
  font-size: 26px;
}

.crown::before { content: "♛"; }
.shield::before { content: "◆"; color: var(--blue); }
.code::before { content: "</>"; color: var(--green); font-size: 20px; }
.flask::before { content: "△"; color: var(--orange); }
.camera::before { content: "◉"; color: var(--red); }
.heart::before { content: "♡"; color: var(--yellow); }

.lap-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 26px;
  padding: 28px;
  border-radius: 20px;
}

.lap-panel h2 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
}

.lap-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lap-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.lap-list strong {
  color: var(--green);
}

@media (max-width: 900px) {
  .hero,
  .systems,
  .roles-panel,
  .lap-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 48px 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .dash-main {
    min-height: 0;
    padding: 18px;
    border-radius: 20px;
  }

  .gauge-row,
  .metric-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .gear-dial {
    width: 150px;
    height: 150px;
  }

  .speed-block strong {
    font-size: 58px;
  }
}
