/* ============================================================
   Portafolio de proyectos — hoja de estilos compartida
   ============================================================ */

:root {
  /* ===== Tema CLARO (predeterminado) — colores cítricos ===== */
  --bg: #fbfef5;
  --bg-soft: #eef7e0;
  --card: #ffffff;
  --card-2: #f3fae8;
  --border: #d7e8bf;
  --text: #21301a;
  --text-strong: #33452a;
  --muted: #5f7150;
  --brand: #16a34a;      /* verde cítrico */
  --brand-2: #0ea5e9;    /* azul claro */
  --accent: #f97316;     /* naranja */
  --warn: #b45309;       /* ámbar (legible sobre fondo claro) */
  --tint: rgba(34, 197, 94, .14);
  --header-bg: rgba(255, 255, 255, .82);
  --glow-1: rgba(163, 230, 53, .35);   /* lima */
  --glow-2: rgba(56, 189, 248, .28);   /* azul claro */
  --hero-1: #15803d; --hero-2: #f59e0b; --hero-3: #ea580c;  /* verde→amarillo→naranja */
  --btn-primary-text: #06210f;
  /* Tonos claros cítricos por sección (solo tema claro) */
  --sec-lima:     #f0f9e0;
  --sec-verde:    #e9f6da;
  --sec-azul:     #e4f4fb;
  --sec-amarillo: #fbf5da;
  --sec-naranja:  #fdeede;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(30, 50, 20, .12);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  /* ===== Tema OSCURO (el original) ===== */
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: #161f3d;
  --card-2: #1c264a;
  --border: #27315a;
  --text: #e8ecf8;
  --text-strong: var(--text-strong);
  --muted: #9aa6cc;
  --brand: #6ea8fe;
  --brand-2: #8b7bff;
  --accent: #34d399;
  --warn: #fbbf24;
  --tint: rgba(110, 168, 254, .12);
  --header-bg: rgba(11, 16, 32, .72);
  --glow-1: rgba(139, 123, 255, .18);
  --glow-2: rgba(110, 168, 254, .16);
  --hero-1: #ffffff; --hero-2: #b9c6ff; --hero-3: #8b7bff;
  --btn-primary-text: #0a0f1f;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  /* Color base y degradados separados: el color sigue al tema sin la
     ambigüedad del atajo `background` con var() (que no siempre recalcula). */
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, var(--glow-1), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, var(--glow-2), transparent 55%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--text);
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 18px rgba(110,168,254,.8);
}
.brand img.logo { height: 40px; width: auto; display: block; border-radius: 8px; }
.footer-logo { height: 30px; width: auto; opacity: .85; border-radius: 6px; vertical-align: middle; }
.hero-logo { height: 84px; width: auto; margin-bottom: 22px; border-radius: 14px; box-shadow: var(--shadow); }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.nav-links > a { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav-links > a:hover { color: var(--text); text-decoration: none; }

/* Menús desplegables del nav */
.nav-drop { position: relative; }
.nav-drop-top {
  color: var(--muted); font-weight: 600; font-size: 15px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.nav-drop:hover .nav-drop-top,
.nav-drop:focus-within .nav-drop-top { color: var(--text); }
.nav-menu {
  position: absolute; top: 100%; left: 0;
  display: none; flex-direction: column; gap: 2px;
  min-width: 240px; padding: 8px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); z-index: 60;
}
.nav-drop:hover .nav-menu,
.nav-drop:focus-within .nav-menu { display: flex; }
.nav-menu a {
  color: var(--muted); font-weight: 600; font-size: 14.5px;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav-menu a:hover { color: var(--text); background: var(--tint); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 36px; }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
  background: linear-gradient(120deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 720px; margin: 0; }
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}

/* ---------- Project grid (home) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  padding: 18px 0 40px;
}
.card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.card-head img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 20px; }
.card-head .tag { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.card p { color: var(--muted); margin: 0 0 18px; flex: 1; }
.card .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.chip {
  font-size: 12px; font-weight: 600;
  color: var(--text);
  background: var(--tint);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
  padding: 11px 18px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--btn-primary-text);
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.06); }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { text-decoration: none; border-color: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Google Play badge (CSS, sin imágenes externas) */
.gp-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: #000; color: #fff;
  border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 10px 18px; min-width: 200px;
}
.gp-badge:hover { text-decoration: none; border-color: #555; }
.gp-badge .tri {
  width: 0; height: 0;
  border-top: 11px solid transparent; border-bottom: 11px solid transparent;
  border-left: 18px solid #6ea8fe;
}
.gp-badge .gp-text { display: flex; flex-direction: column; line-height: 1.15; }
.gp-badge .gp-small { font-size: 11px; color: #cbd5e1; }
.gp-badge .gp-big { font-size: 19px; font-weight: 700; }

/* ---------- Project detail page ---------- */
.proj-hero {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  padding: 56px 0 28px;
}
.proj-hero img.icon {
  width: 104px; height: 104px; border-radius: 24px; object-fit: cover;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.proj-hero .meta h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); }
.proj-hero .meta .sub { color: var(--muted); font-size: 18px; margin: 0 0 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }

.section { padding: 28px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 24px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.section h2 .ic { font-size: 22px; }
.section p { color: var(--text-strong); }
.section ul { color: var(--text-strong); padding-left: 22px; }
.section li { margin: 6px 0; }

/* Cada sección con su propio color claro a TODO lo ancho (SOLO tema claro).
   El contenido sigue centrado (.wrap) pero el color se extiende de borde a
   borde con un box-shadow enorme, recortado en vertical con clip-path.
   En oscuro se conserva el separador original de arriba (sin color). */
:root:not([data-theme="dark"]) .section {
  border-top: none;
  padding: 48px 22px;
  clip-path: inset(0 -100vw);   /* deja pasar el color a los lados */
}
:root:not([data-theme="dark"]) .section:nth-of-type(5n + 1) { background: var(--sec-lima);     box-shadow: 0 0 0 100vw var(--sec-lima); }
:root:not([data-theme="dark"]) .section:nth-of-type(5n + 2) { background: var(--sec-verde);    box-shadow: 0 0 0 100vw var(--sec-verde); }
:root:not([data-theme="dark"]) .section:nth-of-type(5n + 3) { background: var(--sec-azul);     box-shadow: 0 0 0 100vw var(--sec-azul); }
:root:not([data-theme="dark"]) .section:nth-of-type(5n + 4) { background: var(--sec-amarillo); box-shadow: 0 0 0 100vw var(--sec-amarillo); }
:root:not([data-theme="dark"]) .section:nth-of-type(5n + 5) { background: var(--sec-naranja);  box-shadow: 0 0 0 100vw var(--sec-naranja); }

/* "Qué hacemos": cada tarjeta con fondo SÓLIDO de un color suave (tema claro) */
:root:not([data-theme="dark"]) #servicios .card {
  background-image: none;   /* quita el degradado; fondo sólido */
}
:root:not([data-theme="dark"]) #servicios .card:nth-of-type(1) { background-color: #eaf5db; border-color: #c7e2a3; }
:root:not([data-theme="dark"]) #servicios .card:nth-of-type(2) { background-color: #e4f2fc; border-color: #b8def4; }
:root:not([data-theme="dark"]) #servicios .card:nth-of-type(3) { background-color: #fbf6dc; border-color: #ecdd9d; }
:root:not([data-theme="dark"]) #servicios .card:nth-of-type(4) { background-color: #fdefe1; border-color: #f6cead; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel h3 { margin: 0 0 8px; font-size: 18px; }
.panel p, .panel ul { margin: 0; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.feature .fic { font-size: 22px; }
.feature h4 { margin: 8px 0 6px; font-size: 16px; }
.feature p { margin: 0; font-size: 14.5px; color: var(--muted); }

/* Screenshots gallery */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.shots img {
  width: 100%; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-soft); object-fit: cover;
}
.shots.wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Download highlight box */
.download-box {
  background: linear-gradient(135deg, var(--glow-1), var(--glow-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.download-box .dl-text h3 { margin: 0 0 4px; }
.download-box .dl-text p { margin: 0; color: var(--muted); }

.note {
  font-size: 13.5px; color: var(--warn);
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
  border-radius: 10px; padding: 10px 14px; margin-top: 14px;
}

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-top: 26px; }

/* ---------- Company sections ---------- */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 26px; }
.section-head h2 { justify-content: center; font-size: 28px; }
.section-head p { color: var(--muted); margin: 6px 0 0; }

.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .mv-grid { grid-template-columns: 1fr; } }
.mv {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.mv .mv-ic { font-size: 30px; }
.mv h3 { margin: 10px 0 8px; font-size: 22px; }
.mv p { color: var(--text-strong); margin: 0; }

.division { margin-top: 18px; }
.division-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.division-head .d-ic {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 24px; background: var(--tint); border: 1px solid var(--border);
}
.division-head h3 { margin: 0; font-size: 22px; }
.division-head .d-sub { color: var(--muted); font-size: 14.5px; width: 100%; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.svc {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; transition: border-color .18s ease, transform .18s ease;
}
.svc:hover { border-color: var(--brand); transform: translateY(-3px); }
.svc .s-ic { font-size: 22px; }
.svc h4 { margin: 8px 0 6px; font-size: 16px; }
.svc p { margin: 0; font-size: 14px; color: var(--muted); }
.svc .badge-new {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3);
  padding: 1px 8px; border-radius: 999px; margin-left: 6px;
}

.center { text-align: center; }
.mt-24 { margin-top: 24px; }

/* ---------- FAQ (acordeón) ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 4px 18px; margin-bottom: 12px;
}
.faq details[open] { border-color: var(--brand); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 0; font-weight: 700; font-size: 16.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 22px; font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-strong); margin: 0 0 16px; }

/* ---------- Formulario de consultas ---------- */
.form {
  max-width: 720px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--text); }
.form input, .form select, .form textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 15px;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--brand);
}
.form textarea { resize: vertical; min-height: 120px; }
.form .form-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 30px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Historial de trabajos (línea de tiempo con tarjetas) ---------- */
.timeline { position: relative; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-left: 52px; margin-bottom: 24px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: 9px; top: 6px; width: 18px; height: 18px;
  border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 3px solid var(--bg);
}
.timeline-dot.pendiente { background: var(--border); }
.timeline-fecha {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--brand); margin-bottom: 8px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
@media (max-width: 520px) {
  .timeline::before { left: 13px; }
  .timeline-item { padding-left: 40px; }
  .timeline-dot { left: 5px; }
}

/* ---------- Párrafos justificados (lectura más presentable) ---------- */
.section p,
.section li,
.panel p,
.panel li,
.card p,
.mv p,
.feature p,
.svc p,
.faq details p,
.hero p.lead {
  text-align: justify;
}
/* Conservar centrado donde corresponde (encabezados y textos centrados) */
.section-head p,
p.center,
.center {
  text-align: center;
}

/* ---------- Botón de tema claro / oscuro ---------- */
.tema-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; margin-left: 4px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; font-size: 18px; line-height: 1;
  transition: border-color .18s ease, transform .18s ease, background-color .25s ease;
}
.tema-toggle:hover { border-color: var(--brand); transform: translateY(-1px); }
.tema-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
