/* Car Brain Center — portada pública. Solo HTML + CSS + un script propio pequeño; sin recursos externos.
   Firma: el robot mascota de CBC (mascot/), que parpadea y cambia de emoción (algo está a punto de hablar). */

:root {
  --bg: #eef3fb;
  --bg-glow: rgba(10, 92, 255, .14);
  --ink: #07101f;
  --muted: #4b5870;
  --line: #bfcee6;
  --panel: rgba(255, 255, 255, .72);
  --panel-line: #c9d6ea;
  --eye: #0a5cff;
  --ring-glow: rgba(10, 92, 255, .30);
  --chip-bg: #e2ecfd;
  --chip-ink: #0b3fb3;
  --logo-light: block;
  --logo-dark: none;
  --sun: none;
  --moon: block;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050914;
    --bg-glow: rgba(26, 120, 255, .26);
    --ink: #eaf2ff;
    --muted: #9db0cc;
    --line: #17294a;
    --panel: rgba(12, 22, 42, .72);
    --panel-line: #1d3157;
    --eye: #9fe9ff;
    --ring-glow: rgba(47, 155, 255, .55);
    --chip-bg: #0f1c3a;
    --chip-ink: #8fb4ff;
    --logo-light: none;
    --logo-dark: block;
    --sun: block;
    --moon: none;
  }
}

:root[data-theme="dark"] {
  --bg: #050914;
  --bg-glow: rgba(26, 120, 255, .26);
  --ink: #eaf2ff;
  --muted: #9db0cc;
  --line: #17294a;
  --panel: rgba(12, 22, 42, .72);
  --panel-line: #1d3157;
  --eye: #9fe9ff;
  --ring-glow: rgba(47, 155, 255, .55);
  --chip-bg: #0f1c3a;
  --chip-ink: #8fb4ff;
  --logo-light: none;
  --logo-dark: block;
  --sun: block;
  --moon: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(900px 520px at 50% 42%, var(--bg-glow), transparent 70%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 clamp(20px, 5vw, 64px);
  max-width: 1280px;
  margin: 0 auto;
}

/* Cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: clamp(18px, 3.5vw, 34px) 0 0; position: relative; z-index: 2; }
.logo { width: clamp(140px, 20vw, 220px); height: auto; }
.logo--light { display: var(--logo-light); }
.logo--dark { display: var(--logo-dark); }

.tools { display: flex; align-items: center; gap: 10px; }
.lang, .theme {
  min-height: 44px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.lang { display: inline-flex; align-items: center; gap: 8px; padding-inline: 14px 8px; }
.lang__icon, .theme svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lang__select {
  appearance: none; -webkit-appearance: none;
  min-height: 42px; max-width: 150px;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-size: 15px; padding-inline: 4px 12px; cursor: pointer;
}
.lang__select option { color: #07101f; background: #fff; }
.theme { width: 44px; display: inline-grid; place-items: center; padding: 0; cursor: pointer; }
.theme__sun { display: var(--sun); }
.theme__moon { display: var(--moon); }
.lang:hover, .theme:hover { border-color: var(--eye); }
.lang:focus-within, .theme:focus-visible, .lang__select:focus-visible { outline: 2px solid var(--eye); outline-offset: 2px; }
.lang__select:focus-visible { outline: none; }

/* Escena */
.stage {
  position: relative;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3.2vh, 30px);
  padding: clamp(22px, 5vh, 56px) 0;
  text-align: center;
  min-width: 0;
}
.circuit {
  position: absolute; inset: 0 0 auto 0; width: 100%; height: 62%;
  fill: none; stroke: var(--line); stroke-width: 1.5; opacity: .9;
  pointer-events: none; z-index: 0; overflow: visible;
}
.circuit__lines path { stroke-dasharray: 520; stroke-dashoffset: 520; animation: trazar 3.2s cubic-bezier(.4, .1, .2, 1) .5s forwards; }
.circuit__nodes circle { fill: var(--bg); stroke: var(--eye); stroke-width: 2; opacity: 0; animation: aparecer .6s ease 2.6s forwards; }

/* Mascota (mascot/mascot.js + mascot/mascot.css). Decorativa: aria-hidden. */
.mascot { position: relative; z-index: 1; width: clamp(190px, 30vw, 300px); aspect-ratio: 1; }

.title {
  position: relative; z-index: 1;
  margin: 0;
  max-width: 18ch;
  font-size: clamp(32px, 6.4vw, 68px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.tag {
  position: relative; z-index: 1;
  margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-ink);
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.tag__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--eye); animation: pulso 1.8s ease-in-out infinite; }

/* Pie */
.foot {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 18px 0 clamp(18px, 3.5vw, 30px);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.foot__tag { font-family: var(--mono); letter-spacing: .06em; }

@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { to { opacity: 1; } }
@keyframes pulso { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }

@media (prefers-reduced-motion: reduce) {
  .circuit__lines path { animation: none; stroke-dashoffset: 0; }
  .circuit__nodes circle { animation: none; opacity: 1; }
  .tag__dot { animation: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .lang { padding-inline: 12px 6px; }
  .lang__select { max-width: 112px; }
  .tag { font-size: 12px; letter-spacing: .1em; }
}
