:root {
  /* Paleta definitiva, confirmada por Alex 2026-08-13 -- Grafito + lima
     eléctrico. Contraste verificado (WCAG): texto principal sobre fondo
     ~14.6:1, texto secundario sobre sección inferior ~5.3:1, lima sobre
     fondo ~13.9:1 -- todos por encima del mínimo 4.5:1 para texto normal. */
  --night-deep: #1a1f24;
  --night-mid: #262d33;
  --night-soft: #333c44;
  --night-softer: #46525c;

  --lime: #baff5c;
  --lime-deep: #8fd147;
  --leaf: #7fb89a;
  --clay: #d99a5b;

  --text-bright: #eef1f0;
  --text-muted: #8fa3ad;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --radius-lg: 20px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--night-deep);
  color: var(--text-bright);
  line-height: 1.6;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--lime); }

/* ---------- fondo con textura de grano, sutil, sobre toda la página ---------- */
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- hero: la zona de goteo animada ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--night-deep);
  color: var(--text-bright);
  padding-bottom: 64px;
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 4%, rgba(51, 60, 68, 0.85), transparent 72%),
    linear-gradient(180deg, #20262b 0%, var(--night-deep) 70%);
}

.drip-glow {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(186, 255, 92, 0.30) 0%,
    rgba(186, 255, 92, 0.13) 28%,
    rgba(143, 209, 71, 0.08) 52%,
    transparent 72%);
  filter: blur(6px);
  animation: respirar 9s ease-in-out infinite;
  transition: transform 1.1s cubic-bezier(.2,.8,.2,1), opacity 1.1s ease;
}

.hero-field.regando .drip-glow { transform: translateX(-50%) scale(1.18); }
.hero-field.ahorra .drip-glow { filter: blur(6px) saturate(1.15); }

@keyframes respirar {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 64px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  color: var(--text-bright);
}

.hero .lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 40px;
}

/* ---------- tarjeta de cristal ---------- */
.calc-card {
  background: rgba(79, 216, 206, 0.055);
  border: 1px solid rgba(159, 180, 196, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lime);
  margin-bottom: 7px;
}

.field select,
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(159, 180, 196, 0.28);
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-family: var(--font-body);
  background: rgba(11, 30, 45, 0.6);
  color: var(--text-bright);
  appearance: none;
}

.select-shell { position: relative; }
.select-shell::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--lime);
  border-bottom: 2px solid var(--lime);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field select:focus-visible,
.field input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

button[type="submit"] {
  width: 100%;
  padding: 15px;
  background: var(--lime);
  color: var(--night-deep);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

button[type="submit"]:hover { background: #6fe4db; }
button[type="submit"]:active { transform: scale(0.985); }

/* ---------- resultado ---------- */
.resultado {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(159, 180, 196, 0.2);
  animation: aparecer 0.5s ease both;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.resultado-frase {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.resultado-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.numero-hero { line-height: 1; }

.numero-valor {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  color: var(--lime);
  display: block;
  font-variant-numeric: tabular-nums;
}

.numero-unidad {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.frecuencia-chip {
  background: rgba(159, 180, 196, 0.1);
  border: 1px solid rgba(159, 180, 196, 0.22);
  border-radius: 999px;
  padding: 8px 16px;
  text-align: right;
}

.frecuencia-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.frecuencia-valor {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-bright);
}

.comparativa {
  background: rgba(143, 201, 169, 0.09);
  border: 1px solid rgba(143, 201, 169, 0.32);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.comparativa-titulo {
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--leaf);
}

.barra-fila {
  display: grid;
  grid-template-columns: 110px 1fr 74px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.barra-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.barra-track {
  height: 9px;
  background: rgba(159, 180, 196, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.barra-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(.2,.8,.2,1);
}

.barra-actual { background: var(--clay); }
.barra-goteo { background: var(--leaf); }

.barra-valor {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: right;
  color: var(--text-bright);
}

.ahorro-frase {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.ahorro-frase strong { color: var(--leaf); font-family: var(--font-mono); }

.nota-resultado {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
  margin: 0;
}

/* ---------- ilustración divisoria: huerto con riego ---------- */
.huerto-divisor {
  position: relative;
  z-index: 2;
  background: var(--night-deep);
  margin-top: -2px; /* evita línea de 1px entre hero y divisor en algunos navegadores */
}

.huerto-divisor svg {
  display: block;
  width: 100%;
  height: auto;
}

.hd-suelo { fill: var(--night-mid); }
.hd-tallo, .hd-tallo-fino { fill: none; stroke: var(--night-softer); stroke-width: 3; stroke-linecap: round; }
.hd-tallo-fino { stroke-width: 2.5; }
.hd-hoja { fill: var(--leaf); opacity: 0.9; }
.hd-hoja-clara { fill: var(--lime); opacity: 0.55; }
.hd-fruto { fill: var(--clay); }
.hd-tiesto { fill: var(--clay); opacity: 0.8; }
.hd-agua { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linecap: round; opacity: 0.8; }
.hd-gota { fill: var(--lime); opacity: 0.85; }
.hd-tubo { fill: none; stroke: var(--clay); stroke-width: 5; stroke-linecap: round; opacity: 0.85; }

/* ---------- secciones inferiores: mismo azul nocturno, con profundidad propia ---------- */
main.wrap {
  padding-top: 52px;
  position: relative;
  background:
    radial-gradient(ellipse 80% 40% at 85% 0%, rgba(143, 209, 71, 0.09), transparent 60%),
    var(--night-mid);
  background-image:
    radial-gradient(ellipse 80% 40% at 85% 0%, rgba(143, 209, 71, 0.09), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23baff5c' stroke-width='1.4' opacity='0.10'%3E%3Cpath d='M20,120 C14,95 26,80 20,55'/%3E%3Cellipse cx='26' cy='90' rx='9' ry='5' transform='rotate(-25 26 90)'/%3E%3Ccircle cx='100' cy='35' r='3'/%3E%3Ccircle cx='108' cy='45' r='2.2'/%3E%3Cpath d='M100,35 C100,28 100,22 100,16' /%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  background-size: auto, 140px 140px;
  background-color: var(--night-mid);
}

.info h2, .tabla-referencia h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 10px;
}

.icono-seccion {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: var(--lime);
  color: var(--lime);
}

.info p { color: var(--text-muted); }
.info p strong { color: var(--text-bright); }

.tabla-referencia { margin: 40px 0 56px; }

.tabla-scroll { overflow-x: auto; border-radius: var(--radius-md); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
  background: rgba(11, 30, 45, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(159, 180, 196, 0.16);
  color: var(--text-bright);
}

th {
  background: var(--night-soft);
  color: var(--text-bright);
  font-weight: 600;
  font-family: var(--font-display);
}

tbody tr:nth-child(even) { background: rgba(79, 216, 206, 0.05); }

td:not(:first-child) { font-family: var(--font-mono); font-size: 0.88rem; color: var(--text-muted); }

.nota-tabla {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.site-footer {
  background: var(--night-deep);
  color: var(--text-muted);
  padding: 22px 0;
  margin-top: 40px;
  font-size: 0.85rem;
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .field-grid { grid-template-columns: 1fr; }
  .hero-content { padding-top: 40px; }
  .calc-card { padding: 20px; }
  .resultado-main { align-items: flex-start; }
  .frecuencia-chip { text-align: left; }
  .barra-fila { grid-template-columns: 84px 1fr 64px; }
}
