/* =============================================
   PROGRAMANDO.CLOUD — Apple-style Design System
   Los colores vienen de theme.js (CSS variables)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap');

/* Valores por defecto (Tema A) — theme.js los sobreescribe al cargar */
:root {
  --bg:           #ffffff;
  --bg2:          #f5f5f7;
  --bg3:          #fbfbfd;
  --bg4:          #e8e8ed;
  --card:         #ffffff;
  --card2:        #f5f5f7;
  --card3:        #e8e8ed;
  --accent:       #007AFF;
  --accent2:      #34C759;
  --accent3:      #FF9F0A;
  --accent-hover: #0066DD;
  --text1:        #1d1d1f;
  --text2:        #6e6e73;
  --text3:        #aeaeb2;
  --border:       rgba(0,0,0,0.08);
  --border2:      rgba(0,0,0,0.05);
  --shadow:       0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow2:      0 8px 32px rgba(0,0,0,0.10);
  --nav-bg:       rgba(255,255,255,0.85);
  --nav-border:   rgba(0,0,0,0.08);
  --btn-text:     #ffffff;
  --badge-bg:     rgba(0,122,255,0.08);
  --badge-color:  #007AFF;
  --tag-bg:       rgba(0,122,255,0.06);
  --tag-border:   rgba(0,122,255,0.2);
  --service-hover-border: rgba(0,122,255,0.25);
  --service-hover-bg:     rgba(0,122,255,0.02);
  --footer-bg:    #f5f5f7;
  --footer-text:  #6e6e73;
  --radius-btn:   980px;
  --radius-card:  16px;
  --radius-icon:  12px;
  --font:         -apple-system, 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font, -apple-system, 'Helvetica Neue', sans-serif);
  background: var(--bg, #fff);
  color: var(--text1, #1d1d1f);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px; z-index: 200;
  display: flex; align-items: center;
  padding: 0 24px; gap: 8px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--nav-border);
}

.nav-logo {
  font-size: 14px; font-weight: 600;
  color: var(--text1);
  letter-spacing: -0.02em;
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo em { font-style: normal; color: var(--accent); }

.nav-spacer { flex: 1; }

.nav-menu { display: flex; align-items: center; gap: 2px; }

.nav-link {
  font-size: 13px; font-weight: 400;
  color: var(--text2);
  padding: 5px 12px; border-radius: 980px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text1); background: var(--border2); }
.nav-link.active { color: var(--accent); }

.nav-cta {
  font-size: 13px; font-weight: 500;
  color: var(--btn-text);
  background: var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-btn);
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-cta:hover { opacity: 0.86; transform: translateY(-1px); }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 6px;
  border: 0.5px solid var(--border);
  border-radius: 8px; background: none;
}
.nav-hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text2); border-radius: 2px; transition: all 0.3s;
}

.nav-drawer {
  display: none;
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 190;
  flex-direction: column; padding: 12px 16px; gap: 2px;
  overflow-y: auto; border-top: 0.5px solid var(--border);
}
.nav-drawer.open { display: flex; }
.nav-drawer .nav-link { font-size: 16px; padding: 12px 16px; border-radius: 12px; }
.nav-drawer .nav-link:hover { background: var(--bg2); }
.nav-drawer .nav-cta { font-size: 16px; padding: 13px 16px; text-align: center; margin-top: 8px; border-radius: 14px; display: block; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius-btn);
  cursor: pointer; border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--accent); color: var(--btn-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }

.btn-secondary {
  background: var(--badge-bg); color: var(--accent);
}
.btn-secondary:hover { opacity: 0.82; transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg2); color: var(--text2);
  border: 0.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text1); }

.btn-wa {
  background: #25D366; color: #fff;
  box-shadow: 0 2px 8px rgba(37,211,102,0.25);
}
.btn-wa:hover { opacity: 0.88; transform: translateY(-1px); }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(52px + 5rem) 24px 5rem;
  text-align: center; overflow: hidden;
}

.hero-bg-blob {
  position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(80px); opacity: 0.5;
}
.blob1 {
  width: 500px; height: 400px;
  background: var(--badge-bg);
  top: 10%; left: 50%; transform: translateX(-40%);
}
.blob2 {
  width: 300px; height: 300px;
  background: var(--tag-bg);
  bottom: 15%; right: 5%;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--accent);
  background: var(--badge-bg);
  padding: 5px 14px; border-radius: 980px;
  margin-bottom: 20px;
  animation: fadeUp 0.7s ease both;
}
.hero-eyebrow-dot {
  width: 7px; height: 7px;
  background: var(--accent2); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.75)} }

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin-bottom: 16px;
  color: var(--text1);
  animation: fadeUp 0.7s 0.08s ease both;
}

