* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0c0e11;
  --panel: #15181d;
  --panel-edge: #262b33;
  --text: #dfe3e8;
  --dim: #8a919c;
  --accent: #ff9e1b;
  --accent-soft: #ffb75e;
  --danger: #e5484d;
  --display: "Sora", "Inter", system-ui, sans-serif;
}

body {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 50% -20%, #1a1e25, var(--bg) 65%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid var(--panel-edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.nav-link {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-link.is-current {
  color: var(--accent);
  background: rgba(255, 158, 27, 0.09);
  border-color: rgba(255, 158, 27, 0.35);
}
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mark {
  width: 62px;
  height: auto;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #f2f4f7;
}

.tagline {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--dim);
}

/* Dashboard push-to-start button: metal bezel around a recessed dark face,
   unlit when stopped, backlit red while the engine is running. */
.power {
  position: relative;
  flex: none;
  width: 110px;
  height: 110px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: conic-gradient(from 215deg,
    #5c6674, #c3ccd9, #79828f, #e6ebf2, #6d7684,
    #aab4c2, #59626e, #d2dae4, #5c6674);
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: transform 0.08s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.power-face {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: radial-gradient(circle at 50% 30%, #2b313a, #171a20 60%, #0b0d10);
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.07);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.power-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 8.5px;
  letter-spacing: 1.8px;
  text-indent: 1.8px; /* offset trailing letter-space so it stays centred */
  text-transform: uppercase;
  color: #79818d;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.power-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #c9cfd8;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.power-actions i {
  width: 1px;
  height: 10px;
  background: #4c535e;
  transition: background 0.25s ease;
}

.power:hover .power-face { background: radial-gradient(circle at 50% 30%, #333a45, #1b1f26 60%, #0b0d10); }
.power:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.power:active { transform: translateY(2px); }
.power:active .power-face { box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.95); }

.power.running {
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.6),
    0 0 26px 5px rgba(229, 72, 77, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  animation: ignition 2.4s ease-in-out infinite;
}
.power.running .power-face {
  background: radial-gradient(circle at 50% 30%, #5a1a1d, #2a0d0f 60%, #150708);
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.8),
    inset 0 0 16px rgba(229, 72, 77, 0.45);
}
.power.running .power-brand {
  color: #ff8e91;
  text-shadow: 0 0 9px rgba(229, 72, 77, 0.75);
}
.power.running .power-actions {
  color: #fff1f1;
  text-shadow: 0 0 11px rgba(229, 72, 77, 0.95);
}
.power.running .power-actions i { background: #e5484d; }

@keyframes ignition {
  0%, 100% {
    box-shadow:
      0 7px 18px rgba(0, 0, 0, 0.6),
      0 0 22px 3px rgba(229, 72, 77, 0.32),
      0 1px 0 rgba(255, 255, 255, 0.2) inset;
  }
  50% {
    box-shadow:
      0 7px 18px rgba(0, 0, 0, 0.6),
      0 0 32px 7px rgba(229, 72, 77, 0.55),
      0 1px 0 rgba(255, 255, 255, 0.2) inset;
  }
}

@media (prefers-reduced-motion: reduce) {
  .power.running { animation: none; }
}

main {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  padding: 18px 26px;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 18px;
}

.controls h2 {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--dim);
  margin: 20px 0 10px;
  border-bottom: 1px solid var(--panel-edge);
  padding-bottom: 5px;
}

.row { margin-bottom: 11px; }
.row label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.val {
  font-family: var(--display);
  font-weight: 600;
  color: var(--accent-soft);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

select,
input[type="text"] {
  width: 100%;
  background: #0c0e11;
  color: var(--text);
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 7px 9px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

input[type="text"]:disabled {
  color: var(--dim);
  opacity: 1;
}

.dash {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Instrument cluster: ignition switch sits beside the tachometer, the way it
   sits beside the binnacle on a real dash. */
.cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.tacho {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 300px;
  min-width: 0;
}

#gauge {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.readout {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  margin-top: -23%; /* percentage keeps the overlap correct as the gauge scales */
}
.readout small {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}

.throttle-box {
  width: 100%;
  max-width: 460px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
}
.throttle-box label {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
}
.throttle-box .val {
  font-family: var(--display);
  font-weight: 600;
  color: var(--accent-soft);
}

.rev {
  background: #21252c;
  color: var(--text);
  border: 1px solid #333945;
  border-radius: 6px;
  padding: 10px 16px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.rev:active, .rev.held {
  background: var(--accent);
  color: #14100a;
  border-color: var(--accent);
}

#viz {
  width: 100%;
  max-width: 600px;
  background: #0a0c0f;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
}

/* --- Prose page (How It Works) ------------------------------------------- */

main.doc {
  display: block;
  max-width: 900px;
  padding: 26px 26px 70px;
}

.doc h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.3px;
  color: #f2f4f7;
  margin-bottom: 12px;
}

.doc .lede {
  font-size: 16px;
  line-height: 1.6;
  color: #b8bfc9;
  margin-bottom: 8px;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin: 40px 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--panel-edge);
}

.doc p,
.doc li {
  line-height: 1.68;
  color: #c2c9d3;
}
.doc p { margin-bottom: 14px; }

.doc ol.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}
.doc ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 52px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 9px;
}
.doc ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 15px;
  top: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 158, 27, 0.12);
  border: 1px solid rgba(255, 158, 27, 0.4);
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
}
.doc ol.steps b {
  font-family: var(--display);
  font-weight: 700;
  color: #e8ecf2;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--panel-edge);
  border-radius: 9px;
  background: var(--panel);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.doc th,
.doc td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-edge);
  vertical-align: top;
}
.doc tr:last-child td { border-bottom: none; }
.doc th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--dim);
  white-space: nowrap;
}
.doc td:first-child {
  color: #e8ecf2;
  font-weight: 500;
  white-space: nowrap;
}
.doc td.wrap { white-space: normal; }

