/* Genkki · landing pública
   Sin build step: CSS escrito a mano para que el despliegue en Hestia no
   dependa de Node ni de Vite. Temas claro y oscuro por atributo data-theme. */

:root {
  --ink:        #12203A;
  --ink-soft:   #2C3E5C;
  --muted:      #5A6B84;
  --paper:      #F7F9FB;
  --surface:    #FFFFFF;
  --line:       #DCE4EC;
  --line-soft:  #EDF2F6;

  --green:      #17C99B;
  --blue:       #1668E3;

  --map-bg:     #EEF3F7;
  --map-grid:   #DCE4EC;
  --map-block:  #E4EBF1;
  --map-road:   #CBD7E2;
  --pin:        #12203A;

  --invert-bg:   #12203A;
  --invert-text: #EAF0F7;
  --invert-soft: #B4C4D8;
  --invert-line: #3A4C6B;

  --ok-bg: #E4F7F1;   --ok-fg: #0B6E56;
  --late-bg: #FCF0DC; --late-fg: #B26A0A;
  --out-bg: #FBE9E9;  --out-fg: #9B2C2C;

  --shadow: 0 12px 30px -18px rgba(18, 32, 58, .45);
  --particle: 22, 104, 227;
  --amber: #B26A0A;
  --notice-bg: #FDF6EA;
  --notice-fg: #6B4708;

  --max: 1120px;
  --gap: clamp(3.5rem, 8vw, 7rem);
}

[data-theme="dark"] {
  --ink:        #E8EEF6;
  --ink-soft:   #C3D0E2;
  --muted:      #8C9DB8;
  --paper:      #0B1220;
  --surface:    #111B2E;
  --line:       #24344F;
  --line-soft:  #1B2739;

  --green:      #2FE0B0;
  --blue:       #4E92F5;

  --map-bg:     #0F1A2C;
  --map-grid:   #1C2A42;
  --map-block:  #16233A;
  --map-road:   #22314B;
  --pin:        #E8EEF6;

  --invert-bg:   #16233C;
  --invert-text: #EAF0F7;
  --invert-soft: #9FB2CC;
  --invert-line: #33456A;

  --ok-bg: #10352C;   --ok-fg: #52DDB4;
  --late-bg: #38290F; --late-fg: #E5A94B;
  --out-bg: #3A1D1D;  --out-fg: #F08B8B;

  --shadow: 0 12px 34px -16px rgba(0, 0, 0, .7);
  --particle: 78, 146, 245;
  --amber: #E5A94B;
  --notice-bg: #2A2010;
  --notice-fg: #E5C48B;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 {
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700; letter-spacing: -0.022em; line-height: 1.1;
  color: var(--ink); margin: 0; text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 4.4vw, 3.375rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; max-width: 68ch; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1.5rem; }
.band { padding-block: var(--gap); }
.band-white { background: var(--surface); border-block: 1px solid var(--line-soft); }
.lede { font-size: 1.1875rem; color: var(--ink-soft); max-width: 58ch; }
.muted { color: var(--muted); }

