/* ============================================================
   Monóxido de Carbono · Guía informativa — estilos
   ============================================================ */

:root {
  --radius: 0.75rem;

  --background: hsl(38 24% 95%);
  --foreground: hsl(222 30% 13%);
  --surface: hsl(40 30% 99%);
  --muted: hsl(220 12% 43%);
  --amber: hsl(36 91% 48%);
  --red: hsl(4 78% 48%);
  --teal: hsl(174 57% 34%);
  --ink: hsl(222 30% 13%);
  --border: hsl(222 30% 13% / 12%);

  --ease-bento: cubic-bezier(0.32, 0.72, 0, 1);

  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- utilidades de color ---------- */
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.text-teal  { color: var(--teal); }
.text-muted { color: var(--muted); }
.bg-teal    { background-color: var(--teal); }
.bg-amber   { background-color: var(--amber); }
.bg-red     { background-color: var(--red); }
.em-red     { color: var(--red); }
.em-red     { font-style: normal; }
.mt         { margin-top: 1.25rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: hsl(210 22% 97% / 0.8);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.brand-badge {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.nav {
  display: none;
  gap: 1.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

@media (min-width: 768px) {
  .nav { display: flex; }
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
  cursor: pointer;
  border: none;
}

.btn-red    { background: var(--red); color: #fff; padding: 0.5rem 1rem; }
.btn-red:hover { background: hsl(4 74% 40%); }
.btn-dark   { background: var(--foreground); color: var(--background); padding: 0.75rem 1.25rem; }
.btn-dark:hover { background: hsl(215 22% 22%); }
.btn-outline {
  border: 1px solid hsl(215 22% 12% / 15%);
  padding: 0.75rem 1.25rem;
  color: var(--foreground);
}
.btn-outline:hover { background: hsl(215 22% 12% / 5%); }
.btn-amber  { background: var(--amber); color: var(--foreground); padding: 0.75rem 1.25rem; }
.btn-amber:hover { background: hsl(38 92% 45%); }

/* ---------- layout ---------- */
.main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 2rem 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.mono-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.grid-2 { display: grid; gap: 1.25rem; }
.grid-3 { display: grid; gap: 1.25rem; }
.grid-4 { display: grid; gap: 1rem; }
.grid-12 { display: grid; gap: 1.25rem; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-12 { grid-template-columns: repeat(12, 1fr); }
  .span-7 { grid-column: span 7; }
  .span-5 { grid-column: span 5; }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- tarjetas ---------- */
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
}

.card-red-tint {
  background: hsl(4 74% 46% / 0.06);
}

.card-quote {
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  text-wrap: balance;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  margin-top: 0.75rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.card-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

.risk {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
}

.stat {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

/* ---------- hero ---------- */
.hero {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
}

.hero-card {
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, hsl(222 30% 13%), hsl(222 29% 20%));
  color: hsl(38 24% 95%);
  box-shadow: 0 1.5rem 3rem hsl(222 30% 13% / 0.13);
}

@media (min-width: 768px) {
  .hero-card { padding: 2.5rem; }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.9rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-top: 1.25rem;
}

@media (min-width: 768px) {
  .hero-title { font-size: 3.6rem; }
}

.hero-lead {
  margin-top: 1.5rem;
  max-width: 42ch;
  font-size: 1.125rem;
  line-height: 1.7;
  color: hsl(38 24% 95% / 0.72);
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-card .eyebrow { color: hsl(38 24% 95% / 0.6); }
.hero-card .btn-outline { border-color: hsl(38 24% 95% / 0.3); color: hsl(38 24% 95%); }
.hero-card .btn-outline:hover { background: hsl(38 24% 95% / 0.1); }

/* ---------- sistema conectado ---------- */
.system-section { padding-top: 3rem; }

.section-intro {
  max-width: 31ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.system-status {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  font-size: 0.78rem;
}

.status-live, .dashboard-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #53b59f;
  box-shadow: 0 0 0 4px hsl(174 57% 34% / 0.12);
}

.status-label { color: var(--muted); }

.system-flow {
  display: grid;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 1rem;
}

.flow-node {
  position: relative;
  min-height: 11.5rem;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--teal);
  border-radius: 0.85rem;
  background: var(--surface);
}

.flow-cloud { border-top-color: var(--amber); }
.flow-alert { border-top-color: var(--red); }
.flow-action { border-top-color: var(--foreground); }

.flow-index, .flow-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.flow-index { color: var(--muted); }
.flow-kicker { display: block; margin-top: 1.5rem; color: var(--muted); }
.flow-node h3 { margin-top: 0.4rem; font-size: 1.1rem; }
.flow-node p { margin-top: 0.55rem; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.flow-arrow { display: none; align-self: center; color: var(--red); font-size: 1.4rem; }

.system-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--red);
  background: hsl(4 78% 48% / 0.07);
  font-size: 0.88rem;
  line-height: 1.55;
}

.system-note strong { color: var(--red); }
.system-note span { color: var(--muted); }

/* ---------- dashboard de respuesta ---------- */
.response-section { padding-bottom: 3rem; }
.response-layout { display: grid; gap: 1.5rem; align-items: center; }
.response-copy { max-width: 48ch; margin: 1rem 0 1.25rem; color: var(--muted); font-size: 0.95rem; line-height: 1.7; }

.dashboard-preview {
  overflow: hidden;
  border-radius: 1rem;
  background: var(--foreground);
  color: hsl(38 24% 95%);
  box-shadow: 0 1.5rem 3rem hsl(222 30% 13% / 0.16);
}

.dashboard-top, .dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-top { border-bottom: 1px solid hsl(38 24% 95% / 0.12); color: hsl(38 24% 95% / 0.6); }
.dashboard-footer { color: hsl(38 24% 95% / 0.45); border-top: 1px solid hsl(38 24% 95% / 0.12); }
.threat-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid hsl(38 24% 95% / 0.1); }
.threat-marker { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px hsl(4 78% 48% / 0.16); }
.threat-high .threat-marker { background: var(--amber); box-shadow: 0 0 0 5px hsl(36 91% 48% / 0.16); }
.threat-watch .threat-marker { background: #53b59f; box-shadow: 0 0 0 5px hsl(174 57% 34% / 0.16); }
.threat-row strong, .threat-row small { display: block; }
.threat-row strong { font-size: 0.82rem; }
.threat-row small { margin-top: 0.25rem; color: hsl(38 24% 95% / 0.56); font-size: 0.7rem; }
.threat-row b { font-family: var(--font-mono); font-size: 0.62rem; color: var(--red); }
.threat-high b { color: var(--amber); }
.threat-watch b { color: #53b59f; }

/* visual del gas */
.gas-visual {
  position: relative;
  height: 11rem;
  overflow: hidden;
  border-radius: 1rem;
  background: hsl(215 22% 12% / 5%);
  margin-top: 0.75rem;
}

.gas-blob {
  position: absolute;
  border-radius: 9999px;
  animation: breathe 7s ease-in-out infinite;
}

.gas-blob-a {
  width: 150px;
  height: 150px;
  left: -30px;
  top: -20px;
  background: hsl(210 40% 70% / 0.5);
  filter: blur(30px);
}

.gas-blob-b {
  width: 170px;
  height: 170px;
  right: -40px;
  bottom: -30px;
  background: hsl(210 40% 65% / 0.45);
  filter: blur(34px);
  animation: breathe 9s var(--ease-bento) infinite reverse;
}

.gas-caption {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* ---------- franja de cita ---------- */
.quote-band {
  margin-top: 1.25rem;
  border-radius: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(180deg, hsl(210 22% 95%), hsl(210 15% 94%));
}

@media (min-width: 768px) {
  .quote-band { padding: 2rem; }
}

.quote-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.35;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .quote-text { font-size: 1.875rem; }
}

.quote-note {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ---------- medidor interactivo ---------- */
.meter-card { border-radius: 1.5rem; padding: 1.75rem; }

.meter-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .meter-grid { grid-template-columns: 5fr 7fr; }
}

.meter-value {
  margin-top: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.meter-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  letter-spacing: -0.02em;
}

.meter-unit {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.co-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin-top: 1rem;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    var(--teal) 0%,
    var(--teal) 18%,
    var(--amber) 45%,
    var(--red) 100%
  );
  outline: none;
}

.co-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: var(--surface);
  border: 2px solid var(--foreground);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.co-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: var(--surface);
  border: 2px solid var(--foreground);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.meter-scale {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.meter-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.badge-teal  { background: hsl(174 45% 40% / 0.15); color: var(--teal); }
.badge-amber { background: hsl(38 92% 50% / 0.15);  color: var(--amber); }
.badge-red   { background: hsl(4 74% 46% / 0.15);   color: var(--red); }
.badge-dark  { background: var(--foreground); color: var(--background); }

.meter-effect {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.35;
  text-wrap: balance;
}

/* ---------- barras COHb ---------- */
.bars { margin-top: 1.25rem; display: grid; gap: 1rem; }

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 0.375rem;
}

.bar-track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 9999px;
  background: hsl(215 22% 12% / 10%);
}

.bar-fill {
  height: 100%;
  border-radius: 9999px;
  animation: fillbar 0.9s var(--ease-bento) both;
}

/* ---------- grilla ppm ---------- */
.ppm-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.ppm-cell {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 0.75rem;
  text-align: center;
}

.ppm-cell-dark {
  background: var(--foreground);
  color: var(--background);
  border-color: transparent;
}

.ppm-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.ppm-sub {
  margin-top: 0.25rem;
  font-size: 11px;
}

.ppm-cell-dark .ppm-sub { opacity: 0.7; }

/* ---------- chips y listas ---------- */
.chip {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.chip-amber { background: var(--amber); color: var(--foreground); }
.chip-red   { background: var(--red); color: #fff; }
.chip-dark  { background: var(--foreground); color: var(--background); }

.risk-list {
  margin-top: 0.75rem;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- pasos de emergencia ---------- */
.steps {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--surface);
  display: grid;
}

.step {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-highlight { background: hsl(38 92% 50% / 0.1); }

.step-text-strong { color: var(--foreground); }

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(5, 1fr); }
  .step { border-bottom: none; border-right: 1px solid var(--border); }
  .step:last-child { border-right: none; }
}

/* ---------- banda CTA ---------- */
.cta-band {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 1rem;
  background: var(--foreground);
  color: var(--background);
  padding: 1.5rem;
}

.cta-eyebrow { opacity: 0.6; color: var(--background); }

.cta-title {
  margin-top: 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

/* ---------- footer ---------- */
.footer {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--foreground);
}

.footer-sources {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ---------- animaciones ---------- */
@keyframes fillbar {
  from { width: 0; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50%      { transform: scale(1.12); opacity: 0.8; }
}

@media (min-width: 640px) {
  .system-status { grid-template-columns: auto repeat(3, 1fr); align-items: center; }
}

@media (min-width: 768px) {
  .system-flow { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; }
  .flow-arrow { display: block; }
  .response-layout { grid-template-columns: 0.85fr 1.15fr; }
}

@media (max-width: 767px) {
  .topbar-inner { padding: 0 1rem; }
  .brand-name { font-size: 0.95rem; }
  .btn-red { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .main { padding: 0 1rem; }
  .hero-card { padding: 1.5rem; }
  .hero-title { font-size: 2.55rem; }
  .section-title { font-size: 1.6rem; }
  .dashboard-top, .dashboard-footer { flex-wrap: wrap; }
}