.doc code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent-soft);
  background: #0c0e11;
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 1.5px 6px;
  white-space: nowrap;
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.preset-list li {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  color: #d5dbe4;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  padding: 7px 15px;
}

.doc-cta {
  margin-top: 44px;
  display: flex;
  justify-content: center;
}
.doc-cta a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #14100a;
  background: var(--accent);
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 7px;
  transition: filter 0.2s ease;
}
.doc-cta a:hover { filter: brightness(1.08); }

@media (max-width: 860px) {
  main:not(.doc) { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  header { padding: 13px 16px; gap: 12px; }
  main { padding: 16px; }
  .brand { gap: 10px; }
  .wordmark { font-size: 17px; }
  .tagline { display: none; } /* nav needs the room; the mark carries the brand */
  .nav { gap: 4px; }
  .nav-link { font-size: 10.5px; padding: 6px 9px; }
  .cluster { gap: 14px; }
  .readout { font-size: 28px; }

  main.doc { padding: 20px 16px 50px; }

  .doc h1 { font-size: 24px; }
  .doc .lede { font-size: 15px; }
  .doc table { font-size: 12.5px; }
  .doc th, .doc td { padding: 8px 10px; }
  .doc td:first-child { white-space: normal; }
  .doc ol.steps > li { padding: 12px 13px 12px 46px; }
  .mark { width: 46px; }
  .wordmark { font-size: 19px; }
  .tagline { font-size: 8px; letter-spacing: 1.6px; }

  .power { width: 84px; height: 84px; }
  .power-face { inset: 6px; gap: 3px; }
  .power-brand { font-size: 7px; letter-spacing: 1.4px; text-indent: 1.4px; }
  .power-actions { font-size: 8.5px; gap: 4px; letter-spacing: 0.3px; }
  .power-actions i { height: 8px; }
}

/* Phone widths: the wordmark and both nav links can't share a row without the
   brand text being squeezed into an overflow, so give the nav its own. */
@media (max-width: 480px) {
  header { flex-wrap: wrap; row-gap: 9px; }
  .brand { flex: 1 1 100%; }
  .wordmark { font-size: 19px; }
  .tagline { display: block; }
  .nav { flex: 1 0 100%; justify-content: flex-start; }
}