.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, var(--accent3)) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero-lead {
  font-size: 17px; font-weight: 400;
  color: var(--text2);
  max-width: 520px; margin: 0 auto 32px;
  line-height: 1.65;
  animation: fadeUp 0.7s 0.16s ease both;
}

.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  animation: fadeUp 0.7s 0.24s ease both;
}

.tech-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 48px;
  animation: fadeUp 0.7s 0.32s ease both;
}
.tech-tag {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text2);
  background: var(--bg2);
  border: 0.5px solid var(--border);
  padding: 5px 13px; border-radius: 980px;
  transition: all 0.15s;
}
.tech-tag:hover { color: var(--accent); background: var(--badge-bg); border-color: var(--tag-border); }

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar {
  display: grid; grid-template-columns: repeat(3,1fr);
  background: var(--bg2);
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}
.stat {
  padding: 24px 16px; text-align: center;
  border-right: 0.5px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1; margin-bottom: 5px; display: block;
}
.stat-label { font-size: 12px; color: var(--text3); font-weight: 400; }

/* =============================================
   SECTIONS
   ============================================= */
.section { padding: 80px 24px; }
.section-inner { max-width: 960px; margin: 0 auto; }
.section-header { margin-bottom: 48px; }

.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 10px;
}
.label::before { content: ''; display: block; width: 16px; height: 1.5px; background: var(--accent); border-radius: 2px; }

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.12; margin-bottom: 12px;
  color: var(--text1);
}

.page-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 12px; color: var(--text1);
}

.sub-title {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 8px; color: var(--text1);
}

.section-lead { font-size: 16px; color: var(--text2); max-width: 560px; line-height: 1.7; }

/* =============================================
   SERVICE CARDS (home)
   ============================================= */
.service-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  display: block; color: var(--text1);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  box-shadow: var(--shadow);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow2);
  border-color: var(--service-hover-border);
  background: var(--service-hover-bg, var(--card));
}

.card-icon-wrap {
  width: 56px; height: 56px;
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 16px;
}

.card-title {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.02em; margin-bottom: 8px;
  color: var(--text1);
}

.card-desc { font-size: 14px; color: var(--text2); line-height: 1.6; }

.card-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500;
  color: var(--accent); margin-top: 16px;
  transition: gap 0.2s;
}
.service-card:hover .card-arrow { gap: 8px; }

/* =============================================
   DETAIL CARDS (subpages)
   ============================================= */
.detail-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden; margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.detail-card.open { box-shadow: var(--shadow2); border-color: var(--tag-border); }

.detail-card-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 24px; cursor: pointer;
  transition: background 0.15s;
}
.detail-card-head:hover { background: var(--bg2); }

.detail-head-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.detail-head-text { flex: 1; min-width: 0; }
.detail-head-name {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 4px; color: var(--text1);
}
.detail-head-tag {
  font-size: 11px; font-weight: 500;
  color: var(--accent);
  background: var(--tag-bg);
  border: 0.5px solid var(--tag-border);
  padding: 2px 9px; border-radius: 980px;
  display: inline-block; letter-spacing: 0.02em;
}

.detail-chevron {
  font-size: 12px; color: var(--text3);
  flex-shrink: 0; transition: transform 0.3s, color 0.2s;
}
.detail-card.open .detail-chevron { transform: rotate(180deg); color: var(--accent); }

.detail-card-body {
  display: none; padding: 0 24px 24px;
  border-top: 0.5px solid var(--border); margin: 0 24px;
}
.detail-card.open .detail-card-body { display: block; animation: slideDown 0.28s ease; }
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }

.detail-desc {
  font-size: 15px; color: var(--text2);
  line-height: 1.75; padding-top: 20px; margin-bottom: 16px;
}

.feat-list { display: flex; flex-direction: column; gap: 10px; }
.feat-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text2); }
.feat-list li .bullet { color: var(--accent); flex-shrink: 0; font-size: 13px; margin-top: 2px; font-weight: 600; }

