/* ============================================================
   Webability — Public site design system
   Estilo: Minimalista nórdico
   Sin Tailwind. CSS propio, ~12KB sin gzip.
   ============================================================ */

/* --- Tokens ------------------------------------------------ */
:root {
  /* Color — derivado del logo (cubos azul-teal + esfera roja) */
  --bg:           #fafaf7;
  --bg-soft:      #e7f0f6;       /* azul pastel para secciones alternas */
  --bg-soft-2:    #f0f6fa;       /* azul pastel aún más claro            */
  --surface:      #ffffff;
  --ink:          #14202b;       /* tinta con sutil tono azul   */
  --ink-soft:     #2e3a47;
  --muted:        #5d6873;
  --muted-2:      #8a939c;
  --line:         #dbe4eb;       /* línea con tinte azul         */
  --line-strong:  #c2cdd6;

  /* Acento azul — de los cubos del logo, desaturado */
  --accent:       #2a6f8e;
  --accent-hover: #1f5670;
  --accent-soft:  #e8f0f4;       /* fondos suaves / focus rings */
  --accent-line:  #b8d2dd;

  /* Acento rojo (CTA / "mark") — de la esfera, discreto */
  --brand-red:        #c1342f;
  --brand-red-hover:  #9d2622;
  --brand-red-soft:   #fbeae9;
  --brand-red-line:   #e8b9b6;

  /* aliases mantenidos por compatibilidad con páginas existentes */
  --mark:         var(--brand-red);
  --mark-soft:    var(--brand-red-soft);

  --danger:       #a52a2a;
  --ok:           #2f7d4f;

  /* Typography */
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container:    1120px;
  --container-narrow: 760px;
  --radius-sm:    4px;
  --radius:       6px;
  --radius-lg:    10px;

  /* Misc */
  --shadow-sm:    0 1px 2px rgba(15,20,25,.05);
  --shadow:       0 4px 14px rgba(15,20,25,.06);
  --transition:   180ms ease;
}

/* --- Reset ligero ----------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.015em;
  font-weight: 600;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { margin: 0; }

ul, ol { margin: 0; padding: 0; }

::selection { background: var(--accent); color: var(--bg); }

/* --- Layout ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.container-narrow { max-width: var(--container-narrow); }

.section { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.section-tight { padding: clamp(1.5rem, 4vw, 2.5rem) 0; }

/* Stack utilities */
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.stack-lg > * + * { margin-top: 1.5rem; }

/* Grid */
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

@media (max-width: 880px) {
  .grid-12 { grid-template-columns: 1fr; }
  .col-3, .col-9 { grid-column: 1 / -1 !important; }
}
.col-3 { grid-column: span 3; }
.col-9 { grid-column: span 9; }

/* Two-column (image / text) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split > * { min-width: 0; }   /* permite que <pre> y <img> no rompan el grid */
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

/* --- Eyebrows / titles ------------------------------------ */
.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: .5rem;
  margin-bottom: 3px;
}

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 60ch;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mark         { color: var(--accent); font-weight: 500; font-style: normal; }
.mark-red     { color: var(--brand-red); font-weight: 500; font-style: normal; }
.mark-gold    { color: #a17a1f; font-weight: 500; }
em.mark, em.mark-red { font-style: normal; }

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--ink);
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}
.btn-primary:hover {
  background: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
  color: #fff;
}

.btn-ink {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-ink:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn-secondary {
  background: #cadeec;                 /* azul pastel más saturado */
  color: var(--ink);
  border-color: #97b8cc;
}
.btn-secondary:hover {
  background: #b1cee2;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-link {
  padding: 0;
  background: transparent;
  color: var(--accent);
  border: none;
  font-weight: 500;
}
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.btn-block { width: 100%; }
.btn-sm    { padding: .45rem .85rem; font-size: .85rem; }
.btn-lg    { padding: .9rem 1.6rem; font-size: 1rem; }

/* --- Cards ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  transition: var(--transition);
}
.card-hover:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card-soft   { background: var(--bg-soft-2); border-color: transparent; }
.card-bare   { background: transparent; border: none; padding: 0; }
.card-feature{ border-color: var(--accent); position: relative; }

/* --- Forms ------------------------------------------------ */
.field { display: block; }
.field + .field { margin-top: 1rem; }

.label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.input, .select, .textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  transition: var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--muted-2); }

.checkbox-row {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.checkbox-row input[type="checkbox"] {
  margin-top: .2rem;
  accent-color: var(--accent);
  width: 16px; height: 16px;
}

/* --- Code blocks ------------------------------------------ */
.code, code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--bg-soft-2);
  padding: .1em .35em;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}
