:root {
  --bg-color: #f1f5f9;
  --text-main: #1e293b;
  --card-bg: #ffffff;
  --primary: #714b67;
  --hover-color: #f8fafc;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

/* Cabecera Principal */
header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 50px 20px 45px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid #714b67;
}

.header-content {
  max-width: 1000px;
  margin: 0 auto;
}

.header-kicker {
  margin: 0 0 14px;
  color: #8fc8f4;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

header h1 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  line-height: 1.1;
}

.header-title {
  color: #ffffff;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.header-brand {
  color: #8fc8f4;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
}

.header-subtitle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 650px;
  margin: 20px auto 0;
  color: #94a3b8;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  line-height: 1.5;
}

/* Contenedor Principal (Grid) */
.container {
  flex: 1;
  max-width: 1140px;
  width: 95%;
  margin: 40px auto;
  padding: 0 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  box-sizing: border-box;
  align-items: stretch;
}

/* Tarjetas de Aplicación */
.app-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 26px 24px;
  text-decoration: none;
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 5px solid #714b67;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
  box-sizing: border-box;
}

.app-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.card-header-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin: 0;
}

.app-desc {
  font-size: 0.9rem;
  color: #475569;
  margin: 8px 0 20px;
  line-height: 1.5;
  flex-grow: 1;
}

/* Tarjeta Hero de Portada (Sobre este Portfolio) */
.portfolio-card {
  grid-column: 1 / -1;
  border-top-color: #f59e0b;
  padding: 32px 38px;
  text-align: left;
  background: #ffffff;
}

.portfolio-card:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.portfolio-content {
  max-width: 950px;
}

.portfolio-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.portfolio-eyebrow {
  color: #d97706;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.portfolio-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.25;
}

.portfolio-description {
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.65;
}

.portfolio-description p {
  margin: 0 0 10px;
}

.portfolio-notice {
  margin-top: 16px !important;
  padding: 12px 18px;
  color: #7c5a12;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Colores de Borde por Tema de Tarjeta */
.card-verifactu {
  border-top-color: #714b67;
}

.card-api {
  border-top-color: #ea580c;
}

.card-java {
  border-top-color: #b07219;
}

.card-odoo {
  border-top-color: #714b67;
}

.card-ssl {
  border-top-color: #0288d1;
}

.card-nginx {
  border-top-color: #2e7d32;
}

.card-security {
  border-top-color: #d32f2f;
}

/* Etiquetas de Tecnología y Relaciones con Contenidos */
.tech-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.tag {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-cat {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.tag-tech {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.tag-relation {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
}

/* Footer Compartido de Una Sola Línea */
footer {
  text-align: center;
  padding: 22px 20px;
  background-color: #0f172a;
  color: #94a3b8;
  font-size: 0.88rem;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}

footer a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* Adaptación Responsiva */
@media (max-width: 767px) {
  header {
    padding: 35px 16px 30px;
  }
  
  .container {
    margin: 20px auto;
    gap: 16px;
  }

  .portfolio-card {
    padding: 22px 20px;
  }

  .portfolio-heading {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .app-card {
    min-height: auto;
    padding: 22px 20px;
  }
}