/* ---------- Cargador ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--paper);
  transition: opacity .45s ease, visibility .45s ease;
  /* Si el JS falla, se retira solo: nunca deja la página bloqueada. */
  animation: loaderBailout .1s linear 6s forwards;
}
#loader.done { opacity: 0; visibility: hidden; }
@keyframes loaderBailout { to { opacity: 0; visibility: hidden; } }
.loader-mark { display: grid; place-items: center; gap: 1.125rem; }
.loader-mark svg { width: 56px; height: 56px; }
.loader-ring {
  fill: none; stroke: url(#loaderGrad); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 108 145; transform-origin: 50% 50%;
  animation: loaderSpin 1.1s cubic-bezier(.6,.1,.4,.9) infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
.loader-word { font-size: .8125rem; color: var(--muted); letter-spacing: .01em; }

/* ---------- Cabecera ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: .875rem; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 32px; width: auto; display: block; }
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark  { display: block; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .9375rem; font-weight: 500; }
.nav a:hover { color: var(--blue); }
@media (max-width: 860px) { .nav .nav-hide { display: none; } }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--ink-soft); color: var(--ink); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.375rem; border-radius: 7px;
  font-weight: 600; font-size: .9688rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--ink-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 7vw, 6rem) var(--gap); position: relative; }
#particles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.hero > .hero-grid { position: relative; z-index: 1; }
.hero-grid {
  display: grid; gap: clamp(2.5rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero p.lede { margin-top: 1.375rem; }
.hero-note {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  font-size: .9375rem; color: var(--muted); max-width: 46ch;
}

/* ---------- Geocerca (elemento firma) ---------- */
.geo { position: relative; }
.geo svg { width: 100%; height: auto; display: block; }
.geo-ring { stroke-dasharray: 754; stroke-dashoffset: 754; animation: draw 1.5s cubic-bezier(.4,0,.2,1) .5s forwards; }
.geo-pin { opacity: 0; animation: drop .5s cubic-bezier(.34,1.4,.64,1) 1.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }

.record {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.125rem; box-shadow: var(--shadow);
  display: grid; gap: .5rem; font-size: .9063rem;
  max-width: 21rem; margin: -3.25rem 0 0 auto; position: relative;
}
.record-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.record-row dt { color: var(--muted); }
.record-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.record-head { font-family: "Archivo", sans-serif; font-weight: 700; border-bottom: 1px solid var(--line-soft); padding-bottom: .5rem; }
.tick { color: var(--ok-fg); font-weight: 600; }

/* ---------- Problema ---------- */
.problem-grid { display: grid; gap: 2.25rem 3rem; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 2.75rem; }
@media (max-width: 760px) { .problem-grid { grid-template-columns: 1fr; } }
.problem-grid p { margin: .5rem 0 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 2.25rem; } }
.step { padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.step:nth-child(2) { border-top-color: var(--green); }
.step:nth-child(3) { border-top-color: var(--blue); }
.step-n { font-family: "Archivo", sans-serif; font-weight: 700; font-size: .875rem; color: var(--muted); }
.step h3 { margin: .375rem 0 .5rem; }
.step p { font-size: .9688rem; color: var(--ink-soft); margin: 0; }

/* ---------- Funciones ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2.75rem; margin-top: 3rem; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }
.feature svg { display: block; margin-bottom: .875rem; }
.feature h3 { margin-bottom: .375rem; }
.feature p { font-size: .9688rem; color: var(--ink-soft); margin: 0; }

/* ---------- Vista del panel ---------- */
.panel-shot { margin-top: 2.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); font-size: .8438rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.table-scroll { overflow-x: auto; }
table.day { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 40rem; }
table.day th { text-align: left; font-family: "Archivo", sans-serif; font-weight: 600; font-size: .8125rem; color: var(--muted); padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
table.day td { padding: .8125rem 1rem; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
table.day tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .1875rem .625rem; border-radius: 99px; font-size: .8125rem; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-late { background: var(--late-bg); color: var(--late-fg); }
.pill-out { background: var(--out-bg); color: var(--out-fg); }

/* ---------- Seguridad ---------- */
.sec-list { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 1.25rem; max-width: 60ch; }
.sec-list li { padding-left: 1.75rem; position: relative; color: var(--ink-soft); }
.sec-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 2px; background: linear-gradient(135deg, var(--green), var(--blue)); }
.sec-list strong { color: var(--ink); font-weight: 600; }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.5rem; margin-top: 3rem; align-items: start; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 1.75rem; }
.plan-main { border-color: var(--ink); }
.plan h3 { font-size: 1.0625rem; }
.price { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 2.75rem; letter-spacing: -.03em; margin: .75rem 0 0; font-variant-numeric: tabular-nums; }
.price span { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-alt { margin: .375rem 0 1.25rem; font-size: .9375rem; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .625rem; font-size: .9375rem; color: var(--ink-soft); }
.plan ul li { padding-left: 1.375rem; position: relative; }
.plan ul li::before { content: "·"; position: absolute; left: .375rem; color: var(--green); font-weight: 700; font-size: 1.25rem; line-height: 1; }

/* ---------- FAQ ---------- */
.faq { margin-top: 2.75rem; max-width: 72ch; }
.faq details { border-bottom: 1px solid var(--line); padding: 1.125rem 0; }
.faq summary { cursor: pointer; font-family: "Archivo", sans-serif; font-weight: 600; font-size: 1.0625rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.375rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: .875rem 0 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Cierre ---------- */
.closer { background: var(--invert-bg); }
.closer h2 { color: var(--invert-text); }
.closer p, .closer .lede { color: var(--invert-soft); }
.closer .btn-primary { background: var(--invert-text); color: var(--invert-bg); }
.closer .btn-primary:hover { background: #CBD8E8; }
.closer .btn-outline { background: transparent; border-color: var(--invert-line); color: var(--invert-text); }
.closer .btn-outline:hover { border-color: var(--invert-soft); }

/* ---------- Pie ---------- */
.foot { padding-block: 2.5rem; border-top: 1px solid var(--line); font-size: .9063rem; color: var(--muted); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* ---------- Documentos legales ---------- */
.doc { max-width: 44rem; }
.doc h2 { margin-top: 2.75rem; font-size: 1.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc ul { color: var(--ink-soft); padding-left: 1.25rem; }
.doc li { margin-bottom: .5rem; }
.notice { border-left: 3px solid var(--amber); background: var(--notice-bg); padding: 1rem 1.25rem; margin: 2rem 0; border-radius: 0 6px 6px 0; }
.notice p { margin: 0; font-size: .9688rem; color: var(--notice-fg); }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .geo-ring { animation: none; stroke-dashoffset: 0; }
  .geo-pin  { animation: none; opacity: 1; }
  .loader-ring { animation: none; stroke-dasharray: none; }
  #particles { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