pre.code, pre code {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-soft-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  white-space: pre;
  font-size: .85rem;
}
pre.code-inverse {
  background: var(--ink);
  color: #e0e4ec;
  border-color: var(--ink);
}
pre.code-inverse .ph { color: #e9b85b; }

/* --- Navbar ----------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 246, 250, .85);  /* azul pastel translúcido */
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--brand-red);                  /* "Web" en rojo */
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 28px; height: auto; }
.nav-brand .accent { color: var(--accent); } /* "ability" en azul-teal */

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: .92rem;
  list-style: none;
}
.nav-links a:not(.btn) {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--accent); text-decoration: none; }
/* botones dentro del navbar conservan sus colores definidos en .btn-* */
.nav-links a.btn { color: #fff; }
.nav-links a.btn-secondary { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .4rem .7rem;
  font-size: .85rem;
  color: var(--ink);
}

@media (max-width: 760px) {
  .nav-links.desktop { display: none; }
  .nav-toggle { display: inline-flex; }
}

.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: .5rem 0;
  color: var(--ink-soft);
  text-decoration: none;
}

/* --- Breadcrumbs ------------------------------------------ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--muted);
  list-style: none;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--line-strong); }
.breadcrumbs .current { color: var(--ink); }

/* --- Footer ----------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }
.footer h4 {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .85rem;
}
.footer ul { list-style: none; }
.footer li + li { margin-top: .4rem; }
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- Hero (light, sin gradiente) -------------------------- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  max-width: 18ch;
}
.hero .lead { margin-top: 1.5rem; }
.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* --- Demo (mockup) frame ---------------------------------- */
.window {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .85rem;
  background: var(--bg-soft-2);
  border-bottom: 1px solid var(--line);
  font-size: .75rem;
  color: var(--muted);
}
.window-bar .dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-strong);
}
.window-bar .label {
  margin-left: .65rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-body { padding: clamp(1rem, 2.5vw, 1.5rem); }
.window-body img { border-radius: var(--radius); border: 1px solid var(--line); }

/* --- Pricing table ---------------------------------------- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border-color: var(--brand-red);
  border-width: 1.5px;
  position: relative;
  background: linear-gradient(180deg, #fff 0%, var(--brand-red-soft) 100%);
}
.price-card.featured::before {
  content: "Más popular";
  position: absolute;
  top: -10px;
  left: 1.5rem;
  background: var(--brand-red);
  color: #fff;
  font-size: .7rem;
  letter-spacing: .08em;
  padding: .25rem .65rem;
  border-radius: 100px;
  text-transform: uppercase;
}
.price-card .plan-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.price-card .plan-features {
  list-style: none;
  margin: 1rem 0;
  flex: 1;
  font-size: .92rem;
  color: var(--ink-soft);
}
.price-card .plan-features li {
  padding: .35rem 0 .35rem 1.25rem;
  position: relative;
}
.price-card .plan-features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: .6;
}
.price-card .price {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: .5rem 0 1rem;
}
.price-card .price small {
  font-size: .85rem;
  font-weight: 400;
  color: var(--muted);
}

/* --- Tag / Badge ------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .03em;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.tag-ink   { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag-mark  { background: var(--mark-soft); color: #8a6a1d; border-color: #efe1bd; }

.dot-status {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: .4rem;
}
.dot-status.warn  { background: var(--mark); }
.dot-status.down  { background: var(--danger); }
.dot-status.maint { background: var(--muted-2); }

/* --- Feature list ----------------------------------------- */
.feature {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.feature:last-child { border-bottom: none; }
.feature h3 { margin-bottom: .35rem; }

.icon-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: .85rem;
  font-size: 1.2rem;
}

/* --- Tables ----------------------------------------------- */
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1rem 0;
}
table.table th, table.table td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
table.table th {
  background: var(--bg-soft-2);
  font-weight: 500;
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}
table.table tbody tr:hover { background: var(--bg-soft-2); }

/* --- Docs sidebar layout ---------------------------------- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 880px) { .docs-layout { grid-template-columns: 1fr; } }

.docs-side-wrap {
  position: sticky;
  top: 88px;
  font-size: .9rem;
}
@media (max-width: 880px) { .docs-side-wrap { position: static; } }

.docs-side {
  font-size: .9rem;
}
.docs-side .label-section {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 1.25rem 0 .5rem;
}
.docs-side a {
  display: block;
  padding: .35rem 0;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: .75rem;
  margin-left: -.75rem;
}
.docs-side a:hover {
  color: var(--accent);
  border-left-color: var(--line-strong);
}
.docs-side a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.docs-side a.sub { padding-left: 1.5rem; font-size: .85rem; color: var(--muted); }

.docs-content section { padding-top: 2rem; scroll-margin-top: 88px; }
.docs-content section + section { border-top: 1px solid var(--line); margin-top: 1rem; }
.docs-content h2 { margin-bottom: .75rem; }
.docs-content p  { color: var(--ink-soft); line-height: 1.7; margin-top: .75rem; max-width: 70ch; }
.docs-content ul { margin: 1rem 0 1rem 1.25rem; color: var(--ink-soft); }
.docs-content li { padding: .25rem 0; }

/* --- Misc helpers ----------------------------------------- */
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: .25rem 0; }

.ph { color: var(--mark); font-weight: 500; }

.btn-primary svg, .btn-secondary svg { stroke: currentColor; }

/* Inputs that lost their original wrapping in transformed docs */
input[type="text"].input,
input[type="email"].input,
input[type="password"].input,
input[type="search"].input,
input[type="url"].input { display: block; }

/* --- Hidden / utilities ----------------------------------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: .5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* --- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
