/* I'm Hero OBD2 Scanner — instrument-cluster night theme.
   Signature: a neon dashboard hero (perspective grid + gauge + code readout).
   Data (codes, values) is set in monospace; display type is tight and heavy. */

:root {
  --void: #0A0E14;
  --void-2: #070A0F;
  --panel: #10151E;
  --panel-2: #161C27;
  --line: #232B38;
  --ink: #EAF0F7;
  --muted: #8A97A8;
  --blue: #2E9BFF;
  --blue-ink: #041424;
  --cyan: #35E0D0;
  --amber: #FFC24B;
  --danger: #FF5A52;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--void);
  background-image:
    radial-gradient(1200px 600px at 70% -10%, rgba(46, 155, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(53, 224, 208, 0.08), transparent 55%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Type scale ---------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.9rem;
}
.display {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 1.1rem;
}
.display .accent { color: var(--blue); }
.display-2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 0.6rem;
}
.lede { font-size: 1.12rem; color: #c3ccd8; max-width: 46ch; margin: 0 0 1.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ---- Header -------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 1.4rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(160deg, var(--blue), var(--cyan));
  box-shadow: 0 0 16px rgba(53, 224, 208, 0.55);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px 6px auto 6px; height: 3px; border-radius: 2px;
  background: var(--void); opacity: 0.85;
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.brand-name b { color: var(--cyan); font-weight: 800; }
.topnav { display: flex; gap: 1.3rem; font-size: 0.92rem; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--ink); text-decoration: none; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.4rem; border-radius: var(--radius-sm);
  font-weight: 650; font-size: 0.98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, #4bacff, var(--blue));
  color: var(--blue-ink);
  box-shadow: 0 6px 24px rgba(46, 155, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(46, 155, 255, 0.5); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--cyan); }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 3.2rem 1.4rem 3.6rem; position: relative; z-index: 1; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.6rem; }

/* perspective "road" grid, echoing the app icon */
.grid-floor {
  position: absolute; left: 50%; bottom: -10%; transform: translateX(-50%);
  width: 160%; height: 70%;
  background-image:
    linear-gradient(rgba(53, 224, 208, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 224, 208, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: bottom center;
  mask-image: radial-gradient(70% 80% at 50% 100%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 80% at 50% 100%, #000 30%, transparent 75%);
  opacity: 0.7;
  z-index: 0;
}

/* instrument cluster: gauge + code readout */
.cluster {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.4rem;
  padding: 1.3rem 1.5rem; max-width: 520px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.03);
}
.gauge { width: 128px; height: 80px; }
.gauge-track { stroke: #26303e; stroke-width: 10; stroke-linecap: round; }
.gauge-fill {
  stroke: url(#none); stroke: var(--blue); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 314; stroke-dashoffset: 110;
  filter: drop-shadow(0 0 6px rgba(46,155,255,0.7));
  animation: sweep 4.5s ease-in-out infinite alternate;
}
.gauge-needle { stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(53,224,208,0.8)); transform-origin: 120px 140px; animation: needle 4.5s ease-in-out infinite alternate; }
.gauge-hub { fill: var(--cyan); }
.readout { display: flex; flex-direction: column; gap: 0.15rem; }
.readout-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.24em; color: var(--muted); }
.readout-code { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--amber); letter-spacing: 0.04em; }
.readout-desc { color: #c3ccd8; font-size: 0.95rem; }

@keyframes sweep { from { stroke-dashoffset: 190; } to { stroke-dashoffset: 70; } }
@keyframes needle { from { transform: rotate(-32deg); } to { transform: rotate(30deg); } }

/* ---- Section chrome ------------------------------------------------------ */
section { padding-block: 1rem; }
.section-head { max-width: 52ch; margin: 3rem 0 1.6rem; }

/* ---- Explain tool -------------------------------------------------------- */
.explain { scroll-margin-top: 1.5rem; }
.explain-form {
  display: grid; grid-template-columns: 160px 1fr auto; gap: 0.7rem; align-items: stretch;
  padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.code-input, .q-input {
  background: var(--void-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); padding: 0.85rem 0.95rem; font-size: 1rem; width: 100%;
}
.code-input {
  font-family: var(--mono); font-size: 1.25rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--amber); text-align: center;
}
.code-input::placeholder { color: #5c6675; letter-spacing: 0; }
.q-input::placeholder { color: #5c6675; }
.code-input:focus, .q-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(46,155,255,0.2); }

.chips { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 999px; padding: 0.3rem 0.7rem; cursor: pointer; font-size: 0.85rem;
}
.chip:hover { border-color: var(--cyan); }

.result {
  display: block; margin-top: 1.2rem; padding: 1.3rem 1.4rem;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius);
}
.result[hidden] { display: none; }
.result .r-head { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.result .r-code { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--amber); }
.result .r-title { color: var(--ink); font-weight: 600; }
.result .r-badge {
  margin-left: auto; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.result .r-badge.ai { color: var(--blue-ink); background: var(--cyan); border-color: var(--cyan); }
.result .r-notice {
  margin: 0 0 0.7rem; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
  background: rgba(255, 194, 75, 0.1); border: 1px solid rgba(255, 194, 75, 0.35);
  color: var(--amber); font-size: 0.9rem;
}
.result .r-body { white-space: pre-wrap; color: #cdd6e1; }
.result.error { border-left-color: var(--danger); }
.result.loading .r-body::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Features ------------------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.card {
  padding: 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.card h3 { margin: 0.5rem 0 0.4rem; font-size: 1.15rem; }
.card p { margin: 0; }
.card-idx {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cyan);
}

/* ---- App CTA ------------------------------------------------------------- */
.appcta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  margin: 2.5rem 0 3.5rem; padding: 1.8rem 2rem;
  background: linear-gradient(120deg, rgba(46,155,255,0.14), rgba(53,224,208,0.08));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.appcta h2 { margin: 0 0 0.4rem; }
.appcta p { margin: 0; max-width: 52ch; }

/* ---- Doc pages ----------------------------------------------------------- */
.doc { max-width: 760px; padding-block: 2.4rem 3.5rem; }
.doc h1 { margin-top: 0.4rem; }
.doc h2 { margin: 2rem 0 0.5rem; font-size: 1.28rem; letter-spacing: -0.01em; }
.doc p, .doc li { color: #c3ccd8; }
.doc ul, .doc ol { padding-left: 1.2rem; }
.doc li { margin: 0.3rem 0; }
.doc b { color: var(--ink); }
.callout {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.4rem 0; color: var(--ink);
}

/* ---- Footer -------------------------------------------------------------- */
.sitefooter { border-top: 1px solid var(--line); margin-top: 2rem; }
.foot-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.4rem 0.5rem;
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.foot-grid nav { display: flex; flex-direction: column; gap: 0.4rem; }
.foot-grid nav a { color: var(--muted); }
.foot-grid nav a:hover { color: var(--ink); }
.copy { max-width: var(--maxw); margin: 0 auto; padding: 0.5rem 1.4rem 2rem; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
  .topnav { display: none; }
  .explain-form { grid-template-columns: 1fr; }
  .code-input { text-align: left; }
  .features { grid-template-columns: 1fr; }
  .cluster { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gauge-fill, .gauge-needle, .result.loading .r-body::after { animation: none; }
}