.pill-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 14px 0; }
.pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 9px 13px;
  font-size: 13px; color: var(--text2); transition: all 0.15s;
}
.pill:hover { border-color: var(--tag-border); color: var(--text1); background: var(--tag-bg); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.info-box {
  background: var(--badge-bg); border: 0.5px solid var(--tag-border);
  border-radius: 12px; padding: 14px 16px;
  font-size: 13px; color: var(--text2); line-height: 1.65; margin-top: 14px;
}
.info-box strong { color: var(--accent); }

.warn-box {
  background: rgba(255,159,10,0.07); border: 0.5px solid rgba(255,159,10,0.2);
  border-radius: 12px; padding: 14px 16px;
  font-size: 13px; color: var(--text2); line-height: 1.65; margin-top: 14px;
}
.warn-box strong { color: var(--accent3); }

/* ARCH DIAGRAM */
.arch-diagram {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 20px; margin: 14px 0;
}
.arch-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0; }
.arch-box {
  background: var(--bg3); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
  font-size: 12px; color: var(--text2);
  display: flex; align-items: center; gap: 6px; text-align: center; flex-direction: column;
}
.arch-box small { font-size: 10px; color: var(--text3); }
.arch-box.highlight { border-color: var(--tag-border); color: var(--accent); background: var(--tag-bg); }
.arch-box.accent { border-color: rgba(52,199,89,0.25); color: var(--accent2); background: rgba(52,199,89,0.06); }
.arch-label { font-size: 11px; color: var(--text3); text-align: center; margin: 4px 0; letter-spacing: 0.04em; }
.arch-divider { text-align: center; color: var(--text3); font-size: 13px; margin: 2px 0; }

/* =============================================
   GRIDS
   ============================================= */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* =============================================
   PAGE HERO
   ============================================= */
.page-hero {
  padding: calc(52px + 4rem) 24px 3.5rem;
  text-align: center; position: relative; overflow: hidden;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text3);
  margin-bottom: 20px; flex-wrap: wrap; justify-content: center;
}
.breadcrumb a { color: var(--accent); }

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
  background: var(--bg2);
  border-top: 0.5px solid var(--border);
  padding: 80px 24px; text-align: center;
}
.cta-title {
  font-size: clamp(1.5rem,4vw,2.4rem);
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: 10px; color: var(--text1);
}
.cta-sub { font-size: 16px; color: var(--text2); margin-bottom: 28px; line-height: 1.6; }

.contact-list { display: flex; flex-direction: column; gap: 10px; max-width: 400px; margin: 0 auto 24px; }
.contact-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 14px 18px;
  color: var(--text1); transition: all 0.2s;
  box-shadow: var(--shadow);
}
.contact-item:hover { transform: translateY(-2px); box-shadow: var(--shadow2); border-color: var(--tag-border); }
.contact-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.contact-meta { flex: 1; text-align: left; }
.contact-meta small { font-size: 11px; color: var(--text3); display: block; margin-bottom: 2px; }
.contact-meta span { font-size: 14px; font-weight: 500; }

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--footer-bg, var(--bg2));
  border-top: 0.5px solid var(--border);
  padding: 56px 24px 32px;
}
.footer-inner { max-width: 960px; margin: 0 auto; }
.footer-top { display: flex; flex-direction: column; gap: 32px; margin-bottom: 40px; }
.footer-logo { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--text1); margin-bottom: 8px; }
.footer-logo em { font-style: normal; color: var(--accent); }
.footer-brand p { font-size: 13px; color: var(--footer-text, var(--text3)); max-width: 220px; line-height: 1.65; }
.footer-links-group h4 { font-size: 12px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; color: var(--footer-text, var(--text2)); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 0.5px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.footer-bottom p { font-size: 12px; color: var(--text3); }
.footer-bottom a { color: var(--accent); }

/* =============================================
   WHY CARDS
   ============================================= */
.why-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius-card); padding: 24px;
  transition: all 0.2s; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.why-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); opacity: 0;
  transition: opacity 0.2s;
}
.why-card:hover::after { opacity: 1; }
.why-card:hover { transform: translateY(-3px); box-shadow: var(--shadow2); }
.why-icon { font-size: 28px; margin-bottom: 12px; }
.why-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text1); }
.why-desc { font-size: 13px; color: var(--text2); line-height: 1.65; }

/* =============================================
   REVEAL ANIMATION
   ============================================= */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 767px) {
  .nav-menu, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .hero h1 { font-size: 2.2rem; }
  .section { padding: 56px 20px; }
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pill-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .section { padding: 96px 32px; }
  .footer-top { flex-direction: row; justify-content: space-between; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

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

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::selection { background: var(--badge-bg); color: var(--accent); }
